@masterteam/work-center 0.0.88 → 0.0.90
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 -214
- package/assets/i18n/en.json +217 -214
- package/assets/work-center.css +1 -1
- package/fesm2022/{masterteam-work-center-work-center-process-preview-C7ux62UV.mjs → masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs} +2 -2
- package/fesm2022/{masterteam-work-center-work-center-process-preview-C7ux62UV.mjs.map → masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs.map} +1 -1
- package/fesm2022/masterteam-work-center.mjs +212 -114
- package/fesm2022/masterteam-work-center.mjs.map +1 -1
- package/package.json +6 -6
- package/types/masterteam-work-center.d.ts +22 -2
|
@@ -16,17 +16,17 @@ import { catchError, EMPTY, map, take, firstValueFrom, of } from 'rxjs';
|
|
|
16
16
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
17
17
|
import { DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
18
18
|
import { ClientForm, ClientFormWarningsDialog } from '@masterteam/forms/client-form';
|
|
19
|
-
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
19
|
+
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
|
|
20
20
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
21
21
|
import { Drawer } from '@masterteam/components/drawer';
|
|
22
|
-
import { RuntimeActionContextStore, RuntimeActionRunner, RUNTIME_ACTION_CONFIRM_DIALOG, hasActionFormFields, buildActionPayload, resolveActionLabel } from '@masterteam/components/runtime-action';
|
|
22
|
+
import { RuntimeActionContextStore, RuntimeActionRunner, RUNTIME_ACTION_CONFIRM_DIALOG, hasActionFormFields, buildActionPayload, resolveActionLabel, hasActionInputFields } from '@masterteam/components/runtime-action';
|
|
23
23
|
import { Action, Selector, State, Store, select } from '@ngxs/store';
|
|
24
24
|
import { handleApiRequest } from '@masterteam/components';
|
|
25
25
|
import { ClientInstancePreview } from '@masterteam/client-components/client-instance-preview';
|
|
26
26
|
import { EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
|
|
27
27
|
import { Tabs } from '@masterteam/components/tabs';
|
|
28
28
|
import { StructureBuilder } from '@masterteam/structure-builder';
|
|
29
|
-
import {
|
|
29
|
+
import { ToastService } from '@masterteam/components/toast';
|
|
30
30
|
|
|
31
31
|
class WorkCenterClientFormModal {
|
|
32
32
|
modal = inject(ModalService);
|
|
@@ -38,11 +38,33 @@ class WorkCenterClientFormModal {
|
|
|
38
38
|
operationKey = input('Create', ...(ngDevMode ? [{ debugName: "operationKey" }] : /* istanbul ignore next */ []));
|
|
39
39
|
closeOnPendingApproval = input(false, ...(ngDevMode ? [{ debugName: "closeOnPendingApproval" }] : /* istanbul ignore next */ []));
|
|
40
40
|
lookups = input([], ...(ngDevMode ? [{ debugName: "lookups" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/**
|
|
42
|
+
* The runtime action's `payloadTemplate`. Supplies the non-field keys the
|
|
43
|
+
* ClientForm request builder omits for action-style operations (`recordId`,
|
|
44
|
+
* `moduleId`), so an operation opened from a footer action submits against
|
|
45
|
+
* the same record the action was resolved for.
|
|
46
|
+
*/
|
|
47
|
+
submitPayloadTemplate = input(null, ...(ngDevMode ? [{ debugName: "submitPayloadTemplate" }] : /* istanbul ignore next */ []));
|
|
41
48
|
moduleKey = computed(() => this.data().moduleKey, ...(ngDevMode ? [{ debugName: "moduleKey" }] : /* istanbul ignore next */ []));
|
|
42
49
|
moduleId = computed(() => this.toNumber(this.data().moduleId), ...(ngDevMode ? [{ debugName: "moduleId" }] : /* istanbul ignore next */ []));
|
|
43
50
|
levelId = computed(() => this.toNumber(this.data().levelId), ...(ngDevMode ? [{ debugName: "levelId" }] : /* istanbul ignore next */ []));
|
|
44
51
|
levelDataId = computed(() => this.toNumber(this.data().levelDataId), ...(ngDevMode ? [{ debugName: "levelDataId" }] : /* istanbul ignore next */ []));
|
|
45
52
|
moduleDataId = computed(() => this.toNumber(this.data().moduleDataId), ...(ngDevMode ? [{ debugName: "moduleDataId" }] : /* istanbul ignore next */ []));
|
|
53
|
+
recordId = computed(() => this.toNumber(this.data().recordId), ...(ngDevMode ? [{ debugName: "recordId" }] : /* istanbul ignore next */ []));
|
|
54
|
+
submitRequestMapper = (request) => {
|
|
55
|
+
const template = this.submitPayloadTemplate();
|
|
56
|
+
if (!template) {
|
|
57
|
+
return request;
|
|
58
|
+
}
|
|
59
|
+
const next = { ...request };
|
|
60
|
+
if (next.recordId == null && template['recordId'] != null) {
|
|
61
|
+
next.recordId = template['recordId'];
|
|
62
|
+
}
|
|
63
|
+
if (next.moduleId == null && template['moduleId'] != null) {
|
|
64
|
+
next.moduleId = template['moduleId'];
|
|
65
|
+
}
|
|
66
|
+
return next;
|
|
67
|
+
};
|
|
46
68
|
formMode = computed(() => this.moduleDataId() != null ||
|
|
47
69
|
this.operationKey().trim().toLowerCase() === 'update'
|
|
48
70
|
? 'edit'
|
|
@@ -92,12 +114,12 @@ class WorkCenterClientFormModal {
|
|
|
92
114
|
return undefined;
|
|
93
115
|
}
|
|
94
116
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterClientFormModal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
95
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterClientFormModal, isStandalone: true, selector: "mt-work-center-client-form-modal", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, operationKey: { classPropertyName: "operationKey", publicName: "operationKey", isSignal: true, isRequired: false, transformFunction: null }, closeOnPendingApproval: { classPropertyName: "closeOnPendingApproval", publicName: "closeOnPendingApproval", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "processForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, 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 [formMode]=\"formMode()\"\r\n [autoLoad]=\"true\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"lookups()\"\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", dependencies: [{ 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: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }] });
|
|
117
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterClientFormModal, isStandalone: true, selector: "mt-work-center-client-form-modal", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, operationKey: { classPropertyName: "operationKey", publicName: "operationKey", isSignal: true, isRequired: false, transformFunction: null }, closeOnPendingApproval: { classPropertyName: "closeOnPendingApproval", publicName: "closeOnPendingApproval", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, submitPayloadTemplate: { classPropertyName: "submitPayloadTemplate", publicName: "submitPayloadTemplate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "processForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, 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", dependencies: [{ 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: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }] });
|
|
96
118
|
}
|
|
97
119
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterClientFormModal, decorators: [{
|
|
98
120
|
type: Component,
|
|
99
|
-
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 [formMode]=\"formMode()\"\r\n [autoLoad]=\"true\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"lookups()\"\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" }]
|
|
100
|
-
}], 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 }] }] } });
|
|
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" }]
|
|
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 }] }] } });
|
|
101
123
|
|
|
102
124
|
class EnterArea {
|
|
103
125
|
area;
|
|
@@ -1320,43 +1342,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1320
1342
|
}] });
|
|
1321
1343
|
|
|
1322
1344
|
/**
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
1325
|
-
* in both directions:
|
|
1326
|
-
*
|
|
1327
|
-
* - whether the form is locally complete, so the footer can gate its actions;
|
|
1328
|
-
* - the failure messages of the last action, so they can be rendered above the
|
|
1329
|
-
* form instead of squeezed beside the buttons.
|
|
1345
|
+
* Route-scoped channel for whether the modal body has content ready to commit
|
|
1346
|
+
* and why an action is blocked.
|
|
1330
1347
|
*/
|
|
1331
1348
|
class WorkCenterActionFormStore {
|
|
1332
1349
|
formIncomplete = signal(false, ...(ngDevMode ? [{ debugName: "formIncomplete" }] : /* istanbul ignore next */ []));
|
|
1333
|
-
|
|
1334
|
-
errorHosted = signal(false, ...(ngDevMode ? [{ debugName: "errorHosted" }] : /* istanbul ignore next */ []));
|
|
1350
|
+
incompleteMessage = signal(null, ...(ngDevMode ? [{ debugName: "incompleteMessage" }] : /* istanbul ignore next */ []));
|
|
1335
1351
|
/**
|
|
1336
|
-
* True while the on-screen form fails
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1339
|
-
* blocked round trip tells the approver nothing the form is not already
|
|
1340
|
-
* showing next to the offending field.
|
|
1352
|
+
* True while the on-screen form fails local validation or required approval
|
|
1353
|
+
* content is unavailable. The footer disables actions that commit values;
|
|
1354
|
+
* negative outcomes remain available.
|
|
1341
1355
|
*/
|
|
1342
1356
|
incomplete = this.formIncomplete.asReadonly();
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
/**
|
|
1346
|
-
* Set while the modal body is showing the messages itself — the type
|
|
1347
|
-
* components hand them to `mt-client-form`, which renders them in its own
|
|
1348
|
-
* validation summary. The footer keeps its copy only when nothing else
|
|
1349
|
-
* claims them, so an item type with no form still reports a failure.
|
|
1350
|
-
*/
|
|
1351
|
-
hasErrorHost = this.errorHosted.asReadonly();
|
|
1352
|
-
setIncomplete(incomplete) {
|
|
1357
|
+
incompleteReason = this.incompleteMessage.asReadonly();
|
|
1358
|
+
setIncomplete(incomplete, reason = null) {
|
|
1353
1359
|
this.formIncomplete.set(incomplete);
|
|
1354
|
-
|
|
1355
|
-
setErrors(messages) {
|
|
1356
|
-
this.actionErrors.set(messages);
|
|
1357
|
-
}
|
|
1358
|
-
setErrorHost(hosted) {
|
|
1359
|
-
this.errorHosted.set(hosted);
|
|
1360
|
+
this.incompleteMessage.set(incomplete ? reason : null);
|
|
1360
1361
|
}
|
|
1361
1362
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterActionFormStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1362
1363
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterActionFormStore });
|
|
@@ -1813,16 +1814,6 @@ class WorkCenterProcessRequestType {
|
|
|
1813
1814
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
1814
1815
|
clientForm = viewChild(ClientForm, ...(ngDevMode ? [{ debugName: "clientForm" }] : /* istanbul ignore next */ []));
|
|
1815
1816
|
formStatus = signal(null, ...(ngDevMode ? [{ debugName: "formStatus" }] : /* istanbul ignore next */ []));
|
|
1816
|
-
/**
|
|
1817
|
-
* The last action's failure messages, shaped for `mt-client-form` so they
|
|
1818
|
-
* render in its own validation summary — the same red `p-message` list a
|
|
1819
|
-
* rejected submit produces — instead of a panel of our own above the tabs.
|
|
1820
|
-
*/
|
|
1821
|
-
actionMessages = computed(() => (this.formStore?.errors() ?? []).map((message) => ({
|
|
1822
|
-
code: 'FORMULA_FALSE',
|
|
1823
|
-
severity: 'error',
|
|
1824
|
-
message,
|
|
1825
|
-
})), ...(ngDevMode ? [{ debugName: "actionMessages" }] : /* istanbul ignore next */ []));
|
|
1826
1817
|
formLookups = computed(() => this.lookups() ?? this.facade.lookups(), ...(ngDevMode ? [{ debugName: "formLookups" }] : /* istanbul ignore next */ []));
|
|
1827
1818
|
activeTab = signal('requestDetails', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
1828
1819
|
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
@@ -1905,23 +1896,15 @@ class WorkCenterProcessRequestType {
|
|
|
1905
1896
|
const status = this.formStatus();
|
|
1906
1897
|
this.formStore?.setIncomplete(!this.isReadonly() && !!form && status === 'INVALID' && form.isLoaded());
|
|
1907
1898
|
});
|
|
1908
|
-
// The form only draws its validation summary when it has editable sections
|
|
1909
|
-
// to draw it above; without them the footer has to keep reporting failures
|
|
1910
|
-
// itself. Claim the messages only when they will actually be shown.
|
|
1911
|
-
effect(() => {
|
|
1912
|
-
const form = this.clientForm();
|
|
1913
|
-
this.formStore?.setErrorHost(!!form && form.isLoaded() && form.hasEditableFormSections());
|
|
1914
|
-
});
|
|
1915
1899
|
}
|
|
1916
1900
|
ngOnDestroy() {
|
|
1917
1901
|
this.actionContext?.setFormSource(null);
|
|
1918
1902
|
this.formStore?.setIncomplete(false);
|
|
1919
|
-
this.formStore?.setErrorHost(false);
|
|
1920
1903
|
}
|
|
1921
1904
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1922
|
-
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\
|
|
1905
|
+
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\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 <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'requestDetails'\"\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 @if (canRenderForm()) {\n <mt-client-form\n [moduleKey]=\"moduleKey()\"\n [operationKey]=\"operationKey()\"\n [moduleId]=\"moduleId()\"\n [levelId]=\"levelId()\"\n [levelDataId]=\"levelDataId()\"\n [moduleDataId]=\"moduleDataId()\"\n [requestSchemaId]=\"requestSchemaId()\"\n [draftProcessId]=\"draftProcessId()\"\n [readonly]=\"isReadonly()\"\n [renderMode]=\"'sections'\"\n [lookups]=\"formLookups()\"\n />\n } @else {\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(\"context.requestFormUnavailable\") }}\n </p>\n </div>\n }\n </div>\n </div>\n\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n } @else {\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(\"context.requestPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @defer (when activeTab() === \"schema\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'schema'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n } @else {\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(\"context.requestPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @if (!readOnly()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n @if (canRenderDiscussion()) {\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]=\"discussionRecordId()\"\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 } @else {\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(\"context.requestDiscussionUnavailable\") }}\n </p>\n </div>\n }\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: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }], deferBlockDependencies: [() => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
1923
1906
|
}
|
|
1924
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
1907
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
|
|
1925
1908
|
type: Component,
|
|
1926
1909
|
args: [{ selector: 'mt-work-center-process-request-type', standalone: true, imports: [
|
|
1927
1910
|
CommonModule,
|
|
@@ -1930,7 +1913,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
1930
1913
|
ClientForm,
|
|
1931
1914
|
DiscussionThread,
|
|
1932
1915
|
WorkCenterProcessPreview,
|
|
1933
|
-
], template: "<div\
|
|
1916
|
+
], 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 <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'requestDetails'\"\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 @if (canRenderForm()) {\n <mt-client-form\n [moduleKey]=\"moduleKey()\"\n [operationKey]=\"operationKey()\"\n [moduleId]=\"moduleId()\"\n [levelId]=\"levelId()\"\n [levelDataId]=\"levelDataId()\"\n [moduleDataId]=\"moduleDataId()\"\n [requestSchemaId]=\"requestSchemaId()\"\n [draftProcessId]=\"draftProcessId()\"\n [readonly]=\"isReadonly()\"\n [renderMode]=\"'sections'\"\n [lookups]=\"formLookups()\"\n />\n } @else {\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(\"context.requestFormUnavailable\") }}\n </p>\n </div>\n }\n </div>\n </div>\n\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n } @else {\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(\"context.requestPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @defer (when activeTab() === \"schema\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'schema'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n } @else {\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(\"context.requestPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @if (!readOnly()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n @if (canRenderDiscussion()) {\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]=\"discussionRecordId()\"\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 } @else {\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(\"context.requestDiscussionUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n</div>\n" }]
|
|
1934
1917
|
}], 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 }] }] } }) });
|
|
1935
1918
|
|
|
1936
1919
|
class WorkCenterProcessStepType {
|
|
@@ -1948,16 +1931,6 @@ class WorkCenterProcessStepType {
|
|
|
1948
1931
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
1949
1932
|
clientForm = viewChild(ClientForm, ...(ngDevMode ? [{ debugName: "clientForm" }] : /* istanbul ignore next */ []));
|
|
1950
1933
|
formStatus = signal(null, ...(ngDevMode ? [{ debugName: "formStatus" }] : /* istanbul ignore next */ []));
|
|
1951
|
-
/**
|
|
1952
|
-
* The last action's failure messages, shaped for `mt-client-form` so they
|
|
1953
|
-
* render in its own validation summary — the same red `p-message` list a
|
|
1954
|
-
* rejected submit produces — instead of a panel of our own above the tabs.
|
|
1955
|
-
*/
|
|
1956
|
-
actionMessages = computed(() => (this.formStore?.errors() ?? []).map((message) => ({
|
|
1957
|
-
code: 'FORMULA_FALSE',
|
|
1958
|
-
severity: 'error',
|
|
1959
|
-
message,
|
|
1960
|
-
})), ...(ngDevMode ? [{ debugName: "actionMessages" }] : /* istanbul ignore next */ []));
|
|
1961
1934
|
formLookups = computed(() => this.lookups() ?? this.facade.lookups(), ...(ngDevMode ? [{ debugName: "formLookups" }] : /* istanbul ignore next */ []));
|
|
1962
1935
|
activeTab = signal('form', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
1963
1936
|
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
@@ -2080,23 +2053,15 @@ class WorkCenterProcessStepType {
|
|
|
2080
2053
|
const status = this.formStatus();
|
|
2081
2054
|
this.formStore?.setIncomplete(!this.readOnly() && !!form && status === 'INVALID' && form.isLoaded());
|
|
2082
2055
|
});
|
|
2083
|
-
// The form only draws its validation summary when it has editable sections
|
|
2084
|
-
// to draw it above; without them the footer has to keep reporting failures
|
|
2085
|
-
// itself. Claim the messages only when they will actually be shown.
|
|
2086
|
-
effect(() => {
|
|
2087
|
-
const form = this.clientForm();
|
|
2088
|
-
this.formStore?.setErrorHost(!!form && form.isLoaded() && form.hasEditableFormSections());
|
|
2089
|
-
});
|
|
2090
2056
|
}
|
|
2091
2057
|
ngOnDestroy() {
|
|
2092
2058
|
this.actionContext?.setFormSource(null);
|
|
2093
2059
|
this.formStore?.setIncomplete(false);
|
|
2094
|
-
this.formStore?.setErrorHost(false);
|
|
2095
2060
|
}
|
|
2096
2061
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2097
|
-
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\
|
|
2062
|
+
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\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 <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'form'\"\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 @if (canRenderForm()) {\n <mt-client-form\n [moduleKey]=\"moduleKey()\"\n [operationKey]=\"operationKey()\"\n [moduleId]=\"moduleId()\"\n [levelId]=\"levelId()\"\n [levelDataId]=\"levelDataId()\"\n [moduleDataId]=\"moduleDataId()\"\n [requestSchemaId]=\"requestSchemaId()\"\n [draftProcessId]=\"draftProcessId()\"\n [readonly]=\"readOnly()\"\n [renderMode]=\"'sections'\"\n [lookups]=\"formLookups()\"\n />\n } @else {\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(\"context.processFormUnavailable\") }}\n </p>\n </div>\n }\n </div>\n </div>\n\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'levelDetails'\"\n >\n @if (levelDetailsConfig(); as levelDetailsConfig) {\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-client-instance-preview [config]=\"levelDetailsConfig\" />\n </div>\n }\n </div>\n\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n } @else {\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(\"context.processPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @defer (when activeTab() === \"schema\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'schema'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n } @else {\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(\"context.processPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @if (!readOnly()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n @if (canRenderDiscussion()) {\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]=\"discussionRecordId()\"\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 } @else {\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(\"context.processDiscussionUnavailable\") }}\n </p>\n </div>\n }\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: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: ClientInstancePreview, selector: "mt-client-instance-preview", inputs: ["config", "hideEmptyState", "stackOnNarrow"] }], deferBlockDependencies: [() => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2098
2063
|
}
|
|
2099
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
2064
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
|
|
2100
2065
|
type: Component,
|
|
2101
2066
|
args: [{ selector: 'mt-work-center-process-step-type', standalone: true, imports: [
|
|
2102
2067
|
CommonModule,
|
|
@@ -2106,7 +2071,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
2106
2071
|
ClientInstancePreview,
|
|
2107
2072
|
DiscussionThread,
|
|
2108
2073
|
WorkCenterProcessPreview,
|
|
2109
|
-
], template: "<div\
|
|
2074
|
+
], 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 <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'form'\"\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 @if (canRenderForm()) {\n <mt-client-form\n [moduleKey]=\"moduleKey()\"\n [operationKey]=\"operationKey()\"\n [moduleId]=\"moduleId()\"\n [levelId]=\"levelId()\"\n [levelDataId]=\"levelDataId()\"\n [moduleDataId]=\"moduleDataId()\"\n [requestSchemaId]=\"requestSchemaId()\"\n [draftProcessId]=\"draftProcessId()\"\n [readonly]=\"readOnly()\"\n [renderMode]=\"'sections'\"\n [lookups]=\"formLookups()\"\n />\n } @else {\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(\"context.processFormUnavailable\") }}\n </p>\n </div>\n }\n </div>\n </div>\n\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'levelDetails'\"\n >\n @if (levelDetailsConfig(); as levelDetailsConfig) {\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-client-instance-preview [config]=\"levelDetailsConfig\" />\n </div>\n }\n </div>\n\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n } @else {\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(\"context.processPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @defer (when activeTab() === \"schema\") {\n <div\n class=\"flex-1 min-h-0 overflow-auto\"\n [hidden]=\"activeTab() !== 'schema'\"\n >\n @if (canRenderPreview()) {\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n } @else {\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(\"context.processPreviewUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n\n @if (!readOnly()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n @if (canRenderDiscussion()) {\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]=\"discussionRecordId()\"\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 } @else {\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(\"context.processDiscussionUnavailable\") }}\n </p>\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n</div>\n" }]
|
|
2110
2075
|
}], 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 }] }] } }) });
|
|
2111
2076
|
|
|
2112
2077
|
/**
|
|
@@ -2310,6 +2275,9 @@ class WorkCenterSchedulePublishType {
|
|
|
2310
2275
|
http = inject(HttpClient);
|
|
2311
2276
|
transloco = inject(TranslocoService);
|
|
2312
2277
|
destroyRef = inject(DestroyRef);
|
|
2278
|
+
actionFormStore = inject(WorkCenterActionFormStore, {
|
|
2279
|
+
optional: true,
|
|
2280
|
+
});
|
|
2313
2281
|
loadSub;
|
|
2314
2282
|
details = input.required(...(ngDevMode ? [{ debugName: "details" }] : /* istanbul ignore next */ []));
|
|
2315
2283
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
@@ -2327,6 +2295,19 @@ class WorkCenterSchedulePublishType {
|
|
|
2327
2295
|
levelDataId = computed(() => readNumber(this.itemContext(), 'levelDataId'), ...(ngDevMode ? [{ debugName: "levelDataId" }] : /* istanbul ignore next */ []));
|
|
2328
2296
|
moduleKey = computed(() => readString$1(this.itemContext(), 'moduleKey') ?? 'LevelData', ...(ngDevMode ? [{ debugName: "moduleKey" }] : /* istanbul ignore next */ []));
|
|
2329
2297
|
requestSchemaId = computed(() => readNumber(this.itemContext(), 'requestSchemaId'), ...(ngDevMode ? [{ debugName: "requestSchemaId" }] : /* istanbul ignore next */ []));
|
|
2298
|
+
projectDetailsConfig = computed(() => {
|
|
2299
|
+
const levelId = this.levelId();
|
|
2300
|
+
const levelDataId = this.levelDataId();
|
|
2301
|
+
if (!levelId || !levelDataId) {
|
|
2302
|
+
return null;
|
|
2303
|
+
}
|
|
2304
|
+
return {
|
|
2305
|
+
contextKey: `level:${levelId}`,
|
|
2306
|
+
instanceId: levelDataId,
|
|
2307
|
+
displayAreas: ['preview'],
|
|
2308
|
+
processRequestId: this.requestId(),
|
|
2309
|
+
};
|
|
2310
|
+
}, ...(ngDevMode ? [{ debugName: "projectDetailsConfig" }] : /* istanbul ignore next */ []));
|
|
2330
2311
|
summary = computed(() => summarizeSchedulePublish(this.diff()), ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
|
|
2331
2312
|
groups = computed(() => groupSchedulePublishRows(this.diff(), this.searchText()), ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
2332
2313
|
hasSearch = computed(() => this.searchText().trim().length > 0, ...(ngDevMode ? [{ debugName: "hasSearch" }] : /* istanbul ignore next */ []));
|
|
@@ -2343,8 +2324,22 @@ class WorkCenterSchedulePublishType {
|
|
|
2343
2324
|
value: 'comparison',
|
|
2344
2325
|
icon: 'custom.document-approval',
|
|
2345
2326
|
},
|
|
2327
|
+
...(this.projectDetailsConfig()
|
|
2328
|
+
? [
|
|
2329
|
+
{
|
|
2330
|
+
label: this.transloco.translate('workCenter.tabs.projectDetails'),
|
|
2331
|
+
value: 'projectDetails',
|
|
2332
|
+
icon: 'file.folder',
|
|
2333
|
+
},
|
|
2334
|
+
]
|
|
2335
|
+
: []),
|
|
2346
2336
|
...(this.canRenderPreview()
|
|
2347
2337
|
? [
|
|
2338
|
+
{
|
|
2339
|
+
label: this.transloco.translate('workCenter.tabs.approvals'),
|
|
2340
|
+
value: 'approvals',
|
|
2341
|
+
icon: 'custom.document-approval',
|
|
2342
|
+
},
|
|
2348
2343
|
{
|
|
2349
2344
|
label: this.transloco.translate('workCenter.tabs.steps'),
|
|
2350
2345
|
value: 'workflow',
|
|
@@ -2374,12 +2369,31 @@ class WorkCenterSchedulePublishType {
|
|
|
2374
2369
|
untracked(() => this.loadComparison(levelDataId, requestId));
|
|
2375
2370
|
return;
|
|
2376
2371
|
}
|
|
2372
|
+
this.loadSub?.unsubscribe();
|
|
2373
|
+
this.loading.set(false);
|
|
2377
2374
|
this.diff.set(null);
|
|
2378
|
-
this.error.set(
|
|
2375
|
+
this.error.set(this.transloco.translate('workCenter.error.failedLoadSchedulePublish'));
|
|
2376
|
+
});
|
|
2377
|
+
effect(() => {
|
|
2378
|
+
if (this.readOnly()) {
|
|
2379
|
+
this.actionFormStore?.setIncomplete(false);
|
|
2380
|
+
return;
|
|
2381
|
+
}
|
|
2382
|
+
const unavailable = this.loading() || !!this.error() || !this.diff();
|
|
2383
|
+
if (!unavailable) {
|
|
2384
|
+
this.actionFormStore?.setIncomplete(false);
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
const reason = this.loading()
|
|
2388
|
+
? this.transloco.translate('workCenter.loading.schedulePublish')
|
|
2389
|
+
: (this.error() ??
|
|
2390
|
+
this.transloco.translate('workCenter.error.failedLoadSchedulePublish'));
|
|
2391
|
+
this.actionFormStore?.setIncomplete(true, reason);
|
|
2379
2392
|
});
|
|
2380
2393
|
}
|
|
2381
2394
|
ngOnDestroy() {
|
|
2382
2395
|
this.loadSub?.unsubscribe();
|
|
2396
|
+
this.actionFormStore?.setIncomplete(false);
|
|
2383
2397
|
}
|
|
2384
2398
|
onSearch(value) {
|
|
2385
2399
|
this.searchText.set(value);
|
|
@@ -2494,7 +2508,13 @@ class WorkCenterSchedulePublishType {
|
|
|
2494
2508
|
.subscribe({
|
|
2495
2509
|
next: (response) => {
|
|
2496
2510
|
this.loading.set(false);
|
|
2497
|
-
|
|
2511
|
+
const diff = extractDiff(response);
|
|
2512
|
+
if (!diff || typeof diff.hasSnapshot !== 'boolean') {
|
|
2513
|
+
this.diff.set(null);
|
|
2514
|
+
this.error.set(this.transloco.translate('workCenter.error.failedLoadSchedulePublish'));
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
this.diff.set(diff);
|
|
2498
2518
|
},
|
|
2499
2519
|
error: (error) => {
|
|
2500
2520
|
this.loading.set(false);
|
|
@@ -2506,18 +2526,19 @@ class WorkCenterSchedulePublishType {
|
|
|
2506
2526
|
});
|
|
2507
2527
|
}
|
|
2508
2528
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2509
|
-
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 <!-- 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: [() => [import('./masterteam-work-center-work-center-process-preview-C7ux62UV.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2529
|
+
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-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
2510
2530
|
}
|
|
2511
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
2531
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-qG9T9HoP.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
|
|
2512
2532
|
type: Component,
|
|
2513
2533
|
args: [{ selector: 'mt-work-center-schedule-publish-type', standalone: true, imports: [
|
|
2514
2534
|
CommonModule,
|
|
2515
2535
|
TranslocoDirective,
|
|
2516
2536
|
Tabs,
|
|
2537
|
+
ClientInstancePreview,
|
|
2517
2538
|
DiscussionThread,
|
|
2518
2539
|
EntityPreviewBody,
|
|
2519
2540
|
WorkCenterProcessPreview,
|
|
2520
|
-
], 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 <!-- 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" }]
|
|
2541
|
+
], 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" }]
|
|
2521
2542
|
}], ctorParameters: () => [], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }] } }) });
|
|
2522
2543
|
/**
|
|
2523
2544
|
* The comparison arrives on the response root, but several runtime endpoints
|
|
@@ -2709,9 +2730,8 @@ class WorkCenterActionValidationHandler {
|
|
|
2709
2730
|
}, { defaultAfterSuccess, silent: true });
|
|
2710
2731
|
}
|
|
2711
2732
|
/**
|
|
2712
|
-
* One entry per failing rule
|
|
2713
|
-
*
|
|
2714
|
-
* case — transport failures and plain envelope errors.
|
|
2733
|
+
* One entry per failing rule for the caller's validation toast. A
|
|
2734
|
+
* single-entry array is the normal case for plain envelope errors.
|
|
2715
2735
|
*/
|
|
2716
2736
|
resolveErrorMessages(error, fallback) {
|
|
2717
2737
|
if (error instanceof WorkCenterFormValidationError) {
|
|
@@ -2871,7 +2891,7 @@ const SILENT_MESSAGE_HEADERS = new HttpHeaders({ noMessage: 'true' });
|
|
|
2871
2891
|
*
|
|
2872
2892
|
* Three outcomes, all HTTP `200`:
|
|
2873
2893
|
*
|
|
2874
|
-
* - `Blocked` — the action is never sent, and the
|
|
2894
|
+
* - `Blocked` — the action is never sent, and the caller toasts the messages;
|
|
2875
2895
|
* - `Warning` — the messages are shown, and a confirmed prompt hands the
|
|
2876
2896
|
* `validationWarningsToken` to the action that follows;
|
|
2877
2897
|
* - `Valid` — straight through, no token.
|
|
@@ -3093,7 +3113,7 @@ class WorkCenterRuntimeActionExecutor {
|
|
|
3093
3113
|
})();
|
|
3094
3114
|
finalResult = await pendingRun;
|
|
3095
3115
|
// Every backend outcome leaves the action dialog. The footer then
|
|
3096
|
-
// refreshes on success
|
|
3116
|
+
// refreshes on success; errors use the interceptor or a local toast.
|
|
3097
3117
|
return true;
|
|
3098
3118
|
},
|
|
3099
3119
|
},
|
|
@@ -3144,14 +3164,22 @@ function withWarningsToken(payload, warningsToken) {
|
|
|
3144
3164
|
}
|
|
3145
3165
|
|
|
3146
3166
|
const DEFAULT_GENERAL_TASK_MODAL_STYLE_CLASS = '!w-[70vw] !h-[90vh]';
|
|
3167
|
+
/**
|
|
3168
|
+
* An operation-input action renders only the operation's own fields (Update
|
|
3169
|
+
* Progress is a single percentage), so it gets a dialog sized to a short form
|
|
3170
|
+
* rather than the full-height module editor.
|
|
3171
|
+
*/
|
|
3172
|
+
const DEFAULT_OPERATION_MODAL_STYLE_CLASS = '!w-[45vw] max-w-[96vw]';
|
|
3147
3173
|
class WorkCenterItemModalFooterActions {
|
|
3148
3174
|
http = inject(HttpClient);
|
|
3149
3175
|
facade = inject(WorkCenterFacade);
|
|
3150
3176
|
modal = inject(ModalService);
|
|
3177
|
+
toast = inject(ToastService);
|
|
3151
3178
|
transloco = inject(TranslocoService);
|
|
3152
3179
|
actionValidation = inject(WorkCenterActionValidationHandler);
|
|
3153
3180
|
actionExecutor = inject(WorkCenterRuntimeActionExecutor);
|
|
3154
3181
|
formStore = inject(WorkCenterActionFormStore);
|
|
3182
|
+
incompleteReason = this.formStore.incompleteReason;
|
|
3155
3183
|
loadSub;
|
|
3156
3184
|
lastContextKey = null;
|
|
3157
3185
|
currentExecution = null;
|
|
@@ -3169,12 +3197,6 @@ class WorkCenterItemModalFooterActions {
|
|
|
3169
3197
|
reloadTick = signal(0, ...(ngDevMode ? [{ debugName: "reloadTick" }] : /* istanbul ignore next */ []));
|
|
3170
3198
|
hasResolvedLoad = signal(false, ...(ngDevMode ? [{ debugName: "hasResolvedLoad" }] : /* istanbul ignore next */ []));
|
|
3171
3199
|
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
3172
|
-
errors = this.formStore.errors;
|
|
3173
|
-
/**
|
|
3174
|
-
* The modal body renders these above the form whenever it hosts a panel; the
|
|
3175
|
-
* footer keeps its own copy only for the item types that do not.
|
|
3176
|
-
*/
|
|
3177
|
-
showFooterErrors = computed(() => !this.formStore.hasErrorHost() && this.errors().length > 0, ...(ngDevMode ? [{ debugName: "showFooterErrors" }] : /* istanbul ignore next */ []));
|
|
3178
3200
|
actionData = signal(null, ...(ngDevMode ? [{ debugName: "actionData" }] : /* istanbul ignore next */ []));
|
|
3179
3201
|
actions = signal([], ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
3180
3202
|
pendingActionKey = signal(null, ...(ngDevMode ? [{ debugName: "pendingActionKey" }] : /* istanbul ignore next */ []));
|
|
@@ -3187,12 +3209,11 @@ class WorkCenterItemModalFooterActions {
|
|
|
3187
3209
|
label: resolveActionLabel(action),
|
|
3188
3210
|
severity: resolveActionSeverity(action.actionKey, index),
|
|
3189
3211
|
variant: resolveActionVariant(action.actionKey, index),
|
|
3190
|
-
|
|
3212
|
+
blockedByContent: this.formStore.incomplete() && commitsFormValues(action),
|
|
3191
3213
|
})), ...(ngDevMode ? [{ debugName: "displayActions" }] : /* istanbul ignore next */ []));
|
|
3192
3214
|
shouldRender = computed(() => !!this.contextKey() &&
|
|
3193
3215
|
(!this.hasResolvedLoad() ||
|
|
3194
3216
|
this.loading() ||
|
|
3195
|
-
this.showFooterErrors() ||
|
|
3196
3217
|
!!this.previewLevelTarget() ||
|
|
3197
3218
|
this.displayActions().length > 0 ||
|
|
3198
3219
|
!!this.pendingActionKey()), ...(ngDevMode ? [{ debugName: "shouldRender" }] : /* istanbul ignore next */ []));
|
|
@@ -3200,7 +3221,6 @@ class WorkCenterItemModalFooterActions {
|
|
|
3200
3221
|
effect(() => {
|
|
3201
3222
|
const contextKey = this.contextKey();
|
|
3202
3223
|
this.reloadTick();
|
|
3203
|
-
this.formStore.setErrors([]);
|
|
3204
3224
|
if (!contextKey) {
|
|
3205
3225
|
this.lastContextKey = null;
|
|
3206
3226
|
this.actionData.set(null);
|
|
@@ -3241,7 +3261,19 @@ class WorkCenterItemModalFooterActions {
|
|
|
3241
3261
|
this.executeGeneralTaskUpdateAction(action);
|
|
3242
3262
|
return;
|
|
3243
3263
|
}
|
|
3244
|
-
|
|
3264
|
+
// The action declares operation inputs the user still has to supply — its
|
|
3265
|
+
// `payloadTemplate.fields` is a list of `{ propertyKey, value: null }`
|
|
3266
|
+
// placeholders (`Task.UpdateProgress` and friends). Firing it from the
|
|
3267
|
+
// template alone submits those nulls, and the runner would only raise a
|
|
3268
|
+
// plain "are you sure?" confirmation over a payload it then rejects as
|
|
3269
|
+
// incomplete. Such an operation runs through its own form instead:
|
|
3270
|
+
// `process-form-load` → `process-submit/validate` → `process-submit`,
|
|
3271
|
+
// which is exactly what `mt-client-form` does. Mirrors the client-list
|
|
3272
|
+
// record-action path.
|
|
3273
|
+
if (hasActionInputFields(action)) {
|
|
3274
|
+
this.executeOperationInputAction(action);
|
|
3275
|
+
return;
|
|
3276
|
+
}
|
|
3245
3277
|
this.pendingActionKey.set(action.actionKey);
|
|
3246
3278
|
const execution = { actionKey: action.actionKey, cancelled: false };
|
|
3247
3279
|
this.currentExecution = execution;
|
|
@@ -3262,9 +3294,15 @@ class WorkCenterItemModalFooterActions {
|
|
|
3262
3294
|
this.itemUnavailable.emit();
|
|
3263
3295
|
return;
|
|
3264
3296
|
}
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3297
|
+
// The HTTP interceptor owns transport errors. Only errors produced
|
|
3298
|
+
// locally or by the silent validation pre-flight need a toast here.
|
|
3299
|
+
if (!(result.error instanceof HttpErrorResponse)) {
|
|
3300
|
+
this.toast.error(this.actionValidation
|
|
3301
|
+
.resolveErrorMessages(result.error, this.transloco.translate('workCenter.actions.executeFailed', {
|
|
3302
|
+
action: action.label,
|
|
3303
|
+
}))
|
|
3304
|
+
.join(' • '));
|
|
3305
|
+
}
|
|
3268
3306
|
return;
|
|
3269
3307
|
}
|
|
3270
3308
|
const afterSuccess = result.afterSuccess ?? 'refresh';
|
|
@@ -3302,34 +3340,66 @@ class WorkCenterItemModalFooterActions {
|
|
|
3302
3340
|
this.actions.set([]);
|
|
3303
3341
|
this.loading.set(false);
|
|
3304
3342
|
this.hasResolvedLoad.set(true);
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
]);
|
|
3343
|
+
// Runtime item-action reads are silent in the message interceptor.
|
|
3344
|
+
this.toast.error(resolveHttpErrorMessage(error, this.transloco.translate('workCenter.actions.loadActionsFailed')));
|
|
3308
3345
|
},
|
|
3309
3346
|
});
|
|
3310
3347
|
}
|
|
3311
3348
|
executeGeneralTaskUpdateAction(action) {
|
|
3312
|
-
this.formStore.setErrors([]);
|
|
3313
3349
|
const modalData = this.buildGeneralTaskUpdateModalData(action);
|
|
3314
3350
|
if (!modalData.moduleDataId) {
|
|
3315
|
-
this.
|
|
3316
|
-
this.transloco.translate('workCenter.error.missingModuleDataId'),
|
|
3317
|
-
]);
|
|
3351
|
+
this.toast.error(this.transloco.translate('workCenter.error.missingModuleDataId'));
|
|
3318
3352
|
return;
|
|
3319
3353
|
}
|
|
3354
|
+
this.openClientFormModal(action, {
|
|
3355
|
+
data: modalData,
|
|
3356
|
+
operationKey: resolvePayloadString(action, 'operationKey') ?? 'Update',
|
|
3357
|
+
styleClass: DEFAULT_GENERAL_TASK_MODAL_STYLE_CLASS,
|
|
3358
|
+
});
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* Runs an action whose operation declares its own input fields through the
|
|
3362
|
+
* operation's real form. The `payloadTemplate` rides along so the submit
|
|
3363
|
+
* carries the record identity the action was resolved for, the same way the
|
|
3364
|
+
* client-list record actions do.
|
|
3365
|
+
*/
|
|
3366
|
+
executeOperationInputAction(action) {
|
|
3367
|
+
const modalData = buildOperationInputModalData(action, this.actionData()?.context);
|
|
3368
|
+
if (modalData.recordId == null && modalData.moduleDataId == null) {
|
|
3369
|
+
this.toast.error(this.transloco.translate('workCenter.error.missingRecordId'));
|
|
3370
|
+
return;
|
|
3371
|
+
}
|
|
3372
|
+
this.openClientFormModal(action, {
|
|
3373
|
+
data: modalData,
|
|
3374
|
+
operationKey: resolvePayloadString(action, 'operationKey') ?? action.actionKey,
|
|
3375
|
+
styleClass: DEFAULT_OPERATION_MODAL_STYLE_CLASS,
|
|
3376
|
+
// No `allowedFieldKeys`: the effective form is rendered exactly as the
|
|
3377
|
+
// backend returned it. A contract-only operation already comes back with
|
|
3378
|
+
// nothing but its own inputs, and one composed with the configured form
|
|
3379
|
+
// was deliberately composed that way — filtering would hide fields the
|
|
3380
|
+
// backend meant to show.
|
|
3381
|
+
submitPayloadTemplate: action.payloadTemplate ?? null,
|
|
3382
|
+
});
|
|
3383
|
+
}
|
|
3384
|
+
/**
|
|
3385
|
+
* Opens the operation's form and, on a real write, refreshes the footer and
|
|
3386
|
+
* tells the host. A dismissed dialog wrote nothing and refreshes nothing.
|
|
3387
|
+
*/
|
|
3388
|
+
openClientFormModal(action, options) {
|
|
3320
3389
|
this.pendingActionKey.set(action.actionKey);
|
|
3321
3390
|
const execution = { actionKey: action.actionKey, cancelled: false };
|
|
3322
3391
|
this.currentExecution = execution;
|
|
3323
3392
|
const ref = this.modal.openModal(WorkCenterClientFormModal, 'dialog', {
|
|
3324
3393
|
header: resolveActionLabel(action),
|
|
3325
|
-
styleClass:
|
|
3394
|
+
styleClass: options.styleClass,
|
|
3326
3395
|
position: 'end',
|
|
3327
3396
|
dismissableMask: true,
|
|
3328
3397
|
inputValues: {
|
|
3329
|
-
data:
|
|
3330
|
-
operationKey:
|
|
3398
|
+
data: options.data,
|
|
3399
|
+
operationKey: options.operationKey,
|
|
3331
3400
|
closeOnPendingApproval: true,
|
|
3332
3401
|
lookups: this.facade.lookups(),
|
|
3402
|
+
submitPayloadTemplate: options.submitPayloadTemplate ?? null,
|
|
3333
3403
|
},
|
|
3334
3404
|
});
|
|
3335
3405
|
ref.onClose.pipe(take(1)).subscribe((result) => {
|
|
@@ -3372,13 +3442,13 @@ class WorkCenterItemModalFooterActions {
|
|
|
3372
3442
|
};
|
|
3373
3443
|
}
|
|
3374
3444
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3375
|
-
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'\">\
|
|
3445
|
+
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"] }] });
|
|
3376
3446
|
}
|
|
3377
3447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, decorators: [{
|
|
3378
3448
|
type: Component,
|
|
3379
|
-
args: [{ selector: 'mt-work-center-item-modal-footer-actions', standalone: true, imports: [CommonModule, TranslocoDirective, Button
|
|
3449
|
+
args: [{ selector: 'mt-work-center-item-modal-footer-actions', standalone: true, imports: [CommonModule, TranslocoDirective, Button], host: {
|
|
3380
3450
|
class: 'flex w-full flex-1 flex-wrap items-center justify-end gap-2',
|
|
3381
|
-
}, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\
|
|
3451
|
+
}, 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" }]
|
|
3382
3452
|
}], 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"] }] } });
|
|
3383
3453
|
// Only the actions that commit the edited values wait on the form being
|
|
3384
3454
|
// locally valid. A negative outcome — reject, return, terminate — has to stay
|
|
@@ -3392,6 +3462,34 @@ const NEGATIVE_OUTCOME_ACTION_KEYS = new Set([
|
|
|
3392
3462
|
'close',
|
|
3393
3463
|
'delete',
|
|
3394
3464
|
]);
|
|
3465
|
+
/**
|
|
3466
|
+
* The `mt-client-form` context for an operation-input action, read from the
|
|
3467
|
+
* action's own `payloadTemplate` first and the item's action context second.
|
|
3468
|
+
*
|
|
3469
|
+
* Exported for the spec: this mapping is the whole contract between the footer
|
|
3470
|
+
* button and `process-form-load`, and getting `recordId` wrong opens the
|
|
3471
|
+
* operation's form with none of the record's current values.
|
|
3472
|
+
*/
|
|
3473
|
+
function buildOperationInputModalData(action, context) {
|
|
3474
|
+
return {
|
|
3475
|
+
// The action's own module identity, not the item's generic source type: an
|
|
3476
|
+
// operation is registered against the business module (`Task`, `Risk`, …)
|
|
3477
|
+
// and `process-form-load` resolves the operation contract from it.
|
|
3478
|
+
moduleKey: resolvePayloadString(action, 'moduleKey') ??
|
|
3479
|
+
readRecordString(context, 'moduleKey') ??
|
|
3480
|
+
'ModuleData',
|
|
3481
|
+
moduleId: resolvePayloadId(action, 'moduleId') ?? readRecordId(context, 'moduleId'),
|
|
3482
|
+
levelId: resolvePayloadId(action, 'levelId') ?? readRecordId(context, 'levelId'),
|
|
3483
|
+
levelDataId: resolvePayloadId(action, 'levelDataId') ??
|
|
3484
|
+
readRecordId(context, 'levelDataId'),
|
|
3485
|
+
// `recordId`, not `moduleDataId`: a schedule item carries no module-data
|
|
3486
|
+
// row, and this is the identity `process-form-load` needs to return the
|
|
3487
|
+
// current values the form opens on.
|
|
3488
|
+
recordId: resolvePayloadId(action, 'recordId') ??
|
|
3489
|
+
readRecordId(context, 'recordId') ??
|
|
3490
|
+
readRecordId(context, 'instanceId'),
|
|
3491
|
+
};
|
|
3492
|
+
}
|
|
3395
3493
|
function commitsFormValues(action) {
|
|
3396
3494
|
if (NEGATIVE_OUTCOME_ACTION_KEYS.has(normalizeKey(action.actionKey))) {
|
|
3397
3495
|
return false;
|