Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
5247d01
release 6.0.2
machacjozef Feb 17, 2022
88b082a
NAE-1574 - Net role permission checking
Feb 17, 2022
f6a887f
[NAE-1455] Navigation menu closes on small screens and cannot be reop…
machacjozef Feb 21, 2022
4199a71
[NAE-1459] Loading indicator on login and registration related compon…
machacjozef Feb 21, 2022
5dcb8ed
[NAE-1472] MaterialAppearance property on AbstractDataField
machacjozef Feb 21, 2022
d041311
[NAE-1524] Header search by author is not working
machacjozef Feb 21, 2022
e7902e7
[NAE-1529] Finish auto does not work
machacjozef Feb 21, 2022
55318fc
[NAE-1557] Cannot clear optional enumeration
machacjozef Feb 21, 2022
523c1c4
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 22, 2022
47d8f51
[NAE-1575] User select component trying open non-exisisting side menu…
renczesnetgrif Feb 22, 2022
f19d54d
Merge pull request #3 from netgrif/NAE-1574
machacjozef Feb 22, 2022
c6fb53d
Merge branch 'release/6.0.2' into NAE-1557
machacjozef Feb 22, 2022
54c7bd3
Merge branch 'release/6.0.2' into NAE-1455_2
machacjozef Feb 22, 2022
f5bcec6
CHANGELOG
machacjozef Feb 22, 2022
cab298a
[NAE-1580] Grammar check
machacjozef Feb 22, 2022
c6e9e10
Merge pull request #12 from netgrif/NAE-1580
machacjozef Feb 22, 2022
eaa543f
Merge branch 'release/6.0.2' into NAE-1557
machacjozef Feb 22, 2022
92bb58c
CHANGELOG.md
machacjozef Feb 23, 2022
a58b20d
Merge branch 'release/6.0.2' into NAE-1557
machacjozef Feb 23, 2022
0750ced
Merge pull request #5 from netgrif/NAE-1557
machacjozef Feb 23, 2022
b3fb9ab
[NAE-1455] Navigation menu closes on small screens and cannot be reop…
machacjozef Feb 23, 2022
44a9286
[NAE-1455] Navigation menu closes on small screens and cannot be reop…
machacjozef Feb 23, 2022
00672c1
[NAE-1459] Loading indicator on login and registration related compon…
renczesnetgrif Feb 23, 2022
482d51f
Merge branch 'release/6.0.2' into 'release/6.0.2'
machacjozef Feb 23, 2022
95ff4c5
Merge branch 'release/6.0.2' into NAE-1455_2
machacjozef Feb 23, 2022
1c31415
[NAE-1459] Loading indicator on login and registration related compon…
renczesnetgrif Feb 23, 2022
7ae7acf
[NAE-1459] Loading indicator on login and registration related compon…
renczesnetgrif Feb 23, 2022
325a5df
[NAE-1459] Loading indicator on login and registration related compon…
renczesnetgrif Feb 23, 2022
036d655
Merge branch 'release/6.0.2' into NAE-1472
machacjozef Feb 23, 2022
ca99ff5
Merge branch 'release/6.0.2' into NAE-1524
machacjozef Feb 23, 2022
6d0df43
Merge branch 'release/6.0.2' into NAE-1575
machacjozef Feb 23, 2022
9459d37
Merge pull request #11 from netgrif/NAE-1575
machacjozef Feb 23, 2022
cadf999
Merge branch 'release/6.0.2' into NAE-1577
machacjozef Feb 23, 2022
b583c6c
Merge pull request #10 from netgrif/NAE-1577
machacjozef Feb 23, 2022
fd45084
Merge branch 'release/6.0.2' into NAE-1529
machacjozef Feb 23, 2022
f53945d
Merge pull request #9 from netgrif/NAE-1529
machacjozef Feb 23, 2022
39a31a0
Merge branch 'release/6.0.2' into NAE-1524
machacjozef Feb 23, 2022
ae17b40
Merge pull request #8 from netgrif/NAE-1524
machacjozef Feb 23, 2022
b19ebd0
Merge branch 'release/6.0.2' into NAE-1472
machacjozef Feb 23, 2022
110d1f3
Merge pull request #7 from netgrif/NAE-1472
machacjozef Feb 23, 2022
e345da2
Merge branch 'release/6.0.2' into NAE-1455_2
machacjozef Feb 23, 2022
cde0a8d
Merge branch 'release/6.0.2' into NAE-1459
machacjozef Feb 23, 2022
55122bd
[NAE-1455] Navigation menu closes on small screens and cannot be reop…
renczesnetgrif Feb 23, 2022
13fc0dc
Merge pull request #6 from netgrif/NAE-1459
machacjozef Feb 23, 2022
fd08f6d
Merge branch 'release/6.0.2' into NAE-1455_2
machacjozef Feb 23, 2022
16d832a
Merge pull request #4 from netgrif/NAE-1455_2
machacjozef Feb 23, 2022
844e265
Release 6.0.2-rc.2
machacjozef Feb 23, 2022
d8b2496
Release 6.0.2-rc.2
machacjozef Feb 23, 2022
ff3d879
[NAE-1583] Broken FileField/FileListField placeholder
Feb 25, 2022
853ae4b
Merge pull request #13 from netgrif/NAE-1583
machacjozef Feb 25, 2022
d58f3e1
Release 6.0.2-rc.3
machacjozef Feb 25, 2022
98eff67
Release 6.0.2-rc.3
machacjozef Feb 25, 2022
de3147b
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 28, 2022
92857da
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 28, 2022
5059e9c
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 28, 2022
ea54ab9
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 28, 2022
43c9078
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 28, 2022
804c434
[NAE-1577] Task reffed change behavior does not propagate
renczesnetgrif Feb 28, 2022
a18563d
Merge branch 'release/6.0.2' into NAE-1577_2
renczesnetgrif Mar 1, 2022
8085dbb
Merge pull request #14 from netgrif/NAE-1577_2
machacjozef Mar 1, 2022
8b5d23a
Release 6.0.2-rc.4
machacjozef Mar 1, 2022
5c29779
[NAE-1586] Virtual scroll is broken everywhere on page
Mar 2, 2022
bcdeef1
Merge pull request #15 from netgrif/NAE-1586
machacjozef Mar 2, 2022
24bf233
Release 6.0.2-rc.5
machacjozef Mar 2, 2022
d6cdf7a
[NAE-1389] Immediate map data fields display their keys
renczesnetgrif Mar 2, 2022
0341842
Merge pull request #16 from netgrif/NAE-1389
machacjozef Mar 4, 2022
9238e02
Release 6.0.2-rc.6
machacjozef Mar 4, 2022
9fc1238
Merge remote-tracking branch 'origin/release/6.0.2' into release/6.0.2
machacjozef Mar 4, 2022
1588e47
Release 6.0.2-rc.6
machacjozef Mar 4, 2022
212ab57
Merge pull request #17 from netgrif/release/6.0.2
tuplle Mar 7, 2022
5caac8a
Release 6.0.2
tuplle Mar 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: devops@netgrif.com
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