Skip to content

Commit 8c51832

Browse files
authored
Merge pull request #118 from netgrif/dev
Release 6.2.2
2 parents 133df2d + 8736975 commit 8c51832

File tree

27 files changed

+493
-58
lines changed

27 files changed

+493
-58
lines changed

.github/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PR_TITLE_REGEX: /(?:\[[A-Z]+-[0-9]+\] .+)|(?:Release [0-9]\.[0-9]\.[0-9](?:-[A-Za-z]+\.[0-9]+)?)/gi
1+
PR_TITLE_REGEX: /(?:\[[A-Z]+-[0-9]+\] .+)|(CI - Update documentation)|(?:Release [0-9]\.[0-9]\.[0-9](?:-[A-Za-z]+\.[0-9]+)?)/gi
22
COMMIT_MESSAGE_REGEX: /((^| )(\[[A-Z]+-[0-9]+\] .+(?:\n\r? - .*)*)|(Merge branch .*. into*.*)|((Release .*)+(:?\n\r? .*)*)|(CI - Update documentation)|(Revert ".*.)|(Merge remote-tracking *.*))/gim
33
INVALID_COMMIT_MESSAGE: Commit messages are invalid. Valid format is -> [JIRA-ISSUE-KEY] Main change in the commit \n - other change in the commit
44
INVALID_PULL_REQUEST_MESSAGE: Pull request title is invalid -> [JIRA-ISSUE-KEY] Jira issue summary / title

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
Full Changelog: [https://github.com/netgrif/components/commits/v6.2.1](https://github.com/netgrif/components/commits/v6.2.1)
8+
Full Changelog: [https://github.com/netgrif/components/commits/v6.2.2](https://github.com/netgrif/components/commits/v6.2.2)
9+
10+
## [6.2.2](https://github.com/netgrif/components/releases/tag/v6.2.2) (2022-09-28)
11+
12+
### Fixed
13+
14+
- [NAE-1693] TaskController deleteFile endpoint lacks data about tasks
15+
- [NAE-1712] Advanced search in case of date operators is blinking (very quickly opening and closing)
16+
- [NAE-1713] Advanced search searching based on case data does not work
17+
- [NAE-1715] Currency component not working properly
18+
- [NAE-1716] Autocomplete component not working properly on enumeration_map field
19+
- [NAE-1717] Banned roles not hiding menu entries
20+
- [NAE-1721] Create case event bad handling on frontend
21+
- [NAE-1724] Incorrect german translation
22+
923

1024
## [6.2.1](https://github.com/netgrif/components/releases/tag/v6.2.1) (2022-09-15)
1125

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netgrif/components-project",
3-
"version": "6.2.1",
3+
"version": "6.2.2",
44
"description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.",
55
"homepage": "https://components.netgrif.com",
66
"license": "SEE LICENSE IN LICENSE",

projects/netgrif-components-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netgrif/components-core",
3-
"version": "6.2.1",
3+
"version": "6.2.2",
44
"description": "Netgrif Application engine frontend core Angular library",
55
"homepage": "https://components.netgrif.com",
66
"license": "SEE LICENSE IN LICENSE",

projects/netgrif-components-core/src/assets/i18n/de.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@
8787
"errThird": "Sie müssen eine Farbe auswählen.",
8888
"noNets": "Es gibt keine erlaubte Netze",
8989
"createCase": "Neuen Fall würde erfolgreich erzeugt",
90-
"defaultCaseName": "mit einem Standardfallnamen"
90+
"defaultCaseName": "mit einem Standardfallnamen",
91+
"createCaseError": "Neuer Fall wurde erstellt, aber beim Ausführen von Aktionen ist ein Fehler aufgetreten"
9192
},
9293
"user": {
93-
"assign": "Benützer zuweisen",
94-
"choose": "Benützer auswählen",
95-
"noUser": "Es gibt keine Benützer",
96-
"err": "Beim laden der Benützer ist eine Fehler aufgetreten",
97-
"showcase": "Benützeransichtmodus ist nicht ausgewählt!"
94+
"assign": "Benutzer zuweisen",
95+
"choose": "Benutzer auswählen",
96+
"noUser": "Es gibt keine Benutzer",
97+
"err": "Beim laden der Benutzer ist eine Fehler aufgetreten",
98+
"showcase": "Die Benutzeransicht ist nicht gesetzt!"
9899
},
99100
"ldapGroup": {
100101
"choose": "LDAP-Gruppe suchen",
@@ -288,8 +289,8 @@
288289
"enterEmail": "Ihre E-Mail Adresse eingeben"
289290
},
290291
"login": {
291-
"length": "Das Benützername muss mindestens 4 Zeichen enthalten",
292-
"login": "Benützername",
292+
"length": "Das Benutzername muss mindestens 4 Zeichen enthalten",
293+
"login": "Benutzername",
293294
"wrongCredentials": "Falsche Anmeldeinformationen!",
294295
"loginButton": "Anmelden",
295296
"reset": "Kennwort wiederherstellen",

projects/netgrif-components-core/src/assets/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
"errThird": "Color is required.",
8888
"noNets": "No allowed Nets",
8989
"createCase": "Successful create new case",
90-
"defaultCaseName": "with default case name"
90+
"defaultCaseName": "with default case name",
91+
"createCaseError": "A new case was created, but an error occurred while executing actions"
9192
},
9293
"user": {
9394
"assign": "User Assign",

projects/netgrif-components-core/src/assets/i18n/sk.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
"errThird": "Farba je povinné pole.",
8888
"noNets": "Žiadne povolené siete",
8989
"createCase": "Úspešne vytvorený nový prípad",
90-
"defaultCaseName": "s prednastaveným názvom prípadu"
90+
"defaultCaseName": "s prednastaveným názvom prípadu",
91+
"createCaseError": "Nový prípad vytvorený, nastala však chyba pri vykonávaní akcií"
9192
},
9293
"user": {
9394
"assign": "Priradiť používateľa",

projects/netgrif-components-core/src/commons/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ export interface Access {
245245
* For `string` values the format is: <net import id>.<role name>
246246
*/
247247
role?: Array<string> | string | RoleAccess | Array<RoleAccess>;
248+
bannedRole?: Array<string> | string | RoleAccess | Array<RoleAccess>;
248249
group?: Array<string> | string;
249250
authority?: Array<string> | string;
250251

projects/netgrif-components-core/src/lib/authorization/permission/access.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class AccessService {
5656
* @returns whether the user passes the role guard condition for accessing the specified view
5757
*/
5858
public passesRoleGuard(view: View, url: string): boolean {
59-
return !view.access.hasOwnProperty('role') || this._roleGuard.canAccessView(view, url);
59+
return (!view.access.hasOwnProperty('role') && !view.access.hasOwnProperty('bannedRole')) || this._roleGuard.canAccessView(view, url);
6060
}
6161

6262
/**
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import {TestBed} from '@angular/core/testing';
2+
3+
import {MaterialModule} from "../../material/material.module";
4+
import {CommonModule} from "@angular/common";
5+
import {FlexModule} from "@angular/flex-layout";
6+
import {BrowserAnimationsModule, NoopAnimationsModule} from "@angular/platform-browser/animations";
7+
import {TranslateLibModule} from "../../translate/translate-lib.module";
8+
import {HttpClientTestingModule} from "@angular/common/http/testing";
9+
import {UserService} from "../../user/services/user.service";
10+
import {MockUserService} from "../../utility/tests/mocks/mock-user.service";
11+
import { Injectable, NO_ERRORS_SCHEMA } from '@angular/core';
12+
import {ConfigurationService} from "../../configuration/configuration.service";
13+
import {TestConfigurationService} from "../../utility/tests/test-config";
14+
import {AuthenticationModule} from "../../authentication/authentication.module";
15+
import {RouterTestingModule} from "@angular/router/testing";
16+
import { RoleGuardService } from './role-guard.service';
17+
import { Access, View } from '../../../commons/schema';
18+
import { User } from '../../user/models/user';
19+
20+
describe('RoleGuardService', () => {
21+
let service: RoleGuardService;
22+
23+
beforeEach(() => {
24+
TestBed.configureTestingModule({
25+
imports: [
26+
MaterialModule,
27+
CommonModule,
28+
FlexModule,
29+
NoopAnimationsModule,
30+
BrowserAnimationsModule,
31+
TranslateLibModule,
32+
HttpClientTestingModule,
33+
AuthenticationModule,
34+
RouterTestingModule.withRoutes([]),
35+
],
36+
providers: [
37+
RoleGuardService,
38+
{provide: ConfigurationService, useClass: TestConfigurationService},
39+
{provide: UserService, useClass: CustomMockUserService},
40+
],
41+
declarations: [],
42+
schemas: [NO_ERRORS_SCHEMA]
43+
});
44+
service = TestBed.inject(RoleGuardService);
45+
});
46+
47+
it('should be created', () => {
48+
expect(service).toBeTruthy();
49+
});
50+
51+
it('should access view with role only', () => {
52+
const view = {access: {role: ['test.role_user']} as Access} as View
53+
expect(service.canAccessView(view, 'test')).toBeTrue();
54+
});
55+
56+
it('should not access view', () => {
57+
const view = {access: {role: [], bannedRole: []} as Access} as View
58+
expect(service.canAccessView(view, 'test')).toBeFalse();
59+
});
60+
61+
it('should not access view with banned role only', () => {
62+
const view = {access: {bannedRole: ['test.banned_role']} as Access} as View
63+
expect(service.canAccessView(view, 'test')).toBeFalse();
64+
});
65+
66+
it('should not access view with role and banned role', () => {
67+
const view = {access: {role: ['test.role_user'], bannedRole: ['test.banned_role']} as Access} as View
68+
expect(service.canAccessView(view, 'test')).toBeFalse();
69+
});
70+
});
71+
72+
@Injectable()
73+
class CustomMockUserService extends MockUserService {
74+
constructor() {
75+
super();
76+
this._user = new User('123', 'test@netgrif.com', 'Test', 'User', ['ROLE_USER'], [{
77+
stringId: 'role_user',
78+
name: 'role_user',
79+
description: '',
80+
importId: 'role_user',
81+
netImportId: 'test',
82+
netVersion: '1.0.0',
83+
netStringId: 'test',
84+
},{
85+
stringId: 'banned_role',
86+
name: 'banned_role',
87+
description: '',
88+
importId: 'banned_role',
89+
netImportId: 'test',
90+
netVersion: '1.0.0',
91+
netStringId: 'test',
92+
} ]);
93+
}
94+
}

0 commit comments

Comments
 (0)