{{ 'project-listing.add-edit-dialog.form.template' | translate }}
-
-
- {{ type }}
+
+
+ {{ ruleSet.name }}
diff --git a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts b/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts
index 2fa878326..db8e19078 100644
--- a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts
+++ b/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts
@@ -1,6 +1,6 @@
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
-import { Project } from '@redaction/red-ui-http';
+import { Project, RuleSetModel } from '@redaction/red-ui-http';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AppStateService } from '../../state/app-state.service';
import { ProjectWrapper } from '../../state/model/project.wrapper';
@@ -23,12 +23,17 @@ export class AddEditProjectDialogComponent {
) {
this.projectForm = this._formBuilder.group({
projectName: [this.project?.projectName, Validators.required],
+ ruleSet: [{ value: this.project?.ruleSetId, disabled: this.project?.hasFiles }, Validators.required],
description: [this.project?.description],
dueDate: [this.project?.dueDate]
});
this.hasDueDate = !!this.project?.dueDate;
}
+ public get ruleSets(): RuleSetModel[] {
+ return this._appStateService.ruleSets;
+ }
+
public get changed() {
if (!this.project) {
return true;
@@ -77,7 +82,8 @@ export class AddEditProjectDialogComponent {
return {
projectName: this.projectForm.get('projectName').value,
description: this.projectForm.get('description').value,
- dueDate: this.hasDueDate ? this.projectForm.get('dueDate').value : undefined
+ dueDate: this.hasDueDate ? this.projectForm.get('dueDate').value : undefined,
+ ruleSetId: this.projectForm.get('ruleSet').value
};
}
diff --git a/apps/red-ui/src/app/dialogs/dialog.service.ts b/apps/red-ui/src/app/dialogs/dialog.service.ts
index 1dff8b33a..76a992b44 100644
--- a/apps/red-ui/src/app/dialogs/dialog.service.ts
+++ b/apps/red-ui/src/app/dialogs/dialog.service.ts
@@ -1,10 +1,17 @@
import { Injectable } from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
-import { DictionaryControllerService, FileManagementControllerService, FileStatus, ManualRedactionControllerService, TypeValue } from '@redaction/red-ui-http';
+import {
+ DictionaryControllerService,
+ FileManagementControllerService,
+ FileStatus,
+ ManualRedactionControllerService,
+ RuleSetModel,
+ TypeValue
+} from '@redaction/red-ui-http';
import { ConfirmationDialogComponent, ConfirmationDialogInput } from './confirmation-dialog/confirmation-dialog.component';
import { NotificationService, NotificationType } from '../notification/notification.service';
import { TranslateService } from '@ngx-translate/core';
-import { AppStateService, ProjectTemplate } from '../state/app-state.service';
+import { AppStateService } from '../state/app-state.service';
import { AddEditProjectDialogComponent } from './add-edit-project-dialog/add-edit-project-dialog.component';
import { AssignOwnerDialogComponent } from './assign-owner-dialog/assign-owner-dialog.component';
import { ManualRedactionEntryWrapper } from '../screens/file/model/manual-redaction-entry.wrapper';
@@ -13,7 +20,7 @@ import { ManualAnnotationDialogComponent } from './manual-redaction-dialog/manua
import { ManualAnnotationService } from '../screens/file/service/manual-annotation.service';
import { ProjectWrapper } from '../state/model/project.wrapper';
import { AddEditDictionaryDialogComponent } from '../screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component';
-import { AddEditProjectTemplateDialogComponent } from '../screens/admin/project-templates-listing-screen/add-edit-project-template-dialog/add-edit-project-template-dialog.component';
+import { AddEditRuleSetDialogComponent } from '../screens/admin/rule-sets-listing-screen/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component';
import { DEFAULT_RUL_SET_UUID } from '../utils/rule-set-default';
const dialogConfig = {
@@ -175,7 +182,7 @@ export class DialogService {
return ref;
}
- public openDeleteProjectTemplateDialog($event: MouseEvent, projectTemplate: ProjectTemplate, cb?: Function): MatDialogRef
{
+ public openDeleteRuleSetDialog($event: MouseEvent, ruleSet: RuleSetModel, cb?: Function): MatDialogRef {
$event.stopPropagation();
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
ref.afterClosed().subscribe(async (result) => {
@@ -285,10 +292,10 @@ export class DialogService {
return ref;
}
- public openAddEditTemplateDialog(template: ProjectTemplate, cb?: Function): MatDialogRef {
- const ref = this._dialog.open(AddEditProjectTemplateDialogComponent, {
+ public openAddEditRuleSetDialog(ruleSet: RuleSetModel, cb?: Function): MatDialogRef {
+ const ref = this._dialog.open(AddEditRuleSetDialogComponent, {
...dialogConfig,
- data: template,
+ data: ruleSet,
autoFocus: true
});
diff --git a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts b/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts
index b7bb110f7..c30163e83 100644
--- a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts
+++ b/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts
@@ -63,7 +63,8 @@ export class AddEditDictionaryDialogComponent {
observable = this._dictionaryControllerService.updateType(typeValue, typeValue.type, DEFAULT_RUL_SET_UUID);
} else {
// create mode
- observable = this._dictionaryControllerService.addType(typeValue, DEFAULT_RUL_SET_UUID);
+ typeValue.ruleSetId = DEFAULT_RUL_SET_UUID;
+ observable = this._dictionaryControllerService.addType(typeValue);
}
//
diff --git a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.html b/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.html
index f67bc5685..7417f7e3b 100644
--- a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.html
+++ b/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.html
@@ -2,11 +2,10 @@