@masterteam/work-center 0.0.34 → 0.0.36
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
CHANGED
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"name": "\u0627\u0644\u0627\u0633\u0645",
|
|
80
80
|
"status": "\u0627\u0644\u062d\u0627\u0644\u0629",
|
|
81
81
|
"user": "\u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645",
|
|
82
|
+
"userOrGroup": "\u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645 / \u0627\u0644\u0645\u062c\u0645\u0648\u0639\u0629",
|
|
82
83
|
"initiationDate": "\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u0628\u062f\u0621",
|
|
83
84
|
"actionDate": "\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u0625\u062c\u0631\u0627\u0621",
|
|
84
85
|
"start": "\u0628\u062f\u0627\u064a\u0629",
|
|
@@ -125,6 +126,7 @@
|
|
|
125
126
|
"name": "الاسم",
|
|
126
127
|
"status": "الحالة",
|
|
127
128
|
"user": "المستخدم",
|
|
129
|
+
"userOrGroup": "المستخدم / المجموعة",
|
|
128
130
|
"initiationDate": "تاريخ البدء",
|
|
129
131
|
"actionDate": "تاريخ الإجراء",
|
|
130
132
|
"start": "بداية",
|
package/assets/i18n/en.json
CHANGED
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"name": "Name",
|
|
80
80
|
"status": "Status",
|
|
81
81
|
"user": "User",
|
|
82
|
+
"userOrGroup": "User / Group",
|
|
82
83
|
"initiationDate": "Initiation Date",
|
|
83
84
|
"actionDate": "Action Date",
|
|
84
85
|
"start": "Start",
|
|
@@ -125,6 +126,7 @@
|
|
|
125
126
|
"name": "Name",
|
|
126
127
|
"status": "Status",
|
|
127
128
|
"user": "User",
|
|
129
|
+
"userOrGroup": "User / Group",
|
|
128
130
|
"initiationDate": "Initiation Date",
|
|
129
131
|
"actionDate": "Action Date",
|
|
130
132
|
"start": "Start",
|
|
@@ -1735,10 +1735,11 @@ class WorkCenterProcessPreview {
|
|
|
1735
1735
|
{
|
|
1736
1736
|
key: 'status',
|
|
1737
1737
|
label: this.transloco.translate('workCenter.preview.status'),
|
|
1738
|
+
type: 'entity',
|
|
1738
1739
|
},
|
|
1739
1740
|
{
|
|
1740
1741
|
key: 'user',
|
|
1741
|
-
label: this.transloco.translate('workCenter.preview.
|
|
1742
|
+
label: this.transloco.translate('workCenter.preview.userOrGroup'),
|
|
1742
1743
|
type: 'entity',
|
|
1743
1744
|
},
|
|
1744
1745
|
{
|
|
@@ -1756,18 +1757,50 @@ class WorkCenterProcessPreview {
|
|
|
1756
1757
|
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
1757
1758
|
preview = signal(null, ...(ngDevMode ? [{ debugName: "preview" }] : /* istanbul ignore next */ []));
|
|
1758
1759
|
canRenderPreview = computed(() => (this.requestId() ?? 0) > 0, ...(ngDevMode ? [{ debugName: "canRenderPreview" }] : /* istanbul ignore next */ []));
|
|
1759
|
-
approvalRows = computed(() =>
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1760
|
+
approvalRows = computed(() => {
|
|
1761
|
+
const steps = this.preview()?.steps ?? [];
|
|
1762
|
+
const rows = [];
|
|
1763
|
+
const seenGroupKeys = new Set();
|
|
1764
|
+
for (const step of steps) {
|
|
1765
|
+
const groupName = this.resolveGroupName(step.target);
|
|
1766
|
+
if (groupName) {
|
|
1767
|
+
const dedupKey = `${step.stepSchemaId ?? ''}|${step.target?.groupKey ?? ''}`;
|
|
1768
|
+
if (seenGroupKeys.has(dedupKey))
|
|
1769
|
+
continue;
|
|
1770
|
+
seenGroupKeys.add(dedupKey);
|
|
1771
|
+
// Prefer a sibling that has been actioned so we can surface real
|
|
1772
|
+
// action date/status; otherwise fall back to the current step.
|
|
1773
|
+
const siblings = steps.filter((s) => (s.stepSchemaId ?? '') === (step.stepSchemaId ?? '') &&
|
|
1774
|
+
(s.target?.groupKey ?? '') === (step.target?.groupKey ?? ''));
|
|
1775
|
+
const repr = siblings.find((s) => s.actionUserInfo) ?? step;
|
|
1776
|
+
rows.push({
|
|
1777
|
+
stepName: this.resolveDisplayName(repr.stepName) ||
|
|
1778
|
+
String(repr.stepId ?? '--'),
|
|
1779
|
+
status: buildEntity('Status', 'Status', repr.status),
|
|
1780
|
+
user: buildEntity('User', 'Text', groupName),
|
|
1781
|
+
createdAt: buildEntity('Initiation Date', 'DateTime', repr.createdAt ?? ''),
|
|
1782
|
+
actionDate: buildEntity('Action Date', 'DateTime', repr.actionDate ?? ''),
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
else {
|
|
1786
|
+
rows.push({
|
|
1787
|
+
stepName: this.resolveDisplayName(step.stepName) ||
|
|
1788
|
+
String(step.stepId ?? '--'),
|
|
1789
|
+
status: buildEntity('Status', 'Status', step.status),
|
|
1790
|
+
user: buildEntity('User', 'User', (step.actionUserInfo ?? step.targetUser ?? null)),
|
|
1791
|
+
createdAt: buildEntity('Initiation Date', 'DateTime', step.createdAt ?? ''),
|
|
1792
|
+
actionDate: buildEntity('Action Date', 'DateTime', step.actionDate ?? ''),
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
return rows;
|
|
1797
|
+
}, ...(ngDevMode ? [{ debugName: "approvalRows" }] : /* istanbul ignore next */ []));
|
|
1766
1798
|
hasApprovals = computed(() => this.approvalRows().length > 0, ...(ngDevMode ? [{ debugName: "hasApprovals" }] : /* istanbul ignore next */ []));
|
|
1767
1799
|
schemaNodes = computed(() => {
|
|
1768
1800
|
const steps = this.preview()?.schema?.stepsSchema ?? [];
|
|
1769
1801
|
const connections = this.preview()?.schema?.connections ?? [];
|
|
1770
1802
|
const sourceIds = new Set(connections.map((c) => String(c.source)));
|
|
1803
|
+
const currentStepIds = new Set((this.preview()?.currentStepSchemaIds ?? []).map(String));
|
|
1771
1804
|
return steps.map((step) => {
|
|
1772
1805
|
const isAppAction = step.type === 'AppAction';
|
|
1773
1806
|
const isApprovalCommit = step.type === 'ApprovalCommit' || step.systemKind === 'ApprovalCommit';
|
|
@@ -1817,6 +1850,7 @@ class WorkCenterProcessPreview {
|
|
|
1817
1850
|
: null,
|
|
1818
1851
|
status: step.status ?? null,
|
|
1819
1852
|
style: isAppAction || isApprovalCommit ? 'icon' : 'detail',
|
|
1853
|
+
current: currentStepIds.has(String(step.id)),
|
|
1820
1854
|
};
|
|
1821
1855
|
});
|
|
1822
1856
|
}, ...(ngDevMode ? [{ debugName: "schemaNodes" }] : /* istanbul ignore next */ []));
|
|
@@ -1836,6 +1870,7 @@ class WorkCenterProcessPreview {
|
|
|
1836
1870
|
badge: 'badge',
|
|
1837
1871
|
status: 'status',
|
|
1838
1872
|
style: 'style',
|
|
1873
|
+
current: 'current',
|
|
1839
1874
|
};
|
|
1840
1875
|
constructor() {
|
|
1841
1876
|
effect(() => {
|
|
@@ -1853,6 +1888,13 @@ class WorkCenterProcessPreview {
|
|
|
1853
1888
|
ngOnDestroy() {
|
|
1854
1889
|
this.loadSub?.unsubscribe();
|
|
1855
1890
|
}
|
|
1891
|
+
resolveGroupName(target) {
|
|
1892
|
+
if (!target || target.type !== 'Group' || !target.group) {
|
|
1893
|
+
return '';
|
|
1894
|
+
}
|
|
1895
|
+
return (this.resolveDisplayName(target.displayName) ||
|
|
1896
|
+
this.resolveDisplayName(target.group.name));
|
|
1897
|
+
}
|
|
1856
1898
|
resolveDisplayName(name) {
|
|
1857
1899
|
if (typeof name === 'string') {
|
|
1858
1900
|
return name;
|
|
@@ -2453,7 +2495,7 @@ class WorkCenterItemModalRoute {
|
|
|
2453
2495
|
: null;
|
|
2454
2496
|
}
|
|
2455
2497
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalRoute, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2456
|
-
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
|
|
2498
|
+
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 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"] }] });
|
|
2457
2499
|
}
|
|
2458
2500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalRoute, decorators: [{
|
|
2459
2501
|
type: Component,
|
|
@@ -2464,7 +2506,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2464
2506
|
SkeletonModule,
|
|
2465
2507
|
WorkCenterItemModal,
|
|
2466
2508
|
WorkCenterItemModalFooterActions,
|
|
2467
|
-
], providers: [RuntimeActionContextStore], template: "<mt-drawer\r\n [visible]=\"drawerVisible()\"\r\n [loadingHeader]=\"loading()\"\r\n [title]=\"drawerTitle()\"\r\n
|
|
2509
|
+
], providers: [RuntimeActionContextStore], template: "<mt-drawer\r\n [visible]=\"drawerVisible()\"\r\n [loadingHeader]=\"loading()\"\r\n [title]=\"drawerTitle()\"\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" }]
|
|
2468
2510
|
}], ctorParameters: () => [], propDecorators: { contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }] } });
|
|
2469
2511
|
|
|
2470
2512
|
const APP_STATES = [WorkCenterState];
|