@masterteam/work-center 0.0.97 → 0.0.99
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/assets/i18n/ar.json +217 -217
- package/assets/i18n/en.json +217 -217
- package/fesm2022/{masterteam-work-center-work-center-process-preview-DRPL21nM.mjs → masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs} +2 -2
- package/fesm2022/{masterteam-work-center-work-center-process-preview-DRPL21nM.mjs.map → masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs.map} +1 -1
- package/fesm2022/masterteam-work-center.mjs +241 -400
- package/fesm2022/masterteam-work-center.mjs.map +1 -1
- package/package.json +6 -8
- package/types/masterteam-work-center.d.ts +69 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgComponentOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, viewChild, input, computed, signal, Component,
|
|
4
|
+
import { inject, viewChild, input, computed, signal, Component, Injectable, DestroyRef, effect, untracked, InjectionToken, linkedSignal, Injector, output, runInInjectionContext } from '@angular/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { TranslocoService, TranslocoDirective } from '@jsverse/transloco';
|
|
7
7
|
import { Button } from '@masterteam/components/button';
|
|
@@ -9,17 +9,13 @@ import { ClientPage } from '@masterteam/components/client-page';
|
|
|
9
9
|
import { ModalService } from '@masterteam/components/modal';
|
|
10
10
|
import { PropertyFilterBuilder } from '@masterteam/components/property-filter-builder';
|
|
11
11
|
import { StatisticCard } from '@masterteam/components/statistic-card';
|
|
12
|
+
import { Table } from '@masterteam/components/table';
|
|
12
13
|
import * as i1$1 from 'primeng/skeleton';
|
|
13
14
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
14
15
|
import { catchError, EMPTY, map, take, firstValueFrom, of, isObservable } from 'rxjs';
|
|
15
16
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
16
17
|
import { DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
17
18
|
import { ClientForm, ClientFormWarningsDialog } from '@masterteam/forms/client-form';
|
|
18
|
-
import { EntityPreview, EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
|
|
19
|
-
import { TableExportService, TableValueResolver } from '@masterteam/components/table';
|
|
20
|
-
import { MtDataGridComponent, captureGridViewState } from '@masterteam/data-grid';
|
|
21
|
-
import { mtEntityCellValues, mtEntityExportValue, mtEntityColumn } from '@masterteam/data-table';
|
|
22
|
-
import { MtTableText, MtTablePreferences } from '@masterteam/data-table/legacy';
|
|
23
19
|
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
|
|
24
20
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
25
21
|
import { Drawer } from '@masterteam/components/drawer';
|
|
@@ -27,6 +23,7 @@ import { RuntimeActionContextStore, RuntimeActionRunner, RUNTIME_ACTION_CONFIRM_
|
|
|
27
23
|
import { Action, Selector, State, Store, select } from '@ngxs/store';
|
|
28
24
|
import { handleApiRequest } from '@masterteam/components';
|
|
29
25
|
import { ClientInstancePreview } from '@masterteam/client-components/client-instance-preview';
|
|
26
|
+
import { EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
|
|
30
27
|
import { Tabs } from '@masterteam/components/tabs';
|
|
31
28
|
import { StructureBuilder } from '@masterteam/structure-builder';
|
|
32
29
|
import { ToastService } from '@masterteam/components/toast';
|
|
@@ -124,372 +121,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
124
121
|
args: [{ selector: 'mt-work-center-client-form-modal', standalone: true, imports: [Button, TranslocoDirective, ClientForm], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n <div [class]=\"modal.contentClass + ' p-5 flex flex-col gap-4'\">\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [operationKey]=\"operationKey()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [recordId]=\"recordId()\"\r\n [formMode]=\"formMode()\"\r\n [autoLoad]=\"true\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"lookups()\"\r\n [submitRequestMapper]=\"submitRequestMapper\"\r\n (submitted)=\"onSubmitted($event)\"\r\n (errored)=\"onErrored($event)\"\r\n />\r\n\r\n @if (isSubmitting()) {\r\n <div class=\"text-sm text-muted-color\">{{ t(\"modal.submitting\") }}</div>\r\n }\r\n\r\n @if (validationMessage()) {\r\n <div\r\n class=\"mt-2 rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-700\"\r\n role=\"alert\"\r\n >\r\n {{ validationMessage() }}\r\n </div>\r\n }\r\n\r\n @if (submitError()) {\r\n <div\r\n class=\"mt-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n role=\"alert\"\r\n >\r\n {{ submitError() }}\r\n </div>\r\n }\r\n\r\n @if (submitStatus(); as status) {\r\n <div\r\n class=\"mt-2 rounded-lg border p-3 text-sm\"\r\n [class]=\"\r\n status === 'pending'\r\n ? 'border-amber-200 bg-amber-50 text-amber-700'\r\n : 'border-emerald-200 bg-emerald-50 text-emerald-700'\r\n \"\r\n >\r\n @if (status === \"pending\") {\r\n {{ t(\"modal.requestSubmitted\") }}\r\n } @else {\r\n {{ t(\"modal.operationExecuted\") }}\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button\r\n [label]=\"t('modal.cancel')\"\r\n variant=\"outlined\"\r\n [disabled]=\"isSubmitting()\"\r\n (onClick)=\"ref.close(false)\"\r\n />\r\n <mt-button\r\n [label]=\"t('modal.submit')\"\r\n icon=\"general.check\"\r\n [disabled]=\"\r\n isSubmitting() || processForm().hasBlockingGovernanceFailure()\r\n \"\r\n (onClick)=\"onSubmit()\"\r\n />\r\n </div>\r\n</ng-container>\r\n" }]
|
|
125
122
|
}], propDecorators: { processForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ClientForm), { isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], operationKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "operationKey", required: false }] }], closeOnPendingApproval: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnPendingApproval", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], submitPayloadTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitPayloadTemplate", required: false }] }] } });
|
|
126
123
|
|
|
127
|
-
const OPERATORS = {
|
|
128
|
-
equals: 'Eq',
|
|
129
|
-
notEqual: 'Neq',
|
|
130
|
-
contains: 'Contains',
|
|
131
|
-
startsWith: 'StartsWith',
|
|
132
|
-
greaterThan: 'Gt',
|
|
133
|
-
greaterThanOrEqual: 'Gte',
|
|
134
|
-
lessThan: 'Lt',
|
|
135
|
-
lessThanOrEqual: 'Lte',
|
|
136
|
-
inRange: 'Between',
|
|
137
|
-
blank: 'IsNull',
|
|
138
|
-
notBlank: 'IsNotNull',
|
|
139
|
-
};
|
|
140
|
-
function workCenterFilterOptions(schema, type) {
|
|
141
|
-
const allowed = schema
|
|
142
|
-
? new Set(schema.allowedOperators.map((op) => typeof op === 'string' ? op : op.value))
|
|
143
|
-
: null;
|
|
144
|
-
const options = Object.keys(OPERATORS).filter((key) => (type === 'text'
|
|
145
|
-
? ![
|
|
146
|
-
'greaterThan',
|
|
147
|
-
'greaterThanOrEqual',
|
|
148
|
-
'lessThan',
|
|
149
|
-
'lessThanOrEqual',
|
|
150
|
-
'inRange',
|
|
151
|
-
].includes(key)
|
|
152
|
-
: !['contains', 'startsWith'].includes(key)) &&
|
|
153
|
-
(!allowed || allowed.has(OPERATORS[key])));
|
|
154
|
-
return {
|
|
155
|
-
maxNumConditions: 1,
|
|
156
|
-
filterOptions: options,
|
|
157
|
-
defaultOption: type === 'text' && options.includes('contains') ? 'contains' : options[0],
|
|
158
|
-
inRangeInclusive: true,
|
|
159
|
-
buttons: ['apply', 'reset'],
|
|
160
|
-
closeOnApply: true,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
/** Work Center accepts a flat AND of rules, never arbitrary grid OR expressions. */
|
|
164
|
-
function workCenterGridFilters(model, schema) {
|
|
165
|
-
const fields = schema?.properties?.length
|
|
166
|
-
? schema.properties.map((p) => p.key)
|
|
167
|
-
: schema?.allowedFields;
|
|
168
|
-
const allowed = fields?.length ? new Set(fields) : null;
|
|
169
|
-
const operators = schema
|
|
170
|
-
? new Set(schema.allowedOperators.map((op) => typeof op === 'string' ? op : op.value))
|
|
171
|
-
: null;
|
|
172
|
-
return Object.entries(model).flatMap(([field, filter]) => {
|
|
173
|
-
if (allowed && !allowed.has(field))
|
|
174
|
-
return [];
|
|
175
|
-
return toRule(field, filter).filter((rule) => !operators || operators.has(rule.op));
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function toRule(field, filter) {
|
|
179
|
-
if (filter.filterType === 'multi' || 'conditions' in filter)
|
|
180
|
-
return [];
|
|
181
|
-
if (filter.filterType === 'set')
|
|
182
|
-
return [{ field, op: 'In', values: [...filter.values] }];
|
|
183
|
-
const op = OPERATORS[filter.type];
|
|
184
|
-
if (!op)
|
|
185
|
-
return [];
|
|
186
|
-
if (op === 'IsNull' || op === 'IsNotNull')
|
|
187
|
-
return [{ field, op }];
|
|
188
|
-
const value = filter.filterType === 'date' ? filter.dateFrom : filter.filter;
|
|
189
|
-
const end = filter.filterType === 'date' ? filter.dateTo : filter.filterTo;
|
|
190
|
-
return op === 'Between'
|
|
191
|
-
? [{ field, op, from: value, to: end }]
|
|
192
|
-
: [{ field, op, value }];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
class WorkCenterGroupValue {
|
|
196
|
-
params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
|
|
197
|
-
first = computed(() => this.params().node.allLeafChildren?.[0]?.data, ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
|
|
198
|
-
entity = computed(() => {
|
|
199
|
-
const read = this.params().column.cellRendererParams?.['entity'];
|
|
200
|
-
return this.first() ? read(this.first()) : null;
|
|
201
|
-
}, ...(ngDevMode ? [{ debugName: "entity" }] : /* istanbul ignore next */ []));
|
|
202
|
-
count = computed(() => {
|
|
203
|
-
const counts = this.params().column.cellRendererParams?.['counts'];
|
|
204
|
-
const label = this.entity()
|
|
205
|
-
? mtEntityCellValues(this.entity()).display
|
|
206
|
-
: '';
|
|
207
|
-
return (counts?.get(label) ?? this.params().node.allLeafChildren?.length ?? 0);
|
|
208
|
-
}, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
209
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGroupValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
210
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterGroupValue, isStandalone: true, selector: "ng-component", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, host: { styleAttribute: "display:inline-flex;align-items:center;gap:6px" }, ngImport: i0, template: `@if (entity(); as value) {
|
|
211
|
-
<mt-entity-preview [data]="value" />
|
|
212
|
-
}
|
|
213
|
-
<span>({{ count() }})</span>`, isInline: true, dependencies: [{ kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
214
|
-
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGroupValue, decorators: [{
|
|
216
|
-
type: Component,
|
|
217
|
-
args: [{
|
|
218
|
-
imports: [EntityPreview],
|
|
219
|
-
template: `@if (entity(); as value) {
|
|
220
|
-
<mt-entity-preview [data]="value" />
|
|
221
|
-
}
|
|
222
|
-
<span>({{ count() }})</span>`,
|
|
223
|
-
host: { style: 'display:inline-flex;align-items:center;gap:6px' },
|
|
224
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
225
|
-
}]
|
|
226
|
-
}], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
|
|
227
|
-
/** Work Center owns its server query; presentation is the same native grid as Dependencies. */
|
|
228
|
-
class WorkCenterGrid {
|
|
229
|
-
rows = input.required(...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
230
|
-
columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
231
|
-
context = input.required(...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
232
|
-
schema = input(null, ...(ngDevMode ? [{ debugName: "schema" }] : /* istanbul ignore next */ []));
|
|
233
|
-
group = input(null, ...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
|
|
234
|
-
total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
235
|
-
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
236
|
-
filterRules = input([], ...(ngDevMode ? [{ debugName: "filterRules" }] : /* istanbul ignore next */ []));
|
|
237
|
-
groupCounts = input(null, ...(ngDevMode ? [{ debugName: "groupCounts" }] : /* istanbul ignore next */ []));
|
|
238
|
-
label = input('Work Center', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
239
|
-
viewKey = input.required(...(ngDevMode ? [{ debugName: "viewKey" }] : /* istanbul ignore next */ []));
|
|
240
|
-
rowClick = output();
|
|
241
|
-
filtersChange = output();
|
|
242
|
-
groupChange = output();
|
|
243
|
-
queryChange = output();
|
|
244
|
-
text = inject(MtTableText);
|
|
245
|
-
preferences = inject(MtTablePreferences);
|
|
246
|
-
exporter = inject(TableExportService);
|
|
247
|
-
host = inject(ElementRef);
|
|
248
|
-
grid = viewChild((MtDataGridComponent), ...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
249
|
-
ready = signal(null, ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
250
|
-
height = signal(400, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
251
|
-
search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
|
|
252
|
-
direction = computed(() => this.text.language().startsWith('ar') ? 'rtl' : 'ltr', ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
253
|
-
fit = { type: 'fitGridWidth' };
|
|
254
|
-
synchronizing = false;
|
|
255
|
-
restored = null;
|
|
256
|
-
layoutRevision = signal(0, ...(ngDevMode ? [{ debugName: "layoutRevision" }] : /* istanbul ignore next */ []));
|
|
257
|
-
identity = computed(() => ({
|
|
258
|
-
level: this.viewKey(),
|
|
259
|
-
role: 'work-center',
|
|
260
|
-
}), ...(ngDevMode ? [{ debugName: "identity" }] : /* istanbul ignore next */ []));
|
|
261
|
-
rowId = (row) => String(row['contextKey'] ?? row['id']);
|
|
262
|
-
exportParams = { processCellCallback: (mtEntityExportValue) };
|
|
263
|
-
visibleRows = computed(() => {
|
|
264
|
-
const words = this.search()
|
|
265
|
-
.trim()
|
|
266
|
-
.toLocaleLowerCase()
|
|
267
|
-
.split(/\s+/)
|
|
268
|
-
.filter(Boolean);
|
|
269
|
-
if (!words.length)
|
|
270
|
-
return this.rows();
|
|
271
|
-
// Retain Work Center's existing lazyLocalSearch contract; server column filters stay separate.
|
|
272
|
-
return this.rows().filter((row) => {
|
|
273
|
-
const value = this.columns()
|
|
274
|
-
.map((col) => mtEntityCellValues(this.entity(row, col)).display)
|
|
275
|
-
.join(' ')
|
|
276
|
-
.toLocaleLowerCase();
|
|
277
|
-
return words.every((word) => value.includes(word));
|
|
278
|
-
});
|
|
279
|
-
}, ...(ngDevMode ? [{ debugName: "visibleRows" }] : /* istanbul ignore next */ []));
|
|
280
|
-
definitions = computed(() => this.columns().map((column) => {
|
|
281
|
-
const viewType = (column
|
|
282
|
-
.viewType ?? 'Text');
|
|
283
|
-
const scalar = ['Number', 'Percentage', 'Currency'].includes(viewType)
|
|
284
|
-
? 'number'
|
|
285
|
-
: ['Date', 'DateTime'].includes(viewType)
|
|
286
|
-
? 'date'
|
|
287
|
-
: 'text';
|
|
288
|
-
const fields = this.schema()?.properties?.length
|
|
289
|
-
? this.schema().properties.map((p) => p.key)
|
|
290
|
-
: this.schema()?.allowedFields;
|
|
291
|
-
const filterable = column.filterable !== false &&
|
|
292
|
-
(!fields?.length || fields.includes(column.key));
|
|
293
|
-
// Runtime filters compare displayed values (WorkCenterRuntimeService.CompareValues), including lookup labels.
|
|
294
|
-
// Use the native scalar editor so values outside the loaded server page remain searchable.
|
|
295
|
-
const options = workCenterFilterOptions(this.schema(), scalar);
|
|
296
|
-
const definition = mtEntityColumn({
|
|
297
|
-
key: column.key,
|
|
298
|
-
label: column.label,
|
|
299
|
-
viewType,
|
|
300
|
-
entity: (row) => this.entity(row, column),
|
|
301
|
-
initialWidth: column.width?.endsWith('%')
|
|
302
|
-
? Number.parseFloat(column.width) * 12
|
|
303
|
-
: 200,
|
|
304
|
-
minWidth: 90,
|
|
305
|
-
filter: filterable && options.filterOptions?.length ? scalar : false,
|
|
306
|
-
filterParams: options,
|
|
307
|
-
enablePivot: false,
|
|
308
|
-
enableValue: false,
|
|
309
|
-
enableRowGroup: column.groupable !== false,
|
|
310
|
-
groupValueRenderer: WorkCenterGroupValue,
|
|
311
|
-
cellRendererParams: {
|
|
312
|
-
counts: column.groupKey ? null : this.groupCounts(),
|
|
313
|
-
},
|
|
314
|
-
...(column.groupKey
|
|
315
|
-
? {
|
|
316
|
-
valueGetter: ({ data }) => String(data[column.groupKey] ?? ''),
|
|
317
|
-
}
|
|
318
|
-
: {}),
|
|
319
|
-
});
|
|
320
|
-
return definition;
|
|
321
|
-
}), ...(ngDevMode ? [{ debugName: "definitions" }] : /* istanbul ignore next */ []));
|
|
322
|
-
constructor() {
|
|
323
|
-
effect(() => {
|
|
324
|
-
const key = this.viewKey();
|
|
325
|
-
untracked(() => {
|
|
326
|
-
this.search.set('');
|
|
327
|
-
this.ready()?.setFilterModel(null);
|
|
328
|
-
});
|
|
329
|
-
this.restored = null;
|
|
330
|
-
void key;
|
|
331
|
-
});
|
|
332
|
-
effect(() => {
|
|
333
|
-
const rules = this.filterRules(), api = this.ready();
|
|
334
|
-
if (!api || rules.length)
|
|
335
|
-
return;
|
|
336
|
-
untracked(() => {
|
|
337
|
-
this.synchronizing = true;
|
|
338
|
-
try {
|
|
339
|
-
api.setFilterModel(null);
|
|
340
|
-
}
|
|
341
|
-
finally {
|
|
342
|
-
this.synchronizing = false;
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
effect(() => {
|
|
347
|
-
const api = this.ready(), context = this.context(), group = this.group();
|
|
348
|
-
if (!api)
|
|
349
|
-
return;
|
|
350
|
-
untracked(() => {
|
|
351
|
-
this.synchronizing = true;
|
|
352
|
-
try {
|
|
353
|
-
const key = this.preferences.key(this.identity());
|
|
354
|
-
if (key && key !== this.restored) {
|
|
355
|
-
const state = this.preferences.read(this.identity());
|
|
356
|
-
if (state)
|
|
357
|
-
api.applyColumnState({
|
|
358
|
-
state: state.columns.map(({ colId, width, hide, pinned }) => ({
|
|
359
|
-
colId,
|
|
360
|
-
width,
|
|
361
|
-
hide,
|
|
362
|
-
pinned,
|
|
363
|
-
})),
|
|
364
|
-
applyOrder: true,
|
|
365
|
-
});
|
|
366
|
-
this.restored = key;
|
|
367
|
-
}
|
|
368
|
-
api.setRowGroupColumns(group ? [group] : []);
|
|
369
|
-
api.setSortModel(context.sort.map((rule) => ({ colId: rule.field, sort: rule.dir })));
|
|
370
|
-
}
|
|
371
|
-
finally {
|
|
372
|
-
this.synchronizing = false;
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
afterRenderEffect(() => {
|
|
377
|
-
this.layoutRevision();
|
|
378
|
-
this.visibleRows();
|
|
379
|
-
this.loading();
|
|
380
|
-
const grid = this.grid();
|
|
381
|
-
if (!grid)
|
|
382
|
-
return;
|
|
383
|
-
const root = this.host.nativeElement.querySelector('mt-data-grid');
|
|
384
|
-
const viewport = root?.querySelector('.mt-grid-viewport');
|
|
385
|
-
const header = root?.querySelector('.mt-grid-header');
|
|
386
|
-
if (!root || !viewport || !header)
|
|
387
|
-
return;
|
|
388
|
-
const chrome = root.getBoundingClientRect().height -
|
|
389
|
-
viewport.clientHeight +
|
|
390
|
-
header.getBoundingClientRect().height;
|
|
391
|
-
// A page grows with its displayed rows/groups. Only the surrounding ClientPage scrolls.
|
|
392
|
-
this.height.set(Math.max(400, Math.ceil(chrome + grid.api.getDisplayedRowCount() * 52)));
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
onReady(api) {
|
|
396
|
-
this.ready.set(api);
|
|
397
|
-
}
|
|
398
|
-
filters(event) {
|
|
399
|
-
if (this.synchronizing || this.loading())
|
|
400
|
-
return;
|
|
401
|
-
const api = this.ready();
|
|
402
|
-
if (!api)
|
|
403
|
-
return;
|
|
404
|
-
if (event.source === 'quickFilter')
|
|
405
|
-
this.search.set(api.getQuickFilter() ?? '');
|
|
406
|
-
else
|
|
407
|
-
this.filtersChange.emit(workCenterGridFilters(api.getFilterModel(), this.schema()));
|
|
408
|
-
this.resize();
|
|
409
|
-
}
|
|
410
|
-
sorted(sort) {
|
|
411
|
-
if (this.synchronizing || this.loading())
|
|
412
|
-
return;
|
|
413
|
-
const first = sort[0];
|
|
414
|
-
this.queryChange.emit({
|
|
415
|
-
currentPage: 1,
|
|
416
|
-
pageSize: this.context().pageSize,
|
|
417
|
-
sortField: first?.colId ?? null,
|
|
418
|
-
sortOrder: first?.sort === 'desc' ? -1 : 1,
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
grouped() {
|
|
422
|
-
if (this.synchronizing || this.loading())
|
|
423
|
-
return;
|
|
424
|
-
const groups = this.ready()?.getRowGroupColumns() ?? [];
|
|
425
|
-
const next = groups.at(-1) ?? null;
|
|
426
|
-
this.groupChange.emit(next);
|
|
427
|
-
this.resize();
|
|
428
|
-
}
|
|
429
|
-
paged(event) {
|
|
430
|
-
if (!event.newPage && !event.newPageSize)
|
|
431
|
-
return;
|
|
432
|
-
const sort = this.context().sort[0];
|
|
433
|
-
this.queryChange.emit({
|
|
434
|
-
currentPage: event.currentPage + 1,
|
|
435
|
-
pageSize: event.pageSize,
|
|
436
|
-
sortField: sort?.field ?? null,
|
|
437
|
-
sortOrder: sort?.dir === 'desc' ? -1 : 1,
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
resize() {
|
|
441
|
-
this.layoutRevision.update((value) => value + 1);
|
|
442
|
-
}
|
|
443
|
-
save() {
|
|
444
|
-
if (this.synchronizing || !this.ready())
|
|
445
|
-
return;
|
|
446
|
-
this.preferences.write(this.identity(), captureGridViewState(this.ready()));
|
|
447
|
-
}
|
|
448
|
-
menu = (params) => [
|
|
449
|
-
...params.defaultItems,
|
|
450
|
-
{ name: this.text.text('print'), action: () => this.print() },
|
|
451
|
-
];
|
|
452
|
-
print() {
|
|
453
|
-
const visible = new Set(this.ready()
|
|
454
|
-
?.getColumnState()
|
|
455
|
-
.filter((col) => !col.hide)
|
|
456
|
-
.map((col) => col.colId));
|
|
457
|
-
this.exporter.printPdf({
|
|
458
|
-
rows: this.visibleRows(),
|
|
459
|
-
columns: this.columns().filter((col) => visible.has(col.key)),
|
|
460
|
-
filename: this.label(),
|
|
461
|
-
title: this.label(),
|
|
462
|
-
resolveValue: (row, column) => TableValueResolver.getEntityValueByType(this.entity(row, column), 'export'),
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
entity(row, column) {
|
|
466
|
-
const entity = row[column.key];
|
|
467
|
-
const raw = entity.rawValue ??
|
|
468
|
-
(['Number', 'Percentage', 'Currency'].includes(entity.viewType)
|
|
469
|
-
? TableValueResolver.getEntityValueByType(entity, 'sort')
|
|
470
|
-
: ['Date', 'DateTime'].includes(entity.viewType)
|
|
471
|
-
? TableValueResolver.resolveDateValue(entity.value)
|
|
472
|
-
: null);
|
|
473
|
-
return {
|
|
474
|
-
...entity,
|
|
475
|
-
...(raw != null ? { rawValue: String(raw) } : {}),
|
|
476
|
-
configuration: {
|
|
477
|
-
...entity.configuration,
|
|
478
|
-
hideName: true,
|
|
479
|
-
showDisplayName: true,
|
|
480
|
-
showEmail: false,
|
|
481
|
-
showPhoneNumber: false,
|
|
482
|
-
},
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGrid, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
486
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: WorkCenterGrid, isStandalone: true, selector: "mt-work-center-grid", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, filterRules: { classPropertyName: "filterRules", publicName: "filterRules", isSignal: true, isRequired: false, transformFunction: null }, groupCounts: { classPropertyName: "groupCounts", publicName: "groupCounts", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, viewKey: { classPropertyName: "viewKey", publicName: "viewKey", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { rowClick: "rowClick", filtersChange: "filtersChange", groupChange: "groupChange", queryChange: "queryChange" }, viewQueries: [{ propertyName: "grid", first: true, predicate: (MtDataGridComponent), descendants: true, isSignal: true }], ngImport: i0, template: "<mt-data-grid\r\n [rowData]=\"visibleRows()\"\r\n [columnDefs]=\"definitions()\"\r\n [getRowId]=\"rowId\"\r\n dataProcessing=\"external\"\r\n [height]=\"height()\"\r\n [rowHeight]=\"52\"\r\n [headerHeight]=\"48\"\r\n [autoSizeStrategy]=\"fit\"\r\n [ariaLabel]=\"label()\"\r\n [loading]=\"loading()\"\r\n [direction]=\"direction()\"\r\n [localeText]=\"text.gridLocale()\"\r\n [showQuickFilter]=\"true\"\r\n [quickFilterText]=\"search()\"\r\n rowGroupPanelShow=\"always\"\r\n pivotPanelShow=\"never\"\r\n [sideBar]=\"{\r\n toolPanels: ['columns', 'filters'],\r\n position: direction() === 'rtl' ? 'left' : 'right',\r\n }\"\r\n [pagination]=\"true\"\r\n paginationPanelShow=\"whenNeeded\"\r\n [paginationTotalRows]=\"total()\"\r\n [paginationCurrentPage]=\"context().page - 1\"\r\n [paginationPageSize]=\"context().pageSize\"\r\n [paginationPageSizeSelector]=\"[10, 20, 50, 100]\"\r\n [cellSelection]=\"true\"\r\n [suppressCutToClipboard]=\"true\"\r\n [suppressPdfExport]=\"true\"\r\n [getContextMenuItems]=\"menu\"\r\n [defaultCsvExportParams]=\"exportParams\"\r\n [defaultExcelExportParams]=\"exportParams\"\r\n [groupDefaultExpanded]=\"-1\"\r\n [groupMaintainOrder]=\"true\"\r\n [autoGroupColumnDef]=\"{ cellRendererParams: { suppressCount: true } }\"\r\n groupDisplayType=\"groupRows\"\r\n (gridReady)=\"onReady($event.api)\"\r\n (filterChanged)=\"filters($event)\"\r\n (sortChanged)=\"sorted($event)\"\r\n (columnRowGroupChanged)=\"grouped()\"\r\n (rowGroupOpened)=\"resize()\"\r\n (paginationChanged)=\"paged($event)\"\r\n (columnResized)=\"$event.finished && save()\"\r\n (columnMoved)=\"save()\"\r\n (columnVisible)=\"save()\"\r\n (columnPinned)=\"save()\"\r\n (rowClicked)=\"\r\n $event.node.data && !$event.node.group && rowClick.emit($event.node.data)\r\n \"\r\n/>\r\n", dependencies: [{ kind: "component", type: MtDataGridComponent, selector: "mt-data-grid", inputs: ["rowData", "dataProcessing", "columnDefs", "getRowId", "height", "autoHeight", "autoHeightMaxRows", "autoHeightMinRows", "rowHeight", "animateRows", "headerHeight", "groupHeaderHeight", "direction", "localeText", "localeTextResolver", "ariaLabel", "loading", "noRowsText", "loadingText", "noRowsTemplate", "autoSizeStrategy", "columnMenu", "mainMenuItems", "autoSizePadding", "quickFilterText", "showQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "cacheQuickFilter", "applyQuickFilterBeforePivotOrAgg", "filtersToolPanelDef", "isExternalFilterPresent", "doesExternalFilterPass", "floatingFiltersHeight", "rowSelection", "selectionColumnDef", "rowNumbers", "rowDragManaged", "rowDragEntireRow", "rowDragMultiRow", "suppressMoveWhenRowDragging", "cellSelection", "statusBar", "suppressContextMenu", "allowContextMenuWithControlKey", "preventDefaultOnContextMenu", "getContextMenuItems", "suppressCsvExport", "suppressExcelExport", "suppressPdfExport", "defaultPdfExportParams", "excelStyles", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "copySelectedRows", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressCutToClipboard", "defaultCsvExportParams", "defaultExcelExportParams", "groupDisplayType", "groupRowRenderer", "groupRowRendererParams", "suppressGroupRowsSticky", "groupHideOpenParents", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "showOpenedGroup", "groupAggFiltering", "suppressAggFilteredOnly", "aggregateOnlyChangedColumns", "suppressColumnMoveAnimation", "pivotRowTotals", "pivotColumnGroupTotals", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "processPivotResultColDef", "processPivotResultColGroupDef", "processUnpinnedColumns", "rowGroupPanelShow", "pivotPanelShow", "pivotPanelHint", "groupDefaultExpanded", "autoGroupColumnDef", "groupTotalRow", "grandTotalRow", "aggFuncs", "suppressRowGroupHidesColumns", "suppressMakeColumnVisibleAfterUnGroup", "sideBar", "pivotMode", "suppressAggFuncInHeader", "enableCharts", "chartThemes", "customChartThemes", "chartToolPanelsDef", "chartThemeOverrides", "chartContext", "chartRecordsLabel", "getChartToolbarItems", "groupMaintainOrder", "treeData", "getDataPath", "masterDetail", "isRowMaster", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "singleClickEdit", "suppressClickEdit", "stopEditingWhenCellsLoseFocus", "undoRedoCellEditing", "undoRedoCellEditingLimit", "pagination", "paginationPanelShow", "paginationPageSize", "paginationTotalRows", "paginationCurrentPage", "paginationPageSizeSelector", "rowGroupPanelSuppressSort"], outputs: ["displayedColumnsChanged", "columnEverythingChanged", "pivotMaxColumnsExceeded", "gridReady", "sortChanged", "cellFocused", "columnResized", "columnMoved", "columnPinned", "columnVisible", "columnGroupOpened", "filterChanged", "filterModified", "filterOpened", "rowSelected", "selectionChanged", "rowClicked", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "cellSelectionChanged", "contextMenuVisibleChanged", "rowGroupOpened", "columnRowGroupChanged", "expandOrCollapseAll", "cellEditingStarted", "cellEditingStopped", "cellValueChanged", "pasteStart", "pasteEnd", "fillStart", "fillEnd", "paginationChanged", "toolPanelVisibleChanged", "toolPanelSizeChanged", "columnValueChanged", "columnPivotChanged", "columnPivotModeChanged", "chartCreated", "chartDestroyed", "chartRangeSelectionChanged", "chartOptionsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
487
|
-
}
|
|
488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGrid, decorators: [{
|
|
489
|
-
type: Component,
|
|
490
|
-
args: [{ selector: 'mt-work-center-grid', imports: [MtDataGridComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-data-grid\r\n [rowData]=\"visibleRows()\"\r\n [columnDefs]=\"definitions()\"\r\n [getRowId]=\"rowId\"\r\n dataProcessing=\"external\"\r\n [height]=\"height()\"\r\n [rowHeight]=\"52\"\r\n [headerHeight]=\"48\"\r\n [autoSizeStrategy]=\"fit\"\r\n [ariaLabel]=\"label()\"\r\n [loading]=\"loading()\"\r\n [direction]=\"direction()\"\r\n [localeText]=\"text.gridLocale()\"\r\n [showQuickFilter]=\"true\"\r\n [quickFilterText]=\"search()\"\r\n rowGroupPanelShow=\"always\"\r\n pivotPanelShow=\"never\"\r\n [sideBar]=\"{\r\n toolPanels: ['columns', 'filters'],\r\n position: direction() === 'rtl' ? 'left' : 'right',\r\n }\"\r\n [pagination]=\"true\"\r\n paginationPanelShow=\"whenNeeded\"\r\n [paginationTotalRows]=\"total()\"\r\n [paginationCurrentPage]=\"context().page - 1\"\r\n [paginationPageSize]=\"context().pageSize\"\r\n [paginationPageSizeSelector]=\"[10, 20, 50, 100]\"\r\n [cellSelection]=\"true\"\r\n [suppressCutToClipboard]=\"true\"\r\n [suppressPdfExport]=\"true\"\r\n [getContextMenuItems]=\"menu\"\r\n [defaultCsvExportParams]=\"exportParams\"\r\n [defaultExcelExportParams]=\"exportParams\"\r\n [groupDefaultExpanded]=\"-1\"\r\n [groupMaintainOrder]=\"true\"\r\n [autoGroupColumnDef]=\"{ cellRendererParams: { suppressCount: true } }\"\r\n groupDisplayType=\"groupRows\"\r\n (gridReady)=\"onReady($event.api)\"\r\n (filterChanged)=\"filters($event)\"\r\n (sortChanged)=\"sorted($event)\"\r\n (columnRowGroupChanged)=\"grouped()\"\r\n (rowGroupOpened)=\"resize()\"\r\n (paginationChanged)=\"paged($event)\"\r\n (columnResized)=\"$event.finished && save()\"\r\n (columnMoved)=\"save()\"\r\n (columnVisible)=\"save()\"\r\n (columnPinned)=\"save()\"\r\n (rowClicked)=\"\r\n $event.node.data && !$event.node.group && rowClick.emit($event.node.data)\r\n \"\r\n/>\r\n" }]
|
|
491
|
-
}], ctorParameters: () => [], propDecorators: { rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], schema: [{ type: i0.Input, args: [{ isSignal: true, alias: "schema", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], filterRules: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterRules", required: false }] }], groupCounts: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupCounts", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], viewKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewKey", required: true }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], filtersChange: [{ type: i0.Output, args: ["filtersChange"] }], groupChange: [{ type: i0.Output, args: ["groupChange"] }], queryChange: [{ type: i0.Output, args: ["queryChange"] }], grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MtDataGridComponent), { isSignal: true }] }] } });
|
|
492
|
-
|
|
493
124
|
class EnterArea {
|
|
494
125
|
area;
|
|
495
126
|
static type = '[WorkCenter] Enter Area';
|
|
@@ -2208,6 +1839,29 @@ function resolveWorkCenterExtraTabs(tabs, details) {
|
|
|
2208
1839
|
};
|
|
2209
1840
|
return tabs.filter((tab) => tab.when(item));
|
|
2210
1841
|
}
|
|
1842
|
+
/**
|
|
1843
|
+
* The request form's sub-tab strip (`placement: 'form'`): the form, then the
|
|
1844
|
+
* host tabs. `formLabel: null` leaves the form out (it loaded empty, "No form
|
|
1845
|
+
* required"). Empty when fewer than two options remain, so no strip renders.
|
|
1846
|
+
*/
|
|
1847
|
+
function workCenterFormTabOptions(formLabel, tabs, translate) {
|
|
1848
|
+
const options = [
|
|
1849
|
+
...(formLabel === null ? [] : [{ label: formLabel, value: 'form' }]),
|
|
1850
|
+
...tabs.map((tab) => ({
|
|
1851
|
+
label: translate(tab.label),
|
|
1852
|
+
value: tab.key,
|
|
1853
|
+
icon: tab.icon ?? null,
|
|
1854
|
+
})),
|
|
1855
|
+
];
|
|
1856
|
+
return options.length > 1 ? options : [];
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* The form sub-tab a body opens on: the form, unless it loaded empty and a
|
|
1860
|
+
* host tab sits beside it — then the first host tab takes its place.
|
|
1861
|
+
*/
|
|
1862
|
+
function workCenterInitialFormTab(formEmpty, tabs) {
|
|
1863
|
+
return formEmpty && tabs.length ? tabs[0].key : 'form';
|
|
1864
|
+
}
|
|
2211
1865
|
/** Splices the extra tabs into a built-in tab list (see `after`). */
|
|
2212
1866
|
function insertWorkCenterExtraTabs(options, tabs, translate) {
|
|
2213
1867
|
const result = [...options];
|
|
@@ -2231,6 +1885,24 @@ function insertWorkCenterExtraTabs(options, tabs, translate) {
|
|
|
2231
1885
|
}
|
|
2232
1886
|
return result;
|
|
2233
1887
|
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Built-in tabs a host hides from the `ProcessStep` / `ProcessRequest` bodies,
|
|
1890
|
+
* by tab value: `levelDetails` (ProcessStep), `approvals`, `schema`,
|
|
1891
|
+
* `discussion`. The item's first tab (`form` / `requestDetails`) is the one the
|
|
1892
|
+
* body opens on, so it always stays. A hidden `levelDetails` also skips its
|
|
1893
|
+
* record fetch. Providing nothing changes nothing.
|
|
1894
|
+
*
|
|
1895
|
+
* @example
|
|
1896
|
+
* providers: [{ provide: WORK_CENTER_HIDDEN_TABS, useValue: ['levelDetails'] }]
|
|
1897
|
+
*/
|
|
1898
|
+
const WORK_CENTER_HIDDEN_TABS = new InjectionToken('WORK_CENTER_HIDDEN_TABS');
|
|
1899
|
+
/** Drops the hidden built-in tabs, always keeping the first (default) one. */
|
|
1900
|
+
function removeWorkCenterHiddenTabs(options, hidden) {
|
|
1901
|
+
if (!hidden?.length) {
|
|
1902
|
+
return [...options];
|
|
1903
|
+
}
|
|
1904
|
+
return options.filter((option, index) => index === 0 || !hidden.includes(String(option.value)));
|
|
1905
|
+
}
|
|
2234
1906
|
|
|
2235
1907
|
class WorkCenterProcessRequestType {
|
|
2236
1908
|
facade = inject(WorkCenterFacade);
|
|
@@ -2245,6 +1917,9 @@ class WorkCenterProcessRequestType {
|
|
|
2245
1917
|
extraTabRegistry = inject(WORK_CENTER_EXTRA_TABS, {
|
|
2246
1918
|
optional: true,
|
|
2247
1919
|
});
|
|
1920
|
+
hiddenTabs = inject(WORK_CENTER_HIDDEN_TABS, {
|
|
1921
|
+
optional: true,
|
|
1922
|
+
});
|
|
2248
1923
|
details = input.required(...(ngDevMode ? [{ debugName: "details" }] : /* istanbul ignore next */ []));
|
|
2249
1924
|
lookups = input(null, ...(ngDevMode ? [{ debugName: "lookups" }] : /* istanbul ignore next */ []));
|
|
2250
1925
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
@@ -2253,8 +1928,21 @@ class WorkCenterProcessRequestType {
|
|
|
2253
1928
|
formLookups = computed(() => this.lookups() ?? this.facade.lookups(), ...(ngDevMode ? [{ debugName: "formLookups" }] : /* istanbul ignore next */ []));
|
|
2254
1929
|
activeTab = signal('requestDetails', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
2255
1930
|
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
2256
|
-
// Host tabs (WORK_CENTER_EXTRA_TABS) that apply to this item
|
|
2257
|
-
|
|
1931
|
+
// Host tabs (WORK_CENTER_EXTRA_TABS) that apply to this item: entries of
|
|
1932
|
+
// their own in the tab list, or sub-tabs of the form (`placement: 'form'`).
|
|
1933
|
+
itemExtraTabs = computed(() => resolveWorkCenterExtraTabs(this.extraTabRegistry, this.details()), ...(ngDevMode ? [{ debugName: "itemExtraTabs" }] : /* istanbul ignore next */ []));
|
|
1934
|
+
extraTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement !== 'form'), ...(ngDevMode ? [{ debugName: "extraTabs" }] : /* istanbul ignore next */ []));
|
|
1935
|
+
formTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement === 'form'), ...(ngDevMode ? [{ debugName: "formTabs" }] : /* istanbul ignore next */ []));
|
|
1936
|
+
// The form loaded empty ("No form required", e.g. a KPI value update): a
|
|
1937
|
+
// form-placed host tab then takes the form's place.
|
|
1938
|
+
formEmpty = computed(() => this.clientForm()?.isEmpty() ?? false, ...(ngDevMode ? [{ debugName: "formEmpty" }] : /* istanbul ignore next */ []));
|
|
1939
|
+
formTab = linkedSignal(() => workCenterInitialFormTab(this.formEmpty(), this.formTabs()), ...(ngDevMode ? [{ debugName: "formTab" }] : /* istanbul ignore next */ []));
|
|
1940
|
+
formTabOptions = computed(() => {
|
|
1941
|
+
this.activeLang();
|
|
1942
|
+
return workCenterFormTabOptions(this.formEmpty()
|
|
1943
|
+
? null
|
|
1944
|
+
: this.transloco.translate('workCenter.tabs.requestDetails'), this.formTabs(), (key) => this.transloco.translate(key));
|
|
1945
|
+
}, ...(ngDevMode ? [{ debugName: "formTabOptions" }] : /* istanbul ignore next */ []));
|
|
2258
1946
|
extraTabInputs = computed(() => ({
|
|
2259
1947
|
details: this.details(),
|
|
2260
1948
|
lookups: this.formLookups(),
|
|
@@ -2288,7 +1976,7 @@ class WorkCenterProcessRequestType {
|
|
|
2288
1976
|
]
|
|
2289
1977
|
: []),
|
|
2290
1978
|
];
|
|
2291
|
-
return insertWorkCenterExtraTabs(builtIn, this.extraTabs(), (key) => this.transloco.translate(key));
|
|
1979
|
+
return insertWorkCenterExtraTabs(removeWorkCenterHiddenTabs(builtIn, this.hiddenTabs), this.extraTabs(), (key) => this.transloco.translate(key));
|
|
2292
1980
|
}, ...(ngDevMode ? [{ debugName: "tabOptions" }] : /* istanbul ignore next */ []));
|
|
2293
1981
|
itemContext = computed(() => readItemContext(this.details()), ...(ngDevMode ? [{ debugName: "itemContext" }] : /* istanbul ignore next */ []));
|
|
2294
1982
|
requestId = computed(() => readNumber(this.itemContext(), 'requestId') ??
|
|
@@ -2352,9 +2040,9 @@ class WorkCenterProcessRequestType {
|
|
|
2352
2040
|
this.formStore?.setIncomplete(false);
|
|
2353
2041
|
}
|
|
2354
2042
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2355
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessRequestType, isStandalone: true, selector: "mt-work-center-process-request-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (
|
|
2043
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessRequestType, isStandalone: true, selector: "mt-work-center-process-request-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [requestCommitted]=\"requestCommitted()\"\r\n [readonly]=\"isReadonly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "requestCommitted", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys", "requiredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }], deferBlockDependencies: [() => [i1.NgComponentOutlet], () => [i1.NgComponentOutlet], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2356
2044
|
}
|
|
2357
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
2045
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
|
|
2358
2046
|
type: Component,
|
|
2359
2047
|
args: [{ selector: 'mt-work-center-process-request-type', standalone: true, imports: [
|
|
2360
2048
|
CommonModule,
|
|
@@ -2363,7 +2051,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
2363
2051
|
ClientForm,
|
|
2364
2052
|
DiscussionThread,
|
|
2365
2053
|
WorkCenterProcessPreview,
|
|
2366
|
-
], template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (
|
|
2054
|
+
], template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [requestCommitted]=\"requestCommitted()\"\r\n [readonly]=\"isReadonly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
2367
2055
|
}], ctorParameters: () => [], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], clientForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ClientForm), { isSignal: true }] }] } }) });
|
|
2368
2056
|
|
|
2369
2057
|
class WorkCenterProcessStepType {
|
|
@@ -2379,6 +2067,9 @@ class WorkCenterProcessStepType {
|
|
|
2379
2067
|
extraTabRegistry = inject(WORK_CENTER_EXTRA_TABS, {
|
|
2380
2068
|
optional: true,
|
|
2381
2069
|
});
|
|
2070
|
+
hiddenTabs = inject(WORK_CENTER_HIDDEN_TABS, {
|
|
2071
|
+
optional: true,
|
|
2072
|
+
});
|
|
2382
2073
|
details = input.required(...(ngDevMode ? [{ debugName: "details" }] : /* istanbul ignore next */ []));
|
|
2383
2074
|
lookups = input(null, ...(ngDevMode ? [{ debugName: "lookups" }] : /* istanbul ignore next */ []));
|
|
2384
2075
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
@@ -2387,8 +2078,21 @@ class WorkCenterProcessStepType {
|
|
|
2387
2078
|
formLookups = computed(() => this.lookups() ?? this.facade.lookups(), ...(ngDevMode ? [{ debugName: "formLookups" }] : /* istanbul ignore next */ []));
|
|
2388
2079
|
activeTab = signal('form', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
2389
2080
|
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
2390
|
-
// Host tabs (WORK_CENTER_EXTRA_TABS) that apply to this item
|
|
2391
|
-
|
|
2081
|
+
// Host tabs (WORK_CENTER_EXTRA_TABS) that apply to this item: entries of
|
|
2082
|
+
// their own in the tab list, or sub-tabs of the form (`placement: 'form'`).
|
|
2083
|
+
itemExtraTabs = computed(() => resolveWorkCenterExtraTabs(this.extraTabRegistry, this.details()), ...(ngDevMode ? [{ debugName: "itemExtraTabs" }] : /* istanbul ignore next */ []));
|
|
2084
|
+
extraTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement !== 'form'), ...(ngDevMode ? [{ debugName: "extraTabs" }] : /* istanbul ignore next */ []));
|
|
2085
|
+
formTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement === 'form'), ...(ngDevMode ? [{ debugName: "formTabs" }] : /* istanbul ignore next */ []));
|
|
2086
|
+
// The form loaded empty ("No form required", e.g. a KPI value update): a
|
|
2087
|
+
// form-placed host tab then takes the form's place.
|
|
2088
|
+
formEmpty = computed(() => this.clientForm()?.isEmpty() ?? false, ...(ngDevMode ? [{ debugName: "formEmpty" }] : /* istanbul ignore next */ []));
|
|
2089
|
+
formTab = linkedSignal(() => workCenterInitialFormTab(this.formEmpty(), this.formTabs()), ...(ngDevMode ? [{ debugName: "formTab" }] : /* istanbul ignore next */ []));
|
|
2090
|
+
formTabOptions = computed(() => {
|
|
2091
|
+
this.activeLang();
|
|
2092
|
+
return workCenterFormTabOptions(this.formEmpty()
|
|
2093
|
+
? null
|
|
2094
|
+
: this.transloco.translate('workCenter.tabs.form'), this.formTabs(), (key) => this.transloco.translate(key));
|
|
2095
|
+
}, ...(ngDevMode ? [{ debugName: "formTabOptions" }] : /* istanbul ignore next */ []));
|
|
2392
2096
|
extraTabInputs = computed(() => ({
|
|
2393
2097
|
details: this.details(),
|
|
2394
2098
|
lookups: this.formLookups(),
|
|
@@ -2432,7 +2136,7 @@ class WorkCenterProcessStepType {
|
|
|
2432
2136
|
]
|
|
2433
2137
|
: []),
|
|
2434
2138
|
];
|
|
2435
|
-
return insertWorkCenterExtraTabs(builtIn, this.extraTabs(), (key) => this.transloco.translate(key));
|
|
2139
|
+
return insertWorkCenterExtraTabs(removeWorkCenterHiddenTabs(builtIn, this.hiddenTabs), this.extraTabs(), (key) => this.transloco.translate(key));
|
|
2436
2140
|
}, ...(ngDevMode ? [{ debugName: "tabOptions" }] : /* istanbul ignore next */ []));
|
|
2437
2141
|
itemContext = computed(() => readItemContext(this.details()), ...(ngDevMode ? [{ debugName: "itemContext" }] : /* istanbul ignore next */ []));
|
|
2438
2142
|
requestId = computed(() => readNumber(this.itemContext(), 'requestId') ??
|
|
@@ -2452,11 +2156,14 @@ class WorkCenterProcessStepType {
|
|
|
2452
2156
|
canRenderPreview = computed(() => (this.requestId() ?? 0) > 0, ...(ngDevMode ? [{ debugName: "canRenderPreview" }] : /* istanbul ignore next */ []));
|
|
2453
2157
|
// Level record preview for the process step's owning level. The fetch
|
|
2454
2158
|
// contextKey pairs the numeric `levelId` (schema/context) with the
|
|
2455
|
-
// `levelDataId` record id — same shape as the level-preview dialog.
|
|
2159
|
+
// `levelDataId` record id — same shape as the level-preview dialog. Null
|
|
2160
|
+
// when the host hides the tab, so the record is never fetched.
|
|
2456
2161
|
levelDetailsConfig = computed(() => {
|
|
2457
2162
|
const levelId = this.levelId();
|
|
2458
2163
|
const levelDataId = this.levelDataId();
|
|
2459
|
-
if (levelId == null ||
|
|
2164
|
+
if (levelId == null ||
|
|
2165
|
+
levelDataId == null ||
|
|
2166
|
+
this.hiddenTabs?.includes('levelDetails')) {
|
|
2460
2167
|
return null;
|
|
2461
2168
|
}
|
|
2462
2169
|
return {
|
|
@@ -2520,9 +2227,9 @@ class WorkCenterProcessStepType {
|
|
|
2520
2227
|
this.formStore?.setIncomplete(false);
|
|
2521
2228
|
}
|
|
2522
2229
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2523
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessStepType, isStandalone: true, selector: "mt-work-center-process-step-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }, { propertyName: "levelPreview", first: true, predicate: ClientInstancePreview, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (
|
|
2230
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessStepType, isStandalone: true, selector: "mt-work-center-process-step-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }, { propertyName: "levelPreview", first: true, predicate: ClientInstancePreview, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [readonly]=\"readOnly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'levelDetails'\"\r\n >\r\n @if (levelDetailsConfig(); as levelDetailsConfig) {\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-client-instance-preview [config]=\"levelDetailsConfig\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "requestCommitted", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys", "requiredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: ClientInstancePreview, selector: "mt-client-instance-preview", inputs: ["config", "hideEmptyState", "stackOnNarrow"] }], deferBlockDependencies: [() => [i1.NgComponentOutlet], () => [i1.NgComponentOutlet], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2524
2231
|
}
|
|
2525
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
2232
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
|
|
2526
2233
|
type: Component,
|
|
2527
2234
|
args: [{ selector: 'mt-work-center-process-step-type', standalone: true, imports: [
|
|
2528
2235
|
CommonModule,
|
|
@@ -2532,7 +2239,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
2532
2239
|
ClientInstancePreview,
|
|
2533
2240
|
DiscussionThread,
|
|
2534
2241
|
WorkCenterProcessPreview,
|
|
2535
|
-
], template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (
|
|
2242
|
+
], template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [readonly]=\"readOnly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'levelDetails'\"\r\n >\r\n @if (levelDetailsConfig(); as levelDetailsConfig) {\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-client-instance-preview [config]=\"levelDetailsConfig\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
2536
2243
|
}], ctorParameters: () => [], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], clientForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ClientForm), { isSignal: true }] }], levelPreview: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ClientInstancePreview), { isSignal: true }] }] } }) });
|
|
2537
2244
|
|
|
2538
2245
|
/**
|
|
@@ -2987,9 +2694,9 @@ class WorkCenterSchedulePublishType {
|
|
|
2987
2694
|
});
|
|
2988
2695
|
}
|
|
2989
2696
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2990
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterSchedulePublishType, isStandalone: true, selector: "mt-work-center-schedule-publish-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\n *transloco=\"let t; prefix: 'workCenter'\"\n>\n <div\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\n >\n @if (tabOptions().length > 1) {\n <mt-tabs\n [(active)]=\"activeTab\"\n [options]=\"tabOptions()\"\n mode=\"vertical\"\n size=\"small\"\n />\n }\n\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\n <!-- Comparison -->\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'comparison'\"\n >\n <div\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\n >\n @if (loading()) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"loading.schedulePublish\") }}\n </p>\n </div>\n } @else if (error(); as loadError) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-red-600\">\n {{ loadError }}\n </p>\n </div>\n } @else if (!summary().hasSnapshot) {\n <!-- Never published: nothing has been announced, so nothing can\n differ from it. That is a different statement from \"no changes\". -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.neverPublished\") }}\n </p>\n </div>\n } @else if (!summary().needsAttention) {\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\n convergences is publish-empty but must still show its conflicts\n section rather than claim there is nothing here. -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.nothingToPublish\") }}\n </p>\n </div>\n } @else {\n <!-- Counts stay visible while searching, so a filtered view never\n reads as the whole request. -->\n <div class=\"flex flex-wrap items-center gap-2\">\n @if (summary().conflictCount > 0) {\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('conflict')\"\n >{{\n t(\"publish.conflictCount\", {\n count: summary().conflictCount,\n })\n }}</span\n >\n }\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('added')\"\n >{{\n t(\"publish.addedCount\", { count: summary().addedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('changed')\"\n >{{\n t(\"publish.changedCount\", { count: summary().changedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('removed')\"\n >{{\n t(\"publish.removedCount\", { count: summary().removedCount })\n }}</span\n >\n </div>\n\n <input\n type=\"search\"\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\n [placeholder]=\"t('publish.searchPlaceholder')\"\n [value]=\"searchText()\"\n (input)=\"onSearch($any($event.target).value)\"\n />\n\n <div\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n @if (searchFoundNothing()) {\n <div\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"text-sm text-surface-500\">\n {{ t(\"publish.noSearchResults\") }}\n </p>\n </div>\n }\n\n @for (group of groups(); track group.state) {\n <section class=\"mb-4\">\n <header class=\"mb-2 flex items-center gap-2\">\n <h4 class=\"text-sm font-semibold text-surface-700\">\n {{ groupLabel(group.state) }}\n </h4>\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass(group.state)\"\n >{{ group.totalCount }}</span\n >\n </header>\n\n @if (group.state === \"conflict\") {\n <!-- Informational only: unlike the planner's drawer there is\n no keep-mine / use-published control here. The frozen\n plan under approval was captured while the live plan had\n moved on these rows. -->\n <p class=\"mb-2 text-xs text-surface-500\">\n {{ t(\"publish.conflictHint\") }}\n </p>\n }\n\n <ul class=\"flex flex-col gap-1\">\n @for (row of visibleRows(group); track rowKey(row)) {\n <li\n class=\"rounded-md border border-surface-200 bg-surface-0\"\n >\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\n [class.cursor-default]=\"!isExpandable(row)\"\n [attr.aria-expanded]=\"\n isExpandable(row) ? isExpanded(row) : null\n \"\n [disabled]=\"!isExpandable(row)\"\n (click)=\"toggleRow(row)\"\n >\n @if (isExpandable(row)) {\n <span\n class=\"shrink-0 text-xs text-surface-500\"\n aria-hidden=\"true\"\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\n >\n } @else {\n <span\n class=\"w-3 shrink-0\"\n aria-hidden=\"true\"\n ></span>\n }\n <span\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\n >{{ row.name }}</span\n >\n @if (row.type) {\n <span class=\"shrink-0 text-xs text-surface-500\">{{\n row.type\n }}</span>\n }\n </button>\n\n @if (\n group.state === \"conflict\" &&\n publishedMovedFields(row).length > 0\n ) {\n <p\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\n >\n {{ t(\"publish.publishedSideMoved\") }}:\n {{ publishedMovedFields(row).join(\", \") }}\n </p>\n }\n\n @if (isExpandable(row) && isExpanded(row)) {\n <div\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\n >\n @for (\n change of changesFor(row);\n track change.field\n ) {\n <div class=\"flex min-w-0 flex-col gap-1\">\n <span\n class=\"text-xs font-medium text-surface-600\"\n >{{ fieldLabel(change.field) }}</span\n >\n <!-- Before -> After rendered locally rather than\n via mt-comparison-value, whose Before/After\n labels are hardcoded English. Each side still\n goes through mt-entity-preview-body, so a date\n renders as a date and a user as an avatar. -->\n <div\n class=\"flex w-full min-w-0 items-stretch gap-3\"\n >\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\n >{{ t(\"publish.before\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'published')\"\n />\n </div>\n <div\n class=\"flex shrink-0 items-center text-muted-color\"\n aria-hidden=\"true\"\n >\n →\n </div>\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\n >{{ t(\"publish.after\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'current')\"\n />\n </div>\n </div>\n </div>\n }\n </div>\n }\n </li>\n }\n </ul>\n\n @if (hiddenCount(group) > 0) {\n <!-- Said out loud: a silently truncated comparison reads as a\n complete one to whoever is approving it. -->\n <p class=\"mt-2 text-xs text-surface-500\">\n {{\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\n }}\n </p>\n }\n </section>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- Project record preview. Loaded only when opened; it is a current\n record view, while Comparison is the frozen submitted schedule. -->\n @if (projectDetailsConfig(); as projectDetailsConfig) {\n @defer (when activeTab() === \"projectDetails\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'projectDetails'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <p class=\"mb-3 text-xs text-surface-500\">\n {{ t(\"publish.projectDetailsLiveNote\") }}\n </p>\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\n </div>\n </div>\n }\n }\n\n <!-- Approval history -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Workflow -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"workflow\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'workflow'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Discussion -->\n @if (!readOnly() && canRenderDiscussion()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n <div\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\n >\n <mt-discussion-thread\n [moduleType]=\"'ProcessRequest'\"\n [recordId]=\"resolvedRequestId()\"\n [mentionSearchEndpoint]=\"'Identity/users'\"\n [mentionSearchParam]=\"'query'\"\n [mentionSearchDataPath]=\"'data'\"\n [uploadEndpoint]=\"'uploader'\"\n [attachmentDownloadEndpoint]=\"'uploader'\"\n [showParticipants]=\"true\"\n [autoMarkRead]=\"true\"\n [refreshIntervalMs]=\"0\"\n [styleClass]=\"'h-full'\"\n />\n </div>\n </div>\n }\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }], deferBlockDependencies: [() => [ClientInstancePreview], () => [import('./masterteam-work-center-work-center-process-preview-DRPL21nM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-DRPL21nM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2697
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterSchedulePublishType, isStandalone: true, selector: "mt-work-center-schedule-publish-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <!-- Comparison -->\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'comparison'\"\r\n >\r\n <div\r\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\r\n >\r\n @if (loading()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"loading.schedulePublish\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as loadError) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-red-600\">\r\n {{ loadError }}\r\n </p>\r\n </div>\r\n } @else if (!summary().hasSnapshot) {\r\n <!-- Never published: nothing has been announced, so nothing can\r\n differ from it. That is a different statement from \"no changes\". -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.neverPublished\") }}\r\n </p>\r\n </div>\r\n } @else if (!summary().needsAttention) {\r\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\r\n convergences is publish-empty but must still show its conflicts\r\n section rather than claim there is nothing here. -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.nothingToPublish\") }}\r\n </p>\r\n </div>\r\n } @else {\r\n <!-- Counts stay visible while searching, so a filtered view never\r\n reads as the whole request. -->\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @if (summary().conflictCount > 0) {\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('conflict')\"\r\n >{{\r\n t(\"publish.conflictCount\", {\r\n count: summary().conflictCount,\r\n })\r\n }}</span\r\n >\r\n }\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('added')\"\r\n >{{\r\n t(\"publish.addedCount\", { count: summary().addedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('changed')\"\r\n >{{\r\n t(\"publish.changedCount\", { count: summary().changedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('removed')\"\r\n >{{\r\n t(\"publish.removedCount\", { count: summary().removedCount })\r\n }}</span\r\n >\r\n </div>\r\n\r\n <input\r\n type=\"search\"\r\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\r\n [placeholder]=\"t('publish.searchPlaceholder')\"\r\n [value]=\"searchText()\"\r\n (input)=\"onSearch($any($event.target).value)\"\r\n />\r\n\r\n <div\r\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (searchFoundNothing()) {\r\n <div\r\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"text-sm text-surface-500\">\r\n {{ t(\"publish.noSearchResults\") }}\r\n </p>\r\n </div>\r\n }\r\n\r\n @for (group of groups(); track group.state) {\r\n <section class=\"mb-4\">\r\n <header class=\"mb-2 flex items-center gap-2\">\r\n <h4 class=\"text-sm font-semibold text-surface-700\">\r\n {{ groupLabel(group.state) }}\r\n </h4>\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass(group.state)\"\r\n >{{ group.totalCount }}</span\r\n >\r\n </header>\r\n\r\n @if (group.state === \"conflict\") {\r\n <!-- Informational only: unlike the planner's drawer there is\r\n no keep-mine / use-published control here. The frozen\r\n plan under approval was captured while the live plan had\r\n moved on these rows. -->\r\n <p class=\"mb-2 text-xs text-surface-500\">\r\n {{ t(\"publish.conflictHint\") }}\r\n </p>\r\n }\r\n\r\n <ul class=\"flex flex-col gap-1\">\r\n @for (row of visibleRows(group); track rowKey(row)) {\r\n <li\r\n class=\"rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\r\n [class.cursor-default]=\"!isExpandable(row)\"\r\n [attr.aria-expanded]=\"\r\n isExpandable(row) ? isExpanded(row) : null\r\n \"\r\n [disabled]=\"!isExpandable(row)\"\r\n (click)=\"toggleRow(row)\"\r\n >\r\n @if (isExpandable(row)) {\r\n <span\r\n class=\"shrink-0 text-xs text-surface-500\"\r\n aria-hidden=\"true\"\r\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\r\n >\r\n } @else {\r\n <span\r\n class=\"w-3 shrink-0\"\r\n aria-hidden=\"true\"\r\n ></span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\r\n >{{ row.name }}</span\r\n >\r\n @if (row.type) {\r\n <span class=\"shrink-0 text-xs text-surface-500\">{{\r\n row.type\r\n }}</span>\r\n }\r\n </button>\r\n\r\n @if (\r\n group.state === \"conflict\" &&\r\n publishedMovedFields(row).length > 0\r\n ) {\r\n <p\r\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\r\n >\r\n {{ t(\"publish.publishedSideMoved\") }}:\r\n {{ publishedMovedFields(row).join(\", \") }}\r\n </p>\r\n }\r\n\r\n @if (isExpandable(row) && isExpanded(row)) {\r\n <div\r\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\r\n >\r\n @for (\r\n change of changesFor(row);\r\n track change.field\r\n ) {\r\n <div class=\"flex min-w-0 flex-col gap-1\">\r\n <span\r\n class=\"text-xs font-medium text-surface-600\"\r\n >{{ fieldLabel(change.field) }}</span\r\n >\r\n <!-- Before -> After rendered locally rather than\r\n via mt-comparison-value, whose Before/After\r\n labels are hardcoded English. Each side still\r\n goes through mt-entity-preview-body, so a date\r\n renders as a date and a user as an avatar. -->\r\n <div\r\n class=\"flex w-full min-w-0 items-stretch gap-3\"\r\n >\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >{{ t(\"publish.before\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'published')\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex shrink-0 items-center text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n →\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >{{ t(\"publish.after\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'current')\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if (hiddenCount(group) > 0) {\r\n <!-- Said out loud: a silently truncated comparison reads as a\r\n complete one to whoever is approving it. -->\r\n <p class=\"mt-2 text-xs text-surface-500\">\r\n {{\r\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\r\n }}\r\n </p>\r\n }\r\n </section>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Project record preview. Loaded only when opened; it is a current\r\n record view, while Comparison is the frozen submitted schedule. -->\r\n @if (projectDetailsConfig(); as projectDetailsConfig) {\r\n @defer (when activeTab() === \"projectDetails\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'projectDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <p class=\"mb-3 text-xs text-surface-500\">\r\n {{ t(\"publish.projectDetailsLiveNote\") }}\r\n </p>\r\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Approval history -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Workflow -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"workflow\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'workflow'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Discussion -->\r\n @if (!readOnly() && canRenderDiscussion()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"resolvedRequestId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }], deferBlockDependencies: [() => [ClientInstancePreview], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2991
2698
|
}
|
|
2992
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
2699
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
|
|
2993
2700
|
type: Component,
|
|
2994
2701
|
args: [{ selector: 'mt-work-center-schedule-publish-type', standalone: true, imports: [
|
|
2995
2702
|
CommonModule,
|
|
@@ -2999,7 +2706,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
2999
2706
|
DiscussionThread,
|
|
3000
2707
|
EntityPreviewBody,
|
|
3001
2708
|
WorkCenterProcessPreview,
|
|
3002
|
-
], template: "<div\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\n *transloco=\"let t; prefix: 'workCenter'\"\n>\n <div\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\n >\n @if (tabOptions().length > 1) {\n <mt-tabs\n [(active)]=\"activeTab\"\n [options]=\"tabOptions()\"\n mode=\"vertical\"\n size=\"small\"\n />\n }\n\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\n <!-- Comparison -->\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'comparison'\"\n >\n <div\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\n >\n @if (loading()) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"loading.schedulePublish\") }}\n </p>\n </div>\n } @else if (error(); as loadError) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-red-600\">\n {{ loadError }}\n </p>\n </div>\n } @else if (!summary().hasSnapshot) {\n <!-- Never published: nothing has been announced, so nothing can\n differ from it. That is a different statement from \"no changes\". -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.neverPublished\") }}\n </p>\n </div>\n } @else if (!summary().needsAttention) {\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\n convergences is publish-empty but must still show its conflicts\n section rather than claim there is nothing here. -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.nothingToPublish\") }}\n </p>\n </div>\n } @else {\n <!-- Counts stay visible while searching, so a filtered view never\n reads as the whole request. -->\n <div class=\"flex flex-wrap items-center gap-2\">\n @if (summary().conflictCount > 0) {\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('conflict')\"\n >{{\n t(\"publish.conflictCount\", {\n count: summary().conflictCount,\n })\n }}</span\n >\n }\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('added')\"\n >{{\n t(\"publish.addedCount\", { count: summary().addedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('changed')\"\n >{{\n t(\"publish.changedCount\", { count: summary().changedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('removed')\"\n >{{\n t(\"publish.removedCount\", { count: summary().removedCount })\n }}</span\n >\n </div>\n\n <input\n type=\"search\"\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\n [placeholder]=\"t('publish.searchPlaceholder')\"\n [value]=\"searchText()\"\n (input)=\"onSearch($any($event.target).value)\"\n />\n\n <div\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n @if (searchFoundNothing()) {\n <div\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"text-sm text-surface-500\">\n {{ t(\"publish.noSearchResults\") }}\n </p>\n </div>\n }\n\n @for (group of groups(); track group.state) {\n <section class=\"mb-4\">\n <header class=\"mb-2 flex items-center gap-2\">\n <h4 class=\"text-sm font-semibold text-surface-700\">\n {{ groupLabel(group.state) }}\n </h4>\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass(group.state)\"\n >{{ group.totalCount }}</span\n >\n </header>\n\n @if (group.state === \"conflict\") {\n <!-- Informational only: unlike the planner's drawer there is\n no keep-mine / use-published control here. The frozen\n plan under approval was captured while the live plan had\n moved on these rows. -->\n <p class=\"mb-2 text-xs text-surface-500\">\n {{ t(\"publish.conflictHint\") }}\n </p>\n }\n\n <ul class=\"flex flex-col gap-1\">\n @for (row of visibleRows(group); track rowKey(row)) {\n <li\n class=\"rounded-md border border-surface-200 bg-surface-0\"\n >\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\n [class.cursor-default]=\"!isExpandable(row)\"\n [attr.aria-expanded]=\"\n isExpandable(row) ? isExpanded(row) : null\n \"\n [disabled]=\"!isExpandable(row)\"\n (click)=\"toggleRow(row)\"\n >\n @if (isExpandable(row)) {\n <span\n class=\"shrink-0 text-xs text-surface-500\"\n aria-hidden=\"true\"\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\n >\n } @else {\n <span\n class=\"w-3 shrink-0\"\n aria-hidden=\"true\"\n ></span>\n }\n <span\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\n >{{ row.name }}</span\n >\n @if (row.type) {\n <span class=\"shrink-0 text-xs text-surface-500\">{{\n row.type\n }}</span>\n }\n </button>\n\n @if (\n group.state === \"conflict\" &&\n publishedMovedFields(row).length > 0\n ) {\n <p\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\n >\n {{ t(\"publish.publishedSideMoved\") }}:\n {{ publishedMovedFields(row).join(\", \") }}\n </p>\n }\n\n @if (isExpandable(row) && isExpanded(row)) {\n <div\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\n >\n @for (\n change of changesFor(row);\n track change.field\n ) {\n <div class=\"flex min-w-0 flex-col gap-1\">\n <span\n class=\"text-xs font-medium text-surface-600\"\n >{{ fieldLabel(change.field) }}</span\n >\n <!-- Before -> After rendered locally rather than\n via mt-comparison-value, whose Before/After\n labels are hardcoded English. Each side still\n goes through mt-entity-preview-body, so a date\n renders as a date and a user as an avatar. -->\n <div\n class=\"flex w-full min-w-0 items-stretch gap-3\"\n >\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\n >{{ t(\"publish.before\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'published')\"\n />\n </div>\n <div\n class=\"flex shrink-0 items-center text-muted-color\"\n aria-hidden=\"true\"\n >\n →\n </div>\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\n >{{ t(\"publish.after\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'current')\"\n />\n </div>\n </div>\n </div>\n }\n </div>\n }\n </li>\n }\n </ul>\n\n @if (hiddenCount(group) > 0) {\n <!-- Said out loud: a silently truncated comparison reads as a\n complete one to whoever is approving it. -->\n <p class=\"mt-2 text-xs text-surface-500\">\n {{\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\n }}\n </p>\n }\n </section>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- Project record preview. Loaded only when opened; it is a current\n record view, while Comparison is the frozen submitted schedule. -->\n @if (projectDetailsConfig(); as projectDetailsConfig) {\n @defer (when activeTab() === \"projectDetails\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'projectDetails'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <p class=\"mb-3 text-xs text-surface-500\">\n {{ t(\"publish.projectDetailsLiveNote\") }}\n </p>\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\n </div>\n </div>\n }\n }\n\n <!-- Approval history -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Workflow -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"workflow\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'workflow'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Discussion -->\n @if (!readOnly() && canRenderDiscussion()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n <div\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\n >\n <mt-discussion-thread\n [moduleType]=\"'ProcessRequest'\"\n [recordId]=\"resolvedRequestId()\"\n [mentionSearchEndpoint]=\"'Identity/users'\"\n [mentionSearchParam]=\"'query'\"\n [mentionSearchDataPath]=\"'data'\"\n [uploadEndpoint]=\"'uploader'\"\n [attachmentDownloadEndpoint]=\"'uploader'\"\n [showParticipants]=\"true\"\n [autoMarkRead]=\"true\"\n [refreshIntervalMs]=\"0\"\n [styleClass]=\"'h-full'\"\n />\n </div>\n </div>\n }\n }\n </div>\n </div>\n</div>\n" }]
|
|
2709
|
+
], template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <!-- Comparison -->\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'comparison'\"\r\n >\r\n <div\r\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\r\n >\r\n @if (loading()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"loading.schedulePublish\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as loadError) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-red-600\">\r\n {{ loadError }}\r\n </p>\r\n </div>\r\n } @else if (!summary().hasSnapshot) {\r\n <!-- Never published: nothing has been announced, so nothing can\r\n differ from it. That is a different statement from \"no changes\". -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.neverPublished\") }}\r\n </p>\r\n </div>\r\n } @else if (!summary().needsAttention) {\r\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\r\n convergences is publish-empty but must still show its conflicts\r\n section rather than claim there is nothing here. -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.nothingToPublish\") }}\r\n </p>\r\n </div>\r\n } @else {\r\n <!-- Counts stay visible while searching, so a filtered view never\r\n reads as the whole request. -->\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @if (summary().conflictCount > 0) {\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('conflict')\"\r\n >{{\r\n t(\"publish.conflictCount\", {\r\n count: summary().conflictCount,\r\n })\r\n }}</span\r\n >\r\n }\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('added')\"\r\n >{{\r\n t(\"publish.addedCount\", { count: summary().addedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('changed')\"\r\n >{{\r\n t(\"publish.changedCount\", { count: summary().changedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('removed')\"\r\n >{{\r\n t(\"publish.removedCount\", { count: summary().removedCount })\r\n }}</span\r\n >\r\n </div>\r\n\r\n <input\r\n type=\"search\"\r\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\r\n [placeholder]=\"t('publish.searchPlaceholder')\"\r\n [value]=\"searchText()\"\r\n (input)=\"onSearch($any($event.target).value)\"\r\n />\r\n\r\n <div\r\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (searchFoundNothing()) {\r\n <div\r\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"text-sm text-surface-500\">\r\n {{ t(\"publish.noSearchResults\") }}\r\n </p>\r\n </div>\r\n }\r\n\r\n @for (group of groups(); track group.state) {\r\n <section class=\"mb-4\">\r\n <header class=\"mb-2 flex items-center gap-2\">\r\n <h4 class=\"text-sm font-semibold text-surface-700\">\r\n {{ groupLabel(group.state) }}\r\n </h4>\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass(group.state)\"\r\n >{{ group.totalCount }}</span\r\n >\r\n </header>\r\n\r\n @if (group.state === \"conflict\") {\r\n <!-- Informational only: unlike the planner's drawer there is\r\n no keep-mine / use-published control here. The frozen\r\n plan under approval was captured while the live plan had\r\n moved on these rows. -->\r\n <p class=\"mb-2 text-xs text-surface-500\">\r\n {{ t(\"publish.conflictHint\") }}\r\n </p>\r\n }\r\n\r\n <ul class=\"flex flex-col gap-1\">\r\n @for (row of visibleRows(group); track rowKey(row)) {\r\n <li\r\n class=\"rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\r\n [class.cursor-default]=\"!isExpandable(row)\"\r\n [attr.aria-expanded]=\"\r\n isExpandable(row) ? isExpanded(row) : null\r\n \"\r\n [disabled]=\"!isExpandable(row)\"\r\n (click)=\"toggleRow(row)\"\r\n >\r\n @if (isExpandable(row)) {\r\n <span\r\n class=\"shrink-0 text-xs text-surface-500\"\r\n aria-hidden=\"true\"\r\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\r\n >\r\n } @else {\r\n <span\r\n class=\"w-3 shrink-0\"\r\n aria-hidden=\"true\"\r\n ></span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\r\n >{{ row.name }}</span\r\n >\r\n @if (row.type) {\r\n <span class=\"shrink-0 text-xs text-surface-500\">{{\r\n row.type\r\n }}</span>\r\n }\r\n </button>\r\n\r\n @if (\r\n group.state === \"conflict\" &&\r\n publishedMovedFields(row).length > 0\r\n ) {\r\n <p\r\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\r\n >\r\n {{ t(\"publish.publishedSideMoved\") }}:\r\n {{ publishedMovedFields(row).join(\", \") }}\r\n </p>\r\n }\r\n\r\n @if (isExpandable(row) && isExpanded(row)) {\r\n <div\r\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\r\n >\r\n @for (\r\n change of changesFor(row);\r\n track change.field\r\n ) {\r\n <div class=\"flex min-w-0 flex-col gap-1\">\r\n <span\r\n class=\"text-xs font-medium text-surface-600\"\r\n >{{ fieldLabel(change.field) }}</span\r\n >\r\n <!-- Before -> After rendered locally rather than\r\n via mt-comparison-value, whose Before/After\r\n labels are hardcoded English. Each side still\r\n goes through mt-entity-preview-body, so a date\r\n renders as a date and a user as an avatar. -->\r\n <div\r\n class=\"flex w-full min-w-0 items-stretch gap-3\"\r\n >\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >{{ t(\"publish.before\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'published')\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex shrink-0 items-center text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n →\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >{{ t(\"publish.after\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'current')\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if (hiddenCount(group) > 0) {\r\n <!-- Said out loud: a silently truncated comparison reads as a\r\n complete one to whoever is approving it. -->\r\n <p class=\"mt-2 text-xs text-surface-500\">\r\n {{\r\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\r\n }}\r\n </p>\r\n }\r\n </section>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Project record preview. Loaded only when opened; it is a current\r\n record view, while Comparison is the frozen submitted schedule. -->\r\n @if (projectDetailsConfig(); as projectDetailsConfig) {\r\n @defer (when activeTab() === \"projectDetails\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'projectDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <p class=\"mb-3 text-xs text-surface-500\">\r\n {{ t(\"publish.projectDetailsLiveNote\") }}\r\n </p>\r\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Approval history -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Workflow -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"workflow\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'workflow'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Discussion -->\r\n @if (!readOnly() && canRenderDiscussion()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"resolvedRequestId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
3003
2710
|
}], ctorParameters: () => [], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }] } }) });
|
|
3004
2711
|
/**
|
|
3005
2712
|
* The comparison arrives on the response root, but several runtime endpoints
|
|
@@ -3999,13 +3706,13 @@ class WorkCenterItemModalFooterActions {
|
|
|
3999
3706
|
};
|
|
4000
3707
|
}
|
|
4001
3708
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4002
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemModalFooterActions, isStandalone: true, selector: "mt-work-center-item-modal-footer-actions", inputs: { contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null }, previewLevelTarget: { classPropertyName: "previewLevelTarget", publicName: "previewLevelTarget", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionExecuted: "actionExecuted", itemUnavailable: "itemUnavailable", previewLevelSelected: "previewLevelSelected", visibilityChange: "visibilityChange" }, host: { classAttribute: "flex w-full flex-1 flex-wrap items-center justify-end gap-2" }, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\n @if (shouldRender()) {\n @if (loading() && !displayActions().length) {\n <span class=\"me-auto text-sm text-surface-500\">{{\n t(\"modal.loadingActions\")\n }}</span>\n }\n\n @if (previewLevelTarget(); as previewLevelTarget) {\n <mt-button\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"loading() || !!pendingActionKey()\"\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\n />\n }\n\n @for (action of displayActions(); track action.actionKey + action.url) {\n <mt-button\n [label]=\"action.label\"\n [severity]=\"action.severity\"\n [variant]=\"action.variant\"\n [disabled]=\"\n loading() || !!pendingActionKey() || action.blockedByContent\n \"\n [tooltip]=\"\n action.blockedByContent\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\n : ''\n \"\n [loading]=\"pendingActionKey() === action.actionKey\"\n (onClick)=\"executeAction(action)\"\n />\n }\n }\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
3709
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemModalFooterActions, isStandalone: true, selector: "mt-work-center-item-modal-footer-actions", inputs: { contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null }, previewLevelTarget: { classPropertyName: "previewLevelTarget", publicName: "previewLevelTarget", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionExecuted: "actionExecuted", itemUnavailable: "itemUnavailable", previewLevelSelected: "previewLevelSelected", visibilityChange: "visibilityChange" }, host: { classAttribute: "flex w-full flex-1 flex-wrap items-center justify-end gap-2" }, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n @if (shouldRender()) {\r\n @if (loading() && !displayActions().length) {\r\n <span class=\"me-auto text-sm text-surface-500\">{{\r\n t(\"modal.loadingActions\")\r\n }}</span>\r\n }\r\n\r\n @if (previewLevelTarget(); as previewLevelTarget) {\r\n <mt-button\r\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [disabled]=\"loading() || !!pendingActionKey()\"\r\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\r\n />\r\n }\r\n\r\n @for (action of displayActions(); track action.actionKey + action.url) {\r\n <mt-button\r\n [label]=\"action.label\"\r\n [severity]=\"action.severity\"\r\n [variant]=\"action.variant\"\r\n [disabled]=\"\r\n loading() || !!pendingActionKey() || action.blockedByContent\r\n \"\r\n [tooltip]=\"\r\n action.blockedByContent\r\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\r\n : ''\r\n \"\r\n [loading]=\"pendingActionKey() === action.actionKey\"\r\n (onClick)=\"executeAction(action)\"\r\n />\r\n }\r\n }\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
4003
3710
|
}
|
|
4004
3711
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, decorators: [{
|
|
4005
3712
|
type: Component,
|
|
4006
3713
|
args: [{ selector: 'mt-work-center-item-modal-footer-actions', standalone: true, imports: [CommonModule, TranslocoDirective, Button], host: {
|
|
4007
3714
|
class: 'flex w-full flex-1 flex-wrap items-center justify-end gap-2',
|
|
4008
|
-
}, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\n @if (shouldRender()) {\n @if (loading() && !displayActions().length) {\n <span class=\"me-auto text-sm text-surface-500\">{{\n t(\"modal.loadingActions\")\n }}</span>\n }\n\n @if (previewLevelTarget(); as previewLevelTarget) {\n <mt-button\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"loading() || !!pendingActionKey()\"\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\n />\n }\n\n @for (action of displayActions(); track action.actionKey + action.url) {\n <mt-button\n [label]=\"action.label\"\n [severity]=\"action.severity\"\n [variant]=\"action.variant\"\n [disabled]=\"\n loading() || !!pendingActionKey() || action.blockedByContent\n \"\n [tooltip]=\"\n action.blockedByContent\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\n : ''\n \"\n [loading]=\"pendingActionKey() === action.actionKey\"\n (onClick)=\"executeAction(action)\"\n />\n }\n }\n</ng-container>\n" }]
|
|
3715
|
+
}, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n @if (shouldRender()) {\r\n @if (loading() && !displayActions().length) {\r\n <span class=\"me-auto text-sm text-surface-500\">{{\r\n t(\"modal.loadingActions\")\r\n }}</span>\r\n }\r\n\r\n @if (previewLevelTarget(); as previewLevelTarget) {\r\n <mt-button\r\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [disabled]=\"loading() || !!pendingActionKey()\"\r\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\r\n />\r\n }\r\n\r\n @for (action of displayActions(); track action.actionKey + action.url) {\r\n <mt-button\r\n [label]=\"action.label\"\r\n [severity]=\"action.severity\"\r\n [variant]=\"action.variant\"\r\n [disabled]=\"\r\n loading() || !!pendingActionKey() || action.blockedByContent\r\n \"\r\n [tooltip]=\"\r\n action.blockedByContent\r\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\r\n : ''\r\n \"\r\n [loading]=\"pendingActionKey() === action.actionKey\"\r\n (onClick)=\"executeAction(action)\"\r\n />\r\n }\r\n }\r\n</ng-container>\r\n" }]
|
|
4009
3716
|
}], ctorParameters: () => [], propDecorators: { contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }], previewLevelTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewLevelTarget", required: false }] }], actionExecuted: [{ type: i0.Output, args: ["actionExecuted"] }], itemUnavailable: [{ type: i0.Output, args: ["itemUnavailable"] }], previewLevelSelected: [{ type: i0.Output, args: ["previewLevelSelected"] }], visibilityChange: [{ type: i0.Output, args: ["visibilityChange"] }] } });
|
|
4010
3717
|
// Only the actions that commit the edited values wait on the form being
|
|
4011
3718
|
// locally valid. A negative outcome — reject, return, terminate — has to stay
|
|
@@ -4493,6 +4200,115 @@ function normalizeCardKey(value) {
|
|
|
4493
4200
|
.replace(/[\s_-]/g, '')
|
|
4494
4201
|
.toLowerCase();
|
|
4495
4202
|
}
|
|
4203
|
+
/**
|
|
4204
|
+
* Strips the user envelope used by `mt-table` user filters down to the
|
|
4205
|
+
* scalar id that the BE rule payload accepts. Falls back to the original
|
|
4206
|
+
* value for non-user shapes (e.g. simple string in a select filter).
|
|
4207
|
+
*/
|
|
4208
|
+
function extractIdScalar(value) {
|
|
4209
|
+
if (value !== null &&
|
|
4210
|
+
typeof value === 'object' &&
|
|
4211
|
+
'id' in value) {
|
|
4212
|
+
return value['id'];
|
|
4213
|
+
}
|
|
4214
|
+
return value;
|
|
4215
|
+
}
|
|
4216
|
+
function toIsoDate(value) {
|
|
4217
|
+
if (value instanceof Date)
|
|
4218
|
+
return value.toISOString();
|
|
4219
|
+
return value;
|
|
4220
|
+
}
|
|
4221
|
+
/**
|
|
4222
|
+
* Translates one in-table column filter value into a `WorkCenterFilterRule`.
|
|
4223
|
+
*
|
|
4224
|
+
* The shape of `raw` depends on the column's filter type — see
|
|
4225
|
+
* `mt-table` `table-filter-field` outputs:
|
|
4226
|
+
* - text → string → `Contains`
|
|
4227
|
+
* - select → scalar | scalar[] → `Eq` | `In`
|
|
4228
|
+
* - boolean → boolean → `Eq`
|
|
4229
|
+
* - date → `{ from?, to?, value? }` (Date|null)→ `Between`/`Gte`/`Lte`/`Eq`
|
|
4230
|
+
* - user → `{ id, ... }` | `{ id, ... }[]` → `Eq` (id) | `In` (ids)
|
|
4231
|
+
*
|
|
4232
|
+
* Returns `null` when the value is empty / nothing to send.
|
|
4233
|
+
*/
|
|
4234
|
+
function toRuntimeFilterRule(field, raw, column) {
|
|
4235
|
+
if (raw === null || raw === undefined || raw === '')
|
|
4236
|
+
return null;
|
|
4237
|
+
if (typeof raw === 'boolean') {
|
|
4238
|
+
return { field, op: 'Eq', value: raw };
|
|
4239
|
+
}
|
|
4240
|
+
if (typeof raw === 'number') {
|
|
4241
|
+
return { field, op: 'Eq', value: raw };
|
|
4242
|
+
}
|
|
4243
|
+
if (typeof raw === 'string') {
|
|
4244
|
+
if (!raw.trim().length)
|
|
4245
|
+
return null;
|
|
4246
|
+
return { field, op: 'Contains', value: raw };
|
|
4247
|
+
}
|
|
4248
|
+
if (Array.isArray(raw)) {
|
|
4249
|
+
const values = raw
|
|
4250
|
+
.map(extractIdScalar)
|
|
4251
|
+
.filter((v) => v !== null && v !== undefined && v !== '');
|
|
4252
|
+
if (!values.length)
|
|
4253
|
+
return null;
|
|
4254
|
+
return { field, op: 'In', values };
|
|
4255
|
+
}
|
|
4256
|
+
if (typeof raw === 'object') {
|
|
4257
|
+
const obj = raw;
|
|
4258
|
+
// User filter envelope -> single-id Eq.
|
|
4259
|
+
if (obj.id !== undefined && obj.id !== null && obj.id !== '') {
|
|
4260
|
+
return { field, op: 'Eq', value: obj.id };
|
|
4261
|
+
}
|
|
4262
|
+
const hasFrom = obj.from !== undefined && obj.from !== null;
|
|
4263
|
+
const hasTo = obj.to !== undefined && obj.to !== null;
|
|
4264
|
+
if (hasFrom && hasTo) {
|
|
4265
|
+
return {
|
|
4266
|
+
field,
|
|
4267
|
+
op: 'Between',
|
|
4268
|
+
from: toIsoDate(obj.from),
|
|
4269
|
+
to: toIsoDate(obj.to),
|
|
4270
|
+
};
|
|
4271
|
+
}
|
|
4272
|
+
if (hasFrom) {
|
|
4273
|
+
return { field, op: 'Gte', value: toIsoDate(obj.from) };
|
|
4274
|
+
}
|
|
4275
|
+
if (hasTo) {
|
|
4276
|
+
return { field, op: 'Lte', value: toIsoDate(obj.to) };
|
|
4277
|
+
}
|
|
4278
|
+
if (obj.value !== undefined && obj.value !== null && obj.value !== '') {
|
|
4279
|
+
const treatAsContains = column?.type === 'text' ||
|
|
4280
|
+
(column?.filterConfig?.type === 'text' &&
|
|
4281
|
+
typeof obj.value === 'string');
|
|
4282
|
+
if (treatAsContains) {
|
|
4283
|
+
return { field, op: 'Contains', value: obj.value };
|
|
4284
|
+
}
|
|
4285
|
+
return { field, op: 'Eq', value: extractIdScalar(obj.value) };
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
return null;
|
|
4289
|
+
}
|
|
4290
|
+
/**
|
|
4291
|
+
* Walks `mt-table`'s filter map and produces the `WorkCenterFilterRule[]`
|
|
4292
|
+
* sent on the BE column-filter slice. The synthetic `generalSearch` key is
|
|
4293
|
+
* skipped because the page keeps general search local-only.
|
|
4294
|
+
*/
|
|
4295
|
+
function buildColumnRuntimeFilters(filters, columns, allowedFields) {
|
|
4296
|
+
if (!filters)
|
|
4297
|
+
return [];
|
|
4298
|
+
const allowed = allowedFields && allowedFields.length ? new Set(allowedFields) : null;
|
|
4299
|
+
const columnByKey = new Map(columns.map((col) => [col.key, col]));
|
|
4300
|
+
const rules = [];
|
|
4301
|
+
for (const [key, raw] of Object.entries(filters)) {
|
|
4302
|
+
if (key === 'generalSearch')
|
|
4303
|
+
continue;
|
|
4304
|
+
if (allowed && !allowed.has(key))
|
|
4305
|
+
continue;
|
|
4306
|
+
const rule = toRuntimeFilterRule(key, raw, columnByKey.get(key));
|
|
4307
|
+
if (rule)
|
|
4308
|
+
rules.push(rule);
|
|
4309
|
+
}
|
|
4310
|
+
return rules;
|
|
4311
|
+
}
|
|
4496
4312
|
function areFilterRulesEqual(left, right) {
|
|
4497
4313
|
return JSON.stringify(left) === JSON.stringify(right);
|
|
4498
4314
|
}
|
|
@@ -4580,6 +4396,7 @@ class WorkCenterPage {
|
|
|
4580
4396
|
groupChanged = output();
|
|
4581
4397
|
context = this.facade.context;
|
|
4582
4398
|
headerFilters = this.facade.headerFilters;
|
|
4399
|
+
tableFilters = signal({}, ...(ngDevMode ? [{ debugName: "tableFilters" }] : /* istanbul ignore next */ []));
|
|
4583
4400
|
selectedItemContextKey = signal(null, ...(ngDevMode ? [{ debugName: "selectedItemContextKey" }] : /* istanbul ignore next */ []));
|
|
4584
4401
|
_menuItems = this.facade.menuItems;
|
|
4585
4402
|
menuItems = computed(() => {
|
|
@@ -4611,6 +4428,21 @@ class WorkCenterPage {
|
|
|
4611
4428
|
columnFilters = this.facade.columnFilters;
|
|
4612
4429
|
loading = this.facade.loading;
|
|
4613
4430
|
groupBy = this.facade.groupBy;
|
|
4431
|
+
/**
|
|
4432
|
+
* Sort and grouping live in the runtime query (and the host's URL), not in
|
|
4433
|
+
* table storage — persisting them locally would let a restored table claim a
|
|
4434
|
+
* grouping the backend query no longer has. Stable reference: a fresh array
|
|
4435
|
+
* per change detection would re-run the table's persistence effect.
|
|
4436
|
+
*/
|
|
4437
|
+
persistStateExclude = [
|
|
4438
|
+
'pagePosition',
|
|
4439
|
+
'sort',
|
|
4440
|
+
'groupBy',
|
|
4441
|
+
];
|
|
4442
|
+
tableColumns = computed(() => this.columns().map((column) => ({
|
|
4443
|
+
...column,
|
|
4444
|
+
sortable: true,
|
|
4445
|
+
})), ...(ngDevMode ? [{ debugName: "tableColumns" }] : /* istanbul ignore next */ []));
|
|
4614
4446
|
/**
|
|
4615
4447
|
* Grouping is executed by the backend as a single sort, so the table's own
|
|
4616
4448
|
* sort state is driven from the query we actually sent instead of the
|
|
@@ -4703,6 +4535,7 @@ class WorkCenterPage {
|
|
|
4703
4535
|
}
|
|
4704
4536
|
// The store drops the previous card's filters and grouping; the table's
|
|
4705
4537
|
// own filter chips live here, so they have to be cleared alongside.
|
|
4538
|
+
this.tableFilters.set({});
|
|
4706
4539
|
this.facade.selectCardAndLoad(this.area(), item.key);
|
|
4707
4540
|
this.cardSelected.emit(item.key);
|
|
4708
4541
|
this.groupChanged.emit(null);
|
|
@@ -4722,6 +4555,7 @@ class WorkCenterPage {
|
|
|
4722
4555
|
}
|
|
4723
4556
|
onRuntimeFiltersCleared() {
|
|
4724
4557
|
this.facade.clearAllFiltersAndLoad(this.area());
|
|
4558
|
+
this.tableFilters.set({});
|
|
4725
4559
|
this.runtimeFiltersChanged.emit([]);
|
|
4726
4560
|
}
|
|
4727
4561
|
/**
|
|
@@ -4761,11 +4595,18 @@ class WorkCenterPage {
|
|
|
4761
4595
|
this.groupChanged.emit(nextGroup);
|
|
4762
4596
|
this.emitSortIfChanged(previousSort);
|
|
4763
4597
|
}
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4598
|
+
onTableLazyLoad(event) {
|
|
4599
|
+
const schema = this.runtimeFilterSchema();
|
|
4600
|
+
const propertyKeys = (schema?.properties ?? [])
|
|
4601
|
+
.map((p) => p?.key)
|
|
4602
|
+
.filter((k) => typeof k === 'string' && k.length > 0);
|
|
4603
|
+
const allowedKeys = schema?.allowedFields ?? [];
|
|
4604
|
+
const allowedFields = propertyKeys.length ? propertyKeys : allowedKeys;
|
|
4605
|
+
const nextColumnFilters = buildColumnRuntimeFilters(event?.filters, this.columns(), allowedFields.length ? allowedFields : undefined);
|
|
4606
|
+
if (!areFilterRulesEqual(nextColumnFilters, this.columnFilters())) {
|
|
4607
|
+
this.facade.applyColumnFiltersAndLoad(this.area(), nextColumnFilters);
|
|
4608
|
+
return;
|
|
4609
|
+
}
|
|
4769
4610
|
const previousSort = this.facade.snapshotContext().sort;
|
|
4770
4611
|
this.facade.applyTableLazyLoadAndLoad(this.area(), event);
|
|
4771
4612
|
this.emitSortIfChanged(previousSort);
|
|
@@ -4864,7 +4705,7 @@ class WorkCenterPage {
|
|
|
4864
4705
|
return normalized.length ? normalized : null;
|
|
4865
4706
|
}
|
|
4866
4707
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4867
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterPage, isStandalone: true, selector: "mt-work-center-page", inputs: { area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, menuIcon: { classPropertyName: "menuIcon", publicName: "menuIcon", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, showSidebar: { classPropertyName: "showSidebar", publicName: "showSidebar", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, bootstrapInputs: { classPropertyName: "bootstrapInputs", publicName: "bootstrapInputs", isSignal: true, isRequired: false, transformFunction: null }, openItemDrawer: { classPropertyName: "openItemDrawer", publicName: "openItemDrawer", isSignal: true, isRequired: false, transformFunction: null }, itemReadOnly: { classPropertyName: "itemReadOnly", publicName: "itemReadOnly", isSignal: true, isRequired: false, transformFunction: null }, openItemsInModal: { classPropertyName: "openItemsInModal", publicName: "openItemsInModal", isSignal: true, isRequired: false, transformFunction: null }, itemModal: { classPropertyName: "itemModal", publicName: "itemModal", isSignal: true, isRequired: false, transformFunction: null }, generalTaskModal: { classPropertyName: "generalTaskModal", publicName: "generalTaskModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { runtimeFiltersChanged: "runtimeFiltersChanged", itemClicked: "itemClicked", cardSelected: "cardSelected", sortChanged: "sortChanged", groupChanged: "groupChanged" }, ngImport: i0, template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-
|
|
4708
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterPage, isStandalone: true, selector: "mt-work-center-page", inputs: { area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, menuIcon: { classPropertyName: "menuIcon", publicName: "menuIcon", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, showSidebar: { classPropertyName: "showSidebar", publicName: "showSidebar", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, bootstrapInputs: { classPropertyName: "bootstrapInputs", publicName: "bootstrapInputs", isSignal: true, isRequired: false, transformFunction: null }, openItemDrawer: { classPropertyName: "openItemDrawer", publicName: "openItemDrawer", isSignal: true, isRequired: false, transformFunction: null }, itemReadOnly: { classPropertyName: "itemReadOnly", publicName: "itemReadOnly", isSignal: true, isRequired: false, transformFunction: null }, openItemsInModal: { classPropertyName: "openItemsInModal", publicName: "openItemsInModal", isSignal: true, isRequired: false, transformFunction: null }, itemModal: { classPropertyName: "itemModal", publicName: "itemModal", isSignal: true, isRequired: false, transformFunction: null }, generalTaskModal: { classPropertyName: "generalTaskModal", publicName: "generalTaskModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { runtimeFiltersChanged: "runtimeFiltersChanged", itemClicked: "itemClicked", cardSelected: "cardSelected", sortChanged: "sortChanged", groupChanged: "groupChanged" }, ngImport: i0, template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"tableColumns()\"\r\n tableLayout=\"auto\"\r\n [clickableRows]=\"rowsClickable()\"\r\n [loading]=\"loading()\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [cellClickFilter]=\"true\"\r\n [generalSearch]=\"true\"\r\n [exportable]=\"true\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [freezeActions]=\"true\"\r\n [lazy]=\"true\"\r\n [lazyLocalSearch]=\"true\"\r\n [lazyTotalRecords]=\"totalCount()\"\r\n [pageSize]=\"context().pageSize\"\r\n [currentPage]=\"context().page - 1\"\r\n [first]=\"(context().page - 1) * context().pageSize\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n [groupCountMap]=\"groupCountMap()\"\r\n [groupBy]=\"groupBy()\"\r\n [sortField]=\"sortField()\"\r\n [sortDirection]=\"sortDirection()\"\r\n storageKey=\"work-center-page-table\"\r\n [persistStateExclude]=\"persistStateExclude\"\r\n [filters]=\"tableFilters()\"\r\n [externalFiltersActive]=\"headerFilters().length > 0\"\r\n (filtersChange)=\"tableFilters.set($event)\"\r\n (filtersCleared)=\"onEmptyStateFiltersCleared()\"\r\n (groupByChange)=\"onTableGroupByChange($event)\"\r\n (lazyLoad)=\"onTableLazyLoad($event)\"\r\n (rowClick)=\"onRowClick($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n\r\n@if (showSidebar()) {\r\n <mt-client-page\r\n [menuIcon]=\"menuIcon()\"\r\n [menuTitle]=\"resolvedPageTitle()\"\r\n [menuItems]=\"menuItems()\"\r\n [menuItemsLoading]=\"loading() && !menuItems().length\"\r\n [activeItem]=\"context().selectedCardKey ?? undefined\"\r\n (menuItemClick)=\"onMenuItemClick($event)\"\r\n >\r\n <ng-template #headerClientPageEnd>\r\n @if (showHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n }\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </mt-client-page>\r\n} @else {\r\n <div class=\"flex h-full min-h-0 flex-col bg-surface-0\">\r\n @if (showHeader()) {\r\n <div\r\n class=\"flex shrink-0 items-center justify-end border-b border-surface px-7 py-4\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n </div>\r\n }\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n@if (selectedItemContextKey(); as contextKey) {\r\n <mt-work-center-item-modal-route\r\n [contextKey]=\"contextKey\"\r\n [manageRouteOutlet]=\"false\"\r\n [showPreviewLevelAction]=\"false\"\r\n [readOnly]=\"itemReadOnly()\"\r\n appendTo=\"body\"\r\n drawerStyleClass=\"mt-work-center-item-drawer !w-[90vw]\"\r\n (closed)=\"selectedItemContextKey.set(null)\"\r\n />\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ClientPage, selector: "mt-client-page", inputs: ["menuIcon", "menuTitle", "menuItems", "menuItemsLoading", "showExpandIcon", "activeItem", "collapsed", "resizable", "storageKey", "storageMode", "minSidebarWidth", "maxSidebarWidth", "defaultSidebarWidth"], outputs: ["collapsedChange", "menuItemClick", "loadChildren"] }, { kind: "component", type: PropertyFilterBuilder, selector: "mt-property-filter-builder", inputs: ["schema", "filters", "title", "buttonLabel", "disabled"], outputs: ["filtersChange", "applied", "cleared"] }, { kind: "component", type: StatisticCard, selector: "mt-statistic-card", inputs: ["data", "cardClass"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: WorkCenterItemModalRoute, selector: "mt-work-center-item-modal-route", inputs: ["contextKey", "manageRouteOutlet", "showPreviewLevelAction", "readOnly", "appendTo", "drawerStyleClass"], outputs: ["previewLevel", "closed"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
4868
4709
|
}
|
|
4869
4710
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, decorators: [{
|
|
4870
4711
|
type: Component,
|
|
@@ -4874,10 +4715,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
4874
4715
|
ClientPage,
|
|
4875
4716
|
PropertyFilterBuilder,
|
|
4876
4717
|
StatisticCard,
|
|
4877
|
-
|
|
4718
|
+
Table,
|
|
4878
4719
|
WorkCenterItemModalRoute,
|
|
4879
4720
|
SkeletonModule,
|
|
4880
|
-
], template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-
|
|
4721
|
+
], template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"tableColumns()\"\r\n tableLayout=\"auto\"\r\n [clickableRows]=\"rowsClickable()\"\r\n [loading]=\"loading()\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [cellClickFilter]=\"true\"\r\n [generalSearch]=\"true\"\r\n [exportable]=\"true\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [freezeActions]=\"true\"\r\n [lazy]=\"true\"\r\n [lazyLocalSearch]=\"true\"\r\n [lazyTotalRecords]=\"totalCount()\"\r\n [pageSize]=\"context().pageSize\"\r\n [currentPage]=\"context().page - 1\"\r\n [first]=\"(context().page - 1) * context().pageSize\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n [groupCountMap]=\"groupCountMap()\"\r\n [groupBy]=\"groupBy()\"\r\n [sortField]=\"sortField()\"\r\n [sortDirection]=\"sortDirection()\"\r\n storageKey=\"work-center-page-table\"\r\n [persistStateExclude]=\"persistStateExclude\"\r\n [filters]=\"tableFilters()\"\r\n [externalFiltersActive]=\"headerFilters().length > 0\"\r\n (filtersChange)=\"tableFilters.set($event)\"\r\n (filtersCleared)=\"onEmptyStateFiltersCleared()\"\r\n (groupByChange)=\"onTableGroupByChange($event)\"\r\n (lazyLoad)=\"onTableLazyLoad($event)\"\r\n (rowClick)=\"onRowClick($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n\r\n@if (showSidebar()) {\r\n <mt-client-page\r\n [menuIcon]=\"menuIcon()\"\r\n [menuTitle]=\"resolvedPageTitle()\"\r\n [menuItems]=\"menuItems()\"\r\n [menuItemsLoading]=\"loading() && !menuItems().length\"\r\n [activeItem]=\"context().selectedCardKey ?? undefined\"\r\n (menuItemClick)=\"onMenuItemClick($event)\"\r\n >\r\n <ng-template #headerClientPageEnd>\r\n @if (showHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n }\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </mt-client-page>\r\n} @else {\r\n <div class=\"flex h-full min-h-0 flex-col bg-surface-0\">\r\n @if (showHeader()) {\r\n <div\r\n class=\"flex shrink-0 items-center justify-end border-b border-surface px-7 py-4\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n </div>\r\n }\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n@if (selectedItemContextKey(); as contextKey) {\r\n <mt-work-center-item-modal-route\r\n [contextKey]=\"contextKey\"\r\n [manageRouteOutlet]=\"false\"\r\n [showPreviewLevelAction]=\"false\"\r\n [readOnly]=\"itemReadOnly()\"\r\n appendTo=\"body\"\r\n drawerStyleClass=\"mt-work-center-item-drawer !w-[90vw]\"\r\n (closed)=\"selectedItemContextKey.set(null)\"\r\n />\r\n}\r\n" }]
|
|
4881
4722
|
}], ctorParameters: () => [], propDecorators: { area: [{ type: i0.Input, args: [{ isSignal: true, alias: "area", required: false }] }], pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], menuIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuIcon", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], showSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSidebar", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], bootstrapInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "bootstrapInputs", required: false }] }], openItemDrawer: [{ type: i0.Input, args: [{ isSignal: true, alias: "openItemDrawer", required: false }] }], itemReadOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemReadOnly", required: false }] }], openItemsInModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "openItemsInModal", required: false }] }], itemModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemModal", required: false }] }], generalTaskModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "generalTaskModal", required: false }] }], runtimeFiltersChanged: [{ type: i0.Output, args: ["runtimeFiltersChanged"] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }], cardSelected: [{ type: i0.Output, args: ["cardSelected"] }], sortChanged: [{ type: i0.Output, args: ["sortChanged"] }], groupChanged: [{ type: i0.Output, args: ["groupChanged"] }] } });
|
|
4882
4723
|
|
|
4883
4724
|
/**
|
|
@@ -4903,5 +4744,5 @@ const APP_STATES = [WorkCenterState];
|
|
|
4903
4744
|
* Generated bundle index. Do not edit.
|
|
4904
4745
|
*/
|
|
4905
4746
|
|
|
4906
|
-
export { APP_STATES, ApplyColumnFilters, ApplyHeaderFilters, ClearAllFilters, EnterArea, HydrateFromContext, LoadRuntime, SCHEDULE_PUBLISH_GROUP_ORDER, SCHEDULE_PUBLISH_OPERATION_KEY, SelectCard, SetGroupBy, SetLookups, SetParams, WORK_CENTER_ACTION_HANDLERS, WORK_CENTER_EMPTY_LABEL, WORK_CENTER_EXTRA_TABS, WORK_CENTER_GROUP_NONE, WORK_CENTER_LEVEL_GROUP_FIELD, WORK_CENTER_LEVEL_NAME_KEY, WORK_CENTER_MAX_FILTERS, WORK_CENTER_MAX_PAGE_SIZE, WORK_CENTER_MAX_SORT, WORK_CENTER_QUERY_VERSION, WORK_CENTER_TYPE_COMPONENTS, WorkCenterActionKey, WorkCenterClientFormModal, WorkCenterFacade, WorkCenterItemModal, WorkCenterItemModalRoute, WorkCenterPage, WorkCenterSchedulePublishType, WorkCenterState, decodeWorkCenterRouteContextKey, encodeWorkCenterRouteContextKey, groupSchedulePublishRows, insertWorkCenterExtraTabs, isSchedulePublishConflictRow, matchesSchedulePublishSearch, parseSchedulePublishChangedFields, readSchedulePublishChanges, resolveWorkCenterActionHandler, resolveWorkCenterExtraTabs, schedulePublishRowKey, sortSchedulePublishRows, summarizeSchedulePublish, windowSchedulePublishRows };
|
|
4747
|
+
export { APP_STATES, ApplyColumnFilters, ApplyHeaderFilters, ClearAllFilters, EnterArea, HydrateFromContext, LoadRuntime, SCHEDULE_PUBLISH_GROUP_ORDER, SCHEDULE_PUBLISH_OPERATION_KEY, SelectCard, SetGroupBy, SetLookups, SetParams, WORK_CENTER_ACTION_HANDLERS, WORK_CENTER_EMPTY_LABEL, WORK_CENTER_EXTRA_TABS, WORK_CENTER_GROUP_NONE, WORK_CENTER_HIDDEN_TABS, WORK_CENTER_LEVEL_GROUP_FIELD, WORK_CENTER_LEVEL_NAME_KEY, WORK_CENTER_MAX_FILTERS, WORK_CENTER_MAX_PAGE_SIZE, WORK_CENTER_MAX_SORT, WORK_CENTER_QUERY_VERSION, WORK_CENTER_TYPE_COMPONENTS, WorkCenterActionKey, WorkCenterClientFormModal, WorkCenterFacade, WorkCenterItemModal, WorkCenterItemModalRoute, WorkCenterPage, WorkCenterSchedulePublishType, WorkCenterState, decodeWorkCenterRouteContextKey, encodeWorkCenterRouteContextKey, groupSchedulePublishRows, insertWorkCenterExtraTabs, isSchedulePublishConflictRow, matchesSchedulePublishSearch, parseSchedulePublishChangedFields, readSchedulePublishChanges, removeWorkCenterHiddenTabs, resolveWorkCenterActionHandler, resolveWorkCenterExtraTabs, schedulePublishRowKey, sortSchedulePublishRows, summarizeSchedulePublish, windowSchedulePublishRows, workCenterFormTabOptions, workCenterInitialFormTab };
|
|
4907
4748
|
//# sourceMappingURL=masterteam-work-center.mjs.map
|