@masterteam/work-center 0.0.89 → 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 +2 -0
- package/assets/i18n/en.json +2 -0
- 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 +103 -113
- package/fesm2022/masterteam-work-center.mjs.map +1 -1
- package/package.json +6 -6
- package/types/masterteam-work-center.d.ts +3 -0
|
@@ -16,7 +16,7 @@ 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
22
|
import { RuntimeActionContextStore, RuntimeActionRunner, RUNTIME_ACTION_CONFIRM_DIALOG, hasActionFormFields, buildActionPayload, resolveActionLabel, hasActionInputFields } from '@masterteam/components/runtime-action';
|
|
@@ -26,7 +26,7 @@ import { ClientInstancePreview } from '@masterteam/client-components/client-inst
|
|
|
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);
|
|
@@ -114,11 +114,11 @@ class WorkCenterClientFormModal {
|
|
|
114
114
|
return undefined;
|
|
115
115
|
}
|
|
116
116
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterClientFormModal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
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'\">\n <div [class]=\"modal.contentClass + ' p-5 flex flex-col gap-4'\">\n <mt-client-form\n [moduleKey]=\"moduleKey()\"\n [moduleId]=\"moduleId()\"\n [operationKey]=\"operationKey()\"\n [levelId]=\"levelId()\"\n [levelDataId]=\"levelDataId()\"\n [moduleDataId]=\"moduleDataId()\"\n [recordId]=\"recordId()\"\n [formMode]=\"formMode()\"\n [autoLoad]=\"true\"\n [renderMode]=\"'sections'\"\n [lookups]=\"lookups()\"\n [submitRequestMapper]=\"submitRequestMapper\"\n (submitted)=\"onSubmitted($event)\"\n (errored)=\"onErrored($event)\"\n />\n\n @if (isSubmitting()) {\n <div class=\"text-sm text-muted-color\">{{ t(\"modal.submitting\") }}</div>\n }\n\n @if (validationMessage()) {\n <div\n class=\"mt-2 rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-700\"\n role=\"alert\"\n >\n {{ validationMessage() }}\n </div>\n }\n\n @if (submitError()) {\n <div\n class=\"mt-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\n role=\"alert\"\n >\n {{ submitError() }}\n </div>\n }\n\n @if (submitStatus(); as status) {\n <div\n class=\"mt-2 rounded-lg border p-3 text-sm\"\n [class]=\"\n status === 'pending'\n ? 'border-amber-200 bg-amber-50 text-amber-700'\n : 'border-emerald-200 bg-emerald-50 text-emerald-700'\n \"\n >\n @if (status === \"pending\") {\n {{ t(\"modal.requestSubmitted\") }}\n } @else {\n {{ t(\"modal.operationExecuted\") }}\n }\n </div>\n }\n </div>\n\n <div [class]=\"modal.footerClass\">\n <mt-button\n [label]=\"t('modal.cancel')\"\n variant=\"outlined\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"ref.close(false)\"\n />\n <mt-button\n [label]=\"t('modal.submit')\"\n icon=\"general.check\"\n [disabled]=\"\n isSubmitting() || processForm().hasBlockingGovernanceFailure()\n \"\n (onClick)=\"onSubmit()\"\n />\n </div>\n</ng-container>\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"] }] });
|
|
118
118
|
}
|
|
119
119
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterClientFormModal, decorators: [{
|
|
120
120
|
type: Component,
|
|
121
|
-
args: [{ selector: 'mt-work-center-client-form-modal', standalone: true, imports: [Button, TranslocoDirective, ClientForm], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\n <div [class]=\"modal.contentClass + ' p-5 flex flex-col gap-4'\">\n <mt-client-form\n [moduleKey]=\"moduleKey()\"\n [moduleId]=\"moduleId()\"\n [operationKey]=\"operationKey()\"\n [levelId]=\"levelId()\"\n [levelDataId]=\"levelDataId()\"\n [moduleDataId]=\"moduleDataId()\"\n [recordId]=\"recordId()\"\n [formMode]=\"formMode()\"\n [autoLoad]=\"true\"\n [renderMode]=\"'sections'\"\n [lookups]=\"lookups()\"\n [submitRequestMapper]=\"submitRequestMapper\"\n (submitted)=\"onSubmitted($event)\"\n (errored)=\"onErrored($event)\"\n />\n\n @if (isSubmitting()) {\n <div class=\"text-sm text-muted-color\">{{ t(\"modal.submitting\") }}</div>\n }\n\n @if (validationMessage()) {\n <div\n class=\"mt-2 rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-700\"\n role=\"alert\"\n >\n {{ validationMessage() }}\n </div>\n }\n\n @if (submitError()) {\n <div\n class=\"mt-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\n role=\"alert\"\n >\n {{ submitError() }}\n </div>\n }\n\n @if (submitStatus(); as status) {\n <div\n class=\"mt-2 rounded-lg border p-3 text-sm\"\n [class]=\"\n status === 'pending'\n ? 'border-amber-200 bg-amber-50 text-amber-700'\n : 'border-emerald-200 bg-emerald-50 text-emerald-700'\n \"\n >\n @if (status === \"pending\") {\n {{ t(\"modal.requestSubmitted\") }}\n } @else {\n {{ t(\"modal.operationExecuted\") }}\n }\n </div>\n }\n </div>\n\n <div [class]=\"modal.footerClass\">\n <mt-button\n [label]=\"t('modal.cancel')\"\n variant=\"outlined\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"ref.close(false)\"\n />\n <mt-button\n [label]=\"t('modal.submit')\"\n icon=\"general.check\"\n [disabled]=\"\n isSubmitting() || processForm().hasBlockingGovernanceFailure()\n \"\n (onClick)=\"onSubmit()\"\n />\n </div>\n</ng-container>\n" }]
|
|
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
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 }] }] } });
|
|
123
123
|
|
|
124
124
|
class EnterArea {
|
|
@@ -1342,43 +1342,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1342
1342
|
}] });
|
|
1343
1343
|
|
|
1344
1344
|
/**
|
|
1345
|
-
*
|
|
1346
|
-
*
|
|
1347
|
-
* in both directions:
|
|
1348
|
-
*
|
|
1349
|
-
* - whether the form is locally complete, so the footer can gate its actions;
|
|
1350
|
-
* - the failure messages of the last action, so they can be rendered above the
|
|
1351
|
-
* 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.
|
|
1352
1347
|
*/
|
|
1353
1348
|
class WorkCenterActionFormStore {
|
|
1354
1349
|
formIncomplete = signal(false, ...(ngDevMode ? [{ debugName: "formIncomplete" }] : /* istanbul ignore next */ []));
|
|
1355
|
-
|
|
1356
|
-
errorHosted = signal(false, ...(ngDevMode ? [{ debugName: "errorHosted" }] : /* istanbul ignore next */ []));
|
|
1350
|
+
incompleteMessage = signal(null, ...(ngDevMode ? [{ debugName: "incompleteMessage" }] : /* istanbul ignore next */ []));
|
|
1357
1351
|
/**
|
|
1358
|
-
* True while the on-screen form fails
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1361
|
-
* blocked round trip tells the approver nothing the form is not already
|
|
1362
|
-
* 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.
|
|
1363
1355
|
*/
|
|
1364
1356
|
incomplete = this.formIncomplete.asReadonly();
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
/**
|
|
1368
|
-
* Set while the modal body is showing the messages itself — the type
|
|
1369
|
-
* components hand them to `mt-client-form`, which renders them in its own
|
|
1370
|
-
* validation summary. The footer keeps its copy only when nothing else
|
|
1371
|
-
* claims them, so an item type with no form still reports a failure.
|
|
1372
|
-
*/
|
|
1373
|
-
hasErrorHost = this.errorHosted.asReadonly();
|
|
1374
|
-
setIncomplete(incomplete) {
|
|
1357
|
+
incompleteReason = this.incompleteMessage.asReadonly();
|
|
1358
|
+
setIncomplete(incomplete, reason = null) {
|
|
1375
1359
|
this.formIncomplete.set(incomplete);
|
|
1376
|
-
|
|
1377
|
-
setErrors(messages) {
|
|
1378
|
-
this.actionErrors.set(messages);
|
|
1379
|
-
}
|
|
1380
|
-
setErrorHost(hosted) {
|
|
1381
|
-
this.errorHosted.set(hosted);
|
|
1360
|
+
this.incompleteMessage.set(incomplete ? reason : null);
|
|
1382
1361
|
}
|
|
1383
1362
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterActionFormStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1384
1363
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterActionFormStore });
|
|
@@ -1835,16 +1814,6 @@ class WorkCenterProcessRequestType {
|
|
|
1835
1814
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
1836
1815
|
clientForm = viewChild(ClientForm, ...(ngDevMode ? [{ debugName: "clientForm" }] : /* istanbul ignore next */ []));
|
|
1837
1816
|
formStatus = signal(null, ...(ngDevMode ? [{ debugName: "formStatus" }] : /* istanbul ignore next */ []));
|
|
1838
|
-
/**
|
|
1839
|
-
* The last action's failure messages, shaped for `mt-client-form` so they
|
|
1840
|
-
* render in its own validation summary — the same red `p-message` list a
|
|
1841
|
-
* rejected submit produces — instead of a panel of our own above the tabs.
|
|
1842
|
-
*/
|
|
1843
|
-
actionMessages = computed(() => (this.formStore?.errors() ?? []).map((message) => ({
|
|
1844
|
-
code: 'FORMULA_FALSE',
|
|
1845
|
-
severity: 'error',
|
|
1846
|
-
message,
|
|
1847
|
-
})), ...(ngDevMode ? [{ debugName: "actionMessages" }] : /* istanbul ignore next */ []));
|
|
1848
1817
|
formLookups = computed(() => this.lookups() ?? this.facade.lookups(), ...(ngDevMode ? [{ debugName: "formLookups" }] : /* istanbul ignore next */ []));
|
|
1849
1818
|
activeTab = signal('requestDetails', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
1850
1819
|
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
@@ -1927,23 +1896,15 @@ class WorkCenterProcessRequestType {
|
|
|
1927
1896
|
const status = this.formStatus();
|
|
1928
1897
|
this.formStore?.setIncomplete(!this.isReadonly() && !!form && status === 'INVALID' && form.isLoaded());
|
|
1929
1898
|
});
|
|
1930
|
-
// The form only draws its validation summary when it has editable sections
|
|
1931
|
-
// to draw it above; without them the footer has to keep reporting failures
|
|
1932
|
-
// itself. Claim the messages only when they will actually be shown.
|
|
1933
|
-
effect(() => {
|
|
1934
|
-
const form = this.clientForm();
|
|
1935
|
-
this.formStore?.setErrorHost(!!form && form.isLoaded() && form.hasEditableFormSections());
|
|
1936
|
-
});
|
|
1937
1899
|
}
|
|
1938
1900
|
ngOnDestroy() {
|
|
1939
1901
|
this.actionContext?.setFormSource(null);
|
|
1940
1902
|
this.formStore?.setIncomplete(false);
|
|
1941
|
-
this.formStore?.setErrorHost(false);
|
|
1942
1903
|
}
|
|
1943
1904
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1944
|
-
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)]] });
|
|
1945
1906
|
}
|
|
1946
|
-
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: [{
|
|
1947
1908
|
type: Component,
|
|
1948
1909
|
args: [{ selector: 'mt-work-center-process-request-type', standalone: true, imports: [
|
|
1949
1910
|
CommonModule,
|
|
@@ -1952,7 +1913,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
1952
1913
|
ClientForm,
|
|
1953
1914
|
DiscussionThread,
|
|
1954
1915
|
WorkCenterProcessPreview,
|
|
1955
|
-
], 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" }]
|
|
1956
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 }] }] } }) });
|
|
1957
1918
|
|
|
1958
1919
|
class WorkCenterProcessStepType {
|
|
@@ -1970,16 +1931,6 @@ class WorkCenterProcessStepType {
|
|
|
1970
1931
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
1971
1932
|
clientForm = viewChild(ClientForm, ...(ngDevMode ? [{ debugName: "clientForm" }] : /* istanbul ignore next */ []));
|
|
1972
1933
|
formStatus = signal(null, ...(ngDevMode ? [{ debugName: "formStatus" }] : /* istanbul ignore next */ []));
|
|
1973
|
-
/**
|
|
1974
|
-
* The last action's failure messages, shaped for `mt-client-form` so they
|
|
1975
|
-
* render in its own validation summary — the same red `p-message` list a
|
|
1976
|
-
* rejected submit produces — instead of a panel of our own above the tabs.
|
|
1977
|
-
*/
|
|
1978
|
-
actionMessages = computed(() => (this.formStore?.errors() ?? []).map((message) => ({
|
|
1979
|
-
code: 'FORMULA_FALSE',
|
|
1980
|
-
severity: 'error',
|
|
1981
|
-
message,
|
|
1982
|
-
})), ...(ngDevMode ? [{ debugName: "actionMessages" }] : /* istanbul ignore next */ []));
|
|
1983
1934
|
formLookups = computed(() => this.lookups() ?? this.facade.lookups(), ...(ngDevMode ? [{ debugName: "formLookups" }] : /* istanbul ignore next */ []));
|
|
1984
1935
|
activeTab = signal('form', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
1985
1936
|
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
@@ -2102,23 +2053,15 @@ class WorkCenterProcessStepType {
|
|
|
2102
2053
|
const status = this.formStatus();
|
|
2103
2054
|
this.formStore?.setIncomplete(!this.readOnly() && !!form && status === 'INVALID' && form.isLoaded());
|
|
2104
2055
|
});
|
|
2105
|
-
// The form only draws its validation summary when it has editable sections
|
|
2106
|
-
// to draw it above; without them the footer has to keep reporting failures
|
|
2107
|
-
// itself. Claim the messages only when they will actually be shown.
|
|
2108
|
-
effect(() => {
|
|
2109
|
-
const form = this.clientForm();
|
|
2110
|
-
this.formStore?.setErrorHost(!!form && form.isLoaded() && form.hasEditableFormSections());
|
|
2111
|
-
});
|
|
2112
2056
|
}
|
|
2113
2057
|
ngOnDestroy() {
|
|
2114
2058
|
this.actionContext?.setFormSource(null);
|
|
2115
2059
|
this.formStore?.setIncomplete(false);
|
|
2116
|
-
this.formStore?.setErrorHost(false);
|
|
2117
2060
|
}
|
|
2118
2061
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2119
|
-
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)]] });
|
|
2120
2063
|
}
|
|
2121
|
-
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: [{
|
|
2122
2065
|
type: Component,
|
|
2123
2066
|
args: [{ selector: 'mt-work-center-process-step-type', standalone: true, imports: [
|
|
2124
2067
|
CommonModule,
|
|
@@ -2128,7 +2071,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
2128
2071
|
ClientInstancePreview,
|
|
2129
2072
|
DiscussionThread,
|
|
2130
2073
|
WorkCenterProcessPreview,
|
|
2131
|
-
], 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" }]
|
|
2132
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 }] }] } }) });
|
|
2133
2076
|
|
|
2134
2077
|
/**
|
|
@@ -2332,6 +2275,9 @@ class WorkCenterSchedulePublishType {
|
|
|
2332
2275
|
http = inject(HttpClient);
|
|
2333
2276
|
transloco = inject(TranslocoService);
|
|
2334
2277
|
destroyRef = inject(DestroyRef);
|
|
2278
|
+
actionFormStore = inject(WorkCenterActionFormStore, {
|
|
2279
|
+
optional: true,
|
|
2280
|
+
});
|
|
2335
2281
|
loadSub;
|
|
2336
2282
|
details = input.required(...(ngDevMode ? [{ debugName: "details" }] : /* istanbul ignore next */ []));
|
|
2337
2283
|
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
@@ -2349,6 +2295,19 @@ class WorkCenterSchedulePublishType {
|
|
|
2349
2295
|
levelDataId = computed(() => readNumber(this.itemContext(), 'levelDataId'), ...(ngDevMode ? [{ debugName: "levelDataId" }] : /* istanbul ignore next */ []));
|
|
2350
2296
|
moduleKey = computed(() => readString$1(this.itemContext(), 'moduleKey') ?? 'LevelData', ...(ngDevMode ? [{ debugName: "moduleKey" }] : /* istanbul ignore next */ []));
|
|
2351
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 */ []));
|
|
2352
2311
|
summary = computed(() => summarizeSchedulePublish(this.diff()), ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
|
|
2353
2312
|
groups = computed(() => groupSchedulePublishRows(this.diff(), this.searchText()), ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
2354
2313
|
hasSearch = computed(() => this.searchText().trim().length > 0, ...(ngDevMode ? [{ debugName: "hasSearch" }] : /* istanbul ignore next */ []));
|
|
@@ -2365,8 +2324,22 @@ class WorkCenterSchedulePublishType {
|
|
|
2365
2324
|
value: 'comparison',
|
|
2366
2325
|
icon: 'custom.document-approval',
|
|
2367
2326
|
},
|
|
2327
|
+
...(this.projectDetailsConfig()
|
|
2328
|
+
? [
|
|
2329
|
+
{
|
|
2330
|
+
label: this.transloco.translate('workCenter.tabs.projectDetails'),
|
|
2331
|
+
value: 'projectDetails',
|
|
2332
|
+
icon: 'file.folder',
|
|
2333
|
+
},
|
|
2334
|
+
]
|
|
2335
|
+
: []),
|
|
2368
2336
|
...(this.canRenderPreview()
|
|
2369
2337
|
? [
|
|
2338
|
+
{
|
|
2339
|
+
label: this.transloco.translate('workCenter.tabs.approvals'),
|
|
2340
|
+
value: 'approvals',
|
|
2341
|
+
icon: 'custom.document-approval',
|
|
2342
|
+
},
|
|
2370
2343
|
{
|
|
2371
2344
|
label: this.transloco.translate('workCenter.tabs.steps'),
|
|
2372
2345
|
value: 'workflow',
|
|
@@ -2396,12 +2369,31 @@ class WorkCenterSchedulePublishType {
|
|
|
2396
2369
|
untracked(() => this.loadComparison(levelDataId, requestId));
|
|
2397
2370
|
return;
|
|
2398
2371
|
}
|
|
2372
|
+
this.loadSub?.unsubscribe();
|
|
2373
|
+
this.loading.set(false);
|
|
2399
2374
|
this.diff.set(null);
|
|
2400
|
-
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);
|
|
2401
2392
|
});
|
|
2402
2393
|
}
|
|
2403
2394
|
ngOnDestroy() {
|
|
2404
2395
|
this.loadSub?.unsubscribe();
|
|
2396
|
+
this.actionFormStore?.setIncomplete(false);
|
|
2405
2397
|
}
|
|
2406
2398
|
onSearch(value) {
|
|
2407
2399
|
this.searchText.set(value);
|
|
@@ -2516,7 +2508,13 @@ class WorkCenterSchedulePublishType {
|
|
|
2516
2508
|
.subscribe({
|
|
2517
2509
|
next: (response) => {
|
|
2518
2510
|
this.loading.set(false);
|
|
2519
|
-
|
|
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);
|
|
2520
2518
|
},
|
|
2521
2519
|
error: (error) => {
|
|
2522
2520
|
this.loading.set(false);
|
|
@@ -2528,18 +2526,19 @@ class WorkCenterSchedulePublishType {
|
|
|
2528
2526
|
});
|
|
2529
2527
|
}
|
|
2530
2528
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2531
|
-
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)]] });
|
|
2532
2530
|
}
|
|
2533
|
-
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: [{
|
|
2534
2532
|
type: Component,
|
|
2535
2533
|
args: [{ selector: 'mt-work-center-schedule-publish-type', standalone: true, imports: [
|
|
2536
2534
|
CommonModule,
|
|
2537
2535
|
TranslocoDirective,
|
|
2538
2536
|
Tabs,
|
|
2537
|
+
ClientInstancePreview,
|
|
2539
2538
|
DiscussionThread,
|
|
2540
2539
|
EntityPreviewBody,
|
|
2541
2540
|
WorkCenterProcessPreview,
|
|
2542
|
-
], 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" }]
|
|
2543
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 }] }] } }) });
|
|
2544
2543
|
/**
|
|
2545
2544
|
* The comparison arrives on the response root, but several runtime endpoints
|
|
@@ -2731,9 +2730,8 @@ class WorkCenterActionValidationHandler {
|
|
|
2731
2730
|
}, { defaultAfterSuccess, silent: true });
|
|
2732
2731
|
}
|
|
2733
2732
|
/**
|
|
2734
|
-
* One entry per failing rule
|
|
2735
|
-
*
|
|
2736
|
-
* 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.
|
|
2737
2735
|
*/
|
|
2738
2736
|
resolveErrorMessages(error, fallback) {
|
|
2739
2737
|
if (error instanceof WorkCenterFormValidationError) {
|
|
@@ -2893,7 +2891,7 @@ const SILENT_MESSAGE_HEADERS = new HttpHeaders({ noMessage: 'true' });
|
|
|
2893
2891
|
*
|
|
2894
2892
|
* Three outcomes, all HTTP `200`:
|
|
2895
2893
|
*
|
|
2896
|
-
* - `Blocked` — the action is never sent, and the
|
|
2894
|
+
* - `Blocked` — the action is never sent, and the caller toasts the messages;
|
|
2897
2895
|
* - `Warning` — the messages are shown, and a confirmed prompt hands the
|
|
2898
2896
|
* `validationWarningsToken` to the action that follows;
|
|
2899
2897
|
* - `Valid` — straight through, no token.
|
|
@@ -3115,7 +3113,7 @@ class WorkCenterRuntimeActionExecutor {
|
|
|
3115
3113
|
})();
|
|
3116
3114
|
finalResult = await pendingRun;
|
|
3117
3115
|
// Every backend outcome leaves the action dialog. The footer then
|
|
3118
|
-
// refreshes on success
|
|
3116
|
+
// refreshes on success; errors use the interceptor or a local toast.
|
|
3119
3117
|
return true;
|
|
3120
3118
|
},
|
|
3121
3119
|
},
|
|
@@ -3176,10 +3174,12 @@ class WorkCenterItemModalFooterActions {
|
|
|
3176
3174
|
http = inject(HttpClient);
|
|
3177
3175
|
facade = inject(WorkCenterFacade);
|
|
3178
3176
|
modal = inject(ModalService);
|
|
3177
|
+
toast = inject(ToastService);
|
|
3179
3178
|
transloco = inject(TranslocoService);
|
|
3180
3179
|
actionValidation = inject(WorkCenterActionValidationHandler);
|
|
3181
3180
|
actionExecutor = inject(WorkCenterRuntimeActionExecutor);
|
|
3182
3181
|
formStore = inject(WorkCenterActionFormStore);
|
|
3182
|
+
incompleteReason = this.formStore.incompleteReason;
|
|
3183
3183
|
loadSub;
|
|
3184
3184
|
lastContextKey = null;
|
|
3185
3185
|
currentExecution = null;
|
|
@@ -3197,12 +3197,6 @@ class WorkCenterItemModalFooterActions {
|
|
|
3197
3197
|
reloadTick = signal(0, ...(ngDevMode ? [{ debugName: "reloadTick" }] : /* istanbul ignore next */ []));
|
|
3198
3198
|
hasResolvedLoad = signal(false, ...(ngDevMode ? [{ debugName: "hasResolvedLoad" }] : /* istanbul ignore next */ []));
|
|
3199
3199
|
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
3200
|
-
errors = this.formStore.errors;
|
|
3201
|
-
/**
|
|
3202
|
-
* The modal body renders these above the form whenever it hosts a panel; the
|
|
3203
|
-
* footer keeps its own copy only for the item types that do not.
|
|
3204
|
-
*/
|
|
3205
|
-
showFooterErrors = computed(() => !this.formStore.hasErrorHost() && this.errors().length > 0, ...(ngDevMode ? [{ debugName: "showFooterErrors" }] : /* istanbul ignore next */ []));
|
|
3206
3200
|
actionData = signal(null, ...(ngDevMode ? [{ debugName: "actionData" }] : /* istanbul ignore next */ []));
|
|
3207
3201
|
actions = signal([], ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
3208
3202
|
pendingActionKey = signal(null, ...(ngDevMode ? [{ debugName: "pendingActionKey" }] : /* istanbul ignore next */ []));
|
|
@@ -3215,12 +3209,11 @@ class WorkCenterItemModalFooterActions {
|
|
|
3215
3209
|
label: resolveActionLabel(action),
|
|
3216
3210
|
severity: resolveActionSeverity(action.actionKey, index),
|
|
3217
3211
|
variant: resolveActionVariant(action.actionKey, index),
|
|
3218
|
-
|
|
3212
|
+
blockedByContent: this.formStore.incomplete() && commitsFormValues(action),
|
|
3219
3213
|
})), ...(ngDevMode ? [{ debugName: "displayActions" }] : /* istanbul ignore next */ []));
|
|
3220
3214
|
shouldRender = computed(() => !!this.contextKey() &&
|
|
3221
3215
|
(!this.hasResolvedLoad() ||
|
|
3222
3216
|
this.loading() ||
|
|
3223
|
-
this.showFooterErrors() ||
|
|
3224
3217
|
!!this.previewLevelTarget() ||
|
|
3225
3218
|
this.displayActions().length > 0 ||
|
|
3226
3219
|
!!this.pendingActionKey()), ...(ngDevMode ? [{ debugName: "shouldRender" }] : /* istanbul ignore next */ []));
|
|
@@ -3228,7 +3221,6 @@ class WorkCenterItemModalFooterActions {
|
|
|
3228
3221
|
effect(() => {
|
|
3229
3222
|
const contextKey = this.contextKey();
|
|
3230
3223
|
this.reloadTick();
|
|
3231
|
-
this.formStore.setErrors([]);
|
|
3232
3224
|
if (!contextKey) {
|
|
3233
3225
|
this.lastContextKey = null;
|
|
3234
3226
|
this.actionData.set(null);
|
|
@@ -3282,7 +3274,6 @@ class WorkCenterItemModalFooterActions {
|
|
|
3282
3274
|
this.executeOperationInputAction(action);
|
|
3283
3275
|
return;
|
|
3284
3276
|
}
|
|
3285
|
-
this.formStore.setErrors([]);
|
|
3286
3277
|
this.pendingActionKey.set(action.actionKey);
|
|
3287
3278
|
const execution = { actionKey: action.actionKey, cancelled: false };
|
|
3288
3279
|
this.currentExecution = execution;
|
|
@@ -3303,9 +3294,15 @@ class WorkCenterItemModalFooterActions {
|
|
|
3303
3294
|
this.itemUnavailable.emit();
|
|
3304
3295
|
return;
|
|
3305
3296
|
}
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
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
|
+
}
|
|
3309
3306
|
return;
|
|
3310
3307
|
}
|
|
3311
3308
|
const afterSuccess = result.afterSuccess ?? 'refresh';
|
|
@@ -3343,19 +3340,15 @@ class WorkCenterItemModalFooterActions {
|
|
|
3343
3340
|
this.actions.set([]);
|
|
3344
3341
|
this.loading.set(false);
|
|
3345
3342
|
this.hasResolvedLoad.set(true);
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
]);
|
|
3343
|
+
// Runtime item-action reads are silent in the message interceptor.
|
|
3344
|
+
this.toast.error(resolveHttpErrorMessage(error, this.transloco.translate('workCenter.actions.loadActionsFailed')));
|
|
3349
3345
|
},
|
|
3350
3346
|
});
|
|
3351
3347
|
}
|
|
3352
3348
|
executeGeneralTaskUpdateAction(action) {
|
|
3353
|
-
this.formStore.setErrors([]);
|
|
3354
3349
|
const modalData = this.buildGeneralTaskUpdateModalData(action);
|
|
3355
3350
|
if (!modalData.moduleDataId) {
|
|
3356
|
-
this.
|
|
3357
|
-
this.transloco.translate('workCenter.error.missingModuleDataId'),
|
|
3358
|
-
]);
|
|
3351
|
+
this.toast.error(this.transloco.translate('workCenter.error.missingModuleDataId'));
|
|
3359
3352
|
return;
|
|
3360
3353
|
}
|
|
3361
3354
|
this.openClientFormModal(action, {
|
|
@@ -3371,12 +3364,9 @@ class WorkCenterItemModalFooterActions {
|
|
|
3371
3364
|
* client-list record actions do.
|
|
3372
3365
|
*/
|
|
3373
3366
|
executeOperationInputAction(action) {
|
|
3374
|
-
this.formStore.setErrors([]);
|
|
3375
3367
|
const modalData = buildOperationInputModalData(action, this.actionData()?.context);
|
|
3376
3368
|
if (modalData.recordId == null && modalData.moduleDataId == null) {
|
|
3377
|
-
this.
|
|
3378
|
-
this.transloco.translate('workCenter.error.missingRecordId'),
|
|
3379
|
-
]);
|
|
3369
|
+
this.toast.error(this.transloco.translate('workCenter.error.missingRecordId'));
|
|
3380
3370
|
return;
|
|
3381
3371
|
}
|
|
3382
3372
|
this.openClientFormModal(action, {
|
|
@@ -3452,13 +3442,13 @@ class WorkCenterItemModalFooterActions {
|
|
|
3452
3442
|
};
|
|
3453
3443
|
}
|
|
3454
3444
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3455
|
-
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"] }] });
|
|
3456
3446
|
}
|
|
3457
3447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, decorators: [{
|
|
3458
3448
|
type: Component,
|
|
3459
|
-
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: {
|
|
3460
3450
|
class: 'flex w-full flex-1 flex-wrap items-center justify-end gap-2',
|
|
3461
|
-
}, 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" }]
|
|
3462
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"] }] } });
|
|
3463
3453
|
// Only the actions that commit the edited values wait on the form being
|
|
3464
3454
|
// locally valid. A negative outcome — reject, return, terminate — has to stay
|