From 067b67efd060667deeb399249d28c9932b8803fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 6 Dec 2021 04:09:11 +0200 Subject: [PATCH] More workflow updates (multi drag almost done) --- .../dossier-overview-bulk-actions.component.ts | 3 +-- .../workflow-item/workflow-item.component.html | 2 +- .../file-actions/file-actions.component.ts | 16 +--------------- .../expandable-file-actions.component.html | 2 +- .../expandable-file-actions.component.ts | 3 +-- apps/red-ui/src/assets/i18n/en.json | 1 - libs/common-ui | 2 +- .../src/lib/shared/expandable-file-actions.ts | 2 +- libs/red-domain/src/lib/shared/index.ts | 1 + 9 files changed, 8 insertions(+), 24 deletions(-) rename apps/red-ui/src/app/modules/shared/components/expandable-file-actions/types.ts => libs/red-domain/src/lib/shared/expandable-file-actions.ts (94%) diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts index 060e4c237..445aa6a8e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; -import { Dossier, File } from '@red/domain'; +import { Action, ActionTypes, Dossier, File } from '@red/domain'; import { FileAssignService } from '../../../../shared/services/file-assign.service'; import { DossiersDialogService } from '../../../../services/dossiers-dialog.service'; import { CircleButtonType, CircleButtonTypes, ConfirmationDialogInput, LoadingService, Required } from '@iqser/common-ui'; @@ -10,7 +10,6 @@ import { UserPreferenceService } from '@services/user-preference.service'; import { FileManagementService } from '@services/entity-services/file-management.service'; import { ReanalysisService } from '@services/reanalysis.service'; import { FilesService } from '@services/entity-services/files.service'; -import { Action, ActionTypes } from '@shared/components/expandable-file-actions/types'; @Component({ selector: 'redaction-dossier-overview-bulk-actions', diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/workflow-item/workflow-item.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/workflow-item/workflow-item.component.html index 3b0eaa732..ec7481294 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/workflow-item/workflow-item.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/workflow-item/workflow-item.component.html @@ -1,7 +1,7 @@
-
+
{{ file.filename }}
diff --git a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts index 09031d88c..f13b86b1a 100644 --- a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts @@ -12,7 +12,7 @@ import { ViewChild, } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; -import { File } from '@red/domain'; +import { Action, ActionTypes, File } from '@red/domain'; import { DossiersDialogService } from '../../../services/dossiers-dialog.service'; import { AutoUnsubscribe, @@ -37,7 +37,6 @@ import { Router } from '@angular/router'; import { ExcludedPagesService } from '../../../screens/file-preview-screen/services/excluded-pages.service'; import { tap } from 'rxjs/operators'; import { DocumentInfoService } from '../../../screens/file-preview-screen/services/document-info.service'; -import { Action, ActionTypes } from '@shared/components/expandable-file-actions/types'; import { ExpandableFileActionsComponent } from '@shared/components/expandable-file-actions/expandable-file-actions.component'; @Component({ @@ -115,13 +114,6 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy, private get _buttons(): Action[] { return [ - { - type: ActionTypes.circleBtn, - action: () => this._openDocument(), - tooltip: _('dossier-overview.open-document'), - icon: 'iqser:collapse', - show: this.showOpenDocument, - }, { type: ActionTypes.circleBtn, action: $event => this._openDeleteFileDialog($event), @@ -263,10 +255,6 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy, this._setup(); } - private _openDocument() { - this._router.navigate([this.file.routerLink]).then(); - } - private _openDeleteFileDialog($event: MouseEvent) { this._dialogService.openDialog( 'confirm', @@ -361,8 +349,6 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy, (this._permissionsService.canAssignUser(this.file) || this._permissionsService.canUnassignUser(this.file)) && this.isDossierOverview; - this.showOpenDocument = this.file.canBeOpened && this.isDossierOverviewWorkflow; - this.showReanalyseFilePreview = this.canReanalyse && this.isFilePreview && this.analysisForced; this.showReanalyseDossierOverview = this.canReanalyse && this.isDossierOverview && this.analysisForced; diff --git a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html index 330b08556..5dda8405a 100644 --- a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html +++ b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html @@ -41,7 +41,7 @@ (menuOpened)="expanded = true" *ngIf="hiddenButtons.length > 0" [attr.aria-expanded]="expanded" - [icon]="'iqser:plus'" + [icon]="'iqser:more-actions'" [matMenuTriggerFor]="hiddenButtonsMenu" [type]="buttonType" > diff --git a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts index 454fd9242..1ccc95efe 100644 --- a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts @@ -1,8 +1,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core'; -import { Action, ActionTypes } from './types'; +import { Action, ActionTypes, File } from '@red/domain'; import { CircleButtonType, IqserTooltipPosition, Toaster } from '@iqser/common-ui'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { File } from '@red/domain'; import { FileDownloadService } from '@upload-download/services/file-download.service'; import { PermissionsService } from '@services/permissions.service'; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index a2e1649b8..f81c13f51 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -728,7 +728,6 @@ }, "ocr-file": "OCR Document", "ocr-performed": "OCR was performed for this file.", - "open-document": "Open Document", "quick-filters": { "assigned-to-me": "Assigned to me", "assigned-to-others": "Assigned to others", diff --git a/libs/common-ui b/libs/common-ui index 6286eea9d..4c119e2a7 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 6286eea9dbfbf4f34de8da4c5ad486e555c99af7 +Subproject commit 4c119e2a7870d0778457d22d50ac380316c68e29 diff --git a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/types.ts b/libs/red-domain/src/lib/shared/expandable-file-actions.ts similarity index 94% rename from apps/red-ui/src/app/modules/shared/components/expandable-file-actions/types.ts rename to libs/red-domain/src/lib/shared/expandable-file-actions.ts index fe73bfd0b..f53c95fe0 100644 --- a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/types.ts +++ b/libs/red-domain/src/lib/shared/expandable-file-actions.ts @@ -11,7 +11,7 @@ export const ActionTypes = { }; export interface Action { - action?: Function; + action?: (...args: any[]) => void; tooltip?: string; icon?: string; show?: boolean; diff --git a/libs/red-domain/src/lib/shared/index.ts b/libs/red-domain/src/lib/shared/index.ts index 3da2cbc13..585848bd6 100644 --- a/libs/red-domain/src/lib/shared/index.ts +++ b/libs/red-domain/src/lib/shared/index.ts @@ -4,3 +4,4 @@ export * from './rules'; export * from './watermark'; export * from './default-color-type'; export * from './view-mode'; +export * from './expandable-file-actions';