,
@@ -61,72 +63,43 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
readonly configService: ConfigService,
) {
super(_dialogRef, true);
- this.dossier$ = this._dossiersService.getEntityChanged$(this._data.dossierId).pipe(
- tap(dossier => {
- this.#dossier = dossier;
- this._initializeNavItems();
- }),
- );
- this.activeNav = this._data.section || 'dossierInfo';
- }
-
- get activeNavItem(): NavItem {
- return this.navItems.find(item => item.key === this.activeNav);
- }
-
- get activeComponent(): EditDossierSectionInterface {
- return {
- dossierInfo: this.generalInfoComponent,
- downloadPackage: this.downloadPackageComponent,
- dossierDictionary: this.dictionaryComponent,
- members: this.membersComponent,
- dossierAttributes: this.attributesComponent,
- }[this.activeNav];
- }
-
- get noPaddingTab(): boolean {
- return ['dossierAttributes', 'dossierDictionary'].includes(this.activeNav);
- }
-
- get showHeading(): boolean {
- return !['dossierAttributes', 'dossierDictionary'].includes(this.activeNav);
- }
-
- get showActionButtons(): boolean {
- return (
- (['dossierDictionary'].includes(this.activeNav) && this._permissionsService.canEditDossierDictionary(this.#dossier)) ||
- (['members'].includes(this.activeNav) &&
- this.#currentUser.isManager &&
- this.iqserPermissionsService.has(Roles.dossiers.edit)) ||
- this._permissionsService.canEditDossier(this.#dossier)
- );
+ this.dossier = toSignal(this._dossiersService.getEntityChanged$(this._data.dossierId));
+ this.navItems = computed(() => this._getNavItems(this.dossier()));
+ this.activeNav = signal(this._data.section || 'dossierInfo');
+ this.activeNavItem = computed(() => this.navItems().find(item => item.key === this.activeNav()));
+ this.activeComponent = computed(() => this._getActiveComponent(this.activeNav()));
+ this.noPaddingTab = computed(() => ['dossierAttributes', 'dossierDictionary'].includes(this.activeNav()));
+ this.showHeading = computed(() => !['dossierAttributes', 'dossierDictionary'].includes(this.activeNav()));
+ this.showActionButtons = computed(() => !this.activeNavItem().readonly);
}
get changed(): boolean {
- return this.activeComponent?.changed;
+ return this.activeComponent()?.changed;
}
get valid(): boolean {
- return this.activeComponent?.valid;
+ return this.activeComponent()?.valid;
}
get disabled(): boolean {
- return this.activeComponent?.disabled;
+ return this.activeComponent()?.disabled;
}
ngAfterViewInit() {
- if (!this.#dossier.ownerId) {
+ if (!untracked(this.dossier).ownerId) {
this._toaster.error(_('edit-dossier-dialog.missing-owner'));
}
}
async save(options?: SaveOptions) {
this._loadingService.start();
- const result = await this.activeComponent.save();
+ const result = await untracked(this.activeComponent).save();
this._loadingService.stop();
if (result.success) {
- this._toaster.success(_('edit-dossier-dialog.change-successful'), { params: { dossierName: this.#dossier.dossierName } });
+ this._toaster.success(_('edit-dossier-dialog.change-successful'), {
+ params: { dossierName: untracked(this.dossier).dossierName },
+ });
}
if (result.success && options?.closeAfterSave) {
@@ -135,7 +108,7 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
}
revert() {
- this.activeComponent.revert();
+ untracked(this.activeComponent).revert();
}
changeTab(key: Section) {
@@ -146,34 +119,44 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
} else {
this.revert();
}
- this.activeNav = key;
+ this.activeNav.set(key);
});
} else {
- this.activeNav = key;
+ this.activeNav.set(key);
}
}
- private _initializeNavItems(): void {
- this.navItems = [
+ private _getActiveComponent(section: Section): EditDossierSectionInterface {
+ return {
+ dossierInfo: this.generalInfoComponent,
+ downloadPackage: this.downloadPackageComponent,
+ dossierDictionary: this.dictionaryComponent,
+ members: this.membersComponent,
+ dossierAttributes: this.attributesComponent,
+ }[section];
+ }
+
+ private _getNavItems(dossier: Dossier): NavItem[] {
+ return [
{
key: 'dossierInfo',
title: _('edit-dossier-dialog.nav-items.general-info'),
sideNavTitle: _('edit-dossier-dialog.nav-items.dossier-info'),
- readonly: !this.#dossier.isActive || !this._permissionsService.canEditDossier(this.#dossier),
+ readonly: !this._permissionsService.canEditDossier(dossier),
helpModeKey: 'edit_dossier_dossier_info_DIALOG',
},
{
key: 'downloadPackage',
title: _('edit-dossier-dialog.nav-items.choose-download'),
sideNavTitle: _('edit-dossier-dialog.nav-items.download-package'),
- readonly: !this._permissionsService.canEditDossier(this.#dossier),
+ readonly: !this._permissionsService.canEditDossier(dossier),
helpModeKey: 'edit_dossier_download_package_DIALOG',
},
{
key: 'dossierDictionary',
sideNavTitle: _('edit-dossier-dialog.nav-items.dictionary'),
title: _('edit-dossier-dialog.nav-items.dossier-dictionary'),
- readonly: !this._permissionsService.canEditDossierDictionary(this.#dossier),
+ readonly: !this._permissionsService.canEditDossierDictionary(dossier),
helpModeKey: 'edit_dossier_dossier_dictionary_DIALOG',
hide: this.configService.values.IS_DOCUMINE,
},
@@ -181,13 +164,13 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
key: 'members',
title: _('edit-dossier-dialog.nav-items.team-members'),
sideNavTitle: _('edit-dossier-dialog.nav-items.members'),
- readonly: !this._permissionsService.canEditTeamMembers(this.#dossier),
+ readonly: !this._permissionsService.canEditTeamMembers(dossier),
helpModeKey: 'edit_dossier_members_DIALOG',
},
{
key: 'dossierAttributes',
title: _('edit-dossier-dialog.nav-items.dossier-attributes'),
- readonly: !this._permissionsService.canEditDossierAttributes(this.#dossier),
+ readonly: !this._permissionsService.canEditDossierAttributes(dossier),
helpModeKey: 'edit_dossier_dossier_attributes_DIALOG',
},
];
diff --git a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html
index 56a0eb045..1e5f43d09 100644
--- a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html
+++ b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html
@@ -106,14 +106,14 @@
{
diff --git a/apps/red-ui/src/app/services/permissions.service.ts b/apps/red-ui/src/app/services/permissions.service.ts
index 05e98f73d..0786aa785 100644
--- a/apps/red-ui/src/app/services/permissions.service.ts
+++ b/apps/red-ui/src/app/services/permissions.service.ts
@@ -302,7 +302,14 @@ export class PermissionsService {
}
canEditDossier(dossier: Dossier): boolean {
- return this._iqserPermissionsService.has(Roles.dossiers.edit) && this.isManager() && !!dossier?.ownerId;
+ const dossierTemplate = this._dossierTemplatesService.find(dossier.dossierTemplateId);
+ return (
+ this._iqserPermissionsService.has(Roles.dossiers.edit) &&
+ this.isManager() &&
+ !!dossier?.ownerId &&
+ dossier.isActive &&
+ dossierTemplate.isActive
+ );
}
canEditDossierDictionary(dossier: Dossier): boolean {
diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json
index c92861f44..ad22e3a79 100644
--- a/apps/red-ui/src/assets/i18n/redact/de.json
+++ b/apps/red-ui/src/assets/i18n/redact/de.json
@@ -26,6 +26,11 @@
"title": "Add annotation"
}
},
+ "add-clone-dossier-template": {
+ "save": "",
+ "save-and-edit": "",
+ "title": ""
+ },
"add-dossier-dialog": {
"actions": {
"save": "Speichern",
@@ -87,8 +92,7 @@
"valid-from": "Gültig ab",
"valid-to": "Gültig bis"
},
- "save": "Dossier-Vorlage speichern",
- "title": "{type, select, edit{Dossier-Vorlage {name} bearbeiten} create{Dossier-Vorlage erstellen} clone{} other{}}"
+ "save": "Dossier-Vorlage speichern"
},
"add-edit-dossier-attribute": {
"error": {
@@ -1020,6 +1024,7 @@
"entities": "{count} {count, plural, one{entity} other{entities}}",
"entries": "{count} {count, plural, one{entry} other{entries}}",
"modified-on": "Modified on: {date}",
+ "title": "",
"valid-from": "Valid from: {date}",
"valid-to": "Valid to: {date}"
},
@@ -1645,7 +1650,7 @@
"clicking-anywhere-on": "Klicken Sie auf eine beliebige Stelle des Bildschirms um zu sehen, welche Bereiche interaktiv sind. Wenn Sie mit der Maus über einen interaktiven Bereich fahren, verändert sich der Mauszeiger, um Ihnen zu zeigen, ob ein Element interaktiv ist.",
"instructions": "Hilfe-Modus-Anleitungen öffnen",
"options": {
- "do-not-show-again": ""
+ "do-not-show-again": "Do not show again"
},
"welcome-to-help-mode": " Willkommen im Hilfe-Modus!
Klicken Sie auf interaktive Elemente, um in einem neuen Tab Infos dazu zu erhalten. "
},
@@ -1970,7 +1975,7 @@
},
"form": {
"auto-expand-filters-on-action": "Auto-expand filters on my actions",
- "help-mode-dialog": "",
+ "help-mode-dialog": "Help Mode Dialog",
"load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview",
"open-structured-view-by-default": "Display structured component management modal by default",
"table-extraction-type": "Table extraction type"
@@ -1979,8 +1984,7 @@
"title": "Edit preferences",
"warnings-description": "Selecting the 'Do not show this message again' checkbox will skip the warning dialog the next time you trigger it.",
"warnings-label": "Prompts and dialogs",
- "warnings-subtitle": "Do not show again options",
- "warnings-title": "Prompts and dialogs settings"
+ "warnings-subtitle": "Do not show again options"
},
"processing-status": {
"ocr": "OCR",
@@ -2267,6 +2271,9 @@
},
"title": "Authentifizierung aktivieren"
},
+ "table-header": {
+ "selected-count": ""
+ },
"tenant-resolve": {
"contact-administrator": "Cannot remember the workspace? Please contact your administrator.",
"header": {
diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json
index a698d6731..2b66573c3 100644
--- a/apps/red-ui/src/assets/i18n/redact/en.json
+++ b/apps/red-ui/src/assets/i18n/redact/en.json
@@ -26,6 +26,11 @@
"title": "Add annotation"
}
},
+ "add-clone-dossier-template": {
+ "save": "{type, select, clone{Clone} other{Save}}",
+ "save-and-edit": "{type, select, clone{Clone} other{Save}} and edit",
+ "title": "{type, select, clone{Clone {dossierTemplateName}} other{Create dossier template}}"
+ },
"add-dossier-dialog": {
"actions": {
"save": "Save",
@@ -87,8 +92,7 @@
"valid-from": "Valid from",
"valid-to": "Valid to"
},
- "save": "Save dossier template",
- "title": "{type, select, edit{Edit {name}} create{Create} clone{Clone} other{}} dossier template"
+ "save": "Save dossier template"
},
"add-edit-dossier-attribute": {
"error": {
@@ -1021,6 +1025,7 @@
"entities": "{count} {count, plural, one{entity} other{entities}}",
"entries": "{count} {count, plural, one{entry} other{entries}}",
"modified-on": "Modified on: {date}",
+ "title": "Edit dossier template",
"valid-from": "Valid from: {date}",
"valid-to": "Valid to: {date}"
},
@@ -1980,8 +1985,7 @@
"title": "Edit preferences",
"warnings-description": "Selecting the 'Do not show this message again' checkbox will skip the warning dialog the next time you trigger it.",
"warnings-label": "Prompts and dialogs",
- "warnings-subtitle": "Do not show again options",
- "warnings-title": "Prompts and dialogs settings"
+ "warnings-subtitle": "Do not show again options"
},
"processing-status": {
"ocr": "OCR",
@@ -2268,6 +2272,9 @@
},
"title": "Enable authentication"
},
+ "table-header": {
+ "selected-count": "{count} selected"
+ },
"tenant-resolve": {
"contact-administrator": "Cannot remember the workspace? Please contact your administrator.",
"header": {
diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json
index 464198d20..d35779937 100644
--- a/apps/red-ui/src/assets/i18n/scm/de.json
+++ b/apps/red-ui/src/assets/i18n/scm/de.json
@@ -26,6 +26,11 @@
"title": "Add annotation"
}
},
+ "add-clone-dossier-template": {
+ "save": "",
+ "save-and-edit": "",
+ "title": ""
+ },
"add-dossier-dialog": {
"actions": {
"save": "Speichern",
@@ -87,8 +92,7 @@
"valid-from": "Gültig ab",
"valid-to": "Gültig bis"
},
- "save": "Dossier-Vorlage speichern",
- "title": "{type, select, edit{Dossier-Vorlage {name} bearbeiten} create{Dossier-Vorlage erstellen} clone{} other{}}"
+ "save": "Dossier-Vorlage speichern"
},
"add-edit-dossier-attribute": {
"error": {
@@ -1020,6 +1024,7 @@
"entities": "{count} {count, plural, one{entity} other{entities}}",
"entries": "{count} {count, plural, one{entry} other{entries}}",
"modified-on": "Modified on: {date}",
+ "title": "",
"valid-from": "Valid from: {date}",
"valid-to": "Valid to: {date}"
},
@@ -1645,7 +1650,7 @@
"clicking-anywhere-on": "Klicken Sie auf eine beliebige Stelle des Bildschirms um zu sehen, welche Bereiche interaktiv sind. Wenn Sie mit der Maus über einen interaktiven Bereich fahren, verändert sich der Mauszeiger, um Ihnen zu zeigen, ob ein Element interaktiv ist.",
"instructions": "Hilfe-Modus-Anleitungen öffnen",
"options": {
- "do-not-show-again": ""
+ "do-not-show-again": "Do not show again"
},
"welcome-to-help-mode": " Willkommen im Hilfe-Modus!
Klicken Sie auf interaktive Elemente, um in einem neuen Tab Infos dazu zu erhalten. "
},
@@ -1970,7 +1975,7 @@
},
"form": {
"auto-expand-filters-on-action": "Auto expand filters on my actions",
- "help-mode-dialog": "",
+ "help-mode-dialog": "Help Mode Dialog",
"load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview",
"open-structured-view-by-default": "Display Component View by default when opening a document",
"table-extraction-type": "Table extraction type"
@@ -1979,8 +1984,7 @@
"title": "Edit preferences",
"warnings-description": "Selecting the 'Do not show this message again' checkbox will skip the warning dialog the next time you trigger it.",
"warnings-label": "Prompts and dialogs",
- "warnings-subtitle": "Do not show again options",
- "warnings-title": "Prompts and dialogs settings"
+ "warnings-subtitle": "Do not show again options"
},
"processing-status": {
"ocr": "OCR",
@@ -2267,6 +2271,9 @@
},
"title": "Authentifizierung aktivieren"
},
+ "table-header": {
+ "selected-count": ""
+ },
"tenant-resolve": {
"contact-administrator": "Cannot remember the workspace? Please contact your administrator.",
"header": {
diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json
index cc0d3ace5..192bbe8f5 100644
--- a/apps/red-ui/src/assets/i18n/scm/en.json
+++ b/apps/red-ui/src/assets/i18n/scm/en.json
@@ -26,6 +26,11 @@
"title": "Add annotation"
}
},
+ "add-clone-dossier-template": {
+ "save": "{type, select, clone{Clone} other{Save}}",
+ "save-and-edit": "{type, select, clone{Clone} other{Save}} and edit",
+ "title": "{type, select, clone{Clone {dossierTemplateName}} other{Create dossier template}}"
+ },
"add-dossier-dialog": {
"actions": {
"save": "Save",
@@ -87,8 +92,7 @@
"valid-from": "Valid from",
"valid-to": "Valid to"
},
- "save": "Save dossier template",
- "title": "{type, select, edit{Edit {name}} create{Create} clone{Clone} other{}} dossier template"
+ "save": "Save dossier template"
},
"add-edit-dossier-attribute": {
"error": {
@@ -1021,6 +1025,7 @@
"entities": "{count} {count, plural, one{entity} other{entities}}",
"entries": "{count} {count, plural, one{entry} other{entries}}",
"modified-on": "Modified on: {date}",
+ "title": "Edit dossier template",
"valid-from": "Valid from: {date}",
"valid-to": "Valid to: {date}"
},
@@ -1980,8 +1985,7 @@
"title": "Edit preferences",
"warnings-description": "Selecting the 'Do not show this message again' checkbox will skip the warning dialog the next time you trigger it.",
"warnings-label": "Prompts and dialogs",
- "warnings-subtitle": "Do not show again options",
- "warnings-title": "Prompts and dialogs settings"
+ "warnings-subtitle": "Do not show again options"
},
"processing-status": {
"ocr": "OCR",
@@ -2268,6 +2272,9 @@
},
"title": "Enable authentication"
},
+ "table-header": {
+ "selected-count": "{count} selected"
+ },
"tenant-resolve": {
"contact-administrator": "Cannot remember the workspace? Please contact your administrator.",
"header": {
diff --git a/libs/red-domain/src/lib/dossier-templates/dossier-template.model.ts b/libs/red-domain/src/lib/dossier-templates/dossier-template.model.ts
index 24403da76..b3e249e92 100644
--- a/libs/red-domain/src/lib/dossier-templates/dossier-template.model.ts
+++ b/libs/red-domain/src/lib/dossier-templates/dossier-template.model.ts
@@ -60,8 +60,4 @@ export class DossierTemplate implements IDossierTemplate, IListable {
get routerLink(): string {
return `/main/admin/dossier-templates/${this.dossierTemplateId}`;
}
-
- get dossiersRouterLink(): string {
- return `/main/${this.dossierTemplateId}/dossiers`;
- }
}