From a7001188ac39e5242cb1a08962451e47fa6cb594 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 4 Jul 2023 16:26:50 +0300 Subject: [PATCH] RED-6801 - WIP on Effective dossier dictionary in Dossier Settings --- .../edit-dossier-dictionary.component.html | 86 ++++++++++++++----- .../edit-dossier-dictionary.component.scss | 73 ++++++++++++---- .../edit-dossier-dictionary.component.ts | 20 ++++- .../edit-dossier-dialog.component.scss | 4 +- .../edit-dossier-dialog.component.ts | 2 +- apps/red-ui/src/assets/i18n/redact/de.json | 7 +- apps/red-ui/src/assets/i18n/redact/en.json | 11 +-- apps/red-ui/src/assets/i18n/scm/de.json | 7 +- apps/red-ui/src/assets/i18n/scm/en.json | 11 +-- 9 files changed, 164 insertions(+), 57 deletions(-) diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.html b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.html index 8c23e65e9..77665de8d 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.html +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.html @@ -1,28 +1,72 @@ -
-
-
-
{{ dossierDictionary?.label }}
-
-
- - {{ 'edit-dossier-dialog.dictionary.entries' | translate : { length: (dossierDictionary?.entries || []).length } }} +
+
+
+ +
+ {{ dictionary.label }} +
+
+ + {{ dictionary.entries.length }} entries +
+
+
+
+
+
+ {{ dossierDictionary?.label }} + +
+
+
+ + {{ + 'edit-dossier-dialog.dictionary.entries' | translate : { length: (dossierDictionary?.entries || []).length } + }} +
+
+
+
+
+ + + +
+
-
- +
- - diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.scss b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.scss index 7c1305a41..80786cb85 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.scss +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.scss @@ -1,29 +1,68 @@ -:host { - flex: 1; +:host ::ng-deep .content { + padding: 0; +} + +.dictionary-content { display: flex; - flex-direction: column; height: 100%; -} -.header-wrapper { - display: flex; - justify-content: space-between; + .dictionaries { + border-right: 1px solid var(--iqser-separator); + width: 30%; + overflow-y: scroll; - .header-left { - display: flex; + .dictionary { + height: 40px; + padding: 15px; + border: 1px solid var(--iqser-separator); + display: flex; + gap: 10px; + cursor: pointer; - .iqser-input-group { - margin-left: 24px; + span { + font-weight: bold; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } + + .details { + display: flex; + flex-direction: column; + gap: 5px; + } + + &.active { + background: var(--iqser-grey-8); + box-shadow: 0 5px 4px -4px rgba(0, 0, 0, 0.2); + cursor: default; + } } } + .entries { + width: 100%; + padding: 24px 32px; + .header-wrapper { + display: flex; + justify-content: space-between; - .display-name { - display: flex; - align-items: center; - margin-bottom: 24px; + .header-left { + display: flex; - > div { - font-weight: 600; + .iqser-input-group { + margin-left: 24px; + } + } + + .display-name { + display: flex; + align-items: center; + margin-bottom: 24px; + + > div { + font-weight: 600; + } + } } } } diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts index 30d1e781f..aaaaac9c7 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts @@ -5,8 +5,14 @@ import { PermissionsService } from '@services/permissions.service'; import { DictionaryManagerComponent } from '@shared/components/dictionary-manager/dictionary-manager.component'; import { DictionaryService } from '@services/entity-services/dictionary.service'; import { CircleButtonTypes, LoadingService } from '@iqser/common-ui'; -import { firstValueFrom } from 'rxjs'; import { DossiersDialogService } from '../../../services/dossiers-dialog.service'; +import { tap } from 'rxjs/operators'; + +enum DictionaryTab { + TO_REDACT, + FALSE_POSITIVES, + FALSE_RECOMMENDATIONS, +} @Component({ selector: 'redaction-edit-dossier-dictionary', @@ -18,8 +24,12 @@ export class EditDossierDictionaryComponent implements EditDossierSectionInterfa canEdit = false; dossierDictionary: Dictionary; + dictionaries: Dictionary[]; + selectedDictionary: Dictionary; + activeDictionaryTab = DictionaryTab.TO_REDACT; readonly circleButtonTypes = CircleButtonTypes; + readonly dictionaryTab = DictionaryTab; @ViewChild(DictionaryManagerComponent, { static: false }) private readonly _dictionaryManager: DictionaryManagerComponent; constructor( @@ -77,8 +87,16 @@ export class EditDossierDictionaryComponent implements EditDossierSectionInterfa }); } + selectDictionaryTab(selectedDictionaryTab: DictionaryTab) { + this.activeDictionaryTab = selectedDictionaryTab; + } + async #updateDossierDictionary() { const { dossierId, dossierTemplateId } = this.dossier; this.dossierDictionary = await this._dictionaryService.loadDossierDictionary(dossierTemplateId, dossierId); + + this.dictionaries = this._dictionaryService.getPossibleDictionaries(dossierTemplateId, false); + this.dictionaries.forEach(d => console.log(d.hexColor)); + this.selectedDictionary = this.dictionaries[0]; } } diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.scss b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.scss index 47f54c0b8..2b8c3be56 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.scss +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.scss @@ -13,14 +13,16 @@ flex: 1; .content { - padding: 24px 32px; overflow: auto; @include common-mixins.scroll-bar; flex: 1; box-sizing: border-box; + padding: 24px 32px; + margin-right: 16px; &.no-padding { padding: 0; + overflow: hidden; } &.no-actions { diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts index ece30b9ba..5922a419a 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts @@ -89,7 +89,7 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A } get noPaddingTab(): boolean { - return ['dossierAttributes'].includes(this.activeNav); + return ['dossierAttributes', 'dossierDictionary'].includes(this.activeNav); } get showHeading(): boolean { diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 294073cf1..d3acfcf53 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1132,7 +1132,10 @@ "dictionary": { "edit": "", "entries": "{length} {length, plural, one{entry} other{entries}}", - "info": "" + "false-positives": "", + "false-recommendations": "", + "info": "", + "to-redact": "" }, "general-info": { "form": { @@ -1647,8 +1650,6 @@ "license-info-screen": { "backend-version": "Backend-Version der Anwendung", "chart": { - "cumulative": "Seiten insgesamt", - "legend": "", "pages-per-month": "Seiten pro Monat", "total-pages": "Gesamtzahl der Seiten" }, diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 0c2d1092d..228b58935 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -686,7 +686,7 @@ }, "revert-changes": "Revert", "save-changes": "Save Changes", - "search": "Search...", + "search": "Search entries ...", "select-dictionary": "Select a dictionary above to compare with the current one.", "success": { "generic": "Dictionary updated!" @@ -1131,8 +1131,11 @@ "delete-successful": "Dossier {dossierName} was deleted.", "dictionary": { "edit": "Edit", - "entries": "{length} {length, plural, one{entry} other{entries}}", - "info": "Info" + "entries": "{length} {length, plural, one{entry} other{entries}} to redact", + "false-positives": "False Positives", + "false-recommendations": "False Recommendations", + "info": "Info", + "to-redact": "To Redact" }, "general-info": { "form": { @@ -1647,8 +1650,6 @@ "license-info-screen": { "backend-version": "Backend Application Version", "chart": { - "cumulative": "Cumulative Pages", - "legend": "Legend", "pages-per-month": "Pages per Month", "total-pages": "Total Pages" }, diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 33d99d99a..7e64332e8 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -1132,7 +1132,10 @@ "dictionary": { "edit": "", "entries": "{length} {length, plural, one{entry} other{entries}}", - "info": "" + "false-positives": "", + "false-recommendations": "", + "info": "", + "to-redact": "" }, "general-info": { "form": { @@ -1647,8 +1650,6 @@ "license-info-screen": { "backend-version": "Backend-Version der Anwendung", "chart": { - "cumulative": "Seiten insgesamt", - "legend": "", "pages-per-month": "Seiten pro Monat", "total-pages": "Gesamtzahl der Seiten" }, diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 62c9bc50b..3b2d245c7 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -686,7 +686,7 @@ }, "revert-changes": "Revert", "save-changes": "Save Changes", - "search": "Search...", + "search": "Search entries ...", "select-dictionary": "Select a dictionary above to compare with the current one.", "success": { "generic": "Dictionary updated!" @@ -1131,8 +1131,11 @@ "delete-successful": "Dossier {dossierName} was deleted.", "dictionary": { "edit": "Edit", - "entries": "{length} {length, plural, one{entry} other{entries}}", - "info": "Info" + "entries": "{length} {length, plural, one{entry} other{entries}} to redact", + "false-positives": "False Positives", + "false-recommendations": "False Recommendations", + "info": "Info", + "to-redact": "To Redact" }, "general-info": { "form": { @@ -1647,8 +1650,6 @@ "license-info-screen": { "backend-version": "Backend Application Version", "chart": { - "cumulative": "Cumulative Pages", - "legend": "Legend", "pages-per-month": "Pages per Month", "total-pages": "Total Pages" },