verben-authentication-ui 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/esm2022/lib/components/role-control/ChildrenType.mjs +6 -0
  2. package/esm2022/lib/components/role-control/MappedRole.mjs +2 -0
  3. package/esm2022/lib/components/role-control/MappedRoleAction.mjs +2 -0
  4. package/esm2022/lib/components/role-control/MappedRoleContext.mjs +2 -0
  5. package/esm2022/lib/components/role-control/UIActions.mjs +7 -0
  6. package/esm2022/lib/components/role-control/UIs.mjs +40 -0
  7. package/esm2022/lib/components/role-control/base-table-style.mjs +53 -0
  8. package/esm2022/lib/components/role-control/role-control.component.mjs +792 -0
  9. package/esm2022/lib/components/role-control/role-control.module.mjs +18 -0
  10. package/esm2022/lib/components/role-control/role-control.service.mjs +52 -0
  11. package/esm2022/lib/components/sign-up/sign-up.component.mjs +23 -21
  12. package/esm2022/lib/components/sso/helper.mjs +4 -2
  13. package/esm2022/lib/components/user-management/helper.mjs +4 -2
  14. package/esm2022/lib/components/user-management/user-management.component.mjs +11 -10
  15. package/esm2022/lib/components/user-request/user-request.component.mjs +7 -6
  16. package/esm2022/lib/components/user-request-approval/helper.mjs +4 -2
  17. package/esm2022/lib/components/user-request-approval/user-request-approval.component.mjs +2 -2
  18. package/esm2022/lib/models/PagedResult.mjs +1 -1
  19. package/esm2022/lib/models/Role.mjs +2 -0
  20. package/esm2022/lib/models/RoleAction.mjs +2 -0
  21. package/esm2022/lib/models/RoleContext.mjs +2 -0
  22. package/esm2022/lib/models/base.mjs +1 -1
  23. package/esm2022/lib/services/authorization.service.mjs +24 -0
  24. package/esm2022/lib/services/util.service.mjs +9 -2
  25. package/esm2022/lib/shared/shared.module.mjs +81 -0
  26. package/esm2022/public-api.mjs +4 -1
  27. package/fesm2022/verben-authentication-ui.mjs +1105 -46
  28. package/fesm2022/verben-authentication-ui.mjs.map +1 -1
  29. package/lib/components/role-control/ChildrenType.d.ts +4 -0
  30. package/lib/components/role-control/MappedRole.d.ts +7 -0
  31. package/lib/components/role-control/MappedRoleAction.d.ts +4 -0
  32. package/lib/components/role-control/MappedRoleContext.d.ts +8 -0
  33. package/lib/components/role-control/UIActions.d.ts +5 -0
  34. package/lib/components/role-control/UIs.d.ts +38 -0
  35. package/lib/components/role-control/base-table-style.d.ts +1 -0
  36. package/lib/components/role-control/role-control.component.d.ts +76 -0
  37. package/lib/components/role-control/role-control.module.d.ts +8 -0
  38. package/lib/components/role-control/role-control.service.d.ts +9 -0
  39. package/lib/components/user-request/user-request.component.d.ts +1 -0
  40. package/lib/models/PagedResult.d.ts +6 -0
  41. package/lib/models/Role.d.ts +8 -0
  42. package/lib/models/RoleAction.d.ts +8 -0
  43. package/lib/models/RoleContext.d.ts +8 -0
  44. package/lib/models/base.d.ts +3 -1
  45. package/lib/services/authorization.service.d.ts +14 -0
  46. package/lib/services/util.service.d.ts +1 -0
  47. package/lib/shared/shared.module.d.ts +9 -0
  48. package/package.json +1 -1
  49. package/public-api.d.ts +3 -0
@@ -0,0 +1,4 @@
1
+ export declare enum ChildrenType {
2
+ Permission = "Permission",
3
+ Action = "Action"
4
+ }
@@ -0,0 +1,7 @@
1
+ import { Role } from '../../models/Role';
2
+ import { MappedRoleContext } from './MappedRoleContext';
3
+ import { ChildrenType } from './ChildrenType';
4
+ export interface MappedRole extends Role {
5
+ RoleContexts: MappedRoleContext[];
6
+ ChildrenType: ChildrenType;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { RoleAction } from '../../models/RoleAction';
2
+ export interface MappedRoleAction extends RoleAction {
3
+ Selected: boolean;
4
+ }
@@ -0,0 +1,8 @@
1
+ import { RoleContext } from '../../models/RoleContext';
2
+ import { ChildrenType } from './ChildrenType';
3
+ import { MappedRoleAction } from './MappedRoleAction';
4
+ export interface MappedRoleContext extends RoleContext {
5
+ Selected: boolean;
6
+ RoleActions: MappedRoleAction[];
7
+ ChildrenType: ChildrenType;
8
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum UIActions {
2
+ Save = "Save",
3
+ Edit = "Edit",
4
+ Delete = "Delete"
5
+ }
@@ -0,0 +1,38 @@
1
+ export declare enum UIs {
2
+ ProductDistribution = "ProductDistribution",
3
+ Terminals = "Terminals",
4
+ Meters = "Meters",
5
+ ProductInbound = "ProductInbound",
6
+ TerminalDocumentation = "TerminalDocumentation",
7
+ Laboratories = "Laboratories",
8
+ Surveyors = "Surveyors",
9
+ Products = "Products",
10
+ Stocks = "Stocks",
11
+ Tanks = "Tanks",
12
+ Customers = "Customers",
13
+ ProductAllocation = "ProductAllocation",
14
+ ReleaseManagement = "ReleaseManagement",
15
+ ProductPricing = "ProductPricing",
16
+ Purchases = "Purchases",
17
+ Agents = "Agents",
18
+ Banks = "Banks",
19
+ Vendors = "Vendors",
20
+ Vessels = "Vessels",
21
+ ExpenseList = "ExpenseList",
22
+ ProcurementDocumentation = "ProcurementDocumentation",
23
+ Journal = "Journal",
24
+ JournalTemplate = "JournalTemplate",
25
+ RecurringJournal = "RecurringJournal",
26
+ InterCompanyJournal = "InterCompanyJournal",
27
+ InterCompanyJournalTemplate = "InterCompanyJournalTemplate",
28
+ UserManagement = "UserManagement",
29
+ AccessRequest = "AccessRequest",
30
+ RolesAndPermissions = "RolesAndPermissions",
31
+ AuditTrail = "AuditTrail",
32
+ LogViewer = "LogViewer",
33
+ MessageHistory = "MessageHistory",
34
+ MessageConfig = "MessageConfig",
35
+ MessageList = "MessageList",
36
+ Config = "Config",
37
+ Reports = "Reports"
38
+ }
@@ -0,0 +1 @@
1
+ export declare const baseStyle: any;
@@ -0,0 +1,76 @@
1
+ import { ChangeDetectorRef, OnInit } from '@angular/core';
2
+ import { RoleControlService } from './role-control.service';
3
+ import { CardData, CardDataViewComponent, ColumnDefinition, DataViewComponent, IDataFilter } from 'verben-ng-ui';
4
+ import { Role } from '../../models/Role';
5
+ import { RoleContext } from '../../models/RoleContext';
6
+ import { RoleAction } from '../../models/RoleAction';
7
+ import { MappedRole } from './MappedRole';
8
+ import { AuthorizationService } from '../../services/authorization.service';
9
+ import { ChildrenType } from './ChildrenType';
10
+ import { FormBuilder } from '@angular/forms';
11
+ import { UtilService } from '../../services/util.service';
12
+ import { HttpWebRequestService } from '../../services/http-web-request.service';
13
+ import * as i0 from "@angular/core";
14
+ export declare class RoleControlComponent implements OnInit {
15
+ private authService;
16
+ private roleControlSvc;
17
+ private utilService;
18
+ private server;
19
+ private cdr;
20
+ private fb;
21
+ visibleColumnDef: ColumnDefinition<MappedRole>[];
22
+ styles: any;
23
+ data: MappedRole[];
24
+ cardData: CardData[];
25
+ currentData: CardData | null;
26
+ currentExpandedCard: CardData | null;
27
+ cardContext: CardData | null;
28
+ cardContextHistory: CardData[];
29
+ cardContextHistoryData: CardData[][];
30
+ cardDataView: CardDataViewComponent;
31
+ dataView: DataViewComponent;
32
+ visibleColumns: IDataFilter[];
33
+ filterArray: IDataFilter[];
34
+ sortOptions: IDataFilter[];
35
+ childPermissionRef: ChildrenType;
36
+ constructor(authService: AuthorizationService, roleControlSvc: RoleControlService, utilService: UtilService, server: HttpWebRequestService, cdr: ChangeDetectorRef, fb: FormBuilder);
37
+ ngOnInit(): Promise<void>;
38
+ getAllRoles(): Promise<Role[] | undefined>;
39
+ findParent(cardData: CardData[], target: CardData): CardData | null;
40
+ isCheckboxDisabled(item: CardData): boolean;
41
+ setUpMappedData(data: Role[]): void;
42
+ setUpCardData(): void;
43
+ getFormattedName(name: string): string;
44
+ viewDetailsFromTable(data: MappedRole): void;
45
+ viewDetails(context: CardData): void;
46
+ viewDetailsChild(context: CardData): void;
47
+ roleCardClicked(item: CardData): void;
48
+ toggleChildren(item: CardData): void;
49
+ closeDetails(): void;
50
+ getCardSubCaption(item: CardData): string;
51
+ getUpdatedRole(role: MappedRole): Role;
52
+ saveRole(): Promise<void>;
53
+ saveRoleDynamic(item: CardData): Promise<void>;
54
+ saveDataAll(): void;
55
+ updateTable(): void;
56
+ onViewChange(isGridView: boolean): void;
57
+ onStateChange(event: {
58
+ key: string;
59
+ value: boolean;
60
+ }): void;
61
+ showTableView: boolean;
62
+ onSelectionChange(selectedRows: Role[]): void;
63
+ retryMessage(): void;
64
+ onColumnsUpdated(updatedColumns: IDataFilter[]): void;
65
+ onSortUpdated(updatedSorts: IDataFilter[]): void;
66
+ handleExport(exportedData: Partial<any>[]): void;
67
+ private downloadCSV;
68
+ getMockRoles(): Role[];
69
+ mockNames: string[];
70
+ randomName(): string;
71
+ randomContexts(): RoleContext[];
72
+ randomActions(): RoleAction[];
73
+ editValue(value: MappedRole): void;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<RoleControlComponent, never>;
75
+ static ɵcmp: i0.ɵɵComponentDeclaration<RoleControlComponent, "lib-role-control", never, {}, {}, never, never, false, never>;
76
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./role-control.component";
3
+ import * as i2 from "../../shared/shared.module";
4
+ export declare class RoleControlModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<RoleControlModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RoleControlModule, [typeof i1.RoleControlComponent], [typeof i2.SharedModule], [typeof i1.RoleControlComponent]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<RoleControlModule>;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { ColumnDefinition } from 'verben-ng-ui';
2
+ import { MappedRole } from './MappedRole';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RoleControlService {
5
+ constructor();
6
+ get roleColumns(): ColumnDefinition<MappedRole>[];
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<RoleControlService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<RoleControlService>;
9
+ }
@@ -52,6 +52,7 @@ export declare class UserRequestComponent {
52
52
  AuthMechanisms: AuthMechanism[] | null;
53
53
  showform: boolean;
54
54
  code: string;
55
+ type: string;
55
56
  constructor(fb: FormBuilder, server: HttpWebRequestService, utilService: UtilService, envSvc: EnvironmentService, route: ActivatedRoute);
56
57
  passwordMatchValidator(control: AbstractControl): ValidationErrors | null;
57
58
  get passwordMismatchError(): boolean;
@@ -1,3 +1,9 @@
1
1
  export interface PagedResult<T> {
2
+ Skip: number;
3
+ PageSize: number;
4
+ IsLoadingResults: boolean;
5
+ Total: number;
6
+ PageState?: unknown;
2
7
  Result: T[];
8
+ LastItem: string[];
3
9
  }
@@ -0,0 +1,8 @@
1
+ import { BaseModel } from './base';
2
+ import { RoleContext } from './RoleContext';
3
+ export interface Role extends BaseModel {
4
+ Name: string;
5
+ Description?: string;
6
+ Application?: string;
7
+ RoleContexts: RoleContext[];
8
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseModel } from './base';
2
+ export interface RoleAction extends BaseModel {
3
+ Name: string;
4
+ Description?: string;
5
+ Role: string;
6
+ Context: string;
7
+ Rule?: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseModel } from './base';
2
+ import { RoleAction } from './RoleAction';
3
+ export interface RoleContext extends BaseModel {
4
+ Name: string;
5
+ Description?: string;
6
+ Role: string;
7
+ RoleActions: RoleAction[];
8
+ }
@@ -5,6 +5,8 @@ export interface BaseModel {
5
5
  CreatedAt: Date;
6
6
  UpdatedAt: Date;
7
7
  DataState: ObjectState;
8
- Tenant: string;
8
+ TenantId: string;
9
+ ServiceName: string;
10
+ Code: string;
9
11
  readonly Error?: string;
10
12
  }
@@ -0,0 +1,14 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare const AUTHORIZATION_CONFIG: InjectionToken<AuthorizationConfig[]>;
4
+ export interface AuthorizationConfig {
5
+ Name: string;
6
+ Actions: string[];
7
+ }
8
+ export declare class AuthorizationService {
9
+ private auth;
10
+ constructor(auth: AuthorizationConfig[]);
11
+ get authorizationConfig(): AuthorizationConfig[];
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthorizationService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthorizationService>;
14
+ }
@@ -3,6 +3,7 @@ export declare class UtilService {
3
3
  private parentUtilService;
4
4
  constructor(parentUtilService: any);
5
5
  sendBI(state: boolean): void;
6
+ showInfo(message: string): void;
6
7
  static ɵfac: i0.ɵɵFactoryDeclaration<UtilService, [{ optional: true; }]>;
7
8
  static ɵprov: i0.ɵɵInjectableDeclaration<UtilService>;
8
9
  }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "verben-ng-ui";
4
+ import * as i3 from "@angular/forms";
5
+ export declare class SharedModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SharedModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedModule, never, [typeof i1.CommonModule], [typeof i1.CommonModule, typeof i2.DataTableModule, typeof i2.CardModule, typeof i2.SvgModule, typeof i2.DataViewModule, typeof i2.CardDataViewModule, typeof i2.SortTableModule, typeof i2.VisibleColumnModule, typeof i2.TableFilterModule, typeof i2.DataExportModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i2.VerbenaInputModule, typeof i2.VerbenaButtonModule, typeof i2.VerbenaBadgeModule, typeof i2.VerbenDialogueModule, typeof i2.DropDownModule, typeof i2.VerbenaTextareaModule, typeof i2.VerbenaSwitchModule, typeof i2.VerbenPopUpModule, typeof i2.ChipModule]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<SharedModule>;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verben-authentication-ui",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "peerDependencies": {
5
5
  "storage-encryption": "^1.0.16",
6
6
  "@angular/common": "^14.0.0 || ^18.0.0",
package/public-api.d.ts CHANGED
@@ -29,3 +29,6 @@ export * from './lib/components/user-request-approval/user-request-approval.serv
29
29
  export * from './lib/components/auth-callback/auth-callback.component';
30
30
  export * from './lib/components/auth-callback/auth-callback.module';
31
31
  export * from './lib/services/environment.service';
32
+ export * from './lib/services/authorization.service';
33
+ export * from './lib/components/role-control/role-control.component';
34
+ export * from './lib/components/role-control/role-control.module';