Merge remote-tracking branch 'origin/master' into RED-6143

This commit is contained in:
Adina Țeudan 2024-05-21 12:02:36 +03:00
commit a3748a6ae8
25 changed files with 193 additions and 162 deletions

View File

@ -25,7 +25,7 @@
[placeholder]="'search.placeholder' | translate"
></redaction-spotlight-search>
<iqser-help-button [attr.help-mode-key]="'help_mode'" id="help-mode-button"></iqser-help-button>
<iqser-help-button [dialogButton]="false"></iqser-help-button>
<redaction-notifications
*ngIf="currentUser.isUser || currentUser.isManager"

View File

@ -7,8 +7,8 @@
<div class="content-inner">
<div class="content-container full-height">
<div class="overlay-shadow"></div>
<div class="dialog">
<div class="dialog-header">
<div [ngClass]="!isWarningsScreen && 'dialog'">
<div *ngIf="!isWarningsScreen" class="dialog-header">
<div class="heading-l" [translate]="translations[path]"></div>
</div>

View File

@ -11,16 +11,21 @@ import { accountTranslations } from '@translations/account-translations';
export class BaseAccountScreenComponent implements OnInit {
readonly translations = accountTranslations;
readonly path: string;
readonly isWarningsScreen: boolean;
constructor(private readonly _router: Router, private readonly _hostRef: ViewContainerRef) {
constructor(
private readonly _router: Router,
private readonly _hostRef: ViewContainerRef,
) {
this.path = this._router.url.split('/').pop();
this.isWarningsScreen = this.path === 'warnings-preferences';
}
ngOnInit(): void {
this._setDialogWidth();
this.#setDialogWidth();
}
private _setDialogWidth() {
#setDialogWidth() {
const element = this._hostRef.element.nativeElement as HTMLElement;
element.style.setProperty('--width', this.path === 'user-profile' ? 'unset' : '100%');
}

View File

@ -1,77 +1,79 @@
<form [formGroup]="form">
<div class="dialog-content">
<h1>{{ 'dialog-defaults-form.title' | translate }}</h1>
<h2>{{ 'dialog-defaults-form.redaction.title' | translate }}</h2>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.redaction.add-dialog"></label>
<mat-form-field>
<mat-select formControlName="addRedaction">
<mat-option *ngFor="let option of redactionAddOptions" [value]="option.value">{{
option.label | translate
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionAddRedaction" formControlName="addRedactionApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
<div class="dialog">
<form [formGroup]="form">
<div class="dialog-content">
<h1>{{ 'dialog-defaults-form.title' | translate }}</h1>
<h3>{{ 'dialog-defaults-form.redaction.title' | translate }}</h3>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.redaction.add-dialog"></label>
<mat-form-field>
<mat-select formControlName="addRedaction">
<mat-option *ngFor="let option of redactionAddOptions" [value]="option.value">{{
option.label | translate
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionAddRedaction" formControlName="addRedactionApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.redaction.remove-dialog"></label>
<mat-form-field>
<mat-select formControlName="removeRedaction">
<mat-option *ngFor="let option of redactionRemoveOptions" [value]="option.value">{{
option.label | translate
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionRemoveRedaction" formControlName="removeRedactionApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
<h3>{{ 'dialog-defaults-form.recommendation.title' | translate }}</h3>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.recommendation.remove-dialog"></label>
<mat-form-field>
<mat-select formControlName="removeRecommendation">
<mat-option *ngFor="let option of recommendationRemoveOptions" [value]="option.value">{{
option.label | translate
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionRemoveRecommendation" formControlName="removeRecommendationApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
<h3>{{ 'dialog-defaults-form.hint.title' | translate }}</h3>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.hint.add-dialog"></label>
<mat-form-field>
<mat-select formControlName="addHint">
<mat-option *ngFor="let option of hintAddOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionAddHint" formControlName="addHintApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.hint.remove-dialog"></label>
<mat-form-field>
<mat-select formControlName="removeHint">
<mat-option *ngFor="let option of removeOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionRemoveHint" formControlName="removeHintApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
</div>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.redaction.remove-dialog"></label>
<mat-form-field>
<mat-select formControlName="removeRedaction">
<mat-option *ngFor="let option of redactionRemoveOptions" [value]="option.value">{{
option.label | translate
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionRemoveRedaction" formControlName="removeRedactionApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
<div class="dialog-actions">
<iqser-icon-button
(action)="save()"
[disabled]="!valid || !changed"
[label]="'preferences-screen.actions.save' | translate"
[type]="iconButtonTypes.primary"
></iqser-icon-button>
</div>
<h2>{{ 'dialog-defaults-form.recommendation.title' | translate }}</h2>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.recommendation.remove-dialog"></label>
<mat-form-field>
<mat-select formControlName="removeRecommendation">
<mat-option *ngFor="let option of recommendationRemoveOptions" [value]="option.value">{{
option.label | translate
}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionRemoveRecommendation" formControlName="removeRecommendationApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
<h2>{{ 'dialog-defaults-form.hint.title' | translate }}</h2>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.hint.add-dialog"></label>
<mat-form-field>
<mat-select formControlName="addHint">
<mat-option *ngFor="let option of hintAddOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionAddHint" formControlName="addHintApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
<div class="iqser-input-group w-450">
<label translate="dialog-defaults-form.hint.remove-dialog"></label>
<mat-form-field>
<mat-select formControlName="removeHint">
<mat-option *ngFor="let option of removeOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox *ngIf="displayExtraOptionRemoveHint" formControlName="removeHintApplyToAll">{{
'dialog-defaults-form.extra-option-label' | translate
}}</mat-checkbox>
</div>
</div>
<div class="dialog-actions">
<iqser-icon-button
(action)="save()"
[disabled]="!valid || !changed"
[label]="'preferences-screen.actions.save' | translate"
[type]="iconButtonTypes.primary"
></iqser-icon-button>
</div>
</form>
</form>
</div>

View File

@ -1,3 +1,16 @@
mat-checkbox {
margin: 8px 0 0 8px;
}
h3 {
margin-top: 24px;
margin-bottom: 4px;
}
form .iqser-input-group:not(first-of-type) {
margin-top: 8px;
}
.dialog {
margin-bottom: 0;
}

View File

@ -1,46 +1,53 @@
<redaction-dialog-defaults *ngIf="currentScreen === screens.WARNING_PREFERENCES && !config.IS_DOCUMINE"></redaction-dialog-defaults>
<form [formGroup]="form">
<div class="dialog-content">
<div class="dialog-content-left">
<ng-container *ngIf="currentScreen === screens.PREFERENCES">
<div class="iqser-input-group">
<mat-slide-toggle color="primary" formControlName="autoExpandFiltersOnActions">
{{ 'preferences-screen.form.auto-expand-filters-on-action' | translate }}
</mat-slide-toggle>
</div>
<div [ngClass]="currentScreen === screens.WARNING_PREFERENCES && 'dialog'">
<form [formGroup]="form">
<div class="dialog-content">
<div class="dialog-content-left">
<ng-container *ngIf="currentScreen === screens.PREFERENCES">
<div class="iqser-input-group">
<mat-slide-toggle color="primary" formControlName="autoExpandFiltersOnActions">
{{ 'preferences-screen.form.auto-expand-filters-on-action' | translate }}
</mat-slide-toggle>
</div>
<div *ngIf="config.IS_DOCUMINE" class="iqser-input-group">
<mat-slide-toggle color="primary" formControlName="openScmDialogByDefault">
{{ 'preferences-screen.form.open-structured-view-by-default' | translate }}
</mat-slide-toggle>
</div>
<div *ngIf="config.IS_DOCUMINE" class="iqser-input-group">
<mat-slide-toggle color="primary" formControlName="openScmDialogByDefault">
{{ 'preferences-screen.form.open-structured-view-by-default' | translate }}
</mat-slide-toggle>
</div>
<div *allow="roles.getTables" class="iqser-input-group">
<label [translate]="'preferences-screen.form.table-extraction-type'"></label>
<input formControlName="tableExtractionType" />
</div>
</ng-container>
<div *allow="roles.getTables" class="iqser-input-group">
<label [translate]="'preferences-screen.form.table-extraction-type'"></label>
<input formControlName="tableExtractionType" />
</div>
</ng-container>
<ng-container *ngIf="currentScreen === screens.WARNING_PREFERENCES">
<h1>{{ 'preferences-screen.warnings-subtitle' | translate }}</h1>
<p class="warnings-description">{{ 'preferences-screen.warnings-description' | translate }}</p>
<ng-container *ngIf="currentScreen === screens.WARNING_PREFERENCES">
<h1>{{ 'preferences-screen.warnings-subtitle' | translate }}</h1>
<p class="warnings-description">{{ 'preferences-screen.warnings-description' | translate }}</p>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="loadAllAnnotationsWarning">
{{ 'preferences-screen.form.load-all-annotations-warning' | translate }}
</mat-checkbox>
</div>
</ng-container>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="loadAllAnnotationsWarning">
{{ 'preferences-screen.form.load-all-annotations-warning' | translate }}
</mat-checkbox>
</div>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="helpModeDialog">
{{ 'preferences-screen.form.help-mode-dialog' | translate }}
</mat-checkbox>
</div>
</ng-container>
</div>
</div>
</div>
<div class="dialog-actions">
<iqser-icon-button
(action)="save()"
[disabled]="!valid || !changed"
[label]="'preferences-screen.actions.save' | translate"
[type]="iconButtonTypes.primary"
></iqser-icon-button>
</div>
</form>
<div class="dialog-actions">
<iqser-icon-button
(action)="save()"
[disabled]="!valid || !changed"
[label]="'preferences-screen.actions.save' | translate"
[type]="iconButtonTypes.primary"
></iqser-icon-button>
</div>
</form>
</div>

View File

@ -1,10 +1,3 @@
@use 'variables';
.content-delimiter {
border-top: 1px solid var(--iqser-separator);
margin-bottom: 15px;
}
.warnings-description {
width: 105%;
}

View File

@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { BaseFormComponent, getConfig, IqserPermissionsService, isIqserDevMode, LoadingService } from '@iqser/common-ui';
import { BaseFormComponent, getConfig, IqserPermissionsService, isIqserDevMode, KEYS, LoadingService } from '@iqser/common-ui';
import { AsControl } from '@iqser/common-ui/lib/utils';
import { Roles } from '@users/roles';
import { PreferencesKeys, UserPreferenceService } from '@users/user-preference.service';
@ -13,6 +13,7 @@ interface PreferencesForm {
tableExtractionType: string;
// warnings preferences
loadAllAnnotationsWarning: boolean;
helpModeDialog: boolean;
[k: string]: any;
}
@ -55,6 +56,7 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
tableExtractionType: [this.userPreferenceService.getTableExtractionType()],
// warnings preferences
loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)],
helpModeDialog: [this.userPreferenceService.getBool(KEYS.helpModeDialog)],
});
if (!this._permissionsService.has(Roles.managePreferences)) {
@ -95,6 +97,10 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
);
}
if (this.form.controls.helpModeDialog.value !== this.userPreferenceService.getBool(KEYS.helpModeDialog)) {
await this.userPreferenceService.save(KEYS.helpModeDialog, String(this.form.controls.helpModeDialog.value));
}
await this.userPreferenceService.reload();
this.#patchValues();
@ -108,6 +114,7 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
openScmDialogByDefault: this.userPreferenceService.getOpenScmDialogByDefault(),
tableExtractionType: this.userPreferenceService.getTableExtractionType(),
loadAllAnnotationsWarning: this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning),
helpModeDialog: this.userPreferenceService.getBool(KEYS.helpModeDialog),
});
}
}

View File

@ -41,11 +41,6 @@
[label]="'add-clone-dossier-template.save-and-edit' | translate"
[type]="iconButtonTypes.dark"
></iqser-icon-button>
<iqser-help-button
*ngIf="!isDocumine && !!dossierTemplate"
[helpButtonKey]="'edit_clone_delete_dossier_templates'"
></iqser-help-button>
</div>
</form>

View File

@ -16,7 +16,7 @@
[type]="iconButtonTypes.primary"
></iqser-icon-button>
<iqser-help-button *ngIf="!config.IS_DOCUMINE" [helpButtonKey]="'create_new_entity'"></iqser-help-button>
<iqser-help-button *ngIf="!config.IS_DOCUMINE"></iqser-help-button>
</div>
<iqser-circle-button (action)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>

View File

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

View File

@ -1,5 +1,5 @@
<section class="dialog">
<div [innerHTML]="'add-edit-file-attribute.title' | translate : titleTranslateParams" class="dialog-header heading-l"></div>
<div [innerHTML]="'add-edit-file-attribute.title' | translate: titleTranslateParams" class="dialog-header heading-l"></div>
<form [formGroup]="form">
<div class="dialog-content">
@ -51,7 +51,7 @@
<mat-checkbox
[matTooltipDisabled]="canSetFilterable"
[matTooltip]="
'add-edit-file-attribute.form.filterable-disabled' | translate : { maxNumber: DISPLAYED_FILTERABLE_LIMIT }
'add-edit-file-attribute.form.filterable-disabled' | translate: { maxNumber: DISPLAYED_FILTERABLE_LIMIT }
"
color="primary"
formControlName="filterable"
@ -66,7 +66,7 @@
<mat-checkbox
[matTooltipDisabled]="canSetDisplayed"
[matTooltip]="
'add-edit-file-attribute.form.displayed-disabled' | translate : { maxNumber: DISPLAYED_FILTERABLE_LIMIT }
'add-edit-file-attribute.form.displayed-disabled' | translate: { maxNumber: DISPLAYED_FILTERABLE_LIMIT }
"
color="primary"
formControlName="displayedInFileList"
@ -86,7 +86,7 @@
[type]="iconButtonTypes.primary"
></iqser-icon-button>
<iqser-help-button *ngIf="!config.IS_DOCUMINE" [helpButtonKey]="'edit_delete_file_attribute'"></iqser-help-button>
<iqser-help-button *ngIf="!config.IS_DOCUMINE"></iqser-help-button>
</div>
</form>

View File

@ -116,7 +116,7 @@
<div [translate]="'edit-redaction.dialog.actions.cancel'" class="all-caps-label cancel" mat-dialog-close></div>
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="helpButtonKey"></iqser-help-button>
<iqser-help-button *deny="roles.getRss"></iqser-help-button>
</div>
</form>

View File

@ -44,7 +44,7 @@
>
</iqser-icon-button>
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="'skipped_force'"></iqser-help-button>
<iqser-help-button *deny="roles.getRss"></iqser-help-button>
</div>
</form>

View File

@ -23,7 +23,7 @@
<ng-container *ngIf="!data.color">
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="confirmation" name="confirmation">
{{ translations[data.operation].confirmation | translate : { count: data.highlights.length } }}
{{ translations[data.operation].confirmation | translate: { count: data.highlights.length } }}
</mat-checkbox>
</div>
</ng-container>
@ -39,7 +39,7 @@
<div class="all-caps-label cancel" mat-dialog-close translate="highlight-action-dialog.actions.cancel"></div>
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="'highlights'"></iqser-help-button>
<iqser-help-button *deny="roles.getRss"></iqser-help-button>
</div>
</form>

View File

@ -33,7 +33,7 @@
(action)="toggleEditingSelectedText()"
*ngIf="dictionaryRequest && !isEditingSelectedText"
[tooltip]="'redact-text.dialog.content.edit-text' | translate"
[size]="18"
[size]="20"
[iconSize]="13"
icon="iqser:edit"
tooltipPosition="below"
@ -44,7 +44,7 @@
*ngIf="isEditingSelectedText"
[showDot]="initialText !== form.get('selectedText').value"
[tooltip]="'redact-text.dialog.content.revert-text' | translate"
[size]="18"
[size]="20"
[iconSize]="13"
class="undo-button"
icon="red:undo"

View File

@ -19,6 +19,10 @@ iqser-circle-button {
&.undo-button {
margin-left: 8px;
}
::ng-deep mat-icon {
padding: 2px;
}
}
.w-full {

View File

@ -39,7 +39,7 @@
<div [translate]="'remove-redaction.dialog.actions.cancel'" class="all-caps-label cancel" mat-dialog-close></div>
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="helpButtonKey"></iqser-help-button>
<iqser-help-button *deny="roles.getRss"></iqser-help-button>
</div>
</form>

View File

@ -74,7 +74,7 @@
<div (click)="revert()" class="all-caps-label cancel" id="revert" translate="edit-dossier-dialog.actions.revert"></div>
<iqser-help-button *deny="roles.getRss" [dialogButton]="true"></iqser-help-button>
<iqser-help-button *deny="roles.getRss"></iqser-help-button>
</div>
</div>
</div>

View File

@ -121,7 +121,7 @@
icon="red:assign"
></iqser-icon-button>
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="'new_dossier_button'"></iqser-help-button>
<iqser-help-button *deny="roles.getRss"></iqser-help-button>
</div>
</form>

View File

@ -4,5 +4,4 @@ export const accountTranslations: Record<string, string> = {
notifications: _('notifications-screen.title'),
'user-profile': _('user-profile-screen.title'),
preferences: _('preferences-screen.title'),
'warnings-preferences': _('preferences-screen.warnings-title'),
};

View File

@ -686,23 +686,23 @@
},
"dev-mode": "DEV",
"dialog-defaults-form": {
"extra-option-label": "",
"extra-option-label": "Apply to all active and future dossiers",
"hint": {
"add-dialog": "",
"remove-dialog": "",
"title": ""
"add-dialog": "Add hint",
"remove-dialog": "Remove hint",
"title": "Hint"
},
"recommendation": {
"remove-dialog": "",
"title": ""
"remove-dialog": "Remove recommendation",
"title": "Recommendation"
},
"redaction": {
"add-dialog": "",
"remove-dialog": "",
"title": ""
"add-dialog": "Redact text",
"remove-dialog": "Remove redaction",
"title": "Redaction"
},
"system-default": "",
"title": ""
"system-default": "Use system default",
"title": "Dialog defaults"
},
"dictionary": "Wörterbuch",
"dictionary-overview": {

View File

@ -1647,9 +1647,11 @@
},
"help-mode": {
"bottom-text": "Help mode",
"button-text": "Help mode (H)",
"clicking-anywhere-on": "<b> Clicking anywhere on the screen </b> will show you which areas are interactive. Hovering an interactive area will <b> change the mouse cursor </b> to let you know if the element is interactive.",
"instructions": "Open help mode instructions",
"options": {
"do-not-show-again": "Do not show again"
},
"welcome-to-help-mode": "<b> Welcome to help mode! <br> Clicking on interactive elements will open info about them in new tab. </b>"
},
"highlight-action-dialog": {
@ -1973,6 +1975,7 @@
},
"form": {
"auto-expand-filters-on-action": "Auto-expand filters on my actions",
"help-mode-dialog": "Help Mode Dialog",
"load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview",
"open-structured-view-by-default": "Display structured component management modal by default",
"table-extraction-type": "Table extraction type"

View File

@ -1647,9 +1647,11 @@
},
"help-mode": {
"bottom-text": "Help mode",
"button-text": "Help mode (H)",
"clicking-anywhere-on": "<b> Clicking anywhere on the screen </b> will show you which areas are interactive. Hovering an interactive area will <b> change the mouse cursor </b> to let you know if the element is interactive.",
"instructions": "Open help mode instructions",
"options": {
"do-not-show-again": "Do not show again"
},
"welcome-to-help-mode": "<b> Welcome to help mode! <br> Clicking on interactive elements will open info about them in new tab. </b>"
},
"highlight-action-dialog": {
@ -1973,6 +1975,7 @@
},
"form": {
"auto-expand-filters-on-action": "Auto expand filters on my actions",
"help-mode-dialog": "Help Mode Dialog",
"load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview",
"open-structured-view-by-default": "Display Component View by default when opening a document",
"table-extraction-type": "Table extraction type"

@ -1 +1 @@
Subproject commit 6f288516e3efa36ec9f1f9eb02d0374c988d3432
Subproject commit 4811d301e6980d3f7fb0125c673cb6b8b9b4f0cf