Pull request #211: Bugs

Merge in RED/ui from bugs to master

* commit 'dcca5c1eb13c9830e12aa78f621d42348dfa9fd8':
  fix readonly for dictionary editor
  change tooltip for edit reviewer
  change edit owner tooltip
  delete dossier on enter
  edit translations for edit dossier
  remove tooltips on route reuse
This commit is contained in:
Timo Bejan 2021-06-16 14:04:56 +02:00
commit 25d2d06f7d
7 changed files with 42 additions and 21 deletions

View File

@ -26,7 +26,7 @@
class="ml-14"
(action)="editingOwner = true"
*ngIf="permissionsService.isManager()"
tooltip="dossier-overview.header-actions.edit"
tooltip="dossier-details.edit-owner"
icon="red:edit"
tooltipPosition="below"
></redaction-circle-button>

View File

@ -6,8 +6,7 @@
icon="red:edit"
tooltip="dossier-listing.edit.action"
type="dark-bg"
>
</redaction-circle-button>
></redaction-circle-button>
<redaction-circle-button
(action)="reanalyseDossier($event, dossier)"
@ -15,8 +14,7 @@
icon="red:refresh"
tooltip="dossier-listing.reanalyse.action"
type="dark-bg"
>
</redaction-circle-button>
></redaction-circle-button>
<redaction-file-download-btn
[dossier]="dossier"

View File

@ -116,7 +116,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
get assignTooltip(): string {
return this.appStateService.activeFile.isUnderApproval
? 'dossier-overview.assign-approver'
: 'dossier-overview.assign-reviewer';
: this.assignOrChangeReviewerTooltip;
}
get annotations(): AnnotationWrapper[] {
@ -514,6 +514,12 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
return false;
}
get assignOrChangeReviewerTooltip() {
return this.currentReviewer
? 'file-preview.change-reviewer'
: 'file-preview.assign-reviewer';
}
get currentReviewer(): string {
return this.appStateService.activeFile.currentReviewer;
}

View File

@ -1,6 +1,5 @@
import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
import { DictionaryControllerService } from '@redaction/red-ui-http';
import { FormBuilder } from '@angular/forms';
import { AppStateService } from '@state/app-state.service';
import { debounce } from '@utils/debounce';
import { Observable } from 'rxjs';
@ -20,7 +19,7 @@ const SMOOTH_SCROLL = 0;
templateUrl: './dictionary-manager.component.html',
styleUrls: ['./dictionary-manager.component.scss']
})
export class DictionaryManagerComponent implements OnChanges {
export class DictionaryManagerComponent implements OnChanges, OnInit {
@Input()
withFloatingActions = true;
@Input()
@ -33,12 +32,7 @@ export class DictionaryManagerComponent implements OnChanges {
currentMatch = 0;
findMatches: FindMatch[] = [];
currentEntries: string[] = [];
editorOptions: IStandaloneEditorConstructionOptions = {
theme: 'vs',
language: 'text/plain',
automaticLayout: true,
readOnly: !this.canEdit
};
editorOptions: IStandaloneEditorConstructionOptions = {};
diffEditorText = '';
showDiffEditor = false;
searchText = '';
@ -50,16 +44,23 @@ export class DictionaryManagerComponent implements OnChanges {
private _diffEditor: IDiffEditor;
private _decorations: string[] = [];
private _searchDecorations: string[] = [];
private _dossier: DossierWrapper = this.selectDossier as DossierWrapper;
constructor(
private readonly _dictionaryControllerService: DictionaryControllerService,
private readonly _appStateService: AppStateService,
private readonly _formBuilder: FormBuilder
private readonly _appStateService: AppStateService
) {
this.currentEntries = this.initialEntries;
}
private _dossier: DossierWrapper = this.selectDossier as DossierWrapper;
ngOnInit(): void {
this.editorOptions = {
theme: 'vs',
language: 'text/plain',
automaticLayout: true,
readOnly: !this.canEdit
};
}
get dossier() {
return this._dossier;

View File

@ -1,4 +1,4 @@
import { Component, Inject } from '@angular/core';
import { Component, HostListener, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
@ -52,6 +52,13 @@ export class ConfirmationDialogComponent {
this.translate(this._inputLabelKey) + ` '${this.config.confirmationText}'`;
}
@HostListener('window:keyup.enter')
onKeyupEnter() {
if (this.config.requireInput && !this.confirmationDoesNotMatch()) {
this.confirm();
}
}
get isDeleteAction() {
return this.config?.titleColor === TitleColors.PRIMARY;
}

View File

@ -17,12 +17,19 @@ interface RouteStorageObject {
export class CustomRouteReuseStrategy implements RouteReuseStrategy {
private _storedRoutes: { [key: string]: RouteStorageObject } = {};
private static _removeTooltips(): void {
while (document.getElementsByTagName('mat-tooltip-component').length > 0) {
document.getElementsByTagName('mat-tooltip-component')[0].remove();
}
}
shouldDetach(route: ActivatedRouteSnapshot): boolean {
return !!route.routeConfig.data?.reuse && !!this._getKey(route);
}
store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): void {
if (handle === null) return;
CustomRouteReuseStrategy._removeTooltips();
const element: any = handle;

View File

@ -221,6 +221,7 @@
}
},
"owner": "Owner",
"edit-owner": "Edit Owner",
"members": "Members",
"see-less": "See less",
"assign-members": "Assign Members",
@ -244,8 +245,8 @@
},
"search": "Document name...",
"header-actions": {
"edit": "Edit",
"delete": "Delete",
"edit": "Edit Dossier",
"delete": "Delete Dossier",
"assign": "Assign Owner & Members",
"upload-document": "Upload Document",
"download-redacted-files": "Download Redacted Files"
@ -386,6 +387,7 @@
"reviewer": "Assigned to",
"unassigned": "Unassigned",
"assign-reviewer": "Assign Reviewer",
"change-reviewer": "Change Reviewer",
"assign-me": "Assign to me",
"last-reviewer": "Last Reviewed by:",
"fullscreen": "Full Screen (F)",