From b1594e6adcb974999d690deddeb3625562b19a6c Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 27 Sep 2022 17:35:21 +0300 Subject: [PATCH] RED-5149 - Create icons in UI and new app keys for help mode for the admin manual --- .../admin-side-nav.component.ts | 18 +++++++++-- ...one-dossier-template-dialog.component.html | 1 + .../add-entity-dialog.component.html | 1 + .../admin/screens/entities/entities.module.ts | 3 +- .../entity-info/entity-info.component.html | 1 + .../watermarks-listing-screen.component.html | 1 + .../dictionary-manager.component.html | 1 + .../dictionary-manager.component.ts | 10 +++++++ apps/red-ui/src/assets/help-mode/links.json | 30 +++++++++++++++++++ 9 files changed, 62 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts index a3f112e79..a4e8d9b0f 100644 --- a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts +++ b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts @@ -127,9 +127,21 @@ export class AdminSideNavComponent implements OnInit { screen: 'info', label: _('admin-side-nav.entity-info'), }, - { screen: 'dictionary', label: _('admin-side-nav.dictionary') }, - { screen: 'false-positive', label: _('admin-side-nav.false-positive') }, - { screen: 'false-recommendations', label: _('admin-side-nav.false-recommendations') }, + { + screen: 'dictionary', + label: _('admin-side-nav.dictionary'), + helpModeKey: 'dictionary_entity', + }, + { + screen: 'false-positive', + label: _('admin-side-nav.false-positive'), + helpModeKey: 'false_positive_entity', + }, + { + screen: 'false-recommendations', + label: _('admin-side-nav.false-recommendations'), + helpModeKey: 'false_recommendations_entity', + }, ], }; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html index 5bd0dc516..6e4ef198f 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html @@ -95,6 +95,7 @@ + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-entity-dialog/add-entity-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-entity-dialog/add-entity-dialog.component.html index a3e7152ca..89d3b7af9 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-entity-dialog/add-entity-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-entity-dialog/add-entity-dialog.component.html @@ -16,6 +16,7 @@ + diff --git a/apps/red-ui/src/app/modules/admin/screens/entities/entities.module.ts b/apps/red-ui/src/app/modules/admin/screens/entities/entities.module.ts index 4a455bf39..5f88a9aa8 100644 --- a/apps/red-ui/src/app/modules/admin/screens/entities/entities.module.ts +++ b/apps/red-ui/src/app/modules/admin/screens/entities/entities.module.ts @@ -8,7 +8,7 @@ import { EntityInfoComponent } from './screens/entity-info/entity-info.component import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'; import { SharedAdminModule } from '../../shared/shared-admin.module'; import { TranslateModule } from '@ngx-translate/core'; -import { IqserScrollbarModule } from '@iqser/common-ui'; +import { IqserHelpModeModule, IqserScrollbarModule } from '@iqser/common-ui'; const routes: Routes = [ { path: '', redirectTo: 'info', pathMatch: 'full' }, @@ -44,6 +44,7 @@ const routes: Routes = [ MonacoEditorModule, TranslateModule, IqserScrollbarModule, + IqserHelpModeModule, ], }) export class EntitiesModule {} diff --git a/apps/red-ui/src/app/modules/admin/screens/entities/screens/entity-info/entity-info.component.html b/apps/red-ui/src/app/modules/admin/screens/entities/screens/entity-info/entity-info.component.html index 9b9e4b874..652ed5e7e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/entities/screens/entity-info/entity-info.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/entities/screens/entity-info/entity-info.component.html @@ -23,6 +23,7 @@
+ diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermarks-listing/watermarks-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermarks-listing/watermarks-listing-screen.component.html index 8c6c78af8..f8f384229 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermarks-listing/watermarks-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermarks-listing/watermarks-listing-screen.component.html @@ -33,6 +33,7 @@ (toggleChange)="toggleStatus(entity)" [checked]="entity.enabled" [disabled]="!permissionsService.isAdmin()" + [iqserHelpMode]="'enable_disable_watermark'" color="primary" > 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 b7990b39f..b590446b2 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 @@ -28,6 +28,7 @@ (action)="download()" *ngIf="canDownload" [matTooltip]="'dictionary-overview.download' | translate" + [iqserHelpMode]="helpModeKey" class="ml-8" icon="iqser:download" > diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index 2c560ebb4..3d06581c9 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -14,6 +14,11 @@ import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration; import FindMatch = monaco.editor.FindMatch; const SMOOTH_SCROLL = 0; +const HELP_MODE_KEYS = { + dictionary: 'download_dictionary', + 'false-positive': 'false_positive_entity', + 'false-recommendations': 'false_recommendations_entity', +}; @Component({ selector: 'redaction-dictionary-manager', @@ -46,6 +51,7 @@ export class DictionaryManagerComponent implements OnChanges { compare: false; dictionaries: List = this._dictionaries; private _searchDecorations: string[] = []; + readonly #currentTab: string = window.location.href.split('/').pop(); constructor( private readonly _dictionaryService: DictionaryService, @@ -153,6 +159,10 @@ export class DictionaryManagerComponent implements OnChanges { return this.dossier.dossierName === this.selectDossier.dossierName; } + get helpModeKey(): string { + return HELP_MODE_KEYS[this.#currentTab]; + } + download(): void { const content = this.editor.currentEntries.join('\n'); const blob = new Blob([content], { diff --git a/apps/red-ui/src/assets/help-mode/links.json b/apps/red-ui/src/assets/help-mode/links.json index 48a83af58..8d187af57 100644 --- a/apps/red-ui/src/assets/help-mode/links.json +++ b/apps/red-ui/src/assets/help-mode/links.json @@ -490,5 +490,35 @@ "de": "", "it": "", "fr": "" + }, + "dictionary_entity": { + "en": "/en/index-en.html?contextId=dictionary_entity", + "de": "", + "it": "", + "fr": "" + }, + "download_dictionary": { + "en": "/en/index-en.html?contextId=download_dictionary", + "de": "", + "it": "", + "fr": "" + }, + "false_positive_entity": { + "en": "/en/index-en.html?contextId=false_positive_entity", + "de": "", + "it": "", + "fr": "" + }, + "false_recommendations_entity": { + "en": "/en/index-en.html?contextId=false_recommendations_entity", + "de": "", + "it": "", + "fr": "" + }, + "enable_disable_watermark": { + "en": "/en/index-en.html?contextId=enable_disable_watermark", + "de": "", + "it": "", + "fr": "" } }