From 293d417abb44d209bb8333e5f40a0ed8622fae4a Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 15 Jun 2021 12:48:45 +0300 Subject: [PATCH 1/6] remove tooltips on route reuse --- apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts b/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts index d44fe6a07..4b85cdbbb 100644 --- a/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts +++ b/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts @@ -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; From e75e9dee85fad14c135e1b985950e6060e653461 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 15 Jun 2021 13:33:30 +0300 Subject: [PATCH 2/6] edit translations for edit dossier --- .../dossier-listing-actions.component.html | 6 ++---- apps/red-ui/src/assets/i18n/en.json | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html index 8be653dd8..ae58a0ab7 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html @@ -6,8 +6,7 @@ icon="red:edit" tooltip="dossier-listing.edit.action" type="dark-bg" - > - + > - + > Date: Tue, 15 Jun 2021 13:55:22 +0300 Subject: [PATCH 3/6] delete dossier on enter --- .../confirmation-dialog/confirmation-dialog.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts index 6c826afcb..bc1bfa48f 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -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; } From 1fae69bbad022c32592f2c3f63fecbf49a9a922f Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 15 Jun 2021 14:00:07 +0300 Subject: [PATCH 4/6] change edit owner tooltip --- .../components/dossier-details/dossier-details.component.html | 2 +- apps/red-ui/src/assets/i18n/en.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html index 4577007ca..b9def2da1 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html @@ -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" > diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index c72bbcec0..40512a628 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -221,6 +221,7 @@ } }, "owner": "Owner", + "edit-owner": "Edit Owner", "members": "Members", "see-less": "See less", "assign-members": "Assign Members", From e4ff415e28b638145f9d0a21caf90356f129d9f8 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 15 Jun 2021 14:27:46 +0300 Subject: [PATCH 5/6] change tooltip for edit reviewer --- .../file-preview-screen/file-preview-screen.component.ts | 8 +++++++- apps/red-ui/src/assets/i18n/en.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 12a92c76c..9341ce02f 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -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; } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 40512a628..9533de10d 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -387,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)", From dcca5c1eb13c9830e12aa78f621d42348dfa9fd8 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Wed, 16 Jun 2021 14:12:30 +0300 Subject: [PATCH 6/6] fix readonly for dictionary editor --- .../dictionary-manager.component.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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 e40c5bb63..9e68c723f 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 @@ -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;