Skip to content

Commit

Permalink
Merge pull request #19 from netgrif/dev
Browse files Browse the repository at this point in the history
Release 6.0.2
  • Loading branch information
tuplle authored Mar 7, 2022
2 parents 9702485 + 5caac8a commit ade6bf8
Show file tree
Hide file tree
Showing 47 changed files with 346 additions and 101 deletions.
11 changes: 10 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,16 @@ You can now safely **delete all between two horizontal lines**, so the instructi

### Test Configuration

<Please describe configuration for tests to run if applicable, like program parameters, host OS, VM configuration etc.>
<Please describe configuration for tests to run if applicable, like program parameters, host OS, VM configuration etc. You can use >

| Name | Tested on |
|---------------------| --------- |
| OS | |
| Runtime | |
| Dependency Manager | |
| Framework version | |
| Run parameters | |
| Other configuration | |

# Checklist:

Expand Down
4 changes: 2 additions & 2 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PR_TITLE_REGEX: /(?:\[[A-Z]+-[0-9]+\] .+)|(?:Release [0-9]\.[0-9]\.[0-9](?:-[A-Za-z]+\.[0-9]+)?)/gi
COMMIT_MESSAGE_REGEX: /\[[A-Z]+-[0-9]+\] .+(?:\n\r? - .*)*/gim
COMMIT_MESSAGE_REGEX: /((^| )(\[[A-Z]+-[0-9]+\] .+(?:\n\r? - .*)*|(Merge branch .*. into*.*))|((Release .*)+(:?\n\r? .*)*)|(CI - Update documentation))/gim
INVALID_COMMIT_MESSAGE: Commit messages are invalid. Valid format is -> [JIRA-ISSUE-KEY] Main change in the commit \n - other change in the commit
INVALID_PULL_REQUEST_MESSAGE: Pull request title is invalid -> [JIRA-ISSUE-KEY] Jira issue summary / title
INVALID_PULL_REQUEST_MESSAGE: Pull request title is invalid -> [JIRA-ISSUE-KEY] Jira issue summary / title
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
default_author: github_actions
committer_name: Netgrif DevOps
committer_email: [email protected]
message: 'Update documentation'
message: 'CI - Update documentation'



24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,28 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Full
Changelog: [https://github.com/netgrif/components/commits/v6.0.0](https://github.com/netgrif/components/commits/v6.0.0)

## [6.0.1](https://github.com/netgrif/components/releases/tag/v6.0.0) (2022-02-15)
## [6.0.2](https://github.com/netgrif/components/releases/tag/v6.0.2) (2022-03-04)

### Fixed

- [NAE-1389] Immediate map data fields display their keys
- [NAE-1455] Navigation menu closes on small screens and cannot be reopened
- [NAE-1472] MaterialAppearance property on AbstractDataField
- [NAE-1524] Header search by author is not working
- [NAE-1529] Finish auto does not work
- [NAE-1557] Cannot clear optional enumeration
- [NAE-1574] Net role permission checking
- [NAE-1575] User select component trying open non-existing side menu component
- [NAE-1577] Task reffed change behavior does not propagate
- [NAE-1580] Grammar check
- [NAE-1583] Broken FileField/FileListField placeholder
- [NAE-1586] Virtual scroll is broken everywhere on page

### Changed

- [NAE-1459] Loading indicator on login and registration related components

## [6.0.1](https://github.com/netgrif/components/releases/tag/v6.0.1) (2022-02-15)

- Fixing mistake with npm registry

Expand Down Expand Up @@ -508,7 +529,6 @@ None

- [NAE-984] Destroy subscription on changedFields


## [4.1.1](https://github.com/netgrif/components/releases/tag/4.1.1) (2020-08-20)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=netgrif_components&metric=coverage)](https://sonarcloud.io/dashboard?id=netgrif_components)
[![Known Vulnerabilities](https://snyk.io/test/github/netgrif/components/badge.svg)](https://snyk.io/test/github/netgrif/components)

Netgrif Components is an Angular library for creating SPA (Single-page application) compatible with Netgrif Application Engine.
Netgrif Components is an Angular library for creating SPA (Single-page application) compatible with [Netgrif Application Engine](https://github.com/netgrif/application-engine).
The library provides all necessary tools for creating refined frontend application into NAE environment,
and to create own library of Angular web components to incorporate your own personal design to the platform.

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-project",
"version": "6.0.1",
"version": "6.0.2",
"description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down Expand Up @@ -33,6 +33,7 @@
"lint": "ng lint",
"e2e": "ng e2e",
"ncc:build": "ng build netgrif-components-core --prod && npm run ncc:build-schematics",
"ncc:local-build": "npm run ncc:build && npm i ./dist/netgrif-components-core --save-optional",
"ncc:build-schematics": "node projects/netgrif-components-core/src/scripts/build-schematics.js",
"ncc:lint": "ng lint netgrif-components-core",
"ncc:spell": "cspell \"{projects/netgrif-components-core/**/*.md,projects/netgrif-components-core/src/**/*.ts}\"",
Expand All @@ -55,7 +56,7 @@
"nc:typedoc": "typedoc --tsconfig projects/netgrif-components/tsconfig.lib.json projects/netgrif-components/src/public-api.ts",
"nc:compodoc": "compodoc -c projects/netgrif-components/.compodocrc.json",
"nc:doc": "npm run nc:compodoc && npm run nc:typedoc",
"project:local-build": "cd projects/netgrif-components-core && npm run ncc:build && cd ../netgrif-components && npm run nc:local-build",
"project:local-build": "npm run ncc:local-build && npm run nc:local-build",
"project:full-test": "npm run ncc:full-test && npm run ncc:build && npm run nc:full-test",
"project:start": "npm run project:local-build && ng serve",
"project:sonar": "node scripts/sonar-scanner-analysis.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import {Component, OnInit} from '@angular/core';
import {Component, OnDestroy, OnInit} from '@angular/core';
import {FormControl} from '@angular/forms';
import {FormSubmitEvent, LoggerService, MessageResource, SignUpService, SnackBarService} from '@netgrif/components-core';
import {
FormSubmitEvent,
LoadingEmitter,
LoggerService,
MessageResource,
SignUpService,
SnackBarService
} from '@netgrif/components-core';
import {Observable} from 'rxjs';

interface EndpointOption {
Expand All @@ -13,26 +20,34 @@ interface EndpointOption {
templateUrl: './password-form.component.html',
styleUrls: ['./password-form.component.scss']
})
export class PasswordFormComponent implements OnInit {
export class PasswordFormComponent implements OnInit, OnDestroy {

readonly TITLE = 'Email submission form';
readonly DESCRIPTION = 'Ukážka email submission form...';

public endpointFormControl: FormControl;

public loading: LoadingEmitter;

public endpointOptions: Array<EndpointOption> = [
{value: 'signup', viewValue: 'Sign up'},
{value: 'forgotten', viewValue: 'Forgotten password'}
];

constructor(protected _signUpService: SignUpService, protected _snackBarService: SnackBarService, protected _log: LoggerService) {
this.endpointFormControl = new FormControl(this.endpointOptions[0].value);
this.loading = new LoadingEmitter();
}

ngOnInit(): void {
}

ngOnDestroy(): void {
this.loading.complete();
}

callEndpoint(event: FormSubmitEvent): void {
event.loading.on();
let endpoint: Observable<MessageResource>;
if (this.endpointFormControl.value === 'signup') {
endpoint = this._signUpService.invite({email: event.email, groups: [], processRoles: []});
Expand All @@ -47,6 +62,7 @@ export class PasswordFormComponent implements OnInit {
} else {
this._snackBarService.openSuccessSnackBar('Request success');
}
event.loading.off();
});
}
}
2 changes: 1 addition & 1 deletion projects/netgrif-components-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-core",
"version": "6.0.1",
"version": "6.0.2",
"description": "Netgrif Application engine frontend core Angular library",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down
3 changes: 3 additions & 0 deletions projects/netgrif-components-core/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
},
"dynamicEnum": {
"noData": "Keine Einträge entsprechen Ihrer Suchanfrage"
},
"enum": {
"reset": "Rücksetzen"
}
},
"dialog": {
Expand Down
3 changes: 3 additions & 0 deletions projects/netgrif-components-core/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
},
"dynamicEnum": {
"noData": "No items match your search"
},
"enum": {
"reset": "Reset"
}
},
"dialog": {
Expand Down
37 changes: 20 additions & 17 deletions projects/netgrif-components-core/src/assets/i18n/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"caseGetFailed": "Načítanie prípadov zlyhalo",
"noLongerExists": "Zvolená úloha už neexistuje",
"caseDeleteFailed": "Prípad sa nepodarilo vymazať",
"caseDeleteSuccess": "Prípad úspešný zmazaný",
"caseDeleteSuccess": "Prípad bol úspešne zmazaný",
"rolesSuccessAssign": "Roly boli úspešne priradené vybraným používateľom"
},
"view": {
Expand Down Expand Up @@ -78,13 +78,13 @@
"errSecond": "Názov je povinné pole.",
"errThird": "Farba je povinné pole.",
"noNets": "Žiadne povolené siete",
"createCase": "Uspešne vytvorený nový prípad",
"createCase": "Úspešne vytvorený nový prípad",
"defaultCaseName": "s prednastaveným názvom prípadu"
},
"user": {
"assign": "Priradiť používateľa",
"choose": "Zvoľte používateľa",
"noUser": "Neexistujú žiadny používatelia",
"noUser": "Neexistujú žiadni používatelia",
"err": "Nepodarilo sa načítať používateľov",
"showcase": "Nebol zvolený mód zobrazenia používateľa!"
},
Expand Down Expand Up @@ -196,7 +196,7 @@
"validations": {
"required": "Toto pole je potrebné!",
"requiredTrue": "Zadaná hodnota musí byť true",
"odd": "Zadané čislo musí byť nepárne",
"odd": "Zadané číslo musí byť nepárne",
"even": "Zadané číslo musí byť párne",
"positive": "Zadané číslo musí byť kladné",
"negative": "Zadané číslo musí byť záporné",
Expand All @@ -207,22 +207,22 @@
"pattern": "Zadaný text je v nesprávnom formáte",
"phone": "Zadaný text musí byť tel. číslo",
"email": "Zadaný text musí byť email",
"dateRange": "Zadaný dátum musí byť z rozsahu {{left}} a {{right}}",
"dateRange": "Zadaný dátum musí byť v rozsahu {{left}} a {{right}}",
"weekend": "Zadaný dátum musí byť víkendový deň",
"workday": "Zadaný dátum musí byť pracovný deň",
"enumeration": "Musí byť vybraná jedna z možností",
"min": "Zadané číslo musí byť väčšie ako {{length}}"
},
"snackBar": {
"downloadFail": " stahovanie zlyhalo",
"moreFiles": "Zvolil si viac súborov ako je povolené",
"sameFiles": "Nemôžeš nahrať dva rovnaké súbory",
"downloadFail": " sťahovanie zlyhalo",
"moreFiles": "Zvolili ste si viac súborov ako je povolené",
"sameFiles": "Nemôžete nahrať dva rovnaké súbory",
"fileSize": "Veľkosť súboru presiahla povolený limit",
"wontUploadSameFile": "Súbor už existuje. Ak chcete súbor aktualizovať zvoľte iný názov súboru alebo súbor odstránte",
"wontUploadSameFiles": "Vybrané súbory už boli nahrané. Ak chcete súbory aktualizovať odstránte už nahrané súbory",
"wontUploadSameFile": "Súbor už existuje. Ak chcete súbor aktualizovať, zvoľte iný názov súboru alebo súbor odstráňte",
"wontUploadSameFiles": "Vybrané súbory už boli nahrané. Ak chcete súbory aktualizovať, odstráňte už nahrané súbory",
"fileUploadFailed": "Súbor sa nepodarilo nahrať",
"fileDeleteFailed": "Súbor sa nepodarilo vymazať",
"maxFilesExceeded": "Je presiahnutý maximálny počet nahrateľných súborov: ",
"maxFilesExceeded": "Je presiahnutý maximálny počet nahratých súborov: ",
"maxFilesSizeExceeded": "Je presiahnutá maximálna veľkosť nahrávaných súborov: ",
"notSelectedUser": "Nebol vybraný žiadny používateľ",
"userAssigned": "Používateľ {{userName}} bol pridelený"
Expand All @@ -242,6 +242,9 @@
},
"dynamicEnum": {
"noData": "Vášmu vyhľadávaniu nezodpovedajú žiadne položky"
},
"enum": {
"reset": "Resetovať"
}
},
"dialog": {
Expand Down Expand Up @@ -345,7 +348,7 @@
},
"admin": {
"user-list": {
"noUsersWereFound": "Momentálne nie sú v systéme žiadny používatelia",
"noUsersWereFound": "Momentálne nie sú v systéme žiadni používatelia",
"listTitle": "Používatelia"
},
"process-list": {
Expand All @@ -359,14 +362,14 @@
"newUser": "Nový používateľ",
"orgs": "Organizácie",
"selectedOrgs": "Vybrané Organizácie",
"selectedRoless": "Vybrané Role",
"selectedRoless": "Vybrané Roly",
"mail": "Zadajte Email",
"noSelectedOrgs": "Nie su zvolené žiadne organizácie!",
"noSelectedRoles": "Nie su zvolené žiadne role!",
"noSelectedOrgs": "Nie zvolené žiadne organizácie!",
"noSelectedRoles": "Nie zvolené žiadne role!",
"noOrgs": "Nie sú žiadne dostupné organizácie!",
"version": "Verzia",
"emailFieldMandatory": "Email je povinný",
"oneOrMoreOrganization": "Nový používateľ musí patriť aspoň do jenej organizácie",
"oneOrMoreOrganization": "Nový používateľ musí patriť aspoň do jednej organizácie",
"inviteSent": "Pozvánka bola odoslaná",
"inviteFailed": "Poslanie pozvánky zlyhalo",
"invite-user": "POZVAŤ POUŽÍVATEĽA"
Expand All @@ -380,7 +383,7 @@
},
"caseTree": {
"newNodeDefaultName": "Nový Vrchol",
"noTaskSelected": "Momentálne nie je zvolený žiaden prípad. Pre vybranie prípadu zvoľte vrchol v strome."
"noTaskSelected": "Momentálne nie je zvolený žiadny prípad. Pre vybranie prípadu zvoľte vrchol v strome."
},
"dashboard": {
"cases": "prípady"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('PermissionService', () => {
{stringId: 'date', title: 'string', type: 'date', value: [2020, 1, 1, 10, 10]},
{stringId: 'string', title: 'string', type: 'string', value: 'dasdsadsad'},
{stringId: 'dateTime', title: 'string', type: 'dateTime', value: [2020, 1, 1, 10, 10]},
{stringId: 'enum', title: 'string', type: 'enumeration', value: { defaultValue: 'dasd'}},
{stringId: 'enum', title: 'string', type: 'enumeration', value: {defaultValue: 'dasd'}},
]
};
expect(permissionService.hasCasePermission(case_, PermissionType.DELETE)).toBeTrue();
Expand Down Expand Up @@ -251,14 +251,14 @@ describe('PermissionService', () => {
{stringId: 'date', title: 'string', type: 'date', value: [2020, 1, 1, 10, 10]},
{stringId: 'string', title: 'string', type: 'string', value: 'dasdsadsad'},
{stringId: 'dateTime', title: 'string', type: 'dateTime', value: [2020, 1, 1, 10, 10]},
{stringId: 'enum', title: 'string', type: 'enumeration', value: { defaultValue: 'dasd'}},
{stringId: 'enum', title: 'string', type: 'enumeration', value: {defaultValue: 'dasd'}},
]
};
expect(permissionService.hasCasePermission(case_, PermissionType.DELEGATE)).toBeFalse();
});

it('should test canDo', () => {
const net = new Net( {
it('should test hasNetPermission', () => {
const net = new Net({
identifier: '',
stringId: '',
immediateData: [],
Expand All @@ -270,21 +270,24 @@ describe('PermissionService', () => {
title: ''
});
net.permissions = {};
expect(permissionService.hasNetPermission('create', net)).toBeTrue();
expect(permissionService.hasNetPermission(PermissionType.CREATE, net)).toBeFalse();

(userService as unknown as MockUserService).user =
new User('', '', '', '', [], [{stringId: '12454sdasd', name: '', importId: ''}]);
net.permissions = {'12454sdasd': {create: true}};
expect(permissionService.hasNetPermission('create', net)).toBeTrue();
new User('', '', '', '', [], [{stringId: 'role1', name: '', importId: ''}]);
net.permissions = {role1: {create: true}};
expect(permissionService.hasNetPermission(PermissionType.CREATE, net)).toBeTrue();

net.permissions = {'12454sdasd': {create: false}};
expect(permissionService.hasNetPermission('create', net)).toBeFalse();
net.permissions = {role1: {create: false}};
expect(permissionService.hasNetPermission(PermissionType.CREATE, net)).toBeFalse();

net.permissions = {role1: {view: true}};
expect(permissionService.hasNetPermission(PermissionType.CREATE, net)).toBeFalse();

(userService as unknown as MockUserService).user =
new User('', '', '', '', [],
[{stringId: '12454sdasd', name: '', importId: ''}, {stringId: '12454sddasdasd', name: '', importId: ''}]);
net.permissions = {'12454sdasd': {create: false}, '12454sddasdasd': {create: true}};
expect(permissionService.hasNetPermission('create', net)).toBeFalse();
[{stringId: 'role1', name: '', importId: ''}, {stringId: 'role2', name: '', importId: ''}]);
net.permissions = {role1: {create: false}, role2: {create: true}};
expect(permissionService.hasNetPermission(PermissionType.CREATE, net)).toBeFalse();
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ export class PermissionService {
this._userService.hasRoleById(role) ? net.permissions[role][action] === false : false)) {
return false;
}
if (!Object.keys(net.permissions).filter(role => Object.keys(net.permissions[role])
.some(perm => perm === action)).some(role =>
!!net.permissions[role][action])) {
return true;
}
return Object.keys(net.permissions).some(role =>
this._userService.hasRoleById(role) ? !!net.permissions[role][action] : false
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ export abstract class AbstractEnumerationListFieldComponent implements OnInit {

ngOnInit() {
}

resetEnum(): void {
this.formControlRef.reset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class EnumerationField extends DataField<string> {
if (this._choices === undefined || this._choices.length === 0 || control.value === '' || control.value === undefined) {
return null;
}
return this._choices.find(choice => choice.key === control.value) ? null : {wrongValue: true};
return this._choices.find(choice => choice.key === control.value || control.value === null) ? null : {wrongValue: true};
}

getType(): string {
Expand Down
Loading

0 comments on commit ade6bf8

Please sign in to comment.