@processpuzzle/base-entity 0.7.1 → 0.7.2
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.
|
@@ -16,6 +16,7 @@ import { MatInput, MatInputModule } from '@angular/material/input';
|
|
|
16
16
|
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
|
17
17
|
import { signalStore, withState, withMethods, patchState, withHooks, signalStoreFeature, withProps, watchState, withComputed } from '@ngrx/signals';
|
|
18
18
|
import { Stack, LayoutService, RUNTIME_CONFIGURATION } from '@processpuzzle/util';
|
|
19
|
+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
|
|
19
20
|
import { __decorate, __param } from 'tslib';
|
|
20
21
|
import { map, filter, switchMap, from, of, firstValueFrom, pipe, tap } from 'rxjs';
|
|
21
22
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
@@ -42,7 +43,6 @@ import { MatPaginator } from '@angular/material/paginator';
|
|
|
42
43
|
import { MatProgressBar } from '@angular/material/progress-bar';
|
|
43
44
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
44
45
|
import { Firestore, collection, doc, deleteDoc, getDoc, setDoc, orderBy, where, query, limit, getDocs, updateDoc } from '@angular/fire/firestore';
|
|
45
|
-
import { withDevtools } from '@angular-architects/ngrx-toolkit';
|
|
46
46
|
import { tapResponse } from '@ngrx/operators';
|
|
47
47
|
import { rxMethod } from '@ngrx/signals/rxjs-interop';
|
|
48
48
|
import 'reflect-metadata';
|
|
@@ -106,7 +106,7 @@ function snakeCaseName(entityName) {
|
|
|
106
106
|
.join('-')
|
|
107
107
|
.toLowerCase();
|
|
108
108
|
}
|
|
109
|
-
const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, withState(INITIAL_NAVIGATION_STATE), withMethods((store, router = inject(Router), route = inject(ActivatedRoute)) => {
|
|
109
|
+
const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, withState(INITIAL_NAVIGATION_STATE), withDevtools('Base Form Navigator'), withMethods((store, router = inject(Router), route = inject(ActivatedRoute)) => {
|
|
110
110
|
let pendingNavigatorUrl;
|
|
111
111
|
let routerEventsSubscription;
|
|
112
112
|
function clearPayloadStacks() {
|
|
@@ -153,6 +153,14 @@ const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, with
|
|
|
153
153
|
if (!(event instanceof NavigationEnd)) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
+
// eslint-disable-next-line no-console
|
|
157
|
+
console.debug('[FormNavigator] NavigationEnd', {
|
|
158
|
+
url: event.url,
|
|
159
|
+
urlAfterRedirects: event.urlAfterRedirects,
|
|
160
|
+
pendingNavigatorUrl,
|
|
161
|
+
isPending: isPendingNavigatorUrl(event),
|
|
162
|
+
requestPayloads: store.requestPayloads().toArray(),
|
|
163
|
+
});
|
|
156
164
|
if (isPendingNavigatorUrl(event)) {
|
|
157
165
|
pendingNavigatorUrl = undefined;
|
|
158
166
|
}
|
|
@@ -218,6 +226,8 @@ const BaseFormNavigatorSingletonStore = signalStore({ providedIn: 'root' }, with
|
|
|
218
226
|
const snakeCaseEntityName = snakeCaseName(relatedTypeName);
|
|
219
227
|
const baseUrl = determineBaseUrl();
|
|
220
228
|
const listPath = baseUrl + '/' + snakeCaseEntityName + '/list';
|
|
229
|
+
// eslint-disable-next-line no-console
|
|
230
|
+
console.debug('[FormNavigator] navigateToRelatedList', { relatedTypeName, listPath, payload, requestPayloadsAfterPush: store.requestPayloads().toArray() });
|
|
221
231
|
await navigateToUrl(listPath, returnTo);
|
|
222
232
|
}
|
|
223
233
|
function setEntityName(entityName) {
|
|
@@ -1335,6 +1345,9 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1335
1345
|
showSelectEntityButton() {
|
|
1336
1346
|
return !this.config().disabled && this.hasFocus();
|
|
1337
1347
|
}
|
|
1348
|
+
hasForeignKeyValue() {
|
|
1349
|
+
return this.foreignKeyId() !== '';
|
|
1350
|
+
}
|
|
1338
1351
|
foreignKeyDisplayName() {
|
|
1339
1352
|
const relatedEntity = this.selectedEntity() ?? this.relatedEntityFromLinkedStore();
|
|
1340
1353
|
if (!relatedEntity) {
|
|
@@ -1396,9 +1409,11 @@ class ForeignKeyComponent extends BaseFormControlComponent {
|
|
|
1396
1409
|
<mat-form-field class="foreign-key-field">
|
|
1397
1410
|
<mat-label>{{ foreignKeyLabel() }}</mat-label>
|
|
1398
1411
|
<input matInput [value]="foreignKeyDisplayName()" [disabled]="config().disabled" readonly />
|
|
1399
|
-
|
|
1400
|
-
<mat-icon
|
|
1401
|
-
|
|
1412
|
+
@if (hasForeignKeyValue()) {
|
|
1413
|
+
<button type="button" mat-icon-button matSuffix (click)="navigateToRelated()" aria-label="Related entity">
|
|
1414
|
+
<mat-icon>link</mat-icon>
|
|
1415
|
+
</button>
|
|
1416
|
+
}
|
|
1402
1417
|
</mat-form-field>
|
|
1403
1418
|
@if (showSelectEntityButton()) {
|
|
1404
1419
|
<div class="foreign-key-select-row">
|
|
@@ -1430,9 +1445,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
1430
1445
|
<mat-form-field class="foreign-key-field">
|
|
1431
1446
|
<mat-label>{{ foreignKeyLabel() }}</mat-label>
|
|
1432
1447
|
<input matInput [value]="foreignKeyDisplayName()" [disabled]="config().disabled" readonly />
|
|
1433
|
-
|
|
1434
|
-
<mat-icon
|
|
1435
|
-
|
|
1448
|
+
@if (hasForeignKeyValue()) {
|
|
1449
|
+
<button type="button" mat-icon-button matSuffix (click)="navigateToRelated()" aria-label="Related entity">
|
|
1450
|
+
<mat-icon>link</mat-icon>
|
|
1451
|
+
</button>
|
|
1452
|
+
}
|
|
1436
1453
|
</mat-form-field>
|
|
1437
1454
|
@if (showSelectEntityButton()) {
|
|
1438
1455
|
<div class="foreign-key-select-row">
|
|
@@ -1928,11 +1945,16 @@ class LookupComponent extends BaseFormControlComponent {
|
|
|
1928
1945
|
<div class="row" [formGroup]="formGroup">
|
|
1929
1946
|
<mat-form-field>
|
|
1930
1947
|
<mat-label>{{ config().label }}</mat-label>
|
|
1931
|
-
<input type="text" matInput [formControl]="displayControl" [matAutocomplete]="lookupOptions"
|
|
1948
|
+
<input type="text" matInput [formControl]="displayControl" [matAutocomplete]="lookupOptions" />
|
|
1932
1949
|
<button type="button" mat-icon-button matSuffix [disabled]="!canNavigateToRelated()" (click)="navigateToRelated()" aria-label="Related entity">
|
|
1933
1950
|
<mat-icon>link</mat-icon>
|
|
1934
1951
|
</button>
|
|
1935
|
-
<mat-autocomplete
|
|
1952
|
+
<mat-autocomplete
|
|
1953
|
+
#lookupOptions="matAutocomplete"
|
|
1954
|
+
[autoActiveFirstOption]="true"
|
|
1955
|
+
(optionSelected)="selectLookupItem($any($event).option.value)"
|
|
1956
|
+
(closed)="restoreSelectedValue()"
|
|
1957
|
+
>
|
|
1936
1958
|
@for (lookupItem of filteredLookupItems(); track lookupItem.key) {
|
|
1937
1959
|
<mat-option [value]="lookupItem.key">{{ lookupDisplayValue(lookupItem) }}</mat-option>
|
|
1938
1960
|
}
|
|
@@ -1953,11 +1975,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
1953
1975
|
<div class="row" [formGroup]="formGroup">
|
|
1954
1976
|
<mat-form-field>
|
|
1955
1977
|
<mat-label>{{ config().label }}</mat-label>
|
|
1956
|
-
<input type="text" matInput [formControl]="displayControl" [matAutocomplete]="lookupOptions"
|
|
1978
|
+
<input type="text" matInput [formControl]="displayControl" [matAutocomplete]="lookupOptions" />
|
|
1957
1979
|
<button type="button" mat-icon-button matSuffix [disabled]="!canNavigateToRelated()" (click)="navigateToRelated()" aria-label="Related entity">
|
|
1958
1980
|
<mat-icon>link</mat-icon>
|
|
1959
1981
|
</button>
|
|
1960
|
-
<mat-autocomplete
|
|
1982
|
+
<mat-autocomplete
|
|
1983
|
+
#lookupOptions="matAutocomplete"
|
|
1984
|
+
[autoActiveFirstOption]="true"
|
|
1985
|
+
(optionSelected)="selectLookupItem($any($event).option.value)"
|
|
1986
|
+
(closed)="restoreSelectedValue()"
|
|
1987
|
+
>
|
|
1961
1988
|
@for (lookupItem of filteredLookupItems(); track lookupItem.key) {
|
|
1962
1989
|
<mat-option [value]="lookupItem.key">{{ lookupDisplayValue(lookupItem) }}</mat-option>
|
|
1963
1990
|
}
|
|
@@ -2173,7 +2200,7 @@ class BaseEntityListComponent {
|
|
|
2173
2200
|
sort = {};
|
|
2174
2201
|
paginator = {};
|
|
2175
2202
|
store;
|
|
2176
|
-
selectOrCreateMode = false;
|
|
2203
|
+
selectOrCreateMode = signal(false, ...(ngDevMode ? [{ debugName: "selectOrCreateMode" }] : /* istanbul ignore next */ []));
|
|
2177
2204
|
constructor() {
|
|
2178
2205
|
this.store = this.entityDescriptor().store;
|
|
2179
2206
|
this.registerEffects();
|
|
@@ -2189,7 +2216,9 @@ class BaseEntityListComponent {
|
|
|
2189
2216
|
this.formNavigator.setEntityName(this.entityDescriptor().entityName);
|
|
2190
2217
|
this.formNavigator.determineActiveRouteSegment();
|
|
2191
2218
|
const requestPayload = this.formNavigator.popRequestPayload();
|
|
2192
|
-
this.selectOrCreateMode
|
|
2219
|
+
this.selectOrCreateMode.set(requestPayload?.command === NavigatorCommand.SELECT_OR_CREATE);
|
|
2220
|
+
// eslint-disable-next-line no-console
|
|
2221
|
+
console.debug('[BaseEntityListComponent] ngOnInit', { entityName: this.entityDescriptor().entityName, requestPayload, selectOrCreateMode: this.selectOrCreateMode() });
|
|
2193
2222
|
this.logger.info('BaseEntityListComponent initialized with:', { columnDescriptors: this.columnDescriptors() });
|
|
2194
2223
|
}
|
|
2195
2224
|
// endregion
|
|
@@ -2294,7 +2323,7 @@ class BaseEntityListComponent {
|
|
|
2294
2323
|
return this.selection.selected.length === 1;
|
|
2295
2324
|
}
|
|
2296
2325
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: BaseEntityListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2297
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: BaseEntityListComponent, isStandalone: true, selector: "base-list", viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n</div>\n@if (selectOrCreateMode) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n}\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:visible}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}\n"], dependencies: [{ kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] });
|
|
2326
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: BaseEntityListComponent, isStandalone: true, selector: "base-list", viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n</div>\n@if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n}\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:visible}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}\n"], dependencies: [{ kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] });
|
|
2298
2327
|
}
|
|
2299
2328
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: BaseEntityListComponent, decorators: [{
|
|
2300
2329
|
type: Component,
|
|
@@ -2316,7 +2345,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2316
2345
|
MatCheckbox,
|
|
2317
2346
|
SlicePipe,
|
|
2318
2347
|
MatButton,
|
|
2319
|
-
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n</div>\n@if (selectOrCreateMode) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n}\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:visible}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}\n"] }]
|
|
2348
|
+
], template: "@if (store.isLoading()) {\n <mat-progress-bar mode=\"query\"></mat-progress-bar>\n}\n<div class=\"base-entity-list mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort aria-describedby=\"base-entity-list\">\n <!-- Checkbox Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? onToggleAllRows() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null; onChangeSelection(row)\" [checked]=\"selection.isSelected(row)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n\n @for (colDescriptor of columnDescriptors(); track colDescriptor.attrName; let i = $index) {\n <ng-container [matColumnDef]=\"colDescriptor.attrName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>{{ colDescriptor.label }}</mat-header-cell>\n <mat-cell (click)=\"onRowClick(element)\" *matCellDef=\"let element\">\n @if (colDescriptor.isLinkToDetails) {\n <a (click)=\"onNavigateToDetails(element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.linkedEntityType !== undefined ) {\n <a (click)=\"onNavigateToRelated(colDescriptor, element)\">{{ element[colDescriptor.attrName] }}</a>\n } @else if (colDescriptor.formControlType === 'ARTIFACT' && element[colDescriptor.attrName] !== undefined ) {\n @let artifact = element[colDescriptor.attrName];\n <a (click)=\"onDownloadObject(artifact, $event)\">{{ ((artifact.name ?? artifact.objectId ?? '') | slice:0:20) + ((artifact.name ?? artifact.objectId ?? '').length > 20 ? '...' : '') }}</a>\n } @else if (colDescriptor.formControlType === 'TAGS' && element[colDescriptor.attrName] !== undefined ) {\n {{ (element[colDescriptor.attrName].join(', ') | slice:0:20) + (element[colDescriptor.attrName].join(', ').length > 20 ? '...' : '') }}\n } @else {\n {{ element[colDescriptor.attrName] }}\n }\n </mat-cell>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"displayedColumns()\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns()\"></mat-row>\n </mat-table>\n <mat-paginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n</div>\n@if (selectOrCreateMode()) {\n <div class=\"base-entity-list-actions\">\n <button id=\"cancel\" [attr.data-testid]=\"entityDescriptor().createTestId('cancel')\" type=\"button\" mat-raised-button color=\"secondary\" (click)=\"onCancelSelectOrCreate()\">Cancel</button>\n <button id=\"select\" [attr.data-testid]=\"entityDescriptor().createTestId( 'select')\" type=\"button\" mat-raised-button color=\"primary\" [disabled]=\"!canSelectEntity()\" (click)=\"onSelectEntity()\">Select</button>\n </div>\n}\n", styles: [".base-entity-list{display:flex;flex-direction:column;max-height:500px;min-width:300px}.mat-table{overflow:auto;max-height:500px}.mat-column-select{overflow:visible}.mat-column-select{overflow:initial}.mat-mdc-row:hover{background-color:#6495ed;cursor:pointer}.base-entity-list-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}\n"] }]
|
|
2320
2349
|
}], ctorParameters: () => [], propDecorators: { sort: [{
|
|
2321
2350
|
type: ViewChild,
|
|
2322
2351
|
args: [MatSort]
|
|
@@ -2632,7 +2661,7 @@ const INITIAL_TABS_STATE = {
|
|
|
2632
2661
|
currentTab: undefined,
|
|
2633
2662
|
};
|
|
2634
2663
|
function BaseEntityTabsStore() {
|
|
2635
|
-
return signalStoreFeature(withState(INITIAL_TABS_STATE), withMethods((store) => {
|
|
2664
|
+
return signalStoreFeature(withState(INITIAL_TABS_STATE), withDevtools('Base Entity Tabs'), withMethods((store) => {
|
|
2636
2665
|
function reset() {
|
|
2637
2666
|
const activeTabs = [];
|
|
2638
2667
|
patchState(store, { activeTabs, currentTab: undefined });
|