@cccteam/ccc-lib 0.0.15 → 0.0.16
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 +38 -13
- package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs +36 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs +25 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs +83 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs +44 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs +82 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-camel-case-to-title.mjs +33 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-camel-case-to-title.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-grid.mjs +256 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-grid.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs +3129 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-forms.mjs +79 -0
- package/fesm2022/cccteam-ccc-lib-src-forms.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-internal-types.mjs +6 -0
- package/fesm2022/cccteam-ccc-lib-src-internal-types.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-types.mjs +431 -0
- package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs +48 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs +41 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-idle-service.mjs +157 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-idle-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs +50 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs +63 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs +60 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs +19 -0
- package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib.mjs +4444 -0
- package/fesm2022/cccteam-ccc-lib.mjs.map +1 -0
- package/package.json +88 -5
- package/types/cccteam-ccc-lib-src-auth-authentication-guard.d.ts +6 -0
- package/types/cccteam-ccc-lib-src-auth-authorization-guard.d.ts +6 -0
- package/types/cccteam-ccc-lib-src-auth-forms.d.ts +28 -0
- package/types/cccteam-ccc-lib-src-auth-has-permission.d.ts +15 -0
- package/types/cccteam-ccc-lib-src-auth-service.d.ts +38 -0
- package/types/cccteam-ccc-lib-src-ccc-camel-case-to-title.d.ts +10 -0
- package/types/cccteam-ccc-lib-src-ccc-grid.d.ts +35 -0
- package/types/cccteam-ccc-lib-src-ccc-resource.d.ts +674 -0
- package/types/cccteam-ccc-lib-src-forms.d.ts +27 -0
- package/types/cccteam-ccc-lib-src-types.d.ts +934 -0
- package/types/cccteam-ccc-lib-src-ui-alert.d.ts +16 -0
- package/types/cccteam-ccc-lib-src-ui-core-service.d.ts +20 -0
- package/types/cccteam-ccc-lib-src-ui-idle-service.d.ts +49 -0
- package/types/cccteam-ccc-lib-src-ui-interceptor.d.ts +16 -0
- package/types/cccteam-ccc-lib-src-ui-notification-service.d.ts +33 -0
- package/types/cccteam-ccc-lib-src-ui-sidenav.d.ts +33 -0
- package/types/cccteam-ccc-lib-src-util-request-options.d.ts +12 -0
- package/types/cccteam-ccc-lib.d.ts +1877 -0
- package/eslint.config.js +0 -32
- package/ng-package.json +0 -11
- package/src/auth-authentication-guard/authentication.guard.ts +0 -40
- package/src/auth-authentication-guard/index.ts +0 -1
- package/src/auth-authentication-guard/ng-package.json +0 -6
- package/src/auth-authorization-guard/authorization.guard.ts +0 -17
- package/src/auth-authorization-guard/index.ts +0 -1
- package/src/auth-authorization-guard/ng-package.json +0 -6
- package/src/auth-forms/ccc-field/ccc-field.component.html +0 -1
- package/src/auth-forms/ccc-field/ccc-field.component.scss +0 -0
- package/src/auth-forms/ccc-field/ccc-field.component.spec.ts +0 -22
- package/src/auth-forms/ccc-field/ccc-field.component.ts +0 -74
- package/src/auth-forms/form-helpers.ts +0 -39
- package/src/auth-forms/index.ts +0 -3
- package/src/auth-forms/ng-package.json +0 -6
- package/src/auth-has-permission/has-permission.directive.ts +0 -34
- package/src/auth-has-permission/index.ts +0 -1
- package/src/auth-has-permission/ng-package.json +0 -6
- package/src/auth-service/auth.service.ts +0 -92
- package/src/auth-service/index.ts +0 -1
- package/src/auth-service/ng-package.json +0 -6
- package/src/ccc-camel-case-to-title/camel-case-to-title.pipe.ts +0 -23
- package/src/ccc-camel-case-to-title/index.ts +0 -1
- package/src/ccc-camel-case-to-title/ng-package.json +0 -6
- package/src/ccc-grid/ccc-grid.component.ts +0 -155
- package/src/ccc-grid/index.ts +0 -3
- package/src/ccc-grid/ng-package.json +0 -6
- package/src/ccc-grid/table-button/table-button.component.html +0 -16
- package/src/ccc-grid/table-button/table-button.component.scss +0 -5
- package/src/ccc-grid/table-button/table-button.component.spec.ts +0 -22
- package/src/ccc-grid/table-button/table-button.component.ts +0 -49
- package/src/ccc-resource/can-deactivate.guard.ts +0 -41
- package/src/ccc-resource/compound-resource/compound-resource.component.html +0 -57
- package/src/ccc-resource/compound-resource/compound-resource.component.scss +0 -86
- package/src/ccc-resource/compound-resource/compound-resource.component.spec.ts +0 -22
- package/src/ccc-resource/compound-resource/compound-resource.component.ts +0 -158
- package/src/ccc-resource/concat-fns.ts +0 -162
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.html +0 -12
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.scss +0 -0
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.spec.ts +0 -23
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.ts +0 -17
- package/src/ccc-resource/form-state.service.ts +0 -24
- package/src/ccc-resource/format-fns.ts +0 -49
- package/src/ccc-resource/gui-constants.ts +0 -88
- package/src/ccc-resource/index.ts +0 -23
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.html +0 -8
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.scss +0 -0
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.spec.ts +0 -22
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.ts +0 -12
- package/src/ccc-resource/ng-package.json +0 -6
- package/src/ccc-resource/operation-types.ts +0 -19
- package/src/ccc-resource/padding-element/padding-element.component.html +0 -1
- package/src/ccc-resource/padding-element/padding-element.component.scss +0 -3
- package/src/ccc-resource/padding-element/padding-element.component.spec.ts +0 -22
- package/src/ccc-resource/padding-element/padding-element.component.ts +0 -20
- package/src/ccc-resource/resource-array-view/resource-array-view.component.html +0 -81
- package/src/ccc-resource/resource-array-view/resource-array-view.component.scss +0 -21
- package/src/ccc-resource/resource-array-view/resource-array-view.component.spec.ts +0 -22
- package/src/ccc-resource/resource-array-view/resource-array-view.component.ts +0 -143
- package/src/ccc-resource/resource-base/resource-base.component.spec.ts +0 -22
- package/src/ccc-resource/resource-base/resource-base.component.ts +0 -11
- package/src/ccc-resource/resource-cache.service.ts +0 -232
- package/src/ccc-resource/resource-create/resource-create.component.html +0 -31
- package/src/ccc-resource/resource-create/resource-create.component.scss +0 -130
- package/src/ccc-resource/resource-create/resource-create.component.spec.ts +0 -22
- package/src/ccc-resource/resource-create/resource-create.component.ts +0 -303
- package/src/ccc-resource/resource-field/base-field.directive.ts +0 -102
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.html +0 -16
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.ts +0 -15
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.html +0 -13
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.spec.ts +0 -23
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.ts +0 -50
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.html +0 -22
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.ts +0 -14
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.html +0 -71
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.scss +0 -9
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.ts +0 -207
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.html +0 -38
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.scss +0 -3
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.ts +0 -87
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.html +0 -23
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.scss +0 -6
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.ts +0 -14
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.html +0 -29
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.scss +0 -6
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.ts +0 -23
- package/src/ccc-resource/resource-field/resource-field.component.html +0 -112
- package/src/ccc-resource/resource-field/resource-field.component.scss +0 -7
- package/src/ccc-resource/resource-field/resource-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/resource-field.component.ts +0 -214
- package/src/ccc-resource/resource-layout/resource-layout.component.html +0 -73
- package/src/ccc-resource/resource-layout/resource-layout.component.scss +0 -26
- package/src/ccc-resource/resource-layout/resource-layout.component.spec.ts +0 -22
- package/src/ccc-resource/resource-layout/resource-layout.component.ts +0 -176
- package/src/ccc-resource/resource-list/ resource-list.component.spec.ts +0 -22
- package/src/ccc-resource/resource-list/resource-list.component.html +0 -27
- package/src/ccc-resource/resource-list/resource-list.component.scss +0 -67
- package/src/ccc-resource/resource-list/resource-list.component.ts +0 -376
- package/src/ccc-resource/resource-list-create/resource-list-create.component.html +0 -71
- package/src/ccc-resource/resource-list-create/resource-list-create.component.scss +0 -9
- package/src/ccc-resource/resource-list-create/resource-list-create.component.spec.ts +0 -22
- package/src/ccc-resource/resource-list-create/resource-list-create.component.ts +0 -103
- package/src/ccc-resource/resource-resolver/resource-resolver.component.html +0 -1
- package/src/ccc-resource/resource-resolver/resource-resolver.component.scss +0 -0
- package/src/ccc-resource/resource-resolver/resource-resolver.component.spec.ts +0 -22
- package/src/ccc-resource/resource-resolver/resource-resolver.component.ts +0 -69
- package/src/ccc-resource/resource-store.service.ts +0 -93
- package/src/ccc-resource/resource-view/resource-view.component.html +0 -133
- package/src/ccc-resource/resource-view/resource-view.component.scss +0 -150
- package/src/ccc-resource/resource-view/resource-view.component.spec.ts +0 -22
- package/src/ccc-resource/resource-view/resource-view.component.ts +0 -354
- package/src/ccc-resource/resources-helpers.ts +0 -262
- package/src/ccc-resource/utils/validator-utils.ts +0 -6
- package/src/index.ts +0 -44
- package/src/internal-types/ng-package.json +0 -6
- package/src/types/auth.actions.ts +0 -46
- package/src/types/configs.ts +0 -952
- package/src/types/constants.ts +0 -1
- package/src/types/core.actions.ts +0 -33
- package/src/types/index.ts +0 -9
- package/src/types/ng-package.json +0 -6
- package/src/types/notification-message.ts +0 -20
- package/src/types/permissions.ts +0 -17
- package/src/types/session-info.ts +0 -10
- package/src/types/tokens.ts +0 -20
- package/src/ui-alert/alert.component.html +0 -13
- package/src/ui-alert/alert.component.scss +0 -48
- package/src/ui-alert/alert.component.spec.ts +0 -22
- package/src/ui-alert/alert.component.ts +0 -35
- package/src/ui-alert/index.ts +0 -1
- package/src/ui-alert/ng-package.json +0 -6
- package/src/ui-core-service/index.ts +0 -1
- package/src/ui-core-service/ng-package.json +0 -6
- package/src/ui-core-service/ui-core.service.ts +0 -34
- package/src/ui-interceptor/api.interceptor.spec.ts +0 -16
- package/src/ui-interceptor/api.interceptor.ts +0 -45
- package/src/ui-interceptor/index.ts +0 -1
- package/src/ui-interceptor/ng-package.json +0 -6
- package/src/ui-notification-service/index.ts +0 -1
- package/src/ui-notification-service/ng-package.json +0 -6
- package/src/ui-notification-service/notification.service.ts +0 -59
- package/src/ui-sidenav/index.ts +0 -1
- package/src/ui-sidenav/ng-package.json +0 -6
- package/src/ui-sidenav/sidenav.component.html +0 -60
- package/src/ui-sidenav/sidenav.component.scss +0 -99
- package/src/ui-sidenav/sidenav.component.spec.ts +0 -22
- package/src/ui-sidenav/sidenav.component.ts +0 -64
- package/src/util-request-options/index.ts +0 -1
- package/src/util-request-options/ng-package.json +0 -6
- package/src/util-request-options/request-options.ts +0 -17
- package/tsconfig.lib.json +0 -13
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
- /package/{src/internal-types/index.ts → types/cccteam-ccc-lib-src-internal-types.d.ts} +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ResourceResolverComponent } from './resource-resolver.component';
|
|
4
|
-
|
|
5
|
-
describe('ResourceResolverComponent', () => {
|
|
6
|
-
let component: ResourceResolverComponent;
|
|
7
|
-
let fixture: ComponentFixture<ResourceResolverComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [ResourceResolverComponent],
|
|
12
|
-
}).compileComponents();
|
|
13
|
-
|
|
14
|
-
fixture = TestBed.createComponent(ResourceResolverComponent);
|
|
15
|
-
component = fixture.componentInstance;
|
|
16
|
-
fixture.detectChanges();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create', () => {
|
|
20
|
-
expect(component).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Component, ComponentRef, computed, effect, input, untracked, viewChild, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { ChildResourceConfig, ComponentConfig, FieldName, RecordData } from '@cccteam/ccc-lib/src/types';
|
|
3
|
-
import { ResourceStore } from '../../ccc-resource/resource-store.service';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'ccc-resource-resolver',
|
|
7
|
-
imports: [],
|
|
8
|
-
templateUrl: './resource-resolver.component.html',
|
|
9
|
-
styleUrl: './resource-resolver.component.scss',
|
|
10
|
-
providers: [ResourceStore],
|
|
11
|
-
})
|
|
12
|
-
export class ResourceResolverComponent {
|
|
13
|
-
compoundResourceComponent = input.required<ComponentRef<any>>();
|
|
14
|
-
resourceConfig = input<ChildResourceConfig>();
|
|
15
|
-
|
|
16
|
-
config = computed(() => {
|
|
17
|
-
return this.resourceConfig() as ComponentConfig;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
dynamicSlot = viewChild.required<ViewContainerRef, ViewContainerRef>('dynamicSlot', { read: ViewContainerRef });
|
|
21
|
-
|
|
22
|
-
parentData = input.required<RecordData>();
|
|
23
|
-
|
|
24
|
-
constructor() {
|
|
25
|
-
effect(() => {
|
|
26
|
-
const parentData = this.parentData();
|
|
27
|
-
const config = this.config();
|
|
28
|
-
const params = config?.params;
|
|
29
|
-
if (params === undefined || config === undefined) return;
|
|
30
|
-
|
|
31
|
-
untracked(() => {
|
|
32
|
-
this.dynamicSlot().clear();
|
|
33
|
-
const component = config.component;
|
|
34
|
-
switch (component) {
|
|
35
|
-
case 'SwitchResolver': {
|
|
36
|
-
let uuid = '';
|
|
37
|
-
let caseConfig = {} as ChildResourceConfig;
|
|
38
|
-
for (const c of params.cases) {
|
|
39
|
-
if (parentData) {
|
|
40
|
-
if (parentData[c.parentField] === c.caseId) {
|
|
41
|
-
uuid = String(parentData[c.childId]);
|
|
42
|
-
caseConfig = c.config;
|
|
43
|
-
if ('parentRelation' in caseConfig) {
|
|
44
|
-
caseConfig.parentRelation.childKey = '' as FieldName;
|
|
45
|
-
caseConfig.parentRelation.parentKey = '' as FieldName;
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (uuid == '') return;
|
|
53
|
-
|
|
54
|
-
// Use dynamic import to avoid circular dependency
|
|
55
|
-
const primaryComponentRef = this.dynamicSlot().createComponent(this.compoundResourceComponent().componentType);
|
|
56
|
-
primaryComponentRef.setInput('resourceConfig', caseConfig);
|
|
57
|
-
primaryComponentRef.setInput('uuid', uuid);
|
|
58
|
-
primaryComponentRef.setInput('parentData', parentData);
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
default:
|
|
62
|
-
console.warn('Component not found', component);
|
|
63
|
-
// add default component to dynamic slot
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { computed, inject, Injectable, ResourceRef, signal } from '@angular/core';
|
|
2
|
-
import { ColumnConfig, FieldName, FieldSort, RecordData, Resource, ResourceMeta } from '@cccteam/ccc-lib/src/types';
|
|
3
|
-
import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
|
|
4
|
-
import { ResourceCacheService } from './resource-cache.service';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class ResourceStore {
|
|
8
|
-
resourceMeta = signal({} as ResourceMeta);
|
|
9
|
-
resourceName = signal<Resource>('' as Resource);
|
|
10
|
-
filter = signal<string>('');
|
|
11
|
-
searchTokens = signal<string>('');
|
|
12
|
-
sorts = signal<FieldSort[]>([]);
|
|
13
|
-
listColumns = signal<ColumnConfig[]>([]);
|
|
14
|
-
requireSearchToDisplayResults = signal(false);
|
|
15
|
-
uuid = signal<string>('');
|
|
16
|
-
error = signal<string>('');
|
|
17
|
-
|
|
18
|
-
notifications = inject(NotificationService);
|
|
19
|
-
cache = inject(ResourceCacheService);
|
|
20
|
-
|
|
21
|
-
private resourceListRef = signal<ResourceRef<RecordData[]> | undefined>(undefined);
|
|
22
|
-
listData = computed(() => {
|
|
23
|
-
const ref = this.resourceListRef();
|
|
24
|
-
if (ref && ref.status() === 'resolved') {
|
|
25
|
-
return ref.value();
|
|
26
|
-
}
|
|
27
|
-
return [];
|
|
28
|
-
});
|
|
29
|
-
private resourceViewRef = signal<ResourceRef<RecordData> | undefined>(undefined);
|
|
30
|
-
viewData = computed(() => {
|
|
31
|
-
const ref = this.resourceViewRef();
|
|
32
|
-
if (ref && ref.status() === 'resolved') {
|
|
33
|
-
return ref.value();
|
|
34
|
-
}
|
|
35
|
-
return {} as RecordData;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
overrideRoute = signal<string>('');
|
|
39
|
-
resourceRoute = computed(() => this.resourceMeta()?.route);
|
|
40
|
-
route = computed(() => {
|
|
41
|
-
if (this.overrideRoute()) {
|
|
42
|
-
return this.overrideRoute();
|
|
43
|
-
}
|
|
44
|
-
const route = this.resourceRoute();
|
|
45
|
-
if (route) {
|
|
46
|
-
return route;
|
|
47
|
-
}
|
|
48
|
-
return '';
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
reloadResourceView(): void {
|
|
52
|
-
this.resourceViewRef()?.reload();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
resetResourceList(): void {
|
|
56
|
-
const route = this.route();
|
|
57
|
-
const name = this.resourceName();
|
|
58
|
-
if (!route || name === '') return;
|
|
59
|
-
const columnIds = this.listColumns().flatMap((col) => {
|
|
60
|
-
return [col.id];
|
|
61
|
-
});
|
|
62
|
-
const resourceMeta = this.resourceMeta() as ResourceMeta;
|
|
63
|
-
if (resourceMeta && resourceMeta.fields.some((field) => field.fieldName === 'id')) {
|
|
64
|
-
columnIds.push('id' as FieldName);
|
|
65
|
-
}
|
|
66
|
-
const uniqueColumns = [...new Set([...columnIds])];
|
|
67
|
-
|
|
68
|
-
const ref = this.cache.registerList(
|
|
69
|
-
this.route,
|
|
70
|
-
this.resourceName,
|
|
71
|
-
this.filter,
|
|
72
|
-
signal(uniqueColumns),
|
|
73
|
-
this.searchTokens,
|
|
74
|
-
this.sorts,
|
|
75
|
-
this.requireSearchToDisplayResults(),
|
|
76
|
-
);
|
|
77
|
-
this.resourceListRef.set(ref);
|
|
78
|
-
this.resourceListRef()?.reload();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
resetResourceView(): void {
|
|
82
|
-
const route = this.route();
|
|
83
|
-
const name = this.resourceName();
|
|
84
|
-
const uuid = this.uuid();
|
|
85
|
-
|
|
86
|
-
if (!route || name === '' || !uuid) return;
|
|
87
|
-
|
|
88
|
-
if (this.resourceViewRef() === undefined) {
|
|
89
|
-
const ref = this.cache.registerView(this.route, this.resourceName, this.uuid);
|
|
90
|
-
this.resourceViewRef.set(ref);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
@if (useExpansionPanel()) {
|
|
2
|
-
<div class="resource-view">
|
|
3
|
-
<mat-expansion-panel [@.disabled]="true" [disabled]="!config().collapsible" [expanded]="!config().collapsible">
|
|
4
|
-
@if (config().title) {
|
|
5
|
-
<mat-expansion-panel-header>
|
|
6
|
-
<mat-panel-title>
|
|
7
|
-
<h1 class="title">
|
|
8
|
-
{{ config().title }}
|
|
9
|
-
</h1>
|
|
10
|
-
</mat-panel-title>
|
|
11
|
-
</mat-expansion-panel-header>
|
|
12
|
-
} @else {
|
|
13
|
-
<div class="no-title-exp-panel-padding"></div>
|
|
14
|
-
}
|
|
15
|
-
<div class="header-container">
|
|
16
|
-
<div class="state-buttons">
|
|
17
|
-
@if (editMode() === 'view') {
|
|
18
|
-
<div class="edit-button">
|
|
19
|
-
<button mat-raised-button color="accent" (click)="setEditMode('edit')">
|
|
20
|
-
<div class="button-text">
|
|
21
|
-
<mat-icon>edit</mat-icon>
|
|
22
|
-
<span class="mode-text"> Edit </span>
|
|
23
|
-
</div>
|
|
24
|
-
</button>
|
|
25
|
-
</div>
|
|
26
|
-
}
|
|
27
|
-
@if (editMode() === 'edit') {
|
|
28
|
-
@if (form().dirty) {
|
|
29
|
-
<div class="unsaved message">You have unsaved changes!</div>
|
|
30
|
-
}
|
|
31
|
-
@if (shouldShowDelete()) {
|
|
32
|
-
<button mat-raised-button color="primary" (click)="deleteResource()">Delete</button>
|
|
33
|
-
}
|
|
34
|
-
@if (displayFormInvalidMessage()) {
|
|
35
|
-
<div class="invalid message">Please complete or fix required fields.</div>
|
|
36
|
-
}
|
|
37
|
-
<button mat-raised-button color="primary" (click)="resetForm()">Cancel</button>
|
|
38
|
-
<button mat-raised-button color="accent" (click)="saveForm()" [disabled]="form().pristine">Save</button>
|
|
39
|
-
}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="resource-container" [class.form-edit-mode]="editMode() === 'edit'">
|
|
43
|
-
<form [formGroup]="form()">
|
|
44
|
-
<div class="resource row">
|
|
45
|
-
@for (element of config().elements; track element) {
|
|
46
|
-
@if (element.type === 'section' || element.type === 'computedDisplayField') {
|
|
47
|
-
<ccc-resource-layout-template
|
|
48
|
-
[element]="element"
|
|
49
|
-
[meta]="store.resourceMeta()"
|
|
50
|
-
[fieldClass]="config().fieldClass"
|
|
51
|
-
[editMode]="editMode()"
|
|
52
|
-
[relatedData]="relatedData()"
|
|
53
|
-
[form]="form()">
|
|
54
|
-
</ccc-resource-layout-template>
|
|
55
|
-
} @else if (element.type === 'field') {
|
|
56
|
-
<ccc-resource-layout-template
|
|
57
|
-
[element]="element"
|
|
58
|
-
[meta]="store.resourceMeta()"
|
|
59
|
-
[fieldClass]="config().fieldClass"
|
|
60
|
-
[pristineValue]="pristineFormValues[element.name]"
|
|
61
|
-
[editMode]="editMode()"
|
|
62
|
-
[relatedData]="relatedData()"
|
|
63
|
-
[form]="form()">
|
|
64
|
-
</ccc-resource-layout-template>
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
</div>
|
|
68
|
-
</form>
|
|
69
|
-
</div>
|
|
70
|
-
<ng-template #createSlot></ng-template>
|
|
71
|
-
<ng-template #primarySlot></ng-template>
|
|
72
|
-
</mat-expansion-panel>
|
|
73
|
-
</div>
|
|
74
|
-
} @else {
|
|
75
|
-
<div class="page-container">
|
|
76
|
-
<div class="header-container">
|
|
77
|
-
<div class="state-buttons">
|
|
78
|
-
@if (editMode() === 'view') {
|
|
79
|
-
<div class="edit-button">
|
|
80
|
-
<button mat-raised-button color="accent" (click)="setEditMode('edit')">
|
|
81
|
-
<div class="button-text">
|
|
82
|
-
<mat-icon>edit</mat-icon>
|
|
83
|
-
<span class="mode-text"> Edit </span>
|
|
84
|
-
</div>
|
|
85
|
-
</button>
|
|
86
|
-
</div>
|
|
87
|
-
}
|
|
88
|
-
@if (editMode() === 'edit') {
|
|
89
|
-
@if (form().dirty) {
|
|
90
|
-
<div class="unsaved message">You have unsaved changes!</div>
|
|
91
|
-
}
|
|
92
|
-
@if (shouldShowDelete()) {
|
|
93
|
-
<button mat-raised-button color="primary" (click)="deleteResource()">Delete</button>
|
|
94
|
-
}
|
|
95
|
-
@if (!form().valid && displayFormInvalidMessage()) {
|
|
96
|
-
<div class="invalid message">Please complete or fix required fields.</div>
|
|
97
|
-
}
|
|
98
|
-
<button mat-raised-button color="primary" (click)="resetForm()">Cancel</button>
|
|
99
|
-
<button mat-raised-button color="accent" (click)="saveForm()" [disabled]="form().pristine">Save</button>
|
|
100
|
-
}
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div class="resource-container base-container-bg" [class.form-edit-mode]="editMode() === 'edit'">
|
|
105
|
-
<form [formGroup]="form()">
|
|
106
|
-
<div class="resource row">
|
|
107
|
-
@for (element of config().elements; track element) {
|
|
108
|
-
@if (element.type === 'section' || element.type === 'computedDisplayField' || element.type === 'padding') {
|
|
109
|
-
<ccc-resource-layout-template
|
|
110
|
-
[element]="element"
|
|
111
|
-
[meta]="store.resourceMeta()"
|
|
112
|
-
[fieldClass]="config().fieldClass"
|
|
113
|
-
[editMode]="editMode()"
|
|
114
|
-
[relatedData]="relatedData()"
|
|
115
|
-
[form]="form()">
|
|
116
|
-
</ccc-resource-layout-template>
|
|
117
|
-
} @else {
|
|
118
|
-
<ccc-resource-layout-template
|
|
119
|
-
[element]="element"
|
|
120
|
-
[meta]="store.resourceMeta()"
|
|
121
|
-
[fieldClass]="config().fieldClass"
|
|
122
|
-
[pristineValue]="pristineFormValues[element.name]"
|
|
123
|
-
[editMode]="editMode()"
|
|
124
|
-
[relatedData]="relatedData()"
|
|
125
|
-
[form]="form()">
|
|
126
|
-
</ccc-resource-layout-template>
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
</div>
|
|
130
|
-
</form>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
border: 1px solid #8e8e8e;
|
|
3
|
-
border-radius: 5px;
|
|
4
|
-
position: relative;
|
|
5
|
-
margin-bottom: 20px;
|
|
6
|
-
padding-top: 10px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.label {
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: -15px;
|
|
12
|
-
left: 20px;
|
|
13
|
-
height: 20px;
|
|
14
|
-
background-color: #ffffff;
|
|
15
|
-
margin: 0px 10px 0px 10px;
|
|
16
|
-
padding: 0px 10px 0px 10px;
|
|
17
|
-
text-align: center;
|
|
18
|
-
z-index: 10;
|
|
19
|
-
font-weight: 500;
|
|
20
|
-
font:
|
|
21
|
-
18px 'Roboto',
|
|
22
|
-
sans-serif;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.padding {
|
|
26
|
-
width: 100px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.page-container {
|
|
30
|
-
position: relative;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.header-container {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: row;
|
|
36
|
-
top: 0;
|
|
37
|
-
z-index: 11;
|
|
38
|
-
background: transparent;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.title {
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.message {
|
|
48
|
-
margin-top: auto;
|
|
49
|
-
margin-bottom: auto;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.state-buttons {
|
|
53
|
-
display: flex;
|
|
54
|
-
flex-direction: row;
|
|
55
|
-
margin-top: auto;
|
|
56
|
-
margin-bottom: auto;
|
|
57
|
-
justify-content: right;
|
|
58
|
-
flex-grow: 1;
|
|
59
|
-
gap: 20px;
|
|
60
|
-
margin-right: 20px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.mode-text {
|
|
64
|
-
margin-top: auto;
|
|
65
|
-
margin-bottom: auto;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.resource {
|
|
69
|
-
margin: 10px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.section h2 {
|
|
73
|
-
font-size: 1.5em;
|
|
74
|
-
border-bottom: 2px solid #ccc;
|
|
75
|
-
padding-bottom: 8px;
|
|
76
|
-
|
|
77
|
-
margin-bottom: 100px;
|
|
78
|
-
}
|
|
79
|
-
.section {
|
|
80
|
-
margin-top: 15px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.divider {
|
|
84
|
-
margin: 16px 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.section-elements {
|
|
88
|
-
display: flex;
|
|
89
|
-
flex-wrap: wrap;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.mat-input-element:disabled[readonly] {
|
|
93
|
-
color: currentColor;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.unsaved {
|
|
97
|
-
color: #f44336;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.edit-button {
|
|
101
|
-
margin-top: auto;
|
|
102
|
-
margin-bottom: auto;
|
|
103
|
-
padding-left: 10px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.button-text {
|
|
107
|
-
display: flex;
|
|
108
|
-
flex-direction: row;
|
|
109
|
-
align-items: center;
|
|
110
|
-
|
|
111
|
-
.edit {
|
|
112
|
-
color: #003b49;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.mat-icon {
|
|
116
|
-
margin-right: 8px;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.shaded {
|
|
121
|
-
background-color: #e9e9e9;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.rounded {
|
|
125
|
-
border-radius: 8px;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.dotted-outline {
|
|
129
|
-
border: 1px dotted #ccc;
|
|
130
|
-
padding: 8px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.margin-top {
|
|
134
|
-
margin-top: 50px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.resource-view {
|
|
138
|
-
display: flex;
|
|
139
|
-
flex-direction: column;
|
|
140
|
-
min-height: 36px;
|
|
141
|
-
padding: 10px 0 0 0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.no-title-exp-panel-padding {
|
|
145
|
-
padding: 10px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.base-container-bg {
|
|
149
|
-
background-color: var(--ccc-background-color);
|
|
150
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ResourceViewComponent } from './resource-view.component';
|
|
4
|
-
|
|
5
|
-
xdescribe('ResourceViewComponent', () => {
|
|
6
|
-
let component: ResourceViewComponent;
|
|
7
|
-
let fixture: ComponentFixture<ResourceViewComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [ResourceViewComponent],
|
|
12
|
-
}).compileComponents();
|
|
13
|
-
|
|
14
|
-
fixture = TestBed.createComponent(ResourceViewComponent);
|
|
15
|
-
component = fixture.componentInstance;
|
|
16
|
-
fixture.detectChanges();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create', () => {
|
|
20
|
-
expect(component).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
});
|