@masterteam/users-groups 0.0.49 → 0.0.51
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.
|
@@ -2538,7 +2538,7 @@ class ReplaceUserDialog {
|
|
|
2538
2538
|
this.blockingId.set(null);
|
|
2539
2539
|
}
|
|
2540
2540
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ReplaceUserDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2541
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ReplaceUserDialog, isStandalone: true, selector: "mt-replace-user-dialog", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, users: { classPropertyName: "users", publicName: "users", isSignal: true, isRequired: false, transformFunction: null }, successorUserId: { classPropertyName: "successorUserId", publicName: "successorUserId", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-5 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Who is leaving -->\r\n <div class=\"flex flex-col gap-3\">\r\n <div class=\"flex min-w-0 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n size=\"large\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">\r\n {{ t(\"dialog.replacing\") }}\r\n </div>\r\n <div class=\"truncate text-base font-semibold\">{{ sourceName() }}</div>\r\n </div>\r\n </div>\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"dialog.intro\", { name: sourceName() }) }}\r\n </p>\r\n </div>\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"successorConfig()\"\r\n [formControl]=\"successorForm\"\r\n />\r\n\r\n <mt-dynamic-form [formConfig]=\"reasonConfig()\" [formControl]=\"reasonForm\" />\r\n\r\n <!--
|
|
2541
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ReplaceUserDialog, isStandalone: true, selector: "mt-replace-user-dialog", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, users: { classPropertyName: "users", publicName: "users", isSignal: true, isRequired: false, transformFunction: null }, successorUserId: { classPropertyName: "successorUserId", publicName: "successorUserId", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-5 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Who is leaving -->\r\n <div class=\"flex flex-col gap-3\">\r\n <div class=\"flex min-w-0 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n size=\"large\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">\r\n {{ t(\"dialog.replacing\") }}\r\n </div>\r\n <div class=\"truncate text-base font-semibold\">{{ sourceName() }}</div>\r\n </div>\r\n </div>\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"dialog.intro\", { name: sourceName() }) }}\r\n </p>\r\n </div>\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"successorConfig()\"\r\n [formControl]=\"successorForm\"\r\n />\r\n\r\n <mt-dynamic-form [formConfig]=\"reasonConfig()\" [formControl]=\"reasonForm\" />\r\n\r\n <!-- What a replacement moves and what it keeps, the same for every\r\n person: this is what the admin confirms. Nothing is looked up for\r\n this person. Keep the list in step with the backend's handover\r\n (Pplus5.BE Docs/User-Replacement/BE-Handover-Execution.md). -->\r\n <section\r\n class=\"flex flex-col gap-2 rounded-md border border-surface bg-surface-50 p-4 text-sm dark:bg-surface-900\"\r\n >\r\n <div class=\"flex items-center gap-2 font-semibold\">\r\n <mt-icon icon=\"general.info-circle\" class=\"text-muted-color\" />\r\n {{ t(\"dialog.what-happens\") }}\r\n </div>\r\n <ul class=\"flex flex-col gap-2\">\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"user.user-right-01\"\r\n class=\"mt-0.5 shrink-0 text-primary\"\r\n />\r\n <div class=\"flex flex-col gap-1\">\r\n <span>{{ t(\"dialog.explain-moves\") }}</span>\r\n <ul class=\"list-disc ps-5 text-muted-color\">\r\n <li>{{ t(\"dialog.moves-fields\") }}</li>\r\n <li>{{ t(\"dialog.moves-teams\") }}</li>\r\n <li>{{ t(\"dialog.moves-schedule\") }}</li>\r\n <li>{{ t(\"dialog.moves-approvals\") }}</li>\r\n <li>{{ t(\"dialog.moves-requests\") }}</li>\r\n <li>{{ t(\"dialog.moves-escalations\") }}</li>\r\n <li>{{ t(\"dialog.moves-lists\") }}</li>\r\n </ul>\r\n </div>\r\n </li>\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"time.clock-rewind\"\r\n class=\"mt-0.5 shrink-0 text-muted-color\"\r\n />\r\n <span>{{ t(\"dialog.explain-history\") }}</span>\r\n </li>\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"alert.alert-triangle\"\r\n class=\"mt-0.5 shrink-0 text-muted-color\"\r\n />\r\n <span>{{ t(\"dialog.explain-manual\") }}</span>\r\n </li>\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"user.user-check-01\"\r\n class=\"mt-0.5 shrink-0 text-muted-color\"\r\n />\r\n <span>{{ t(\"dialog.explain-account\") }}</span>\r\n </li>\r\n </ul>\r\n </section>\r\n\r\n @if (createError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <div class=\"flex flex-col items-start gap-2\">\r\n <span>{{ createError() }}</span>\r\n @if (blockingId()) {\r\n <mt-button\r\n [label]=\"t('dialog.open-blocking')\"\r\n icon=\"general.link-external-01\"\r\n variant=\"outlined\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (click)=\"openBlocking()\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n variant=\"outlined\"\r\n [disabled]=\"creating()\"\r\n (click)=\"close()\"\r\n />\r\n <mt-button\r\n [label]=\"t('dialog.submit')\"\r\n icon=\"user.user-right-01\"\r\n [loading]=\"creating()\"\r\n [disabled]=\"!canSubmit()\"\r\n (click)=\"submit()\"\r\n />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ 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: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "forcedDisabledFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys", "externalValues", "serverFieldErrors"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
|
|
2542
2542
|
}
|
|
2543
2543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ReplaceUserDialog, decorators: [{
|
|
2544
2544
|
type: Component,
|
|
@@ -2549,7 +2549,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2549
2549
|
Button,
|
|
2550
2550
|
Icon,
|
|
2551
2551
|
TranslocoDirective,
|
|
2552
|
-
], template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-5 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Who is leaving -->\r\n <div class=\"flex flex-col gap-3\">\r\n <div class=\"flex min-w-0 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n size=\"large\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">\r\n {{ t(\"dialog.replacing\") }}\r\n </div>\r\n <div class=\"truncate text-base font-semibold\">{{ sourceName() }}</div>\r\n </div>\r\n </div>\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"dialog.intro\", { name: sourceName() }) }}\r\n </p>\r\n </div>\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"successorConfig()\"\r\n [formControl]=\"successorForm\"\r\n />\r\n\r\n <mt-dynamic-form [formConfig]=\"reasonConfig()\" [formControl]=\"reasonForm\" />\r\n\r\n <!--
|
|
2552
|
+
], template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-5 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Who is leaving -->\r\n <div class=\"flex flex-col gap-3\">\r\n <div class=\"flex min-w-0 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n size=\"large\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">\r\n {{ t(\"dialog.replacing\") }}\r\n </div>\r\n <div class=\"truncate text-base font-semibold\">{{ sourceName() }}</div>\r\n </div>\r\n </div>\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"dialog.intro\", { name: sourceName() }) }}\r\n </p>\r\n </div>\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"successorConfig()\"\r\n [formControl]=\"successorForm\"\r\n />\r\n\r\n <mt-dynamic-form [formConfig]=\"reasonConfig()\" [formControl]=\"reasonForm\" />\r\n\r\n <!-- What a replacement moves and what it keeps, the same for every\r\n person: this is what the admin confirms. Nothing is looked up for\r\n this person. Keep the list in step with the backend's handover\r\n (Pplus5.BE Docs/User-Replacement/BE-Handover-Execution.md). -->\r\n <section\r\n class=\"flex flex-col gap-2 rounded-md border border-surface bg-surface-50 p-4 text-sm dark:bg-surface-900\"\r\n >\r\n <div class=\"flex items-center gap-2 font-semibold\">\r\n <mt-icon icon=\"general.info-circle\" class=\"text-muted-color\" />\r\n {{ t(\"dialog.what-happens\") }}\r\n </div>\r\n <ul class=\"flex flex-col gap-2\">\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"user.user-right-01\"\r\n class=\"mt-0.5 shrink-0 text-primary\"\r\n />\r\n <div class=\"flex flex-col gap-1\">\r\n <span>{{ t(\"dialog.explain-moves\") }}</span>\r\n <ul class=\"list-disc ps-5 text-muted-color\">\r\n <li>{{ t(\"dialog.moves-fields\") }}</li>\r\n <li>{{ t(\"dialog.moves-teams\") }}</li>\r\n <li>{{ t(\"dialog.moves-schedule\") }}</li>\r\n <li>{{ t(\"dialog.moves-approvals\") }}</li>\r\n <li>{{ t(\"dialog.moves-requests\") }}</li>\r\n <li>{{ t(\"dialog.moves-escalations\") }}</li>\r\n <li>{{ t(\"dialog.moves-lists\") }}</li>\r\n </ul>\r\n </div>\r\n </li>\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"time.clock-rewind\"\r\n class=\"mt-0.5 shrink-0 text-muted-color\"\r\n />\r\n <span>{{ t(\"dialog.explain-history\") }}</span>\r\n </li>\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"alert.alert-triangle\"\r\n class=\"mt-0.5 shrink-0 text-muted-color\"\r\n />\r\n <span>{{ t(\"dialog.explain-manual\") }}</span>\r\n </li>\r\n <li class=\"flex items-start gap-2\">\r\n <mt-icon\r\n icon=\"user.user-check-01\"\r\n class=\"mt-0.5 shrink-0 text-muted-color\"\r\n />\r\n <span>{{ t(\"dialog.explain-account\") }}</span>\r\n </li>\r\n </ul>\r\n </section>\r\n\r\n @if (createError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <div class=\"flex flex-col items-start gap-2\">\r\n <span>{{ createError() }}</span>\r\n @if (blockingId()) {\r\n <mt-button\r\n [label]=\"t('dialog.open-blocking')\"\r\n icon=\"general.link-external-01\"\r\n variant=\"outlined\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (click)=\"openBlocking()\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n variant=\"outlined\"\r\n [disabled]=\"creating()\"\r\n (click)=\"close()\"\r\n />\r\n <mt-button\r\n [label]=\"t('dialog.submit')\"\r\n icon=\"user.user-right-01\"\r\n [loading]=\"creating()\"\r\n [disabled]=\"!canSubmit()\"\r\n (click)=\"submit()\"\r\n />\r\n </div>\r\n</ng-container>\r\n" }]
|
|
2553
2553
|
}], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: true }] }], users: [{ type: i0.Input, args: [{ isSignal: true, alias: "users", required: false }] }], successorUserId: [{ type: i0.Input, args: [{ isSignal: true, alias: "successorUserId", required: false }] }] } });
|
|
2554
2554
|
|
|
2555
2555
|
const COUNT_ICONS = {
|
|
@@ -3843,7 +3843,20 @@ const DONE_RESULTS = [
|
|
|
3843
3843
|
'Applied',
|
|
3844
3844
|
'AlreadySatisfied',
|
|
3845
3845
|
'Preserved',
|
|
3846
|
+
'HandedOverManually',
|
|
3846
3847
|
];
|
|
3848
|
+
/**
|
|
3849
|
+
* A manual item the person no longer holds (components#1986): the admin
|
|
3850
|
+
* handed it over by hand after the replacement. Shown as done; the original
|
|
3851
|
+
* `resultStatus` stays under Technical details.
|
|
3852
|
+
*/
|
|
3853
|
+
const HANDED_OVER_MANUALLY = 'HandedOverManually';
|
|
3854
|
+
/** The result the screens sort and colour by: the live check wins. */
|
|
3855
|
+
function resultKeyOf(item) {
|
|
3856
|
+
return item.manualHandoverStatus === 'NoLongerHeld'
|
|
3857
|
+
? HANDED_OVER_MANUALLY
|
|
3858
|
+
: (item.resultStatus ?? null);
|
|
3859
|
+
}
|
|
3847
3860
|
const PLACE_ICON = {
|
|
3848
3861
|
LevelRecord: 'education.briefcase-01',
|
|
3849
3862
|
ModuleRecord: 'file.file-02',
|
|
@@ -3872,7 +3885,7 @@ function describeResult(item, text, names) {
|
|
|
3872
3885
|
detail: sentenceOf(item, text, names),
|
|
3873
3886
|
technical,
|
|
3874
3887
|
foldable: item.display?.subjectKind === 'TeamRole' &&
|
|
3875
|
-
DONE_RESULTS.includes(item
|
|
3888
|
+
DONE_RESULTS.includes(resultKeyOf(item) ?? ''),
|
|
3876
3889
|
untouched: !!item.display && !item.display.subjectKind && !item.resultStatus,
|
|
3877
3890
|
unchecked: !!item.display && !item.display.subjectKind && isNotChecked(item),
|
|
3878
3891
|
};
|
|
@@ -3991,6 +4004,17 @@ function headlineOf(item, text) {
|
|
|
3991
4004
|
* admin with no code, the reason (as before).
|
|
3992
4005
|
*/
|
|
3993
4006
|
function sentenceOf(item, text, names) {
|
|
4007
|
+
const people = { name: names.name, successor: names.successor };
|
|
4008
|
+
if (item.manualHandoverStatus === 'NoLongerHeld')
|
|
4009
|
+
return text.t('sentences.NoLongerHeld', people);
|
|
4010
|
+
const sentence = resultSentenceOf(item, text, names);
|
|
4011
|
+
return item.manualHandoverStatus === 'Unverified'
|
|
4012
|
+
? [sentence, text.t('handover-unverified', people)]
|
|
4013
|
+
.filter(Boolean)
|
|
4014
|
+
.join(' ')
|
|
4015
|
+
: sentence;
|
|
4016
|
+
}
|
|
4017
|
+
function resultSentenceOf(item, text, names) {
|
|
3994
4018
|
if (item.resultCode) {
|
|
3995
4019
|
const sentence = text.code('sentences', item.resultCode, '');
|
|
3996
4020
|
if (sentence)
|
|
@@ -4095,6 +4119,7 @@ const NOT_CHECKED = 'NotChecked';
|
|
|
4095
4119
|
const RESULT_TONE = {
|
|
4096
4120
|
Applied: 'success',
|
|
4097
4121
|
AlreadySatisfied: 'success',
|
|
4122
|
+
HandedOverManually: 'success',
|
|
4098
4123
|
RequiresManualAction: 'warning',
|
|
4099
4124
|
Conflict: 'warning',
|
|
4100
4125
|
};
|
|
@@ -4141,6 +4166,8 @@ class UserReplacementDetails {
|
|
|
4141
4166
|
/** Watching gave up after repeated failures; reopening the drawer retries. */
|
|
4142
4167
|
watchStopped = signal(false, ...(ngDevMode ? [{ debugName: "watchStopped" }] : /* istanbul ignore next */ []));
|
|
4143
4168
|
cancelling = signal(false, ...(ngDevMode ? [{ debugName: "cancelling" }] : /* istanbul ignore next */ []));
|
|
4169
|
+
/** The remaining-work check or the removal of the person is running. */
|
|
4170
|
+
removing = signal(false, ...(ngDevMode ? [{ debugName: "removing" }] : /* istanbul ignore next */ []));
|
|
4144
4171
|
actionError = signal(null, ...(ngDevMode ? [{ debugName: "actionError" }] : /* istanbul ignore next */ []));
|
|
4145
4172
|
items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
4146
4173
|
itemsLoading = signal(false, ...(ngDevMode ? [{ debugName: "itemsLoading" }] : /* istanbul ignore next */ []));
|
|
@@ -4183,12 +4210,38 @@ class UserReplacementDetails {
|
|
|
4183
4210
|
statusClass = computed(() => TONE_PILL[STATUS_TONE[this.status() ?? ''] ?? 'neutral'], ...(ngDevMode ? [{ debugName: "statusClass" }] : /* istanbul ignore next */ []));
|
|
4184
4211
|
createdAt = computed(() => validDate(this.summary()?.createdAtUtc), ...(ngDevMode ? [{ debugName: "createdAt" }] : /* istanbul ignore next */ []));
|
|
4185
4212
|
updatedAt = computed(() => validDate(this.summary()?.updatedAtUtc), ...(ngDevMode ? [{ debugName: "updatedAt" }] : /* istanbul ignore next */ []));
|
|
4213
|
+
/** The person being replaced, as the Users table knows them. */
|
|
4214
|
+
sourceUser = computed(() => {
|
|
4215
|
+
const id = this.summary()?.sourceUserId;
|
|
4216
|
+
return id ? (this.users().find((user) => user.id === id) ?? null) : null;
|
|
4217
|
+
}, ...(ngDevMode ? [{ debugName: "sourceUser" }] : /* istanbul ignore next */ []));
|
|
4218
|
+
/**
|
|
4219
|
+
* Once nothing more will happen, offer to remove the person from the
|
|
4220
|
+
* application (components#1989): a replacement never touches the account.
|
|
4221
|
+
* Gone once they are removed (the Users table marks them unlinked).
|
|
4222
|
+
*/
|
|
4223
|
+
canRemoveSource = computed(() => {
|
|
4224
|
+
const status = this.status() ?? '';
|
|
4225
|
+
const user = this.sourceUser();
|
|
4226
|
+
return ((FINISHED_STATUSES.includes(status) ||
|
|
4227
|
+
CLOSED_STATUSES.includes(status)) &&
|
|
4228
|
+
!!user?.userName &&
|
|
4229
|
+
user.isLinkedToCurrentApplication !== false);
|
|
4230
|
+
}, ...(ngDevMode ? [{ debugName: "canRemoveSource" }] : /* istanbul ignore next */ []));
|
|
4186
4231
|
canCancel = computed(() => !this.cancelling() && !!this.summary()?.canCancel, ...(ngDevMode ? [{ debugName: "canCancel" }] : /* istanbul ignore next */ []));
|
|
4187
4232
|
/** While the server works it is "Stop"; afterwards "Close". */
|
|
4188
4233
|
cancelIsStop = computed(() => this.isActive(), ...(ngDevMode ? [{ debugName: "cancelIsStop" }] : /* istanbul ignore next */ []));
|
|
4234
|
+
/**
|
|
4235
|
+
* What still needs the admin. The summary counts what the handover left;
|
|
4236
|
+
* once every result page is in, the live check (#1986) has the last word.
|
|
4237
|
+
*/
|
|
4189
4238
|
manualCount = computed(() => {
|
|
4190
4239
|
const summary = this.summary();
|
|
4191
|
-
|
|
4240
|
+
if (!summary)
|
|
4241
|
+
return 0;
|
|
4242
|
+
if (this.itemsLoading() || this.items().length < summary.itemCount)
|
|
4243
|
+
return manualCountOf(summary);
|
|
4244
|
+
return this.rows().filter((row) => MANUAL_RESULTS.includes(row.resultKey ?? '')).length;
|
|
4192
4245
|
}, ...(ngDevMode ? [{ debugName: "manualCount" }] : /* istanbul ignore next */ []));
|
|
4193
4246
|
notCheckedCount = computed(() => this.summary()?.itemsByResult?.[NOT_CHECKED] ??
|
|
4194
4247
|
this.rows().filter((row) => row.notChecked).length, ...(ngDevMode ? [{ debugName: "notCheckedCount" }] : /* istanbul ignore next */ []));
|
|
@@ -4269,10 +4322,12 @@ class UserReplacementDetails {
|
|
|
4269
4322
|
const names = { name: this.sourceName(), successor: this.successorName() };
|
|
4270
4323
|
return this.items().map((item) => {
|
|
4271
4324
|
const notChecked = isNotChecked(item);
|
|
4272
|
-
|
|
4325
|
+
// A manual item the person no longer holds counts as done (#1986).
|
|
4326
|
+
const resultKey = resultKeyOf(item);
|
|
4327
|
+
const [status, tone] = resultKey
|
|
4273
4328
|
? [
|
|
4274
|
-
this.text.code('results',
|
|
4275
|
-
RESULT_TONE[
|
|
4329
|
+
this.text.code('results', resultKey),
|
|
4330
|
+
RESULT_TONE[resultKey] ?? 'neutral',
|
|
4276
4331
|
]
|
|
4277
4332
|
: [
|
|
4278
4333
|
active ? this.text.t('waiting') : this.text.t('not-done'),
|
|
@@ -4286,7 +4341,7 @@ class UserReplacementDetails {
|
|
|
4286
4341
|
status,
|
|
4287
4342
|
statusDetail: words.detail,
|
|
4288
4343
|
statusClass: TONE_PILL[tone],
|
|
4289
|
-
resultKey
|
|
4344
|
+
resultKey,
|
|
4290
4345
|
notChecked,
|
|
4291
4346
|
search: [
|
|
4292
4347
|
words.place.title,
|
|
@@ -4578,6 +4633,64 @@ class UserReplacementDetails {
|
|
|
4578
4633
|
close() {
|
|
4579
4634
|
this.ref.close();
|
|
4580
4635
|
}
|
|
4636
|
+
/**
|
|
4637
|
+
* Remove the person from the application, the same protected way as the
|
|
4638
|
+
* Users page: the remaining-work check decides between the plain
|
|
4639
|
+
* confirmation and "Remove anyway".
|
|
4640
|
+
*/
|
|
4641
|
+
removeSource() {
|
|
4642
|
+
const user = this.sourceUser();
|
|
4643
|
+
if (!user?.id || !user.userName || this.removing())
|
|
4644
|
+
return;
|
|
4645
|
+
const userName = user.userName;
|
|
4646
|
+
this.removing.set(true);
|
|
4647
|
+
this.api
|
|
4648
|
+
.remainingWork(user.id)
|
|
4649
|
+
.pipe(finalize(() => this.removing.set(false)))
|
|
4650
|
+
.subscribe({
|
|
4651
|
+
next: (work) => {
|
|
4652
|
+
if (work.safeToRemove) {
|
|
4653
|
+
this.confirmation.confirm({
|
|
4654
|
+
type: 'dialog',
|
|
4655
|
+
header: this.transloco.translate('users-groups.unlink-confirm-header'),
|
|
4656
|
+
message: this.transloco.translate('users-groups.unlink-confirm-message'),
|
|
4657
|
+
icon: 'general.link-broken-01',
|
|
4658
|
+
acceptLabel: this.transloco.translate('users-groups.unlink-from-application'),
|
|
4659
|
+
rejectLabel: this.transloco.translate('users-groups.cancel'),
|
|
4660
|
+
acceptButton: { severity: 'danger' },
|
|
4661
|
+
accept: () => this.unlinkSource(userName),
|
|
4662
|
+
});
|
|
4663
|
+
return;
|
|
4664
|
+
}
|
|
4665
|
+
this.modal
|
|
4666
|
+
.openModal(RemainingWorkDialog, 'dialog', {
|
|
4667
|
+
header: this.transloco.translate('users-groups.unlink-confirm-header'),
|
|
4668
|
+
styleClass: '!w-[32rem] max-w-[96vw]',
|
|
4669
|
+
contentStyle: { display: 'flex', flexDirection: 'column' },
|
|
4670
|
+
dismissableMask: true,
|
|
4671
|
+
dismissible: true,
|
|
4672
|
+
// Starting another replacement belongs to the Users page.
|
|
4673
|
+
inputValues: { user, work, canReplace: false },
|
|
4674
|
+
})
|
|
4675
|
+
.onClose.pipe(take(1))
|
|
4676
|
+
.subscribe((result) => {
|
|
4677
|
+
if (result?.action === 'remove')
|
|
4678
|
+
this.unlinkSource(userName, true);
|
|
4679
|
+
else if (result?.action === 'open-replacement')
|
|
4680
|
+
// Another replacement holds the person: the list opens it.
|
|
4681
|
+
this.ref.close({ openOperationId: result.operationId });
|
|
4682
|
+
});
|
|
4683
|
+
},
|
|
4684
|
+
error: (error) => this.toast.error(this.text.error(replacementErrorKey(error))),
|
|
4685
|
+
});
|
|
4686
|
+
}
|
|
4687
|
+
unlinkSource(userName, acknowledgeRemainingWork = false) {
|
|
4688
|
+
this.removing.set(true);
|
|
4689
|
+
this.facade
|
|
4690
|
+
.deleteUser(userName, acknowledgeRemainingWork)
|
|
4691
|
+
.pipe(finalize(() => this.removing.set(false)))
|
|
4692
|
+
.subscribe();
|
|
4693
|
+
}
|
|
4581
4694
|
/** A warning or stop code: failure keys and limits live in two groups. */
|
|
4582
4695
|
codeText(code) {
|
|
4583
4696
|
return /^UserReplacement_\w+$/.test(code)
|
|
@@ -4591,7 +4704,7 @@ class UserReplacementDetails {
|
|
|
4591
4704
|
return user?.displayName || user?.userName || userId;
|
|
4592
4705
|
}
|
|
4593
4706
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: UserReplacementDetails, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4594
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: UserReplacementDetails, isStandalone: true, selector: "mt-user-replacement-details", inputs: { operationId: { classPropertyName: "operationId", publicName: "operationId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n @if (loading()) {\r\n <p-skeleton height=\"7rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"6rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"12rem\" borderRadius=\"0.375rem\" />\r\n } @else if (loadError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ loadError() }}</span>\r\n </div>\r\n } @else if (contractOutdated()) {\r\n <div\r\n class=\"rounded-md border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200\"\r\n >\r\n {{ t(\"contract-outdated\") }}\r\n </div>\r\n } @else if (summary(); as replacement) {\r\n <!-- Who \u2192 who, the status, and when -->\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border border-surface bg-content p-4\"\r\n >\r\n <div class=\"flex items-center gap-3\">\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"from\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"sourceName()\">\r\n {{ sourceName() }}\r\n </div>\r\n </div>\r\n </div>\r\n <mt-icon\r\n icon=\"arrow.arrow-right\"\r\n class=\"shrink-0 text-lg text-muted-color rtl:rotate-180\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"successorInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-primary-50! text-primary-700! dark:bg-primary-950! dark:text-primary-200!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"to\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"successorName()\">\r\n {{ successorName() }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-surface pt-3 text-xs text-muted-color\"\r\n >\r\n <span\r\n class=\"rounded-md border px-2 py-0.5 font-semibold\"\r\n [class]=\"statusClass()\"\r\n >{{ text.code(\"statuses\", replacement.status) }}</span\r\n >\r\n @if (createdAt(); as created) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.calendar\" />\r\n {{ t(\"started\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n created | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n @if (updatedAt(); as updated) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.clock\" />\r\n {{ t(\"updated\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n updated | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Where it is, in one sentence -->\r\n @if (card(); as status) {\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border p-4\"\r\n [class]=\"cardBoxClass()\"\r\n role=\"status\"\r\n >\r\n <div class=\"flex items-start gap-3\">\r\n <mt-icon\r\n [icon]=\"status.icon\"\r\n class=\"mt-0.5 shrink-0 text-xl\"\r\n [class]=\"cardIconClass()\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\r\n <div class=\"font-semibold\">{{ status.title }}</div>\r\n @if (status.body) {\r\n <div class=\"text-sm\">{{ status.body }}</div>\r\n }\r\n @if (isFinished() && notCheckedCount() > 0) {\r\n <div class=\"text-sm opacity-80\">\r\n {{ t(\"not-checked-note\", { count: notCheckedCount() }) }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (status.progress) {\r\n <p-progressbar mode=\"indeterminate\" [style]=\"{ height: '4px' }\" />\r\n }\r\n\r\n @if (actionError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ actionError() }}</span>\r\n </div>\r\n }\r\n </section>\r\n }\r\n\r\n <!-- The results: outcomes after Start, what needs an admin first -->\r\n @if (showResults()) {\r\n <section class=\"flex flex-col gap-3\">\r\n <h3 class=\"text-sm font-semibold\">{{ t(\"results-title\") }}</h3>\r\n\r\n @if (tabs().length > 1) {\r\n <mt-tabs\r\n [options]=\"tabs()\"\r\n [active]=\"activeTab()\"\r\n (activeChange)=\"selectTab($event)\"\r\n mode=\"underline\"\r\n size=\"small\"\r\n />\r\n }\r\n @if (rows().length > 8) {\r\n <mt-text-field\r\n [formControl]=\"search\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"t('search-results')\"\r\n />\r\n }\r\n\r\n @if (itemsError()) {\r\n <div\r\n class=\"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n {{ itemsError() }}\r\n </div>\r\n } @else if (itemsLoading() && !filteredRows().length) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (row of [1, 2, 3]; track row) {\r\n <p-skeleton height=\"3.5rem\" borderRadius=\"0.375rem\" />\r\n }\r\n </div>\r\n } @else if (!filteredRows().length) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface p-4 text-center text-sm text-muted-color\"\r\n >\r\n {{ t(\"no-matching-results\") }}\r\n </div>\r\n } @else {\r\n <ul class=\"rounded-md border border-surface bg-content\">\r\n @for (group of visibleGroups(); track group.place.key) {\r\n <li class=\"border-t border-surface first:border-t-0\">\r\n <!-- The place: project, record, request or escalation -->\r\n <div\r\n class=\"flex items-center gap-3 bg-surface-50 px-3 py-2 dark:bg-surface-900\"\r\n >\r\n <mt-icon\r\n [icon]=\"group.place.icon\"\r\n class=\"shrink-0 text-muted-color\"\r\n />\r\n <div class=\"min-w-0 flex-1\">\r\n <div\r\n class=\"truncate text-sm font-semibold\"\r\n [title]=\"group.place.title\"\r\n >\r\n {{ group.place.title }}\r\n </div>\r\n @if (group.place.context) {\r\n <div\r\n class=\"truncate text-xs text-muted-color\"\r\n [title]=\"group.place.context\"\r\n >\r\n {{ group.place.context }}\r\n </div>\r\n }\r\n </div>\r\n @if (group.place.openUrl) {\r\n <a\r\n class=\"flex shrink-0 items-center gap-1 text-xs text-primary hover:underline\"\r\n [href]=\"group.place.openUrl\"\r\n target=\"_blank\"\r\n rel=\"noopener\"\r\n >\r\n {{ t(\"open-project\") }}\r\n <mt-icon\r\n icon=\"general.link-external-01\"\r\n class=\"rtl:-scale-x-100\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n <ul>\r\n @for (row of group.rows; track row.itemId) {\r\n <li\r\n class=\"flex items-start gap-3 border-t border-surface p-3\"\r\n >\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\r\n <span class=\"text-sm font-medium\">{{\r\n row.words.headline\r\n }}</span>\r\n @if (row.statusDetail) {\r\n <span class=\"text-xs text-muted-color\">{{\r\n row.statusDetail\r\n }}</span>\r\n }\r\n @if (showDetails() && row.words.technical) {\r\n <span\r\n class=\"truncate font-mono text-[11px] text-muted-color\"\r\n [title]=\"row.words.technical\"\r\n >{{ row.words.technical }}</span\r\n >\r\n }\r\n </div>\r\n <span\r\n class=\"shrink-0 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"row.statusClass\"\r\n >{{ row.status }}</span\r\n >\r\n </li>\r\n }\r\n @if (group.foldedTeamRoles) {\r\n <li\r\n class=\"flex items-center gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.check-circle\" class=\"shrink-0\" />\r\n {{ t(\"team-note\", { count: group.foldedTeamRoles }) }}\r\n </li>\r\n }\r\n @if (group.untouched) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"untouched-note\", { list: group.untouched }) }}\r\n </li>\r\n }\r\n @if (group.unchecked) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"alert.alert-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"unchecked-note\", { list: group.unchecked }) }}\r\n </li>\r\n }\r\n </ul>\r\n </li>\r\n }\r\n </ul>\r\n @if (hiddenRowCount() > 0) {\r\n <mt-button\r\n class=\"self-center\"\r\n [label]=\"t('show-more', { count: hiddenRowCount() })\"\r\n icon=\"arrow.chevron-down\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"showMore()\"\r\n />\r\n }\r\n @if (loadingMore()) {\r\n <div\r\n class=\"flex items-center justify-center gap-2 text-xs text-muted-color\"\r\n role=\"status\"\r\n >\r\n <mt-icon icon=\"arrow.refresh-cw-02\" class=\"animate-spin\" />\r\n {{\r\n t(\"loading-more\", {\r\n loaded: items().length,\r\n total: summary()?.itemCount ?? items().length,\r\n })\r\n }}\r\n </div>\r\n }\r\n }\r\n </section>\r\n }\r\n\r\n <!-- One general limit, with every backend code behind a toggle -->\r\n <div class=\"flex flex-col gap-1 text-xs text-muted-color\">\r\n <div class=\"flex items-start gap-1.5\">\r\n <mt-icon icon=\"general.info-circle\" class=\"mt-px shrink-0\" />\r\n <span>{{ t(\"notices.supported-only\") }}</span>\r\n </div>\r\n @if (technicalDetails().length) {\r\n <button\r\n type=\"button\"\r\n class=\"ms-5 flex items-center gap-1 self-start text-primary hover:underline\"\r\n [attr.aria-expanded]=\"showDetails()\"\r\n (click)=\"showDetails.set(!showDetails())\"\r\n >\r\n <mt-icon\r\n [icon]=\"showDetails() ? 'arrow.chevron-up' : 'arrow.chevron-down'\"\r\n />\r\n {{ showDetails() ? t(\"hide-details\") : t(\"show-details\") }}\r\n </button>\r\n @if (showDetails()) {\r\n <ul class=\"ms-5 flex list-disc flex-col gap-0.5 ps-4\">\r\n @for (detail of technicalDetails(); track $index) {\r\n <li>{{ detail }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Close, and Stop / Close replacement while the backend allows it -->\r\n <div [class]=\"modal.footerClass\">\r\n @if (canCancel()) {\r\n <mt-button\r\n [label]=\"cancelIsStop() ? t('stop') : t('close')\"\r\n icon=\"general.x-circle\"\r\n severity=\"danger\"\r\n variant=\"outlined\"\r\n [loading]=\"cancelling()\"\r\n (click)=\"cancel()\"\r\n />\r\n }\r\n <mt-button [label]=\"t('dismiss')\" (click)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ 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: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i2.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }] });
|
|
4707
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: UserReplacementDetails, isStandalone: true, selector: "mt-user-replacement-details", inputs: { operationId: { classPropertyName: "operationId", publicName: "operationId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n @if (loading()) {\r\n <p-skeleton height=\"7rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"6rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"12rem\" borderRadius=\"0.375rem\" />\r\n } @else if (loadError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ loadError() }}</span>\r\n </div>\r\n } @else if (contractOutdated()) {\r\n <div\r\n class=\"rounded-md border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200\"\r\n >\r\n {{ t(\"contract-outdated\") }}\r\n </div>\r\n } @else if (summary(); as replacement) {\r\n <!-- Who \u2192 who, the status, and when -->\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border border-surface bg-content p-4\"\r\n >\r\n <div class=\"flex items-center gap-3\">\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"from\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"sourceName()\">\r\n {{ sourceName() }}\r\n </div>\r\n </div>\r\n </div>\r\n <mt-icon\r\n icon=\"arrow.arrow-right\"\r\n class=\"shrink-0 text-lg text-muted-color rtl:rotate-180\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"successorInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-primary-50! text-primary-700! dark:bg-primary-950! dark:text-primary-200!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"to\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"successorName()\">\r\n {{ successorName() }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-surface pt-3 text-xs text-muted-color\"\r\n >\r\n <span\r\n class=\"rounded-md border px-2 py-0.5 font-semibold\"\r\n [class]=\"statusClass()\"\r\n >{{ text.code(\"statuses\", replacement.status) }}</span\r\n >\r\n @if (createdAt(); as created) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.calendar\" />\r\n {{ t(\"started\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n created | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n @if (updatedAt(); as updated) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.clock\" />\r\n {{ t(\"updated\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n updated | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Where it is, in one sentence -->\r\n @if (card(); as status) {\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border p-4\"\r\n [class]=\"cardBoxClass()\"\r\n role=\"status\"\r\n >\r\n <div class=\"flex items-start gap-3\">\r\n <mt-icon\r\n [icon]=\"status.icon\"\r\n class=\"mt-0.5 shrink-0 text-xl\"\r\n [class]=\"cardIconClass()\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\r\n <div class=\"font-semibold\">{{ status.title }}</div>\r\n @if (status.body) {\r\n <div class=\"text-sm\">{{ status.body }}</div>\r\n }\r\n @if (isFinished() && notCheckedCount() > 0) {\r\n <div class=\"text-sm opacity-80\">\r\n {{ t(\"not-checked-note\", { count: notCheckedCount() }) }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (canRemoveSource()) {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 border-t border-surface pt-3\"\r\n >\r\n <span class=\"text-sm\">{{\r\n t(\"remove-source-hint\", { name: sourceName() })\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('remove-source')\"\r\n icon=\"general.link-broken-01\"\r\n severity=\"danger\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [loading]=\"removing()\"\r\n (click)=\"removeSource()\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (status.progress) {\r\n <p-progressbar mode=\"indeterminate\" [style]=\"{ height: '4px' }\" />\r\n }\r\n\r\n @if (actionError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ actionError() }}</span>\r\n </div>\r\n }\r\n </section>\r\n }\r\n\r\n <!-- The results: outcomes after Start, what needs an admin first -->\r\n @if (showResults()) {\r\n <section class=\"flex flex-col gap-3\">\r\n <h3 class=\"text-sm font-semibold\">{{ t(\"results-title\") }}</h3>\r\n\r\n @if (tabs().length > 1) {\r\n <mt-tabs\r\n [options]=\"tabs()\"\r\n [active]=\"activeTab()\"\r\n (activeChange)=\"selectTab($event)\"\r\n mode=\"underline\"\r\n size=\"small\"\r\n />\r\n }\r\n @if (rows().length > 8) {\r\n <mt-text-field\r\n [formControl]=\"search\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"t('search-results')\"\r\n />\r\n }\r\n\r\n @if (itemsError()) {\r\n <div\r\n class=\"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n {{ itemsError() }}\r\n </div>\r\n } @else if (itemsLoading() && !filteredRows().length) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (row of [1, 2, 3]; track row) {\r\n <p-skeleton height=\"3.5rem\" borderRadius=\"0.375rem\" />\r\n }\r\n </div>\r\n } @else if (!filteredRows().length) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface p-4 text-center text-sm text-muted-color\"\r\n >\r\n {{ t(\"no-matching-results\") }}\r\n </div>\r\n } @else {\r\n <ul class=\"rounded-md border border-surface bg-content\">\r\n @for (group of visibleGroups(); track group.place.key) {\r\n <li class=\"border-t border-surface first:border-t-0\">\r\n <!-- The place: project, record, request or escalation -->\r\n <div\r\n class=\"flex items-center gap-3 bg-surface-50 px-3 py-2 dark:bg-surface-900\"\r\n >\r\n <mt-icon\r\n [icon]=\"group.place.icon\"\r\n class=\"shrink-0 text-muted-color\"\r\n />\r\n <div class=\"min-w-0 flex-1\">\r\n <div\r\n class=\"truncate text-sm font-semibold\"\r\n [title]=\"group.place.title\"\r\n >\r\n {{ group.place.title }}\r\n </div>\r\n @if (group.place.context) {\r\n <div\r\n class=\"truncate text-xs text-muted-color\"\r\n [title]=\"group.place.context\"\r\n >\r\n {{ group.place.context }}\r\n </div>\r\n }\r\n </div>\r\n @if (group.place.openUrl) {\r\n <a\r\n class=\"flex shrink-0 items-center gap-1 text-xs text-primary hover:underline\"\r\n [href]=\"group.place.openUrl\"\r\n target=\"_blank\"\r\n rel=\"noopener\"\r\n >\r\n {{ t(\"open-project\") }}\r\n <mt-icon\r\n icon=\"general.link-external-01\"\r\n class=\"rtl:-scale-x-100\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n <ul>\r\n @for (row of group.rows; track row.itemId) {\r\n <li\r\n class=\"flex items-start gap-3 border-t border-surface p-3\"\r\n >\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\r\n <span class=\"text-sm font-medium\">{{\r\n row.words.headline\r\n }}</span>\r\n @if (row.statusDetail) {\r\n <span class=\"text-xs text-muted-color\">{{\r\n row.statusDetail\r\n }}</span>\r\n }\r\n @if (showDetails() && row.words.technical) {\r\n <span\r\n class=\"truncate font-mono text-[11px] text-muted-color\"\r\n [title]=\"row.words.technical\"\r\n >{{ row.words.technical }}</span\r\n >\r\n }\r\n </div>\r\n <span\r\n class=\"shrink-0 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"row.statusClass\"\r\n >{{ row.status }}</span\r\n >\r\n </li>\r\n }\r\n @if (group.foldedTeamRoles) {\r\n <li\r\n class=\"flex items-center gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.check-circle\" class=\"shrink-0\" />\r\n {{ t(\"team-note\", { count: group.foldedTeamRoles }) }}\r\n </li>\r\n }\r\n @if (group.untouched) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"untouched-note\", { list: group.untouched }) }}\r\n </li>\r\n }\r\n @if (group.unchecked) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"alert.alert-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"unchecked-note\", { list: group.unchecked }) }}\r\n </li>\r\n }\r\n </ul>\r\n </li>\r\n }\r\n </ul>\r\n @if (hiddenRowCount() > 0) {\r\n <mt-button\r\n class=\"self-center\"\r\n [label]=\"t('show-more', { count: hiddenRowCount() })\"\r\n icon=\"arrow.chevron-down\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"showMore()\"\r\n />\r\n }\r\n @if (loadingMore()) {\r\n <div\r\n class=\"flex items-center justify-center gap-2 text-xs text-muted-color\"\r\n role=\"status\"\r\n >\r\n <mt-icon icon=\"arrow.refresh-cw-02\" class=\"animate-spin\" />\r\n {{\r\n t(\"loading-more\", {\r\n loaded: items().length,\r\n total: summary()?.itemCount ?? items().length,\r\n })\r\n }}\r\n </div>\r\n }\r\n }\r\n </section>\r\n }\r\n\r\n <!-- One general limit, with every backend code behind a toggle -->\r\n <div class=\"flex flex-col gap-1 text-xs text-muted-color\">\r\n <div class=\"flex items-start gap-1.5\">\r\n <mt-icon icon=\"general.info-circle\" class=\"mt-px shrink-0\" />\r\n <span>{{ t(\"notices.supported-only\") }}</span>\r\n </div>\r\n @if (technicalDetails().length) {\r\n <button\r\n type=\"button\"\r\n class=\"ms-5 flex items-center gap-1 self-start text-primary hover:underline\"\r\n [attr.aria-expanded]=\"showDetails()\"\r\n (click)=\"showDetails.set(!showDetails())\"\r\n >\r\n <mt-icon\r\n [icon]=\"showDetails() ? 'arrow.chevron-up' : 'arrow.chevron-down'\"\r\n />\r\n {{ showDetails() ? t(\"hide-details\") : t(\"show-details\") }}\r\n </button>\r\n @if (showDetails()) {\r\n <ul class=\"ms-5 flex list-disc flex-col gap-0.5 ps-4\">\r\n @for (detail of technicalDetails(); track $index) {\r\n <li>{{ detail }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Close, and Stop / Close replacement while the backend allows it -->\r\n <div [class]=\"modal.footerClass\">\r\n @if (canCancel()) {\r\n <mt-button\r\n [label]=\"cancelIsStop() ? t('stop') : t('close')\"\r\n icon=\"general.x-circle\"\r\n severity=\"danger\"\r\n variant=\"outlined\"\r\n [loading]=\"cancelling()\"\r\n (click)=\"cancel()\"\r\n />\r\n }\r\n <mt-button [label]=\"t('dismiss')\" (click)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ 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: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i2.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }] });
|
|
4595
4708
|
}
|
|
4596
4709
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: UserReplacementDetails, decorators: [{
|
|
4597
4710
|
type: Component,
|
|
@@ -4606,7 +4719,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
4606
4719
|
ProgressBarModule,
|
|
4607
4720
|
SkeletonModule,
|
|
4608
4721
|
MTDateFormatPipe,
|
|
4609
|
-
], template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n @if (loading()) {\r\n <p-skeleton height=\"7rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"6rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"12rem\" borderRadius=\"0.375rem\" />\r\n } @else if (loadError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ loadError() }}</span>\r\n </div>\r\n } @else if (contractOutdated()) {\r\n <div\r\n class=\"rounded-md border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200\"\r\n >\r\n {{ t(\"contract-outdated\") }}\r\n </div>\r\n } @else if (summary(); as replacement) {\r\n <!-- Who \u2192 who, the status, and when -->\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border border-surface bg-content p-4\"\r\n >\r\n <div class=\"flex items-center gap-3\">\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"from\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"sourceName()\">\r\n {{ sourceName() }}\r\n </div>\r\n </div>\r\n </div>\r\n <mt-icon\r\n icon=\"arrow.arrow-right\"\r\n class=\"shrink-0 text-lg text-muted-color rtl:rotate-180\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"successorInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-primary-50! text-primary-700! dark:bg-primary-950! dark:text-primary-200!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"to\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"successorName()\">\r\n {{ successorName() }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-surface pt-3 text-xs text-muted-color\"\r\n >\r\n <span\r\n class=\"rounded-md border px-2 py-0.5 font-semibold\"\r\n [class]=\"statusClass()\"\r\n >{{ text.code(\"statuses\", replacement.status) }}</span\r\n >\r\n @if (createdAt(); as created) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.calendar\" />\r\n {{ t(\"started\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n created | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n @if (updatedAt(); as updated) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.clock\" />\r\n {{ t(\"updated\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n updated | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Where it is, in one sentence -->\r\n @if (card(); as status) {\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border p-4\"\r\n [class]=\"cardBoxClass()\"\r\n role=\"status\"\r\n >\r\n <div class=\"flex items-start gap-3\">\r\n <mt-icon\r\n [icon]=\"status.icon\"\r\n class=\"mt-0.5 shrink-0 text-xl\"\r\n [class]=\"cardIconClass()\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\r\n <div class=\"font-semibold\">{{ status.title }}</div>\r\n @if (status.body) {\r\n <div class=\"text-sm\">{{ status.body }}</div>\r\n }\r\n @if (isFinished() && notCheckedCount() > 0) {\r\n <div class=\"text-sm opacity-80\">\r\n {{ t(\"not-checked-note\", { count: notCheckedCount() }) }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (status.progress) {\r\n <p-progressbar mode=\"indeterminate\" [style]=\"{ height: '4px' }\" />\r\n }\r\n\r\n @if (actionError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ actionError() }}</span>\r\n </div>\r\n }\r\n </section>\r\n }\r\n\r\n <!-- The results: outcomes after Start, what needs an admin first -->\r\n @if (showResults()) {\r\n <section class=\"flex flex-col gap-3\">\r\n <h3 class=\"text-sm font-semibold\">{{ t(\"results-title\") }}</h3>\r\n\r\n @if (tabs().length > 1) {\r\n <mt-tabs\r\n [options]=\"tabs()\"\r\n [active]=\"activeTab()\"\r\n (activeChange)=\"selectTab($event)\"\r\n mode=\"underline\"\r\n size=\"small\"\r\n />\r\n }\r\n @if (rows().length > 8) {\r\n <mt-text-field\r\n [formControl]=\"search\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"t('search-results')\"\r\n />\r\n }\r\n\r\n @if (itemsError()) {\r\n <div\r\n class=\"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n {{ itemsError() }}\r\n </div>\r\n } @else if (itemsLoading() && !filteredRows().length) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (row of [1, 2, 3]; track row) {\r\n <p-skeleton height=\"3.5rem\" borderRadius=\"0.375rem\" />\r\n }\r\n </div>\r\n } @else if (!filteredRows().length) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface p-4 text-center text-sm text-muted-color\"\r\n >\r\n {{ t(\"no-matching-results\") }}\r\n </div>\r\n } @else {\r\n <ul class=\"rounded-md border border-surface bg-content\">\r\n @for (group of visibleGroups(); track group.place.key) {\r\n <li class=\"border-t border-surface first:border-t-0\">\r\n <!-- The place: project, record, request or escalation -->\r\n <div\r\n class=\"flex items-center gap-3 bg-surface-50 px-3 py-2 dark:bg-surface-900\"\r\n >\r\n <mt-icon\r\n [icon]=\"group.place.icon\"\r\n class=\"shrink-0 text-muted-color\"\r\n />\r\n <div class=\"min-w-0 flex-1\">\r\n <div\r\n class=\"truncate text-sm font-semibold\"\r\n [title]=\"group.place.title\"\r\n >\r\n {{ group.place.title }}\r\n </div>\r\n @if (group.place.context) {\r\n <div\r\n class=\"truncate text-xs text-muted-color\"\r\n [title]=\"group.place.context\"\r\n >\r\n {{ group.place.context }}\r\n </div>\r\n }\r\n </div>\r\n @if (group.place.openUrl) {\r\n <a\r\n class=\"flex shrink-0 items-center gap-1 text-xs text-primary hover:underline\"\r\n [href]=\"group.place.openUrl\"\r\n target=\"_blank\"\r\n rel=\"noopener\"\r\n >\r\n {{ t(\"open-project\") }}\r\n <mt-icon\r\n icon=\"general.link-external-01\"\r\n class=\"rtl:-scale-x-100\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n <ul>\r\n @for (row of group.rows; track row.itemId) {\r\n <li\r\n class=\"flex items-start gap-3 border-t border-surface p-3\"\r\n >\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\r\n <span class=\"text-sm font-medium\">{{\r\n row.words.headline\r\n }}</span>\r\n @if (row.statusDetail) {\r\n <span class=\"text-xs text-muted-color\">{{\r\n row.statusDetail\r\n }}</span>\r\n }\r\n @if (showDetails() && row.words.technical) {\r\n <span\r\n class=\"truncate font-mono text-[11px] text-muted-color\"\r\n [title]=\"row.words.technical\"\r\n >{{ row.words.technical }}</span\r\n >\r\n }\r\n </div>\r\n <span\r\n class=\"shrink-0 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"row.statusClass\"\r\n >{{ row.status }}</span\r\n >\r\n </li>\r\n }\r\n @if (group.foldedTeamRoles) {\r\n <li\r\n class=\"flex items-center gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.check-circle\" class=\"shrink-0\" />\r\n {{ t(\"team-note\", { count: group.foldedTeamRoles }) }}\r\n </li>\r\n }\r\n @if (group.untouched) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"untouched-note\", { list: group.untouched }) }}\r\n </li>\r\n }\r\n @if (group.unchecked) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"alert.alert-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"unchecked-note\", { list: group.unchecked }) }}\r\n </li>\r\n }\r\n </ul>\r\n </li>\r\n }\r\n </ul>\r\n @if (hiddenRowCount() > 0) {\r\n <mt-button\r\n class=\"self-center\"\r\n [label]=\"t('show-more', { count: hiddenRowCount() })\"\r\n icon=\"arrow.chevron-down\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"showMore()\"\r\n />\r\n }\r\n @if (loadingMore()) {\r\n <div\r\n class=\"flex items-center justify-center gap-2 text-xs text-muted-color\"\r\n role=\"status\"\r\n >\r\n <mt-icon icon=\"arrow.refresh-cw-02\" class=\"animate-spin\" />\r\n {{\r\n t(\"loading-more\", {\r\n loaded: items().length,\r\n total: summary()?.itemCount ?? items().length,\r\n })\r\n }}\r\n </div>\r\n }\r\n }\r\n </section>\r\n }\r\n\r\n <!-- One general limit, with every backend code behind a toggle -->\r\n <div class=\"flex flex-col gap-1 text-xs text-muted-color\">\r\n <div class=\"flex items-start gap-1.5\">\r\n <mt-icon icon=\"general.info-circle\" class=\"mt-px shrink-0\" />\r\n <span>{{ t(\"notices.supported-only\") }}</span>\r\n </div>\r\n @if (technicalDetails().length) {\r\n <button\r\n type=\"button\"\r\n class=\"ms-5 flex items-center gap-1 self-start text-primary hover:underline\"\r\n [attr.aria-expanded]=\"showDetails()\"\r\n (click)=\"showDetails.set(!showDetails())\"\r\n >\r\n <mt-icon\r\n [icon]=\"showDetails() ? 'arrow.chevron-up' : 'arrow.chevron-down'\"\r\n />\r\n {{ showDetails() ? t(\"hide-details\") : t(\"show-details\") }}\r\n </button>\r\n @if (showDetails()) {\r\n <ul class=\"ms-5 flex list-disc flex-col gap-0.5 ps-4\">\r\n @for (detail of technicalDetails(); track $index) {\r\n <li>{{ detail }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Close, and Stop / Close replacement while the backend allows it -->\r\n <div [class]=\"modal.footerClass\">\r\n @if (canCancel()) {\r\n <mt-button\r\n [label]=\"cancelIsStop() ? t('stop') : t('close')\"\r\n icon=\"general.x-circle\"\r\n severity=\"danger\"\r\n variant=\"outlined\"\r\n [loading]=\"cancelling()\"\r\n (click)=\"cancel()\"\r\n />\r\n }\r\n <mt-button [label]=\"t('dismiss')\" (click)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n" }]
|
|
4722
|
+
], template: "<ng-container *transloco=\"let t; prefix: 'users-groups.replacement'\">\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n @if (loading()) {\r\n <p-skeleton height=\"7rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"6rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton height=\"12rem\" borderRadius=\"0.375rem\" />\r\n } @else if (loadError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ loadError() }}</span>\r\n </div>\r\n } @else if (contractOutdated()) {\r\n <div\r\n class=\"rounded-md border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200\"\r\n >\r\n {{ t(\"contract-outdated\") }}\r\n </div>\r\n } @else if (summary(); as replacement) {\r\n <!-- Who \u2192 who, the status, and when -->\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border border-surface bg-content p-4\"\r\n >\r\n <div class=\"flex items-center gap-3\">\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"sourceInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-surface-100! text-color! dark:bg-surface-800!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"from\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"sourceName()\">\r\n {{ sourceName() }}\r\n </div>\r\n </div>\r\n </div>\r\n <mt-icon\r\n icon=\"arrow.arrow-right\"\r\n class=\"shrink-0 text-lg text-muted-color rtl:rotate-180\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\r\n <mt-avatar\r\n [label]=\"successorInitials()\"\r\n shape=\"circle\"\r\n styleClass=\"bg-primary-50! text-primary-700! dark:bg-primary-950! dark:text-primary-200!\"\r\n />\r\n <div class=\"min-w-0\">\r\n <div class=\"text-xs text-muted-color\">{{ t(\"to\") }}</div>\r\n <div class=\"truncate font-semibold\" [title]=\"successorName()\">\r\n {{ successorName() }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-surface pt-3 text-xs text-muted-color\"\r\n >\r\n <span\r\n class=\"rounded-md border px-2 py-0.5 font-semibold\"\r\n [class]=\"statusClass()\"\r\n >{{ text.code(\"statuses\", replacement.status) }}</span\r\n >\r\n @if (createdAt(); as created) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.calendar\" />\r\n {{ t(\"started\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n created | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n @if (updatedAt(); as updated) {\r\n <span class=\"flex items-center gap-1\">\r\n <mt-icon icon=\"time.clock\" />\r\n {{ t(\"updated\") }}\r\n <span class=\"tabular-nums text-color\">{{\r\n updated | mtDateFormat: \"dateTime\"\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Where it is, in one sentence -->\r\n @if (card(); as status) {\r\n <section\r\n class=\"flex flex-col gap-3 rounded-md border p-4\"\r\n [class]=\"cardBoxClass()\"\r\n role=\"status\"\r\n >\r\n <div class=\"flex items-start gap-3\">\r\n <mt-icon\r\n [icon]=\"status.icon\"\r\n class=\"mt-0.5 shrink-0 text-xl\"\r\n [class]=\"cardIconClass()\"\r\n />\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\r\n <div class=\"font-semibold\">{{ status.title }}</div>\r\n @if (status.body) {\r\n <div class=\"text-sm\">{{ status.body }}</div>\r\n }\r\n @if (isFinished() && notCheckedCount() > 0) {\r\n <div class=\"text-sm opacity-80\">\r\n {{ t(\"not-checked-note\", { count: notCheckedCount() }) }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (canRemoveSource()) {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 border-t border-surface pt-3\"\r\n >\r\n <span class=\"text-sm\">{{\r\n t(\"remove-source-hint\", { name: sourceName() })\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('remove-source')\"\r\n icon=\"general.link-broken-01\"\r\n severity=\"danger\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [loading]=\"removing()\"\r\n (click)=\"removeSource()\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (status.progress) {\r\n <p-progressbar mode=\"indeterminate\" [style]=\"{ height: '4px' }\" />\r\n }\r\n\r\n @if (actionError()) {\r\n <div\r\n class=\"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mt-0.5 shrink-0\" />\r\n <span>{{ actionError() }}</span>\r\n </div>\r\n }\r\n </section>\r\n }\r\n\r\n <!-- The results: outcomes after Start, what needs an admin first -->\r\n @if (showResults()) {\r\n <section class=\"flex flex-col gap-3\">\r\n <h3 class=\"text-sm font-semibold\">{{ t(\"results-title\") }}</h3>\r\n\r\n @if (tabs().length > 1) {\r\n <mt-tabs\r\n [options]=\"tabs()\"\r\n [active]=\"activeTab()\"\r\n (activeChange)=\"selectTab($event)\"\r\n mode=\"underline\"\r\n size=\"small\"\r\n />\r\n }\r\n @if (rows().length > 8) {\r\n <mt-text-field\r\n [formControl]=\"search\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"t('search-results')\"\r\n />\r\n }\r\n\r\n @if (itemsError()) {\r\n <div\r\n class=\"rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-200\"\r\n role=\"alert\"\r\n >\r\n {{ itemsError() }}\r\n </div>\r\n } @else if (itemsLoading() && !filteredRows().length) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (row of [1, 2, 3]; track row) {\r\n <p-skeleton height=\"3.5rem\" borderRadius=\"0.375rem\" />\r\n }\r\n </div>\r\n } @else if (!filteredRows().length) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface p-4 text-center text-sm text-muted-color\"\r\n >\r\n {{ t(\"no-matching-results\") }}\r\n </div>\r\n } @else {\r\n <ul class=\"rounded-md border border-surface bg-content\">\r\n @for (group of visibleGroups(); track group.place.key) {\r\n <li class=\"border-t border-surface first:border-t-0\">\r\n <!-- The place: project, record, request or escalation -->\r\n <div\r\n class=\"flex items-center gap-3 bg-surface-50 px-3 py-2 dark:bg-surface-900\"\r\n >\r\n <mt-icon\r\n [icon]=\"group.place.icon\"\r\n class=\"shrink-0 text-muted-color\"\r\n />\r\n <div class=\"min-w-0 flex-1\">\r\n <div\r\n class=\"truncate text-sm font-semibold\"\r\n [title]=\"group.place.title\"\r\n >\r\n {{ group.place.title }}\r\n </div>\r\n @if (group.place.context) {\r\n <div\r\n class=\"truncate text-xs text-muted-color\"\r\n [title]=\"group.place.context\"\r\n >\r\n {{ group.place.context }}\r\n </div>\r\n }\r\n </div>\r\n @if (group.place.openUrl) {\r\n <a\r\n class=\"flex shrink-0 items-center gap-1 text-xs text-primary hover:underline\"\r\n [href]=\"group.place.openUrl\"\r\n target=\"_blank\"\r\n rel=\"noopener\"\r\n >\r\n {{ t(\"open-project\") }}\r\n <mt-icon\r\n icon=\"general.link-external-01\"\r\n class=\"rtl:-scale-x-100\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n <ul>\r\n @for (row of group.rows; track row.itemId) {\r\n <li\r\n class=\"flex items-start gap-3 border-t border-surface p-3\"\r\n >\r\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\r\n <span class=\"text-sm font-medium\">{{\r\n row.words.headline\r\n }}</span>\r\n @if (row.statusDetail) {\r\n <span class=\"text-xs text-muted-color\">{{\r\n row.statusDetail\r\n }}</span>\r\n }\r\n @if (showDetails() && row.words.technical) {\r\n <span\r\n class=\"truncate font-mono text-[11px] text-muted-color\"\r\n [title]=\"row.words.technical\"\r\n >{{ row.words.technical }}</span\r\n >\r\n }\r\n </div>\r\n <span\r\n class=\"shrink-0 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"row.statusClass\"\r\n >{{ row.status }}</span\r\n >\r\n </li>\r\n }\r\n @if (group.foldedTeamRoles) {\r\n <li\r\n class=\"flex items-center gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.check-circle\" class=\"shrink-0\" />\r\n {{ t(\"team-note\", { count: group.foldedTeamRoles }) }}\r\n </li>\r\n }\r\n @if (group.untouched) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"untouched-note\", { list: group.untouched }) }}\r\n </li>\r\n }\r\n @if (group.unchecked) {\r\n <li\r\n class=\"flex items-start gap-2 border-t border-surface px-3 py-2 text-xs text-muted-color\"\r\n >\r\n <mt-icon\r\n icon=\"alert.alert-circle\"\r\n class=\"mt-0.5 shrink-0\"\r\n />\r\n {{ t(\"unchecked-note\", { list: group.unchecked }) }}\r\n </li>\r\n }\r\n </ul>\r\n </li>\r\n }\r\n </ul>\r\n @if (hiddenRowCount() > 0) {\r\n <mt-button\r\n class=\"self-center\"\r\n [label]=\"t('show-more', { count: hiddenRowCount() })\"\r\n icon=\"arrow.chevron-down\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"showMore()\"\r\n />\r\n }\r\n @if (loadingMore()) {\r\n <div\r\n class=\"flex items-center justify-center gap-2 text-xs text-muted-color\"\r\n role=\"status\"\r\n >\r\n <mt-icon icon=\"arrow.refresh-cw-02\" class=\"animate-spin\" />\r\n {{\r\n t(\"loading-more\", {\r\n loaded: items().length,\r\n total: summary()?.itemCount ?? items().length,\r\n })\r\n }}\r\n </div>\r\n }\r\n }\r\n </section>\r\n }\r\n\r\n <!-- One general limit, with every backend code behind a toggle -->\r\n <div class=\"flex flex-col gap-1 text-xs text-muted-color\">\r\n <div class=\"flex items-start gap-1.5\">\r\n <mt-icon icon=\"general.info-circle\" class=\"mt-px shrink-0\" />\r\n <span>{{ t(\"notices.supported-only\") }}</span>\r\n </div>\r\n @if (technicalDetails().length) {\r\n <button\r\n type=\"button\"\r\n class=\"ms-5 flex items-center gap-1 self-start text-primary hover:underline\"\r\n [attr.aria-expanded]=\"showDetails()\"\r\n (click)=\"showDetails.set(!showDetails())\"\r\n >\r\n <mt-icon\r\n [icon]=\"showDetails() ? 'arrow.chevron-up' : 'arrow.chevron-down'\"\r\n />\r\n {{ showDetails() ? t(\"hide-details\") : t(\"show-details\") }}\r\n </button>\r\n @if (showDetails()) {\r\n <ul class=\"ms-5 flex list-disc flex-col gap-0.5 ps-4\">\r\n @for (detail of technicalDetails(); track $index) {\r\n <li>{{ detail }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Close, and Stop / Close replacement while the backend allows it -->\r\n <div [class]=\"modal.footerClass\">\r\n @if (canCancel()) {\r\n <mt-button\r\n [label]=\"cancelIsStop() ? t('stop') : t('close')\"\r\n icon=\"general.x-circle\"\r\n severity=\"danger\"\r\n variant=\"outlined\"\r\n [loading]=\"cancelling()\"\r\n (click)=\"cancel()\"\r\n />\r\n }\r\n <mt-button [label]=\"t('dismiss')\" (click)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n" }]
|
|
4610
4723
|
}], propDecorators: { operationId: [{ type: i0.Input, args: [{ isSignal: true, alias: "operationId", required: true }] }] } });
|
|
4611
4724
|
|
|
4612
4725
|
const PAGE_SIZE = 25;
|
|
@@ -4832,7 +4945,7 @@ class UserReplacements {
|
|
|
4832
4945
|
});
|
|
4833
4946
|
const drawer = { id, ref };
|
|
4834
4947
|
this.drawer = drawer;
|
|
4835
|
-
ref.onClose.pipe(take(1)).subscribe(() => {
|
|
4948
|
+
ref.onClose.pipe(take(1)).subscribe((result) => {
|
|
4836
4949
|
// Replaced by another drawer, or the list itself is going away.
|
|
4837
4950
|
if (this.drawer !== drawer)
|
|
4838
4951
|
return;
|
|
@@ -4841,7 +4954,8 @@ class UserReplacements {
|
|
|
4841
4954
|
void this.reload();
|
|
4842
4955
|
void this.router.navigate([], {
|
|
4843
4956
|
relativeTo: this.route,
|
|
4844
|
-
|
|
4957
|
+
// The drawer can ask for another replacement of the same person.
|
|
4958
|
+
queryParams: { [OPEN_PARAM]: result?.openOperationId ?? null },
|
|
4845
4959
|
queryParamsHandling: 'merge',
|
|
4846
4960
|
replaceUrl: true,
|
|
4847
4961
|
});
|