@masterteam/work-center 0.0.23 → 0.0.25
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.
|
@@ -17,18 +17,14 @@ import { DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
|
17
17
|
import { ClientForm } from '@masterteam/forms/client-form';
|
|
18
18
|
import { Action, Selector, State, Store, select } from '@ngxs/store';
|
|
19
19
|
import { HttpClient } from '@angular/common/http';
|
|
20
|
-
import { handleApiRequest
|
|
20
|
+
import { handleApiRequest } from '@masterteam/components';
|
|
21
21
|
import { EntitiesPreview } from '@masterteam/components/entities';
|
|
22
22
|
import { Tabs } from '@masterteam/components/tabs';
|
|
23
23
|
import { DiscussionThread } from '@masterteam/discussion';
|
|
24
24
|
import { StructureBuilder } from '@masterteam/structure-builder';
|
|
25
|
+
import { RuntimeActionContextStore, RuntimeActionRunner, resolveActionLabel } from '@masterteam/components/runtime-action';
|
|
25
26
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
26
27
|
import { Drawer } from '@masterteam/components/drawer';
|
|
27
|
-
import { ConfirmationService } from '@masterteam/components/confirmation';
|
|
28
|
-
import { ToastService } from '@masterteam/components/toast';
|
|
29
|
-
import * as i1$1 from '@angular/forms';
|
|
30
|
-
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
31
|
-
import { DynamicForm } from '@masterteam/forms/dynamic-form';
|
|
32
28
|
|
|
33
29
|
class WorkCenterClientFormModal {
|
|
34
30
|
modal = inject(ModalService);
|
|
@@ -1294,7 +1290,7 @@ class WorkCenterEscalationInstanceType {
|
|
|
1294
1290
|
});
|
|
1295
1291
|
}
|
|
1296
1292
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterEscalationInstanceType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1297
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterEscalationInstanceType, isStandalone: true, selector: "mt-work-center-escalation-instance-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, 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 <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'escalationDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (canRenderDetails()) {\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.escalationDetails\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as error) {\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 {{ error }}\r\n </p>\r\n </div>\r\n } @else if (preview()) {\r\n <mt-entities-preview [entities]=\"detailEntities()\" />\r\n }\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationDetailsUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderDetails()) {\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.escalationSchema\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as error) {\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 {{ error }}\r\n </p>\r\n </div>\r\n } @else if (hasSchema()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg lg:h-full lg:min-h-0\"\r\n >\r\n <mt-structure-builder\r\n class=\"h-full\"\r\n [readonly]=\"true\"\r\n [nodes]=\"schemaNodes()\"\r\n [connections]=\"schemaConnections()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationSchemaUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationSchemaContextUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'EscalationInstance'\"\r\n [recordId]=\"resolvedInstanceId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\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", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: DiscussionThread, selector: "mt-discussion-thread", inputs: ["moduleType", "recordId", "title", "subtitle", "placeholder", "pageSize", "currentUserId", "requestContext", "mentionableUsers", "mentionSearchEndpoint", "mentionSearchParam", "mentionSearchDataPath", "allowAttachments", "uploadEndpoint", "attachmentDownloadEndpoint", "showParticipants", "autoMarkRead", "refreshIntervalMs", "styleClass", "disabled"], outputs: ["loaded", "errored", "commentCreated", "commentUpdated", "commentDeleted", "readStateChanged"] }, { kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities", "attachmentShape", "clickableKeys", "activeKeys"], outputs: ["entityClick"] }, { kind: "component", type: StructureBuilder, selector: "mt-structure-builder", inputs: ["availableNodes", "availableNodesLabel", "nodeForm", "nodeDialogFooterConfig", "connectionForm", "connectionFormulaSchemaId", "connectionFormulaConfig", "nodeActions", "nodeFields", "isAutoLayout", "readonly", "addModalType", "updateModalType", "addModalStyleClass", "updateModalStyleClass", "addModalHeader", "updateModalHeader", "appendTo", "availableTabsClass", "layoutDirection", "nodes", "connections", "nodeTemplate"], outputs: ["nodeActionsEvent", "action", "nodesChange", "connectionsChange"] }] });
|
|
1293
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterEscalationInstanceType, isStandalone: true, selector: "mt-work-center-escalation-instance-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, 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 <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'escalationDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (canRenderDetails()) {\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.escalationDetails\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as error) {\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 {{ error }}\r\n </p>\r\n </div>\r\n } @else if (preview()) {\r\n <mt-entities-preview [entities]=\"detailEntities()\" />\r\n }\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationDetailsUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderDetails()) {\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.escalationSchema\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as error) {\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 {{ error }}\r\n </p>\r\n </div>\r\n } @else if (hasSchema()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg lg:h-full lg:min-h-0\"\r\n >\r\n <mt-structure-builder\r\n class=\"h-full\"\r\n [readonly]=\"true\"\r\n [nodes]=\"schemaNodes()\"\r\n [connections]=\"schemaConnections()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationSchemaUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationSchemaContextUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'EscalationInstance'\"\r\n [recordId]=\"resolvedInstanceId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.escalationDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\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", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: DiscussionThread, selector: "mt-discussion-thread", inputs: ["moduleType", "recordId", "title", "subtitle", "placeholder", "pageSize", "currentUserId", "requestContext", "mentionableUsers", "mentionSearchEndpoint", "mentionSearchParam", "mentionSearchDataPath", "allowAttachments", "uploadEndpoint", "attachmentDownloadEndpoint", "showParticipants", "autoMarkRead", "refreshIntervalMs", "styleClass", "disabled"], outputs: ["loaded", "errored", "commentCreated", "commentUpdated", "commentDeleted", "readStateChanged"] }, { kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities", "attachmentShape", "clickableKeys", "activeKeys", "clickableTooltip", "activeTooltip"], outputs: ["entityClick"] }, { kind: "component", type: StructureBuilder, selector: "mt-structure-builder", inputs: ["availableNodes", "availableNodesLabel", "nodeForm", "nodeDialogFooterConfig", "connectionForm", "connectionFormulaSchemaId", "connectionFormulaConfig", "nodeActions", "nodeFields", "isAutoLayout", "readonly", "nodeStyle", "addModalType", "updateModalType", "addModalStyleClass", "updateModalStyleClass", "addModalHeader", "updateModalHeader", "appendTo", "availableTabsClass", "layoutDirection", "nodes", "connections", "nodeTemplate"], outputs: ["nodeActionsEvent", "action", "nodesChange", "connectionsChange"] }] });
|
|
1298
1294
|
}
|
|
1299
1295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterEscalationInstanceType, decorators: [{
|
|
1300
1296
|
type: Component,
|
|
@@ -1363,31 +1359,9 @@ function readString(value, key) {
|
|
|
1363
1359
|
return typeof result === 'string' && result.length ? result : undefined;
|
|
1364
1360
|
}
|
|
1365
1361
|
|
|
1366
|
-
class WorkCenterItemActionContextStore {
|
|
1367
|
-
clientForm = signal(null, ...(ngDevMode ? [{ debugName: "clientForm" }] : /* istanbul ignore next */ []));
|
|
1368
|
-
setClientForm(clientForm) {
|
|
1369
|
-
this.clientForm.set(clientForm);
|
|
1370
|
-
}
|
|
1371
|
-
resolveFormValues() {
|
|
1372
|
-
const values = this.clientForm()?.getSubmitValues();
|
|
1373
|
-
return Array.isArray(values)
|
|
1374
|
-
? values.map((value) => ({
|
|
1375
|
-
requestPropertyId: value.requestPropertyId,
|
|
1376
|
-
propertyKey: value.propertyKey,
|
|
1377
|
-
value: value.value,
|
|
1378
|
-
}))
|
|
1379
|
-
: [];
|
|
1380
|
-
}
|
|
1381
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemActionContextStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1382
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemActionContextStore });
|
|
1383
|
-
}
|
|
1384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemActionContextStore, decorators: [{
|
|
1385
|
-
type: Injectable
|
|
1386
|
-
}] });
|
|
1387
|
-
|
|
1388
1362
|
class WorkCenterModuleType {
|
|
1389
1363
|
facade = inject(WorkCenterFacade);
|
|
1390
|
-
actionContext = inject(
|
|
1364
|
+
actionContext = inject(RuntimeActionContextStore, {
|
|
1391
1365
|
optional: true,
|
|
1392
1366
|
});
|
|
1393
1367
|
transloco = inject(TranslocoService);
|
|
@@ -1433,11 +1407,11 @@ class WorkCenterModuleType {
|
|
|
1433
1407
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1434
1408
|
.subscribe((lang) => this.activeLang.set(lang));
|
|
1435
1409
|
effect(() => {
|
|
1436
|
-
this.actionContext?.
|
|
1410
|
+
this.actionContext?.setFormSource(this.clientForm() ?? null);
|
|
1437
1411
|
});
|
|
1438
1412
|
}
|
|
1439
1413
|
ngOnDestroy() {
|
|
1440
|
-
this.actionContext?.
|
|
1414
|
+
this.actionContext?.setFormSource(null);
|
|
1441
1415
|
}
|
|
1442
1416
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterModuleType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1443
1417
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterModuleType, isStandalone: true, selector: "mt-work-center-module-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'details'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [readonly]=\"true\"\r\n [lookups]=\"lookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.moduleFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"discussionModuleType()\"\r\n [recordId]=\"resolvedInstanceId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.moduleDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\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", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "requestSchemaId", "draftProcessId", "preview", "returnUrl", "defaultValues", "submitRequestMapper", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "lookups", "ignoredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: DiscussionThread, selector: "mt-discussion-thread", inputs: ["moduleType", "recordId", "title", "subtitle", "placeholder", "pageSize", "currentUserId", "requestContext", "mentionableUsers", "mentionSearchEndpoint", "mentionSearchParam", "mentionSearchDataPath", "allowAttachments", "uploadEndpoint", "attachmentDownloadEndpoint", "showParticipants", "autoMarkRead", "refreshIntervalMs", "styleClass", "disabled"], outputs: ["loaded", "errored", "commentCreated", "commentUpdated", "commentDeleted", "readStateChanged"] }] });
|
|
@@ -1477,17 +1451,55 @@ class WorkCenterProcessPreview {
|
|
|
1477
1451
|
actionDate: buildEntity('Action Date', 'DateTime', step.actionDate ?? ''),
|
|
1478
1452
|
})), ...(ngDevMode ? [{ debugName: "approvalRows" }] : /* istanbul ignore next */ []));
|
|
1479
1453
|
hasApprovals = computed(() => this.approvalRows().length > 0, ...(ngDevMode ? [{ debugName: "hasApprovals" }] : /* istanbul ignore next */ []));
|
|
1480
|
-
schemaNodes = computed(() => (this.preview()?.schema?.stepsSchema ?? []).map((step) =>
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1454
|
+
schemaNodes = computed(() => (this.preview()?.schema?.stepsSchema ?? []).map((step) => {
|
|
1455
|
+
const isAppAction = step.type === 'AppAction';
|
|
1456
|
+
const color = step.isFinal
|
|
1457
|
+
? '#059669'
|
|
1458
|
+
: step.isInitial
|
|
1459
|
+
? '#2563eb'
|
|
1460
|
+
: isAppAction
|
|
1461
|
+
? '#B45309'
|
|
1462
|
+
: '#0369A1';
|
|
1463
|
+
return {
|
|
1464
|
+
id: String(step.id),
|
|
1465
|
+
name: display(step.name) || String(step.id),
|
|
1466
|
+
color,
|
|
1467
|
+
icon: isAppAction
|
|
1468
|
+
? 'general.zap'
|
|
1469
|
+
: step.isFinal
|
|
1470
|
+
? 'map.flag-04'
|
|
1471
|
+
: step.isInitial
|
|
1472
|
+
? 'map.flag-04'
|
|
1473
|
+
: 'file.clipboard-check',
|
|
1474
|
+
subtitle: step.isInitial
|
|
1475
|
+
? 'Start'
|
|
1476
|
+
: step.isFinal
|
|
1477
|
+
? 'End'
|
|
1478
|
+
: isAppAction
|
|
1479
|
+
? 'App Action'
|
|
1480
|
+
: 'Form Step',
|
|
1481
|
+
badge: step.isInitial ? 'Initial' : step.isFinal ? 'Final' : null,
|
|
1482
|
+
status: step.status ?? null,
|
|
1483
|
+
style: isAppAction ? 'icon' : 'detail',
|
|
1484
|
+
};
|
|
1485
|
+
}), ...(ngDevMode ? [{ debugName: "schemaNodes" }] : /* istanbul ignore next */ []));
|
|
1485
1486
|
schemaConnections = computed(() => (this.preview()?.schema?.connections ?? []).map((connection, index) => ({
|
|
1486
1487
|
id: String(connection.id ?? `${connection.source}-${connection.target}-${index}`),
|
|
1487
1488
|
from: String(connection.source),
|
|
1488
1489
|
to: String(connection.target),
|
|
1490
|
+
state: connection.state,
|
|
1489
1491
|
})), ...(ngDevMode ? [{ debugName: "schemaConnections" }] : /* istanbul ignore next */ []));
|
|
1490
1492
|
hasSchema = computed(() => this.schemaNodes().length > 0, ...(ngDevMode ? [{ debugName: "hasSchema" }] : /* istanbul ignore next */ []));
|
|
1493
|
+
previewNodeFields = {
|
|
1494
|
+
id: 'id',
|
|
1495
|
+
name: 'name',
|
|
1496
|
+
icon: 'icon',
|
|
1497
|
+
color: 'color',
|
|
1498
|
+
subtitle: 'subtitle',
|
|
1499
|
+
badge: 'badge',
|
|
1500
|
+
status: 'status',
|
|
1501
|
+
style: 'style',
|
|
1502
|
+
};
|
|
1491
1503
|
constructor() {
|
|
1492
1504
|
effect(() => {
|
|
1493
1505
|
const requestId = this.requestId() ?? 0;
|
|
@@ -1525,11 +1537,11 @@ class WorkCenterProcessPreview {
|
|
|
1525
1537
|
});
|
|
1526
1538
|
}
|
|
1527
1539
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1528
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessPreview, isStandalone: true, selector: "mt-work-center-process-preview", inputs: { requestId: { classPropertyName: "requestId", publicName: "requestId", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!canRenderPreview()) {\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 Process preview is not available for this item yet.\r\n </p>\r\n </div>\r\n} @else 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=\"text-sm text-surface-500\">Loading process preview...</p>\r\n </div>\r\n} @else if (error()) {\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\">{{ error() }}</p>\r\n </div>\r\n} @else {\r\n @if (view() === \"schema\") {\r\n @if (hasSchema()) {\r\n <div class=\"h-[70vh] overflow-hidden
|
|
1540
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessPreview, isStandalone: true, selector: "mt-work-center-process-preview", inputs: { requestId: { classPropertyName: "requestId", publicName: "requestId", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!canRenderPreview()) {\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 Process preview is not available for this item yet.\r\n </p>\r\n </div>\r\n} @else 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=\"text-sm text-surface-500\">Loading process preview...</p>\r\n </div>\r\n} @else if (error()) {\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\">{{ error() }}</p>\r\n </div>\r\n} @else {\r\n @if (view() === \"schema\") {\r\n @if (hasSchema()) {\r\n <div class=\"h-[70vh] overflow-hidden\">\r\n <mt-structure-builder\r\n class=\"h-full\"\r\n [layoutDirection]=\"'LR'\"\r\n [readonly]=\"true\"\r\n [nodeFields]=\"previewNodeFields\"\r\n [nodes]=\"schemaNodes()\"\r\n [connections]=\"schemaConnections()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n Process steps are not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n } @else if (hasApprovals()) {\r\n <mt-table\r\n [data]=\"approvalRows()\"\r\n [columns]=\"approvalColumns\"\r\n storageKey=\"work-center-process-preview-table\"\r\n [showFilters]=\"false\"\r\n [generalSearch]=\"false\"\r\n [clickableRows]=\"false\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n Process approvals data is not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "exportable", "printable", "groupable", "cellClickFilter", "freezeActions", "printTitle", "exportFilename", "actionShape", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange"] }, { kind: "component", type: StructureBuilder, selector: "mt-structure-builder", inputs: ["availableNodes", "availableNodesLabel", "nodeForm", "nodeDialogFooterConfig", "connectionForm", "connectionFormulaSchemaId", "connectionFormulaConfig", "nodeActions", "nodeFields", "isAutoLayout", "readonly", "nodeStyle", "addModalType", "updateModalType", "addModalStyleClass", "updateModalStyleClass", "addModalHeader", "updateModalHeader", "appendTo", "availableTabsClass", "layoutDirection", "nodes", "connections", "nodeTemplate"], outputs: ["nodeActionsEvent", "action", "nodesChange", "connectionsChange"] }] });
|
|
1529
1541
|
}
|
|
1530
1542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessPreview, decorators: [{
|
|
1531
1543
|
type: Component,
|
|
1532
|
-
args: [{ selector: 'mt-work-center-process-preview', standalone: true, imports: [CommonModule, Table, StructureBuilder], template: "@if (!canRenderPreview()) {\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 Process preview is not available for this item yet.\r\n </p>\r\n </div>\r\n} @else 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=\"text-sm text-surface-500\">Loading process preview...</p>\r\n </div>\r\n} @else if (error()) {\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\">{{ error() }}</p>\r\n </div>\r\n} @else {\r\n @if (view() === \"schema\") {\r\n @if (hasSchema()) {\r\n <div class=\"h-[70vh] overflow-hidden
|
|
1544
|
+
args: [{ selector: 'mt-work-center-process-preview', standalone: true, imports: [CommonModule, Table, StructureBuilder], template: "@if (!canRenderPreview()) {\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 Process preview is not available for this item yet.\r\n </p>\r\n </div>\r\n} @else 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=\"text-sm text-surface-500\">Loading process preview...</p>\r\n </div>\r\n} @else if (error()) {\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\">{{ error() }}</p>\r\n </div>\r\n} @else {\r\n @if (view() === \"schema\") {\r\n @if (hasSchema()) {\r\n <div class=\"h-[70vh] overflow-hidden\">\r\n <mt-structure-builder\r\n class=\"h-full\"\r\n [layoutDirection]=\"'LR'\"\r\n [readonly]=\"true\"\r\n [nodeFields]=\"previewNodeFields\"\r\n [nodes]=\"schemaNodes()\"\r\n [connections]=\"schemaConnections()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n Process steps are not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n } @else if (hasApprovals()) {\r\n <mt-table\r\n [data]=\"approvalRows()\"\r\n [columns]=\"approvalColumns\"\r\n storageKey=\"work-center-process-preview-table\"\r\n [showFilters]=\"false\"\r\n [generalSearch]=\"false\"\r\n [clickableRows]=\"false\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n Process approvals data is not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n}\r\n" }]
|
|
1533
1545
|
}], ctorParameters: () => [], propDecorators: { requestId: [{ type: i0.Input, args: [{ isSignal: true, alias: "requestId", required: false }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }] } });
|
|
1534
1546
|
function buildEntity(name, viewType, value) {
|
|
1535
1547
|
return {
|
|
@@ -1563,7 +1575,7 @@ function display(value) {
|
|
|
1563
1575
|
|
|
1564
1576
|
class WorkCenterProcessRequestType {
|
|
1565
1577
|
facade = inject(WorkCenterFacade);
|
|
1566
|
-
actionContext = inject(
|
|
1578
|
+
actionContext = inject(RuntimeActionContextStore, {
|
|
1567
1579
|
optional: true,
|
|
1568
1580
|
});
|
|
1569
1581
|
transloco = inject(TranslocoService);
|
|
@@ -1619,11 +1631,11 @@ class WorkCenterProcessRequestType {
|
|
|
1619
1631
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1620
1632
|
.subscribe((lang) => this.activeLang.set(lang));
|
|
1621
1633
|
effect(() => {
|
|
1622
|
-
this.actionContext?.
|
|
1634
|
+
this.actionContext?.setFormSource(this.clientForm() ?? null);
|
|
1623
1635
|
});
|
|
1624
1636
|
}
|
|
1625
1637
|
ngOnDestroy() {
|
|
1626
|
-
this.actionContext?.
|
|
1638
|
+
this.actionContext?.setFormSource(null);
|
|
1627
1639
|
}
|
|
1628
1640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1629
1641
|
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 } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [readonly]=\"true\"\r\n [lookups]=\"lookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </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", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "requestSchemaId", "draftProcessId", "preview", "returnUrl", "defaultValues", "submitRequestMapper", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "lookups", "ignoredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: DiscussionThread, selector: "mt-discussion-thread", inputs: ["moduleType", "recordId", "title", "subtitle", "placeholder", "pageSize", "currentUserId", "requestContext", "mentionableUsers", "mentionSearchEndpoint", "mentionSearchParam", "mentionSearchDataPath", "allowAttachments", "uploadEndpoint", "attachmentDownloadEndpoint", "showParticipants", "autoMarkRead", "refreshIntervalMs", "styleClass", "disabled"], outputs: ["loaded", "errored", "commentCreated", "commentUpdated", "commentDeleted", "readStateChanged"] }, { kind: "component", type: WorkCenterProcessPreview, selector: "mt-work-center-process-preview", inputs: ["requestId", "view"] }] });
|
|
@@ -1642,7 +1654,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1642
1654
|
|
|
1643
1655
|
class WorkCenterProcessStepType {
|
|
1644
1656
|
facade = inject(WorkCenterFacade);
|
|
1645
|
-
actionContext = inject(
|
|
1657
|
+
actionContext = inject(RuntimeActionContextStore, {
|
|
1646
1658
|
optional: true,
|
|
1647
1659
|
});
|
|
1648
1660
|
transloco = inject(TranslocoService);
|
|
@@ -1698,11 +1710,11 @@ class WorkCenterProcessStepType {
|
|
|
1698
1710
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1699
1711
|
.subscribe((lang) => this.activeLang.set(lang));
|
|
1700
1712
|
effect(() => {
|
|
1701
|
-
this.actionContext?.
|
|
1713
|
+
this.actionContext?.setFormSource(this.clientForm() ?? null);
|
|
1702
1714
|
});
|
|
1703
1715
|
}
|
|
1704
1716
|
ngOnDestroy() {
|
|
1705
|
-
this.actionContext?.
|
|
1717
|
+
this.actionContext?.setFormSource(null);
|
|
1706
1718
|
}
|
|
1707
1719
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1708
1720
|
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 } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [lookups]=\"lookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n </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", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "requestSchemaId", "draftProcessId", "preview", "returnUrl", "defaultValues", "submitRequestMapper", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "lookups", "ignoredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: DiscussionThread, selector: "mt-discussion-thread", inputs: ["moduleType", "recordId", "title", "subtitle", "placeholder", "pageSize", "currentUserId", "requestContext", "mentionableUsers", "mentionSearchEndpoint", "mentionSearchParam", "mentionSearchDataPath", "allowAttachments", "uploadEndpoint", "attachmentDownloadEndpoint", "showParticipants", "autoMarkRead", "refreshIntervalMs", "styleClass", "disabled"], outputs: ["loaded", "errored", "commentCreated", "commentUpdated", "commentDeleted", "readStateChanged"] }, { kind: "component", type: WorkCenterProcessPreview, selector: "mt-work-center-process-preview", inputs: ["requestId", "view"] }] });
|
|
@@ -1738,164 +1750,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1738
1750
|
}, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n @if (details().type === \"ProcessStep\") {\r\n <mt-work-center-process-step-type [details]=\"details()\" />\r\n } @else if (details().type === \"ProcessRequest\") {\r\n <mt-work-center-process-request-type [details]=\"details()\" />\r\n } @else if (details().type === \"EscalationInstance\") {\r\n <mt-work-center-escalation-instance-type [details]=\"details()\" />\r\n } @else if (details().type === \"Module\") {\r\n <mt-work-center-module-type [details]=\"details()\" />\r\n } @else {\r\n <div class=\"mt-modal-content flex h-full items-center justify-center p-4\">\r\n <p class=\"text-sm text-surface-500\">{{ t(\"modal.unsupportedType\") }}</p>\r\n </div>\r\n }\r\n</ng-container>\r\n" }]
|
|
1739
1751
|
}], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }] } });
|
|
1740
1752
|
|
|
1741
|
-
class WorkCenterItemActionConfirmDialog {
|
|
1742
|
-
ref = inject(ModalRef);
|
|
1743
|
-
modal = inject(ModalService);
|
|
1744
|
-
transloco = inject(TranslocoService);
|
|
1745
|
-
destroyRef = inject(DestroyRef);
|
|
1746
|
-
activeLang = signal(this.transloco.getActiveLang(), ...(ngDevMode ? [{ debugName: "activeLang" }] : /* istanbul ignore next */ []));
|
|
1747
|
-
action = input.required(...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
|
|
1748
|
-
formControl = new FormControl({});
|
|
1749
|
-
actionLabel = computed(() => this.action().actionName?.display || this.action().actionKey, ...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
1750
|
-
formConfig = computed(() => {
|
|
1751
|
-
this.activeLang();
|
|
1752
|
-
return {
|
|
1753
|
-
sections: [
|
|
1754
|
-
{
|
|
1755
|
-
key: 'action-confirmation',
|
|
1756
|
-
type: 'none',
|
|
1757
|
-
fields: buildActionFields(this.action(), (key) => this.transloco.translate(key)),
|
|
1758
|
-
},
|
|
1759
|
-
],
|
|
1760
|
-
};
|
|
1761
|
-
}, ...(ngDevMode ? [{ debugName: "formConfig" }] : /* istanbul ignore next */ []));
|
|
1762
|
-
hasFormFields = computed(() => this.formConfig().sections[0]?.fields.length > 0, ...(ngDevMode ? [{ debugName: "hasFormFields" }] : /* istanbul ignore next */ []));
|
|
1763
|
-
constructor() {
|
|
1764
|
-
this.transloco.langChanges$
|
|
1765
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1766
|
-
.subscribe((lang) => this.activeLang.set(lang));
|
|
1767
|
-
}
|
|
1768
|
-
onCancel() {
|
|
1769
|
-
this.ref.close(null);
|
|
1770
|
-
}
|
|
1771
|
-
onConfirm() {
|
|
1772
|
-
if (this.formControl.invalid) {
|
|
1773
|
-
this.formControl.markAllAsTouched();
|
|
1774
|
-
return;
|
|
1775
|
-
}
|
|
1776
|
-
this.ref.close(this.formControl.getRawValue() ?? {});
|
|
1777
|
-
}
|
|
1778
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemActionConfirmDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1779
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemActionConfirmDialog, isStandalone: true, selector: "mt-work-center-item-action-confirm-dialog", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n <div [class]=\"modal.contentClass + ' p-4'\">\r\n @if (hasFormFields()) {\r\n <mt-dynamic-form\r\n [formConfig]=\"formConfig()\"\r\n [formControl]=\"formControl\"\r\n />\r\n } @else {\r\n <p class=\"text-sm text-surface-500\">\r\n {{ t(\"modal.confirmAction\", { action: actionLabel() }) }}\r\n </p>\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 severity=\"secondary\"\r\n variant=\"outlined\"\r\n (onClick)=\"onCancel()\"\r\n />\r\n <mt-button [label]=\"actionLabel()\" (onClick)=\"onConfirm()\" />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys"], outputs: ["runtimeMessagesChange"] }, { 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"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
1780
|
-
}
|
|
1781
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemActionConfirmDialog, decorators: [{
|
|
1782
|
-
type: Component,
|
|
1783
|
-
args: [{ selector: 'mt-work-center-item-action-confirm-dialog', standalone: true, imports: [
|
|
1784
|
-
CommonModule,
|
|
1785
|
-
ReactiveFormsModule,
|
|
1786
|
-
TranslocoDirective,
|
|
1787
|
-
DynamicForm,
|
|
1788
|
-
Button,
|
|
1789
|
-
], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n <div [class]=\"modal.contentClass + ' p-4'\">\r\n @if (hasFormFields()) {\r\n <mt-dynamic-form\r\n [formConfig]=\"formConfig()\"\r\n [formControl]=\"formControl\"\r\n />\r\n } @else {\r\n <p class=\"text-sm text-surface-500\">\r\n {{ t(\"modal.confirmAction\", { action: actionLabel() }) }}\r\n </p>\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 severity=\"secondary\"\r\n variant=\"outlined\"\r\n (onClick)=\"onCancel()\"\r\n />\r\n <mt-button [label]=\"actionLabel()\" (onClick)=\"onConfirm()\" />\r\n </div>\r\n</ng-container>\r\n" }]
|
|
1790
|
-
}], ctorParameters: () => [], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }] } });
|
|
1791
|
-
function buildActionFields(action, t) {
|
|
1792
|
-
const requestedKeys = new Set(action.payloadKeys ?? []);
|
|
1793
|
-
const requiredKeys = new Set(action.requiredPayloadKeys ?? []);
|
|
1794
|
-
const fields = [];
|
|
1795
|
-
const progressField = resolveProgressField(action);
|
|
1796
|
-
if (progressField) {
|
|
1797
|
-
fields.push({
|
|
1798
|
-
key: 'progress',
|
|
1799
|
-
type: 'slider',
|
|
1800
|
-
label: t('workCenter.field.progress'),
|
|
1801
|
-
min: 0,
|
|
1802
|
-
max: 100,
|
|
1803
|
-
step: 1,
|
|
1804
|
-
unit: '%',
|
|
1805
|
-
validators: buildRequiredValidators(requiredKeys.has('fields')),
|
|
1806
|
-
defaultValue: progressField.value,
|
|
1807
|
-
colSpan: 12,
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
if (requestedKeys.has('delegatedUser')) {
|
|
1811
|
-
fields.push({
|
|
1812
|
-
key: 'delegatedUser',
|
|
1813
|
-
type: 'user-search',
|
|
1814
|
-
label: t('workCenter.field.delegatedUser'),
|
|
1815
|
-
placeholder: t('workCenter.field.delegatedUserPlaceholder'),
|
|
1816
|
-
apiUrl: 'Identity/users',
|
|
1817
|
-
optionLabel: 'displayName',
|
|
1818
|
-
optionValue: 'id',
|
|
1819
|
-
validators: buildRequiredValidators(requiredKeys.has('delegatedUser')),
|
|
1820
|
-
colSpan: 12,
|
|
1821
|
-
});
|
|
1822
|
-
}
|
|
1823
|
-
if (requestedKeys.has('reason')) {
|
|
1824
|
-
fields.push({
|
|
1825
|
-
key: 'reason',
|
|
1826
|
-
type: 'textarea',
|
|
1827
|
-
label: t('workCenter.field.reason'),
|
|
1828
|
-
placeholder: t('workCenter.field.reasonPlaceholder'),
|
|
1829
|
-
rows: 4,
|
|
1830
|
-
validators: buildRequiredValidators(requiredKeys.has('reason')),
|
|
1831
|
-
colSpan: 12,
|
|
1832
|
-
});
|
|
1833
|
-
}
|
|
1834
|
-
if (requestedKeys.has('note')) {
|
|
1835
|
-
fields.push({
|
|
1836
|
-
key: 'note',
|
|
1837
|
-
type: 'textarea',
|
|
1838
|
-
label: t('workCenter.field.note'),
|
|
1839
|
-
placeholder: t('workCenter.field.notePlaceholder'),
|
|
1840
|
-
rows: 4,
|
|
1841
|
-
validators: buildRequiredValidators(requiredKeys.has('note')),
|
|
1842
|
-
colSpan: 12,
|
|
1843
|
-
});
|
|
1844
|
-
}
|
|
1845
|
-
if (requestedKeys.has('attachments')) {
|
|
1846
|
-
fields.push({
|
|
1847
|
-
key: 'attachments',
|
|
1848
|
-
type: 'upload-file',
|
|
1849
|
-
label: t('workCenter.field.attachments'),
|
|
1850
|
-
endPoint: 'uploader',
|
|
1851
|
-
multiple: true,
|
|
1852
|
-
title: t('workCenter.field.uploadTitle'),
|
|
1853
|
-
description: t('workCenter.field.uploadDescription'),
|
|
1854
|
-
validators: buildRequiredValidators(requiredKeys.has('attachments')),
|
|
1855
|
-
colSpan: 12,
|
|
1856
|
-
});
|
|
1857
|
-
}
|
|
1858
|
-
return fields;
|
|
1859
|
-
}
|
|
1860
|
-
function buildRequiredValidators(required) {
|
|
1861
|
-
return required ? [ValidatorConfig.required()] : [];
|
|
1862
|
-
}
|
|
1863
|
-
function resolveProgressField(action) {
|
|
1864
|
-
const fields = action.payloadTemplate
|
|
1865
|
-
?.fields;
|
|
1866
|
-
if (!Array.isArray(fields)) {
|
|
1867
|
-
return null;
|
|
1868
|
-
}
|
|
1869
|
-
const progressField = fields.find((field) => !!field &&
|
|
1870
|
-
typeof field === 'object' &&
|
|
1871
|
-
field.propertyKey === 'Progress');
|
|
1872
|
-
if (!progressField) {
|
|
1873
|
-
return null;
|
|
1874
|
-
}
|
|
1875
|
-
return {
|
|
1876
|
-
value: normalizeProgressValue(progressField.value),
|
|
1877
|
-
};
|
|
1878
|
-
}
|
|
1879
|
-
function normalizeProgressValue(value) {
|
|
1880
|
-
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
1881
|
-
return value;
|
|
1882
|
-
}
|
|
1883
|
-
if (typeof value !== 'string') {
|
|
1884
|
-
return undefined;
|
|
1885
|
-
}
|
|
1886
|
-
const normalized = Number(value.replace('%', '').trim());
|
|
1887
|
-
return Number.isFinite(normalized) ? normalized : undefined;
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
1753
|
class WorkCenterItemModalFooterActions {
|
|
1891
1754
|
http = inject(HttpClient);
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
toast = inject(ToastService);
|
|
1895
|
-
actionContext = inject(WorkCenterItemActionContextStore);
|
|
1755
|
+
runner = inject(RuntimeActionRunner);
|
|
1756
|
+
actionContext = inject(RuntimeActionContextStore);
|
|
1896
1757
|
loadSub;
|
|
1897
|
-
executeSub;
|
|
1898
1758
|
lastContextKey = null;
|
|
1759
|
+
currentExecution = null;
|
|
1899
1760
|
contextKey = input(null, ...(ngDevMode ? [{ debugName: "contextKey" }] : /* istanbul ignore next */ []));
|
|
1900
1761
|
actionExecuted = output();
|
|
1901
1762
|
visibilityChange = output();
|
|
@@ -1911,7 +1772,7 @@ class WorkCenterItemModalFooterActions {
|
|
|
1911
1772
|
!!normalizeMethod(action.httpMethod))
|
|
1912
1773
|
.map((action, index) => ({
|
|
1913
1774
|
...action,
|
|
1914
|
-
label: action
|
|
1775
|
+
label: resolveActionLabel(action),
|
|
1915
1776
|
severity: resolveActionSeverity(action.actionKey, index),
|
|
1916
1777
|
variant: resolveActionVariant(action.actionKey, index),
|
|
1917
1778
|
})), ...(ngDevMode ? [{ debugName: "displayActions" }] : /* istanbul ignore next */ []));
|
|
@@ -1945,192 +1806,47 @@ class WorkCenterItemModalFooterActions {
|
|
|
1945
1806
|
}
|
|
1946
1807
|
ngOnDestroy() {
|
|
1947
1808
|
this.loadSub?.unsubscribe();
|
|
1948
|
-
this.
|
|
1949
|
-
|
|
1950
|
-
executeAction(action) {
|
|
1951
|
-
const contextKey = this.contextKey();
|
|
1952
|
-
const method = normalizeMethod(action.httpMethod);
|
|
1953
|
-
const url = action.url?.trim();
|
|
1954
|
-
if (!contextKey ||
|
|
1955
|
-
!method ||
|
|
1956
|
-
!url ||
|
|
1957
|
-
action.isAvailable === false ||
|
|
1958
|
-
!!this.pendingActionKey()) {
|
|
1959
|
-
return;
|
|
1960
|
-
}
|
|
1961
|
-
if (action.needConfirmation) {
|
|
1962
|
-
if (hasActionFormFields(action)) {
|
|
1963
|
-
this.openConfirmationDialog(action);
|
|
1964
|
-
}
|
|
1965
|
-
else {
|
|
1966
|
-
this.openSharedConfirmationDialog(action, method, url);
|
|
1967
|
-
}
|
|
1968
|
-
return;
|
|
1809
|
+
if (this.currentExecution) {
|
|
1810
|
+
this.currentExecution.cancelled = true;
|
|
1969
1811
|
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1812
|
+
}
|
|
1813
|
+
async executeAction(action) {
|
|
1814
|
+
if (this.pendingActionKey()) {
|
|
1972
1815
|
return;
|
|
1973
1816
|
}
|
|
1974
|
-
this.runActionRequest(action, method, url, payload);
|
|
1975
|
-
}
|
|
1976
|
-
openConfirmationDialog(action) {
|
|
1977
|
-
const ref = this.modal.openModal(WorkCenterItemActionConfirmDialog, 'dialog', {
|
|
1978
|
-
header: action.label,
|
|
1979
|
-
width: '40rem',
|
|
1980
|
-
dismissableMask: true,
|
|
1981
|
-
inputValues: {
|
|
1982
|
-
action,
|
|
1983
|
-
},
|
|
1984
|
-
});
|
|
1985
|
-
ref.onClose
|
|
1986
|
-
.pipe(take(1))
|
|
1987
|
-
.subscribe((formValue) => {
|
|
1988
|
-
if (formValue == null) {
|
|
1989
|
-
return;
|
|
1990
|
-
}
|
|
1991
|
-
const method = normalizeMethod(action.httpMethod);
|
|
1992
|
-
const url = action.url?.trim();
|
|
1993
|
-
if (!method || !url) {
|
|
1994
|
-
return;
|
|
1995
|
-
}
|
|
1996
|
-
const payload = this.buildActionPayload(action, formValue);
|
|
1997
|
-
if (!this.ensurePayloadIsReady(action, payload)) {
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
|
-
this.runActionRequest(action, method, url, payload);
|
|
2001
|
-
});
|
|
2002
|
-
}
|
|
2003
|
-
openSharedConfirmationDialog(action, method, url) {
|
|
2004
|
-
this.confirmation.confirm({
|
|
2005
|
-
type: 'dialog',
|
|
2006
|
-
header: action.label,
|
|
2007
|
-
message: `Confirm ${action.label} for this item.`,
|
|
2008
|
-
acceptLabel: action.label,
|
|
2009
|
-
icon: 'alert.alert-triangle',
|
|
2010
|
-
acceptButton: {
|
|
2011
|
-
severity: action.severity,
|
|
2012
|
-
variant: undefined,
|
|
2013
|
-
},
|
|
2014
|
-
rejectButton: {
|
|
2015
|
-
severity: 'primary',
|
|
2016
|
-
variant: 'text',
|
|
2017
|
-
},
|
|
2018
|
-
accept: () => {
|
|
2019
|
-
const payload = this.buildActionPayload(action);
|
|
2020
|
-
if (!this.ensurePayloadIsReady(action, payload)) {
|
|
2021
|
-
return;
|
|
2022
|
-
}
|
|
2023
|
-
this.runActionRequest(action, method, url, payload);
|
|
2024
|
-
},
|
|
2025
|
-
});
|
|
2026
|
-
}
|
|
2027
|
-
runActionRequest(action, method, url, payload) {
|
|
2028
1817
|
this.error.set(null);
|
|
2029
1818
|
this.pendingActionKey.set(action.actionKey);
|
|
2030
|
-
|
|
2031
|
-
this.
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
const afterSuccess = resolveActionAfterSuccess(action);
|
|
2037
|
-
this.pendingActionKey.set(null);
|
|
2038
|
-
if (afterSuccess === 'refresh') {
|
|
2039
|
-
this.reloadTick.update((value) => value + 1);
|
|
2040
|
-
}
|
|
2041
|
-
this.actionExecuted.emit({
|
|
2042
|
-
actionKey: action.actionKey,
|
|
2043
|
-
afterSuccess,
|
|
2044
|
-
});
|
|
2045
|
-
},
|
|
2046
|
-
error: (error) => {
|
|
2047
|
-
const message = resolveHttpErrorMessage(error, `Failed to execute ${action.label}.`);
|
|
2048
|
-
this.pendingActionKey.set(null);
|
|
2049
|
-
this.error.set(message);
|
|
2050
|
-
this.toast.error(message);
|
|
1819
|
+
const execution = { actionKey: action.actionKey, cancelled: false };
|
|
1820
|
+
this.currentExecution = execution;
|
|
1821
|
+
const result = await this.runner.execute(action, {
|
|
1822
|
+
defaultAfterSuccess: 'refresh',
|
|
1823
|
+
externalPayloadResolvers: {
|
|
1824
|
+
values: () => this.actionContext.resolveFormValues(),
|
|
2051
1825
|
},
|
|
2052
1826
|
});
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
const templatePayload = this.buildTemplatePayload(action, formValue);
|
|
2056
|
-
if (templatePayload) {
|
|
2057
|
-
return templatePayload;
|
|
2058
|
-
}
|
|
2059
|
-
const payloadKeys = action.payloadKeys ?? [];
|
|
2060
|
-
if (!payloadKeys.length) {
|
|
2061
|
-
return undefined;
|
|
2062
|
-
}
|
|
2063
|
-
const payload = {};
|
|
2064
|
-
for (const key of payloadKeys) {
|
|
2065
|
-
const formFieldValue = formValue?.[key];
|
|
2066
|
-
if (formFieldValue !== undefined) {
|
|
2067
|
-
payload[key] = normalizePayloadValue(key, formFieldValue);
|
|
2068
|
-
continue;
|
|
2069
|
-
}
|
|
2070
|
-
const externalValue = this.resolveExternalPayloadValue(key, action);
|
|
2071
|
-
if (externalValue !== undefined) {
|
|
2072
|
-
payload[key] = externalValue;
|
|
2073
|
-
continue;
|
|
2074
|
-
}
|
|
2075
|
-
const defaultValue = resolveDefaultPayloadValue(key);
|
|
2076
|
-
if (defaultValue !== undefined) {
|
|
2077
|
-
payload[key] = defaultValue;
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
return Object.keys(payload).length ? payload : undefined;
|
|
2081
|
-
}
|
|
2082
|
-
buildTemplatePayload(action, formValue) {
|
|
2083
|
-
const template = action.payloadTemplate;
|
|
2084
|
-
if (!template || typeof template !== 'object') {
|
|
2085
|
-
return null;
|
|
1827
|
+
if (execution.cancelled) {
|
|
1828
|
+
return;
|
|
2086
1829
|
}
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
payload[key] = resolveTemplateFieldsValue(action, template, formValue);
|
|
2092
|
-
continue;
|
|
2093
|
-
}
|
|
2094
|
-
const formFieldValue = formValue?.[key];
|
|
2095
|
-
if (formFieldValue !== undefined) {
|
|
2096
|
-
payload[key] = normalizePayloadValue(key, formFieldValue);
|
|
2097
|
-
continue;
|
|
2098
|
-
}
|
|
2099
|
-
const externalValue = this.resolveExternalPayloadValue(key, action);
|
|
2100
|
-
if (externalValue !== undefined) {
|
|
2101
|
-
payload[key] = externalValue;
|
|
2102
|
-
continue;
|
|
2103
|
-
}
|
|
2104
|
-
if (template[key] !== undefined) {
|
|
2105
|
-
payload[key] = template[key];
|
|
2106
|
-
continue;
|
|
2107
|
-
}
|
|
2108
|
-
const defaultValue = resolveDefaultPayloadValue(key);
|
|
2109
|
-
if (defaultValue !== undefined) {
|
|
2110
|
-
payload[key] = defaultValue;
|
|
2111
|
-
}
|
|
1830
|
+
this.pendingActionKey.set(null);
|
|
1831
|
+
this.currentExecution = null;
|
|
1832
|
+
if (result.status === 'cancelled') {
|
|
1833
|
+
return;
|
|
2112
1834
|
}
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
return
|
|
1835
|
+
if (result.status === 'error') {
|
|
1836
|
+
const message = result.error instanceof Error
|
|
1837
|
+
? result.error.message
|
|
1838
|
+
: `Failed to execute ${action.label}.`;
|
|
1839
|
+
this.error.set(message);
|
|
1840
|
+
return;
|
|
2119
1841
|
}
|
|
2120
|
-
const
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
return false;
|
|
2124
|
-
}
|
|
2125
|
-
resolveExternalPayloadValue(key, action) {
|
|
2126
|
-
switch (key) {
|
|
2127
|
-
case 'stepId':
|
|
2128
|
-
return action.stepIds?.[0];
|
|
2129
|
-
case 'values':
|
|
2130
|
-
return this.actionContext.resolveFormValues();
|
|
2131
|
-
default:
|
|
2132
|
-
return undefined;
|
|
1842
|
+
const afterSuccess = result.afterSuccess ?? 'refresh';
|
|
1843
|
+
if (afterSuccess === 'refresh') {
|
|
1844
|
+
this.reloadTick.update((value) => value + 1);
|
|
2133
1845
|
}
|
|
1846
|
+
this.actionExecuted.emit({
|
|
1847
|
+
actionKey: result.actionKey,
|
|
1848
|
+
afterSuccess,
|
|
1849
|
+
});
|
|
2134
1850
|
}
|
|
2135
1851
|
loadActions(contextKey) {
|
|
2136
1852
|
this.loadSub?.unsubscribe();
|
|
@@ -2169,18 +1885,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2169
1885
|
class: 'flex w-full flex-1 flex-wrap items-center justify-end gap-2',
|
|
2170
1886
|
}, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n @if (shouldRender()) {\r\n @if (error(); as error) {\r\n <span class=\"me-auto max-w-md text-sm text-red-600\">\r\n {{ error }}\r\n </span>\r\n } @else if (loading() && !displayActions().length) {\r\n <span class=\"me-auto text-sm text-surface-500\">{{\r\n t(\"modal.loadingActions\")\r\n }}</span>\r\n }\r\n\r\n @for (action of displayActions(); track action.actionKey + action.url) {\r\n <mt-button\r\n [label]=\"action.label\"\r\n [severity]=\"action.severity\"\r\n [variant]=\"action.variant\"\r\n [disabled]=\"loading() || !!pendingActionKey()\"\r\n [loading]=\"pendingActionKey() === action.actionKey\"\r\n (onClick)=\"executeAction(action)\"\r\n />\r\n }\r\n }\r\n</ng-container>\r\n" }]
|
|
2171
1887
|
}], ctorParameters: () => [], propDecorators: { contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }], actionExecuted: [{ type: i0.Output, args: ["actionExecuted"] }], visibilityChange: [{ type: i0.Output, args: ["visibilityChange"] }] } });
|
|
2172
|
-
function buildRequestOptions(method, payload) {
|
|
2173
|
-
if (!payload || !methodSupportsBody(method)) {
|
|
2174
|
-
return { observe: 'body' };
|
|
2175
|
-
}
|
|
2176
|
-
return {
|
|
2177
|
-
body: payload,
|
|
2178
|
-
observe: 'body',
|
|
2179
|
-
};
|
|
2180
|
-
}
|
|
2181
|
-
function methodSupportsBody(method) {
|
|
2182
|
-
return ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method);
|
|
2183
|
-
}
|
|
2184
1888
|
function normalizeMethod(value) {
|
|
2185
1889
|
if (!value || typeof value !== 'string') {
|
|
2186
1890
|
return null;
|
|
@@ -2188,72 +1892,6 @@ function normalizeMethod(value) {
|
|
|
2188
1892
|
const method = value.trim().toUpperCase();
|
|
2189
1893
|
return method.length ? method : null;
|
|
2190
1894
|
}
|
|
2191
|
-
function normalizePayloadValue(key, value) {
|
|
2192
|
-
if (key === 'attachments') {
|
|
2193
|
-
if (value == null) {
|
|
2194
|
-
return [];
|
|
2195
|
-
}
|
|
2196
|
-
return Array.isArray(value) ? value : [value];
|
|
2197
|
-
}
|
|
2198
|
-
return value;
|
|
2199
|
-
}
|
|
2200
|
-
function hasActionFormFields(action) {
|
|
2201
|
-
return ((action.payloadKeys ?? []).some((key) => ['delegatedUser', 'reason', 'note', 'attachments'].includes(key)) || hasProgressTemplateField(action));
|
|
2202
|
-
}
|
|
2203
|
-
function resolveTemplateFieldsValue(action, template, formValue) {
|
|
2204
|
-
const templateFields = template['fields'];
|
|
2205
|
-
if (!Array.isArray(templateFields)) {
|
|
2206
|
-
return formValue?.['fields'] ?? templateFields;
|
|
2207
|
-
}
|
|
2208
|
-
if (!hasProgressTemplateField(action)) {
|
|
2209
|
-
return formValue?.['fields'] ?? templateFields;
|
|
2210
|
-
}
|
|
2211
|
-
return templateFields.map((field) => {
|
|
2212
|
-
if (!field ||
|
|
2213
|
-
typeof field !== 'object' ||
|
|
2214
|
-
field.propertyKey !== 'Progress') {
|
|
2215
|
-
return field;
|
|
2216
|
-
}
|
|
2217
|
-
return {
|
|
2218
|
-
...field,
|
|
2219
|
-
value: formValue?.['progress'] ?? field.value,
|
|
2220
|
-
};
|
|
2221
|
-
});
|
|
2222
|
-
}
|
|
2223
|
-
function hasProgressTemplateField(action) {
|
|
2224
|
-
const fields = action.payloadTemplate
|
|
2225
|
-
?.fields;
|
|
2226
|
-
return (Array.isArray(fields) &&
|
|
2227
|
-
fields.some((field) => !!field &&
|
|
2228
|
-
typeof field === 'object' &&
|
|
2229
|
-
field.propertyKey === 'Progress'));
|
|
2230
|
-
}
|
|
2231
|
-
function resolveDefaultPayloadValue(key) {
|
|
2232
|
-
switch (key) {
|
|
2233
|
-
case 'attachments':
|
|
2234
|
-
return [];
|
|
2235
|
-
case 'delegatedUser':
|
|
2236
|
-
case 'note':
|
|
2237
|
-
case 'reason':
|
|
2238
|
-
return null;
|
|
2239
|
-
case 'values':
|
|
2240
|
-
return [];
|
|
2241
|
-
default:
|
|
2242
|
-
return undefined;
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
function isMissingPayloadValue(value) {
|
|
2246
|
-
if (value == null) {
|
|
2247
|
-
return true;
|
|
2248
|
-
}
|
|
2249
|
-
if (typeof value === 'string') {
|
|
2250
|
-
return value.trim().length === 0;
|
|
2251
|
-
}
|
|
2252
|
-
if (Array.isArray(value)) {
|
|
2253
|
-
return value.length === 0;
|
|
2254
|
-
}
|
|
2255
|
-
return false;
|
|
2256
|
-
}
|
|
2257
1895
|
function resolveActionSeverity(actionKey, index) {
|
|
2258
1896
|
const normalized = actionKey.trim().toLowerCase();
|
|
2259
1897
|
if (normalized === 'approve') {
|
|
@@ -2273,24 +1911,11 @@ function resolveActionVariant(actionKey, index) {
|
|
|
2273
1911
|
? undefined
|
|
2274
1912
|
: 'outlined';
|
|
2275
1913
|
}
|
|
2276
|
-
function resolveActionAfterSuccess(action) {
|
|
2277
|
-
return action.afterSuccess === 'close' ? 'close' : 'refresh';
|
|
2278
|
-
}
|
|
2279
1914
|
function resolveEnvelopeErrorMessage(response, fallback) {
|
|
2280
1915
|
return (response?.errors?.message ??
|
|
2281
1916
|
response?.message ??
|
|
2282
1917
|
fallback);
|
|
2283
1918
|
}
|
|
2284
|
-
function resolveActionSuccessMessage(response, fallback) {
|
|
2285
|
-
if (!response || typeof response !== 'object') {
|
|
2286
|
-
return fallback;
|
|
2287
|
-
}
|
|
2288
|
-
const apiResponse = response;
|
|
2289
|
-
if (typeof apiResponse.code === 'number' && apiResponse.code !== 1) {
|
|
2290
|
-
throw new Error(resolveEnvelopeErrorMessage(apiResponse, fallback));
|
|
2291
|
-
}
|
|
2292
|
-
return apiResponse.message?.trim() || fallback;
|
|
2293
|
-
}
|
|
2294
1919
|
function resolveHttpErrorMessage(error, fallback) {
|
|
2295
1920
|
if (!error || typeof error !== 'object') {
|
|
2296
1921
|
return fallback;
|
|
@@ -2440,7 +2065,7 @@ class WorkCenterItemModalRoute {
|
|
|
2440
2065
|
: null;
|
|
2441
2066
|
}
|
|
2442
2067
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalRoute, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2443
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemModalRoute, isStandalone: true, selector: "mt-work-center-item-modal-route", inputs: { contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
2068
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemModalRoute, isStandalone: true, selector: "mt-work-center-item-modal-route", inputs: { contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null } }, providers: [RuntimeActionContextStore], ngImport: i0, template: "<mt-drawer\r\n [visible]=\"drawerVisible()\"\r\n [loadingHeader]=\"loading()\"\r\n [title]=\"drawerTitle()\"\r\n [subtitle]=\"drawerSubtitle()\"\r\n styleClass=\"mt-work-center-item-drawer !absolute !w-[96vw] md:!w-[84vw] xl:!w-[70vw]\"\r\n position=\"right\"\r\n [modal]=\"true\"\r\n (visibleChange)=\"onVisibleChange($event)\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <ng-container content>\r\n @if (loading()) {\r\n <div class=\"p-4\" [class]=\"modal.contentClass\">\r\n <div class=\"flex min-h-[22rem] flex-col gap-5\">\r\n <div class=\"flex items-center gap-3\">\r\n <p-skeleton shape=\"circle\" size=\"3rem\" />\r\n <div class=\"flex flex-1 flex-col gap-2\">\r\n <p-skeleton width=\"12rem\" height=\"1rem\" />\r\n <p-skeleton width=\"8rem\" height=\"0.875rem\" />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid gap-3 md:grid-cols-2\">\r\n @for (_ of [1, 2, 3, 4]; track $index) {\r\n <p-skeleton height=\"5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n\r\n <p-skeleton height=\"16rem\" class=\"rounded-lg\" />\r\n </div>\r\n </div>\r\n } @else if (error(); as errorMessage) {\r\n <div class=\"p-4\" [class]=\"modal.contentClass\">\r\n <div class=\"flex min-h-[22rem] items-center justify-center\">\r\n <p class=\"max-w-xl text-sm font-medium text-red-600\">\r\n {{ errorMessage }}\r\n </p>\r\n </div>\r\n </div>\r\n } @else if (details(); as details) {\r\n <div [class]=\"modal.contentClass + ' h-full min-h-0'\">\r\n <mt-work-center-item-modal [details]=\"details\" />\r\n </div>\r\n } @else {\r\n <div class=\"p-4\" [class]=\"modal.contentClass\">\r\n <div class=\"flex min-h-[22rem] items-center justify-center\">\r\n <p class=\"text-sm font-medium text-surface-500\">\r\n {{ t(\"modal.noItemSelected\") }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </ng-container>\r\n\r\n @if (footerActionsMounted()) {\r\n <div footer [class]=\"modal.footerClass\">\r\n <mt-work-center-item-modal-footer-actions\r\n [contextKey]=\"resolvedContextKey()\"\r\n (actionExecuted)=\"onActionExecuted($event)\"\r\n (visibilityChange)=\"onFooterVisibilityChange($event)\"\r\n />\r\n </div>\r\n }\r\n</mt-drawer>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Drawer, selector: "mt-drawer", inputs: ["visible", "position", "fullScreen", "closeOnEscape", "blockScroll", "dismissible", "title", "subtitle", "loadingHeader", "styleClass", "transitionOptions", "appendTo", "modal", "showMaximizeToggle", "maximizeTooltip", "restoreTooltip", "maximized"], outputs: ["visibleChange", "onShow", "onHide", "maximizedChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: WorkCenterItemModal, selector: "mt-work-center-item-modal", inputs: ["details"] }, { kind: "component", type: WorkCenterItemModalFooterActions, selector: "mt-work-center-item-modal-footer-actions", inputs: ["contextKey"], outputs: ["actionExecuted", "visibilityChange"] }] });
|
|
2444
2069
|
}
|
|
2445
2070
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalRoute, decorators: [{
|
|
2446
2071
|
type: Component,
|
|
@@ -2451,7 +2076,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2451
2076
|
SkeletonModule,
|
|
2452
2077
|
WorkCenterItemModal,
|
|
2453
2078
|
WorkCenterItemModalFooterActions,
|
|
2454
|
-
], providers: [
|
|
2079
|
+
], providers: [RuntimeActionContextStore], template: "<mt-drawer\r\n [visible]=\"drawerVisible()\"\r\n [loadingHeader]=\"loading()\"\r\n [title]=\"drawerTitle()\"\r\n [subtitle]=\"drawerSubtitle()\"\r\n styleClass=\"mt-work-center-item-drawer !absolute !w-[96vw] md:!w-[84vw] xl:!w-[70vw]\"\r\n position=\"right\"\r\n [modal]=\"true\"\r\n (visibleChange)=\"onVisibleChange($event)\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <ng-container content>\r\n @if (loading()) {\r\n <div class=\"p-4\" [class]=\"modal.contentClass\">\r\n <div class=\"flex min-h-[22rem] flex-col gap-5\">\r\n <div class=\"flex items-center gap-3\">\r\n <p-skeleton shape=\"circle\" size=\"3rem\" />\r\n <div class=\"flex flex-1 flex-col gap-2\">\r\n <p-skeleton width=\"12rem\" height=\"1rem\" />\r\n <p-skeleton width=\"8rem\" height=\"0.875rem\" />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid gap-3 md:grid-cols-2\">\r\n @for (_ of [1, 2, 3, 4]; track $index) {\r\n <p-skeleton height=\"5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n\r\n <p-skeleton height=\"16rem\" class=\"rounded-lg\" />\r\n </div>\r\n </div>\r\n } @else if (error(); as errorMessage) {\r\n <div class=\"p-4\" [class]=\"modal.contentClass\">\r\n <div class=\"flex min-h-[22rem] items-center justify-center\">\r\n <p class=\"max-w-xl text-sm font-medium text-red-600\">\r\n {{ errorMessage }}\r\n </p>\r\n </div>\r\n </div>\r\n } @else if (details(); as details) {\r\n <div [class]=\"modal.contentClass + ' h-full min-h-0'\">\r\n <mt-work-center-item-modal [details]=\"details\" />\r\n </div>\r\n } @else {\r\n <div class=\"p-4\" [class]=\"modal.contentClass\">\r\n <div class=\"flex min-h-[22rem] items-center justify-center\">\r\n <p class=\"text-sm font-medium text-surface-500\">\r\n {{ t(\"modal.noItemSelected\") }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </ng-container>\r\n\r\n @if (footerActionsMounted()) {\r\n <div footer [class]=\"modal.footerClass\">\r\n <mt-work-center-item-modal-footer-actions\r\n [contextKey]=\"resolvedContextKey()\"\r\n (actionExecuted)=\"onActionExecuted($event)\"\r\n (visibilityChange)=\"onFooterVisibilityChange($event)\"\r\n />\r\n </div>\r\n }\r\n</mt-drawer>\r\n" }]
|
|
2455
2080
|
}], ctorParameters: () => [], propDecorators: { contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }] } });
|
|
2456
2081
|
|
|
2457
2082
|
const APP_STATES = [WorkCenterState];
|