@codex-ts/core-lib 1.0.8 → 1.0.12
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.
- package/README.md +63 -0
- package/fesm2022/codex-ts-core-lib.mjs +1980 -1383
- package/fesm2022/codex-ts-core-lib.mjs.map +1 -1
- package/index.d.ts +5 -29
- package/lib/components/base-form.component.d.ts +27 -22
- package/lib/components/base-list-page.component.d.ts +12 -71
- package/lib/components/base-list-tabbed-form.component.d.ts +40 -0
- package/lib/components/base-tabbed-form.component.d.ts +17 -20
- package/lib/components/base-table.component.d.ts +72 -0
- package/lib/components/base-task-details.component.d.ts +59 -0
- package/lib/components/formly/types/numeric-input.type.d.ts +2 -2
- package/lib/components/formly/types/select.type.d.ts +1 -1
- package/lib/components/formly/types/textarea.type.d.ts +1 -1
- package/lib/enums/task-role.enum.d.ts +37 -0
- package/lib/keycloak/keycloak-config.interface.d.ts +19 -0
- package/lib/keycloak/keycloak.guard.d.ts +25 -0
- package/lib/keycloak/keycloak.service.d.ts +24 -0
- package/lib/keycloak/keycloak.token.d.ts +3 -0
- package/lib/models/base-create-request.model.d.ts +12 -0
- package/lib/models/base-request.model.d.ts +9 -0
- package/lib/models/base-response.model.d.ts +15 -0
- package/lib/models/base-task.model.d.ts +17 -0
- package/lib/models/base-update-request.model.d.ts +16 -0
- package/lib/models/base.model.d.ts +59 -0
- package/lib/models/pagination/page.interface.d.ts +23 -6
- package/lib/services/base-task.service.d.ts +40 -0
- package/lib/services/form.service.d.ts +31 -0
- package/lib/services/http-utility.service.d.ts +1 -1
- package/lib/states/form-component.state.d.ts +12 -0
- package/lib/states/form.state.d.ts +21 -0
- package/lib/states/list-tabbed-form.state.d.ts +9 -0
- package/lib/states/tabbed-form.state.d.ts +21 -0
- package/package.json +11 -25
- package/public-api.d.ts +37 -0
- package/lib/services/entity-registry.service.d.ts +0 -26
- package/lib/services/reference-data-provider.service.d.ts +0 -8
package/index.d.ts
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './lib/services/reference-data-provider.service';
|
|
7
|
-
export * from './lib/services/base-crud.service';
|
|
8
|
-
export * from './lib/services/http-utility.service';
|
|
9
|
-
export * from './lib/services/entity.service';
|
|
10
|
-
export * from './lib/enums/component-context.enum';
|
|
11
|
-
export * from './lib/enums/tabbed-form-type.enum';
|
|
12
|
-
export * from './lib/components/base-form.component';
|
|
13
|
-
export * from './lib/components/base-page.component';
|
|
14
|
-
export * from './lib/components/base-list-page.component';
|
|
15
|
-
export * from './lib/components/base-tabbed-form.component';
|
|
16
|
-
export * from './lib/constants/app.constants';
|
|
17
|
-
export * from './lib/constants/app.messages';
|
|
18
|
-
export * from './lib/models/pagination/page.interface';
|
|
19
|
-
export * from './lib/models/pagination/page-request.interface';
|
|
20
|
-
export * from './lib/pipes/indian-date.pipe';
|
|
21
|
-
export * from './lib/components/formly/core-formly.module';
|
|
22
|
-
export * from './lib/components/formly/form-field.wrapper';
|
|
23
|
-
export * from './lib/components/formly/types/text-input.type';
|
|
24
|
-
export * from './lib/components/formly/types/select.type';
|
|
25
|
-
export * from './lib/components/formly/types/radio.type';
|
|
26
|
-
export * from './lib/components/formly/types/numeric-input.type';
|
|
27
|
-
export * from './lib/components/formly/types/multiselect.type';
|
|
28
|
-
export * from './lib/components/formly/types/date.type';
|
|
29
|
-
export * from './lib/components/formly/types/checkbox.type';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@codex-ts/core-lib" />
|
|
5
|
+
export * from './public-api';
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { ComponentContext } from '../enums/component-context.enum';
|
|
3
|
-
import { FormGroup } from '@angular/forms';
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
4
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
5
3
|
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
6
|
-
import { BasePageComponent } from './base-page.component';
|
|
7
|
-
import { UtilsService } from '../services/utils.service';
|
|
8
|
-
import { NotificationService } from '../services/notification.service';
|
|
9
|
-
import { AppConstants, PageMode } from '../constants/app.constants';
|
|
10
4
|
import { Observable } from 'rxjs';
|
|
11
|
-
import {
|
|
5
|
+
import { AppConstants } from '../constants/app.constants';
|
|
6
|
+
import { ComponentContext } from '../enums/component-context.enum';
|
|
12
7
|
import { EntityService } from '../services/entity.service';
|
|
8
|
+
import { FormlyConfigService } from '../services/formly-config.service';
|
|
9
|
+
import { NotificationService } from '../services/notification.service';
|
|
10
|
+
import { UtilsService } from '../services/utils.service';
|
|
11
|
+
import { FormComponentState } from '../states/form-component.state';
|
|
12
|
+
import { BasePageComponent } from './base-page.component';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
14
|
export declare abstract class BaseFormComponent<T extends {
|
|
15
15
|
uuid: string;
|
|
16
|
-
}> extends BasePageComponent implements OnInit {
|
|
16
|
+
}> extends BasePageComponent implements OnInit, OnDestroy {
|
|
17
17
|
protected route: ActivatedRoute;
|
|
18
18
|
protected router: Router;
|
|
19
19
|
protected notificationService: NotificationService;
|
|
20
20
|
protected utilsService: UtilsService;
|
|
21
21
|
protected formlyConfigService: FormlyConfigService;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
isNew: boolean;
|
|
25
|
-
mode: PageMode;
|
|
26
|
-
currentFormData: any;
|
|
27
|
-
protected originalFormData: T | null;
|
|
28
|
-
protected hasChanges: boolean;
|
|
29
|
-
context: ComponentContext;
|
|
22
|
+
private readonly destroyed$;
|
|
23
|
+
protected state: FormComponentState<T>;
|
|
30
24
|
constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService, formlyConfigService: FormlyConfigService);
|
|
31
25
|
ngOnInit(): void;
|
|
32
|
-
private initializeFormData;
|
|
33
|
-
private loadFromUuid;
|
|
34
26
|
private initializeForm;
|
|
27
|
+
private loadFormData;
|
|
28
|
+
private getRouterState;
|
|
29
|
+
private initializeFormSubscriptions;
|
|
30
|
+
set formData(data: T | null);
|
|
31
|
+
private updateCurrentData;
|
|
32
|
+
private checkFormChanges;
|
|
33
|
+
protected updateFormState(data: T): void;
|
|
34
|
+
private handleInitError;
|
|
35
|
+
private handleLoadError;
|
|
35
36
|
protected patchFormData(data: any): void;
|
|
36
37
|
private initializeFormMode;
|
|
37
38
|
private setupFormState;
|
|
39
|
+
private onFormReady;
|
|
38
40
|
protected getFormlyFieldConfig(): FormlyFieldConfig[];
|
|
39
41
|
protected onSubmitRoute(): string[];
|
|
40
42
|
protected getEntityOperations(): {
|
|
@@ -43,9 +45,12 @@ export declare abstract class BaseFormComponent<T extends {
|
|
|
43
45
|
getById: (uuid: string) => Observable<T>;
|
|
44
46
|
};
|
|
45
47
|
protected onSubmit(): void;
|
|
48
|
+
private validateSubmission;
|
|
49
|
+
private getSubmitOperation;
|
|
50
|
+
private handleSubmitSuccess;
|
|
51
|
+
private handleSubmitError;
|
|
46
52
|
protected hasFormChanges(currentData: any): boolean;
|
|
47
|
-
|
|
48
|
-
protected loadEntity(uuid: string): void;
|
|
53
|
+
ngOnDestroy(): void;
|
|
49
54
|
protected abstract getEntityService(): EntityService<T>;
|
|
50
55
|
private isValidPageMode;
|
|
51
56
|
protected getDropdownOptions(): Record<string, any>;
|
|
@@ -57,6 +62,6 @@ export declare abstract class BaseFormComponent<T extends {
|
|
|
57
62
|
*/
|
|
58
63
|
protected isInContext(contextType: ComponentContext): boolean;
|
|
59
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormComponent<any>, never>;
|
|
60
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormComponent<any>, "ng-component", never, { "
|
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormComponent<any>, "ng-component", never, { "formData": { "alias": "formData"; "required": false; }; }, {}, never, never, true, never>;
|
|
61
66
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseFormComponent<any>>;
|
|
62
67
|
}
|
|
@@ -1,78 +1,24 @@
|
|
|
1
|
-
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
1
|
import { Router } from '@angular/router';
|
|
3
|
-
import { Table, TableLazyLoadEvent } from 'primeng/table';
|
|
4
2
|
import { ConfirmationService } from 'primeng/api';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { BaseTableComponent } from './base-table.component';
|
|
5
5
|
import { NotificationService } from '../services/notification.service';
|
|
6
|
-
import { Subscription, Observable } from 'rxjs';
|
|
7
|
-
import { Page } from '../models/pagination/page.interface';
|
|
8
|
-
import { PageRequest } from '../models/pagination/page-request.interface';
|
|
9
|
-
import { FilterCriteria, FilterOperator } from '../models/pagination/filter-criteria.interface';
|
|
10
|
-
import { BasePageComponent } from './base-page.component';
|
|
11
6
|
import { UtilsService } from '../services/utils.service';
|
|
12
7
|
import * as i0 from "@angular/core";
|
|
13
8
|
/**
|
|
14
9
|
* Base component for all list page components in the application.
|
|
15
|
-
* Provides common functionality for list operations like
|
|
16
|
-
*
|
|
10
|
+
* Provides common functionality for list operations like CRUD operations
|
|
11
|
+
* while inheriting table functionality from BaseTableComponent.
|
|
17
12
|
*/
|
|
18
13
|
export declare abstract class BaseListPageComponent<T extends {
|
|
19
14
|
uuid: string;
|
|
20
|
-
}> extends
|
|
15
|
+
}> extends BaseTableComponent<T> {
|
|
21
16
|
protected router: Router;
|
|
22
17
|
protected notificationService: NotificationService;
|
|
23
18
|
protected utilsService: UtilsService;
|
|
24
19
|
protected confirmationService: ConfirmationService;
|
|
25
|
-
table: Table;
|
|
26
|
-
items: T[];
|
|
27
20
|
actionLoading: boolean;
|
|
28
|
-
rows: number;
|
|
29
|
-
totalRecords: number;
|
|
30
|
-
filters: FilterCriteria[];
|
|
31
|
-
protected subscriptions: Subscription[];
|
|
32
21
|
constructor(router: Router, notificationService: NotificationService, utilsService: UtilsService, confirmationService: ConfirmationService);
|
|
33
|
-
/**
|
|
34
|
-
* Initialize the component, subscribe to loading state if available,
|
|
35
|
-
* and load initial data.
|
|
36
|
-
*/
|
|
37
|
-
ngOnInit(): void;
|
|
38
|
-
/**
|
|
39
|
-
* Clean up any subscriptions when the component is destroyed
|
|
40
|
-
*/
|
|
41
|
-
ngOnDestroy(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Handle search event from the UI
|
|
44
|
-
* @param event The search event
|
|
45
|
-
*/
|
|
46
|
-
onSearch(event: Event): void;
|
|
47
|
-
/**
|
|
48
|
-
* Load data with pagination and sorting
|
|
49
|
-
* @param event The lazy load event from PrimeNG table
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* Convert PrimeNG filter format to backend format
|
|
53
|
-
* @param filters The PrimeNG filters object
|
|
54
|
-
* @returns Converted filters object for backend
|
|
55
|
-
*/
|
|
56
|
-
/**
|
|
57
|
-
* Convert PrimeNG filter format to backend format
|
|
58
|
-
* @param filters The PrimeNG filters object
|
|
59
|
-
* @returns Converted filters object for backend
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* Convert PrimeNG filters to backend format with proper operator mapping
|
|
63
|
-
*/
|
|
64
|
-
protected convertFilters(filters: {
|
|
65
|
-
[key: string]: any;
|
|
66
|
-
}): FilterCriteria[];
|
|
67
|
-
/**
|
|
68
|
-
* Transform filter value based on backend requirements - all values must be strings
|
|
69
|
-
*/
|
|
70
|
-
protected transformFilterValue(value: any): string;
|
|
71
|
-
/**
|
|
72
|
-
* Map PrimeNG operators to backend operators
|
|
73
|
-
*/
|
|
74
|
-
protected transformOperator(operator: string): FilterOperator;
|
|
75
|
-
loadData(event?: TableLazyLoadEvent): void;
|
|
76
22
|
/**
|
|
77
23
|
* Navigate to create a new entity
|
|
78
24
|
*/
|
|
@@ -87,6 +33,11 @@ export declare abstract class BaseListPageComponent<T extends {
|
|
|
87
33
|
* @param item The entity to edit
|
|
88
34
|
*/
|
|
89
35
|
onEdit(item: T): void;
|
|
36
|
+
/**
|
|
37
|
+
* Delete an entity with confirmation
|
|
38
|
+
* @param item The entity to delete
|
|
39
|
+
*/
|
|
40
|
+
onDelete(item: T): void;
|
|
90
41
|
/**
|
|
91
42
|
* Navigate to a route with error handling
|
|
92
43
|
* @param path The route path
|
|
@@ -95,11 +46,6 @@ export declare abstract class BaseListPageComponent<T extends {
|
|
|
95
46
|
protected navigateTo(path: any[], matrixParams?: {
|
|
96
47
|
[key: string]: any;
|
|
97
48
|
}): void;
|
|
98
|
-
/**
|
|
99
|
-
* Delete an entity with confirmation
|
|
100
|
-
* @param item The entity to delete
|
|
101
|
-
*/
|
|
102
|
-
onDelete(item: T): void;
|
|
103
49
|
/**
|
|
104
50
|
* Validate that an entity has a UUID
|
|
105
51
|
* @param item The entity to validate
|
|
@@ -108,15 +54,10 @@ export declare abstract class BaseListPageComponent<T extends {
|
|
|
108
54
|
*/
|
|
109
55
|
protected validateItemUuid(item: T, action: string): boolean;
|
|
110
56
|
/**
|
|
111
|
-
*
|
|
112
|
-
* @returns An observable of loading state if available, null otherwise
|
|
113
|
-
*/
|
|
114
|
-
protected getLoadingObservable(): Observable<boolean> | null;
|
|
115
|
-
/**
|
|
116
|
-
* Get the entity service for data operations
|
|
57
|
+
* Override the getEntityService to include the delete operation
|
|
117
58
|
*/
|
|
118
59
|
protected abstract getEntityService(): {
|
|
119
|
-
getAll: (pageRequest?:
|
|
60
|
+
getAll: (pageRequest?: any) => Observable<any>;
|
|
120
61
|
delete: (uuid: string) => Observable<any>;
|
|
121
62
|
};
|
|
122
63
|
/**
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { FormComponentState } from '../states/form-component.state';
|
|
4
|
+
import { BasePageComponent } from './base-page.component';
|
|
5
|
+
import { UtilsService } from '../services/utils.service';
|
|
6
|
+
import { NotificationService } from '../services/notification.service';
|
|
7
|
+
import { ListTabbedFormState } from '../states/list-tabbed-form.state';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare abstract class BaseListTabbedFormComponent<T extends {
|
|
10
|
+
uuid: string;
|
|
11
|
+
}> extends BasePageComponent implements OnInit, OnDestroy {
|
|
12
|
+
protected route: ActivatedRoute;
|
|
13
|
+
protected router: Router;
|
|
14
|
+
protected notificationService: NotificationService;
|
|
15
|
+
protected utilsService: UtilsService;
|
|
16
|
+
private readonly destroyed$;
|
|
17
|
+
private readonly tabState$;
|
|
18
|
+
state: ListTabbedFormState<T> & FormComponentState<T>;
|
|
19
|
+
constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService);
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
private initializeFormFromQueryParams;
|
|
22
|
+
private setupTabStateSubscription;
|
|
23
|
+
private setupRouteParamsSubscription;
|
|
24
|
+
private handleTabChange;
|
|
25
|
+
private findTabData;
|
|
26
|
+
private updateComponentState;
|
|
27
|
+
private initializeForm;
|
|
28
|
+
private initializeFormMode;
|
|
29
|
+
private setupFormState;
|
|
30
|
+
protected initializeListForm(): void;
|
|
31
|
+
private createTabsFromFormDataList;
|
|
32
|
+
protected onTabChange(event: any): void;
|
|
33
|
+
protected navigateToTab(uuid: string): void;
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
|
+
private isValidPageMode;
|
|
36
|
+
protected abstract getTabTitle(data: T): string;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseListTabbedFormComponent<any>, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseListTabbedFormComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseListTabbedFormComponent<any>>;
|
|
40
|
+
}
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { BasePageComponent } from './base-page.component';
|
|
4
4
|
import { UtilsService } from '../services/utils.service';
|
|
5
5
|
import { NotificationService } from '../services/notification.service';
|
|
6
|
-
import { PageMode } from '../constants/app.constants';
|
|
7
6
|
import { EntityService } from '../services/entity.service';
|
|
7
|
+
import { TabConfig, TabbedFormState } from '../states/tabbed-form.state';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
export interface TabConfig {
|
|
10
|
-
value: string;
|
|
11
|
-
title: string;
|
|
12
|
-
isParentModel?: boolean;
|
|
13
|
-
}
|
|
14
9
|
export declare abstract class BaseTabbedFormComponent<T extends {
|
|
15
10
|
uuid: string;
|
|
16
|
-
}> extends BasePageComponent implements OnInit {
|
|
11
|
+
}> extends BasePageComponent implements OnInit, OnDestroy {
|
|
17
12
|
protected route: ActivatedRoute;
|
|
18
13
|
protected router: Router;
|
|
19
14
|
protected notificationService: NotificationService;
|
|
20
15
|
protected utilsService: UtilsService;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
protected hasChanges: boolean;
|
|
16
|
+
private readonly destroyed$;
|
|
17
|
+
private readonly stateManager$;
|
|
18
|
+
private getInitialState;
|
|
19
|
+
protected get state(): TabbedFormState<T>;
|
|
20
|
+
protected set state(value: TabbedFormState<T>);
|
|
21
|
+
private hasStateChanged;
|
|
22
|
+
private areTabsEqual;
|
|
29
23
|
constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService);
|
|
30
24
|
ngOnInit(): void;
|
|
25
|
+
private initializeFormWithErrorHandling;
|
|
26
|
+
private setupStateSubscription;
|
|
27
|
+
private handleStateChange;
|
|
31
28
|
private initializeFormData;
|
|
32
29
|
private loadFromUuid;
|
|
33
30
|
private initializeForm;
|
|
@@ -38,16 +35,16 @@ export declare abstract class BaseTabbedFormComponent<T extends {
|
|
|
38
35
|
protected findTabByValue(value: string): TabConfig | undefined;
|
|
39
36
|
protected loadDefaultTab(): void;
|
|
40
37
|
protected getTabFormData(tabConfig: TabConfig): T | null;
|
|
41
|
-
private
|
|
42
|
-
private createTabsFromFormDataList;
|
|
43
|
-
protected abstract getTabTitle(data: T): string;
|
|
38
|
+
private isTabFormData;
|
|
44
39
|
protected onTabChange(value: string | number): void;
|
|
45
40
|
protected hasFormChanges(currentData: T): boolean;
|
|
46
|
-
private
|
|
41
|
+
private detectChanges;
|
|
42
|
+
ngOnDestroy(): void;
|
|
47
43
|
private isValidPageMode;
|
|
48
44
|
protected abstract getTabs(): TabConfig[];
|
|
49
45
|
protected abstract getEntityService(): EntityService<T>;
|
|
50
46
|
protected abstract getEntityName(): string;
|
|
47
|
+
protected getTabTitle(data: T): string;
|
|
51
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseTabbedFormComponent<any>, never>;
|
|
52
49
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaseTabbedFormComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
53
50
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseTabbedFormComponent<any>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Table, TableLazyLoadEvent } from 'primeng/table';
|
|
2
|
+
import { Subscription, Observable } from 'rxjs';
|
|
3
|
+
import { Page } from '../models/pagination/page.interface';
|
|
4
|
+
import { PageRequest } from '../models/pagination/page-request.interface';
|
|
5
|
+
import { FilterCriteria, FilterOperator } from '../models/pagination/filter-criteria.interface';
|
|
6
|
+
import { BasePageComponent } from './base-page.component';
|
|
7
|
+
import { UtilsService } from '../services/utils.service';
|
|
8
|
+
import { NotificationService } from '../services/notification.service';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* Base component for all table components in the application.
|
|
12
|
+
* Provides common functionality for table operations like loading data,
|
|
13
|
+
* pagination, sorting, and filtering.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class BaseTableComponent<T extends {
|
|
16
|
+
uuid: string;
|
|
17
|
+
}> extends BasePageComponent {
|
|
18
|
+
protected utilsService: UtilsService;
|
|
19
|
+
protected notificationService: NotificationService;
|
|
20
|
+
table: Table;
|
|
21
|
+
items: T[];
|
|
22
|
+
rows: number;
|
|
23
|
+
totalRecords: number;
|
|
24
|
+
filters: FilterCriteria[];
|
|
25
|
+
protected subscriptions: Subscription[];
|
|
26
|
+
constructor(utilsService: UtilsService, notificationService: NotificationService);
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the component and load initial data
|
|
29
|
+
*/
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Clean up any subscriptions when the component is destroyed
|
|
33
|
+
*/
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Handle search event from the UI
|
|
37
|
+
* @param event The search event
|
|
38
|
+
*/
|
|
39
|
+
onSearch(event: Event): void;
|
|
40
|
+
/**
|
|
41
|
+
* Load data with pagination and sorting
|
|
42
|
+
* @param event The lazy load event from PrimeNG table
|
|
43
|
+
*/
|
|
44
|
+
loadData(event?: TableLazyLoadEvent): void;
|
|
45
|
+
/**
|
|
46
|
+
* Convert PrimeNG filters to backend format with proper operator mapping
|
|
47
|
+
*/
|
|
48
|
+
protected convertFilters(filters: {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}): FilterCriteria[];
|
|
51
|
+
/**
|
|
52
|
+
* Transform filter value based on backend requirements - all values must be strings
|
|
53
|
+
*/
|
|
54
|
+
protected transformFilterValue(value: any): string;
|
|
55
|
+
/**
|
|
56
|
+
* Map PrimeNG operators to backend operators
|
|
57
|
+
*/
|
|
58
|
+
protected transformOperator(operator: string): FilterOperator;
|
|
59
|
+
/**
|
|
60
|
+
* Get an observable for loading state from the entity service
|
|
61
|
+
* @returns An observable of loading state if available, null otherwise
|
|
62
|
+
*/
|
|
63
|
+
protected getLoadingObservable(): Observable<boolean> | null;
|
|
64
|
+
/**
|
|
65
|
+
* Get the entity service for data operations
|
|
66
|
+
*/
|
|
67
|
+
protected abstract getEntityService(): {
|
|
68
|
+
getAll: (pageRequest?: PageRequest) => Observable<Page<T>>;
|
|
69
|
+
};
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseTableComponent<any>, never>;
|
|
71
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTableComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { BasePageComponent } from './base-page.component';
|
|
5
|
+
import { UtilsService } from '../services/utils.service';
|
|
6
|
+
import { NotificationService } from '../services/notification.service';
|
|
7
|
+
import { FormlyConfigService } from '../services/formly-config.service';
|
|
8
|
+
import { EntityService } from '../services/entity.service';
|
|
9
|
+
import { FormService } from '../services/form.service';
|
|
10
|
+
import { ComponentContext } from '../enums/component-context.enum';
|
|
11
|
+
import { FormComponentState } from '../states/form-component.state';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
/**
|
|
14
|
+
* Base component for all task detail components in the application.
|
|
15
|
+
* Uses composition with FormService for form functionality.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class BaseTaskDetailsComponent<T extends {
|
|
18
|
+
uuid: string;
|
|
19
|
+
}> extends BasePageComponent implements OnInit, OnDestroy {
|
|
20
|
+
protected route: ActivatedRoute;
|
|
21
|
+
protected router: Router;
|
|
22
|
+
protected notificationService: NotificationService;
|
|
23
|
+
protected utilsService: UtilsService;
|
|
24
|
+
protected formlyConfigService: FormlyConfigService;
|
|
25
|
+
private readonly destroyed$;
|
|
26
|
+
protected formService: FormService<T>;
|
|
27
|
+
protected state: FormComponentState<T>;
|
|
28
|
+
constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService, formlyConfigService: FormlyConfigService);
|
|
29
|
+
protected initializeServices(): Observable<void>;
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
private initializeFromRoute;
|
|
32
|
+
protected loadData(uuid: string): void;
|
|
33
|
+
protected onSubmit(): void;
|
|
34
|
+
protected navigateAfterSubmit(): void;
|
|
35
|
+
private onInitialized;
|
|
36
|
+
private handleInitError;
|
|
37
|
+
protected handleLoadError(error: any): void;
|
|
38
|
+
protected handleSubmitError(error: any): void;
|
|
39
|
+
protected isInContext(contextType: ComponentContext): boolean;
|
|
40
|
+
ngOnDestroy(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get the entity service for CRUD operations
|
|
43
|
+
*/
|
|
44
|
+
protected abstract getEntityService(): EntityService<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Get field configuration for the form
|
|
47
|
+
*/
|
|
48
|
+
protected abstract getJsonFields(): any;
|
|
49
|
+
/**
|
|
50
|
+
* Get dropdown options for form fields
|
|
51
|
+
*/
|
|
52
|
+
protected abstract getDropdownOptions(): Record<string, any>;
|
|
53
|
+
/**
|
|
54
|
+
* Get entity name for messages
|
|
55
|
+
*/
|
|
56
|
+
protected abstract getEntityName(): string;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseTaskDetailsComponent<any>, never>;
|
|
58
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTaskDetailsComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
59
|
+
}
|
|
@@ -3,8 +3,8 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class NumericInputType extends FieldType {
|
|
4
4
|
defaultOptions: {
|
|
5
5
|
props: {
|
|
6
|
-
min:
|
|
7
|
-
max:
|
|
6
|
+
min: undefined;
|
|
7
|
+
max: undefined;
|
|
8
8
|
minFractionDigits: number;
|
|
9
9
|
maxFractionDigits: number;
|
|
10
10
|
prefix: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard task roles that define user permissions within a task workflow.
|
|
3
|
+
* These roles control what operations a user can perform on tasks.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TaskRole {
|
|
6
|
+
/**
|
|
7
|
+
* Can create new tasks. This could be a user initiating a task manually
|
|
8
|
+
* or a system process creating tasks automatically.
|
|
9
|
+
*/
|
|
10
|
+
TASK_CREATOR = "TASK_CREATOR",
|
|
11
|
+
/**
|
|
12
|
+
* Can assign or reassign tasks to other users. Typically used by
|
|
13
|
+
* team leads or workflow managers to distribute work.
|
|
14
|
+
*/
|
|
15
|
+
TASK_ASSIGNER = "TASK_ASSIGNER",
|
|
16
|
+
/**
|
|
17
|
+
* Can pick tasks for self-assignment from a task pool.
|
|
18
|
+
* Useful in scenarios where tasks can be claimed by available workers.
|
|
19
|
+
*/
|
|
20
|
+
TASK_PICKER = "TASK_PICKER",
|
|
21
|
+
/**
|
|
22
|
+
* Can review and approve completed tasks. This role is responsible for
|
|
23
|
+
* quality assurance or approval steps in the workflow.
|
|
24
|
+
*/
|
|
25
|
+
TASK_REVIEWER = "TASK_REVIEWER",
|
|
26
|
+
/**
|
|
27
|
+
* Can view task details but cannot modify them. Useful for stakeholders
|
|
28
|
+
* who need to monitor task progress without making changes.
|
|
29
|
+
*/
|
|
30
|
+
TASK_VIEWER = "TASK_VIEWER",
|
|
31
|
+
/**
|
|
32
|
+
* Has full administrative control over tasks. Can override or force
|
|
33
|
+
* state changes, bypass normal workflow restrictions, and manage
|
|
34
|
+
* task configuration.
|
|
35
|
+
*/
|
|
36
|
+
TASK_ADMIN = "TASK_ADMIN"
|
|
37
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface KeycloakConfig {
|
|
2
|
+
authServerUrl: string;
|
|
3
|
+
realm: string;
|
|
4
|
+
clientId: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
useSSO?: boolean;
|
|
7
|
+
enableBearerInterceptor?: boolean;
|
|
8
|
+
tokenValidityInSeconds?: number;
|
|
9
|
+
bearerExcludedUrls?: string[];
|
|
10
|
+
silentCheckSsoRedirectUri?: string;
|
|
11
|
+
loginOptions?: KeycloakLoginOptions;
|
|
12
|
+
}
|
|
13
|
+
export interface KeycloakLoginOptions {
|
|
14
|
+
redirectUri?: string;
|
|
15
|
+
prompt?: 'none' | 'login' | 'consent';
|
|
16
|
+
maxAge?: number;
|
|
17
|
+
loginHint?: string;
|
|
18
|
+
idpHint?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
|
2
|
+
import { KeycloakService } from './keycloak.service';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class KeycloakAuthGuard {
|
|
6
|
+
protected keycloakService: KeycloakService;
|
|
7
|
+
protected router: Router;
|
|
8
|
+
constructor(keycloakService: KeycloakService, router: Router);
|
|
9
|
+
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
|
|
10
|
+
protected hasRequiredRoles(requiredRoles: string[]): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if all required roles are present
|
|
13
|
+
* @param route Route being activated
|
|
14
|
+
* @returns true if no roles are required or if all required roles are present
|
|
15
|
+
*/
|
|
16
|
+
protected checkRoles(route: ActivatedRouteSnapshot): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Gets redirect URL from route if present
|
|
19
|
+
* @param state Router state
|
|
20
|
+
* @returns URL to redirect to after login or undefined
|
|
21
|
+
*/
|
|
22
|
+
protected getLoginRedirectUrl(state: RouterStateSnapshot): string;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakAuthGuard, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakAuthGuard>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { KeycloakConfig } from './keycloak-config.interface';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class KeycloakService {
|
|
6
|
+
private config;
|
|
7
|
+
private http;
|
|
8
|
+
private keycloak;
|
|
9
|
+
private isAuthenticated$;
|
|
10
|
+
private userProfile$;
|
|
11
|
+
constructor(config: KeycloakConfig, http: HttpClient);
|
|
12
|
+
initialize(): Promise<boolean>;
|
|
13
|
+
login(options?: any): Promise<void>;
|
|
14
|
+
logout(): Promise<void>;
|
|
15
|
+
isLoggedIn(): Observable<boolean>;
|
|
16
|
+
getToken(): Promise<string | null>;
|
|
17
|
+
getRoles(): string[];
|
|
18
|
+
hasRole(role: string): boolean;
|
|
19
|
+
getUserProfile(): Observable<any>;
|
|
20
|
+
updateToken(minValidity?: number): Promise<boolean>;
|
|
21
|
+
private loadUserProfile;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakService, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakService>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseRequest } from './base-request.model';
|
|
2
|
+
/**
|
|
3
|
+
* Base interface for create operation requests
|
|
4
|
+
* Contains minimal fields needed when creating a new entity
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseCreateRequest extends BaseRequest {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the entity should be active upon creation
|
|
9
|
+
* Optional, defaults to true on server
|
|
10
|
+
*/
|
|
11
|
+
active?: boolean;
|
|
12
|
+
}
|