RED-5149 - Create icons in UI and new app keys for help mode for the admin manual

This commit is contained in:
Valentin Mihai 2022-09-27 17:35:21 +03:00
parent 44f71f30a0
commit b1594e6adc
9 changed files with 62 additions and 4 deletions

View File

@ -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',
},
],
};

View File

@ -95,6 +95,7 @@
<button (click)="save()" [disabled]="disabled" color="primary" mat-flat-button type="button">
{{ 'add-edit-clone-dossier-template.save' | translate }}
</button>
<iqser-help-button *ngIf="dossierTemplate" helpButtonKey="edit_clone_delete_dossier_templates"></iqser-help-button>
</div>
</form>

View File

@ -16,6 +16,7 @@
<button (click)="save()" [disabled]="disabled" color="primary" mat-flat-button type="button">
{{ 'add-entity.save' | translate }}
</button>
<iqser-help-button helpButtonKey="create_new_entity"></iqser-help-button>
</div>
<iqser-circle-button (click)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>

View File

@ -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 {}

View File

@ -23,6 +23,7 @@
</button>
<div (click)="revert()" [translate]="'entity.info.actions.revert'" class="all-caps-label cancel"></div>
<iqser-help-button helpButtonKey="edit_delete_entities"></iqser-help-button>
</div>
</div>
</div>

View File

@ -33,6 +33,7 @@
(toggleChange)="toggleStatus(entity)"
[checked]="entity.enabled"
[disabled]="!permissionsService.isAdmin()"
[iqserHelpMode]="'enable_disable_watermark'"
color="primary"
></mat-slide-toggle>
</div>

View File

@ -28,6 +28,7 @@
(action)="download()"
*ngIf="canDownload"
[matTooltip]="'dictionary-overview.download' | translate"
[iqserHelpMode]="helpModeKey"
class="ml-8"
icon="iqser:download"
></iqser-circle-button>

View File

@ -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<Dictionary> = 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], {

View File

@ -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": ""
}
}