();
+ @ViewChild(DictionaryManagerComponent, { static: false }) private _dictionaryManager: DictionaryManagerComponent;
+
+ constructor(
+ private readonly _appStateService: AppStateService,
+ private readonly _dictionarySaveService: DictionarySaveService,
+ private readonly _permissionsService: PermissionsService
+ ) {}
+
+ get changed() {
+ return this._dictionaryManager.hasChanges;
+ }
+
+ get disabled() {
+ return !this._permissionsService.isAdmin();
+ }
+
+ save() {
+ this._dictionarySaveService
+ .saveEntries(
+ this._dictionaryManager.currentDictionaryEntries,
+ this._dictionaryManager.initialDictionaryEntries,
+ this.projectWrapper.ruleSetId,
+ 'dossier_redaction',
+ this.projectWrapper.projectId,
+ false
+ )
+ .subscribe(async () => {
+ await this._appStateService.updateProjectDictionaryVersion(this.projectWrapper);
+ this._appStateService.updateProjectDictionary(this.projectWrapper.ruleSetId, this.projectWrapper.projectId);
+ this.updateProject.emit();
+ });
+ }
+
+ revert() {
+ this._dictionaryManager.revert();
+ }
+}
diff --git a/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.html
index e788564a3..dd6defdf3 100644
--- a/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.html
+++ b/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.html
@@ -17,7 +17,7 @@
@@ -26,6 +26,13 @@
*ngIf="activeNav === 'download-package'"
[projectWrapper]="projectWrapper"
>
+
+
+
diff --git a/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.scss
index 3e2b674e2..e7d761ec5 100644
--- a/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.scss
+++ b/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.scss
@@ -15,7 +15,8 @@
padding: 24px 32px;
overflow: auto;
@include scroll-bar;
- height: calc(100% - 129px);
+ height: calc(100% - 81px);
+ box-sizing: border-box;
.heading {
margin-bottom: 24px;
@@ -23,3 +24,8 @@
}
}
}
+
+redaction-edit-project-dictionary {
+ display: block;
+ height: calc(100% - 44px);
+}
diff --git a/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.ts
index dd9f30e44..09396132d 100644
--- a/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.ts
+++ b/apps/red-ui/src/app/modules/projects/dialogs/edit-project-dialog/edit-project-dialog.component.ts
@@ -8,6 +8,7 @@ import { EditProjectDownloadPackageComponent } from './download-package/edit-pro
import { EditProjectSectionInterface } from './edit-project-section.interface';
import { NotificationService, NotificationType } from '../../../../services/notification.service';
import { TranslateService } from '@ngx-translate/core';
+import { EditProjectDictionaryComponent } from './dictionary/edit-project-dictionary.component';
@Component({
selector: 'redaction-edit-project-dialog',
@@ -16,18 +17,20 @@ import { TranslateService } from '@ngx-translate/core';
})
export class EditProjectDialogComponent {
navItems: { key: string; title?: string }[] = [
- { key: 'project-info', title: 'general-info' },
- { key: 'download-package', title: 'choose-download' }
- // { key: 'project-dictionary' }
+ { key: 'dossier-info', title: 'general-info' },
+ { key: 'download-package', title: 'choose-download' },
+ { key: 'dossier-dictionary', title: 'dossier-dictionary' }
// TODO:
+ // { key: 'members' },
// { key: 'project-attributes' },
// { key: 'report-attributes' }
];
- activeNav = 'project-info';
+ activeNav = 'dossier-info';
projectWrapper: ProjectWrapper;
@ViewChild(EditProjectGeneralInfoComponent) generalInfoComponent: EditProjectGeneralInfoComponent;
@ViewChild(EditProjectDownloadPackageComponent) downloadPackageComponent: EditProjectDownloadPackageComponent;
+ @ViewChild(EditProjectDictionaryComponent) dictionaryComponent: EditProjectDictionaryComponent;
constructor(
private readonly _appStateService: AppStateService,
@@ -47,8 +50,9 @@ export class EditProjectDialogComponent {
get activeComponent(): EditProjectSectionInterface {
return {
- 'project-info': this.generalInfoComponent,
- 'download-package': this.downloadPackageComponent
+ 'dossier-info': this.generalInfoComponent,
+ 'download-package': this.downloadPackageComponent,
+ 'dossier-dictionary': this.dictionaryComponent
}[this.activeNav];
}
@@ -58,7 +62,9 @@ export class EditProjectDialogComponent {
null,
NotificationType.SUCCESS
);
- this.projectWrapper = updatedProject;
+ if (updatedProject) {
+ this.projectWrapper = updatedProject;
+ }
this._changeRef.detectChanges();
if (this.data.afterSave) {
this.data.afterSave();
diff --git a/apps/red-ui/src/app/modules/projects/projects.module.ts b/apps/red-ui/src/app/modules/projects/projects.module.ts
index 53722ebab..e7d552b34 100644
--- a/apps/red-ui/src/app/modules/projects/projects.module.ts
+++ b/apps/red-ui/src/app/modules/projects/projects.module.ts
@@ -41,6 +41,7 @@ import { EditProjectDialogComponent } from './dialogs/edit-project-dialog/edit-p
import { EditProjectGeneralInfoComponent } from './dialogs/edit-project-dialog/general-info/edit-project-general-info.component';
import { EditProjectDownloadPackageComponent } from './dialogs/edit-project-dialog/download-package/edit-project-download-package.component';
import { UserPreferenceControllerService } from '@redaction/red-ui-http';
+import { EditProjectDictionaryComponent } from './dialogs/edit-project-dialog/dictionary/edit-project-dictionary.component';
const screens = [ProjectListingScreenComponent, ProjectOverviewScreenComponent, FilePreviewScreenComponent];
@@ -74,6 +75,7 @@ const components = [
AnnotationRemoveActionsComponent,
EditProjectGeneralInfoComponent,
EditProjectDownloadPackageComponent,
+ EditProjectDictionaryComponent,
...screens,
...dialogs
diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html
index 8c67ecbf3..0de558717 100644
--- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html
+++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html
@@ -24,7 +24,7 @@
-