From 6c6a42b68b9c7c55ae48c74ce30ba75a9c7aec76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Fri, 1 Oct 2021 20:44:18 +0300 Subject: [PATCH] Refactor complete --- .../active-fields-listing.component.html | 89 +++++++------- .../active-fields-listing.component.scss | 28 ++--- .../active-fields-listing.component.ts | 80 ++++--------- .../screens/audit/audit-screen.component.html | 34 +++--- .../screens/audit/audit-screen.component.ts | 36 ++---- ...r-attributes-listing-screen.component.html | 63 +++++----- ...ier-attributes-listing-screen.component.ts | 33 +----- ...e-attributes-listing-screen.component.html | 109 ++++++++--------- ...e-attributes-listing-screen.component.scss | 6 +- ...ile-attributes-listing-screen.component.ts | 75 +++--------- .../user-listing-screen.component.html | 67 +++++------ .../user-listing-screen.component.scss | 4 - .../user-listing-screen.component.ts | 23 ++-- ...t-dossier-deleted-documents.component.html | 72 ++++++----- ...t-dossier-deleted-documents.component.scss | 8 +- ...dit-dossier-deleted-documents.component.ts | 40 ++----- .../search-screen.component.html | 112 +++++++++--------- .../search-screen.component.scss | 10 +- .../search-screen/search-screen.component.ts | 29 ++--- apps/red-ui/src/assets/i18n/en.json | 2 +- 20 files changed, 356 insertions(+), 564 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index fba752dd7..dd8dbc600 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -1,5 +1,4 @@ - -
- -
-
+ +
+
+ +
- -
- -
-
+
+
+ + + + {{ translations[type] | translate }} + + + +
+
- -
-
- - - - {{ translations[type] | translate }} - - - +
+ +
+ +
+ +
+ +
+
+ +
- - -
- -
-
- - -
- -
-
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.scss index d87b9c85d..053574610 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.scss +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.scss @@ -30,19 +30,19 @@ cdk-virtual-scroll-viewport { height: calc(100% - 80px) !important; - - .cdk-virtual-scroll-content-wrapper .table-item > div.cell { - iqser-editable-input:not(.editing) { - padding-left: 12px; - } - - iqser-editable-input::ng-deep .edit-button { - display: none; - } - - &:hover iqser-editable-input::ng-deep .edit-button { - display: block; - } - } + } +} + +.cell { + iqser-editable-input:not(.editing) { + padding-left: 12px; + } + + iqser-editable-input::ng-deep .edit-button { + display: none; + } + + &:hover iqser-editable-input::ng-deep .edit-button { + display: block; } } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts index b267c26a1..faa19b678 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts @@ -1,16 +1,4 @@ -import { - Component, - EventEmitter, - forwardRef, - Injector, - Input, - OnChanges, - OnInit, - Output, - SimpleChanges, - TemplateRef, - ViewChild -} from '@angular/core'; +import { Component, EventEmitter, forwardRef, Injector, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { Field } from '../file-attributes-csv-import-dialog.component'; import { FileAttributeConfigTypes } from '@redaction/red-ui-http'; import { CircleButtonTypes, DefaultListingServices, ListingComponent, TableColumnConfig } from '@iqser/common-ui'; @@ -23,16 +11,35 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; styleUrls: ['./active-fields-listing.component.scss'], providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => ActiveFieldsListingComponent) }] }) -export class ActiveFieldsListingComponent extends ListingComponent implements OnChanges, OnInit { +export class ActiveFieldsListingComponent extends ListingComponent implements OnChanges { readonly circleButtonTypes = CircleButtonTypes; readonly translations = fileAttributeTypesTranslations; readonly tableHeaderLabel = _('file-attributes-csv-import.table-header.title'); - tableColumnConfigs: TableColumnConfig[]; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { + label: _('file-attributes-csv-import.table-col-names.name'), + class: 'name', + width: 'minmax(0, 350px)' + }, + { + label: _('file-attributes-csv-import.table-col-names.type'), + width: '150px' + }, + { + label: _('file-attributes-csv-import.table-col-names.read-only'), + class: 'flex-center', + leftIcon: 'red:read-only', + width: 'auto' + }, + { + label: _('file-attributes-csv-import.table-col-names.primary'), + class: 'flex-center', + rightIcon: 'red:status-info', + rightIconTooltip: _('file-attributes-csv-import.table-col-names.primary-info-tooltip'), + width: 'auto' + } + ]; readonly typeOptions = Object.keys(FileAttributeConfigTypes); - @ViewChild('labelTemplate', { static: true }) labelTemplate: TemplateRef; - @ViewChild('typeTemplate', { static: true }) typeTemplate: TemplateRef; - @ViewChild('readonlyTemplate', { static: true }) readonlyTemplate: TemplateRef; - @ViewChild('primaryTemplate', { static: true }) primaryTemplate: TemplateRef; @Input() entities: Field[]; @Output() readonly entitiesChange = new EventEmitter(); @Output() readonly setHoveredColumn = new EventEmitter(); @@ -42,10 +49,6 @@ export class ActiveFieldsListingComponent extends ListingComponent implem super(_injector); } - ngOnInit(): void { - this._configureTableColumns(); - } - ngOnChanges(changes: SimpleChanges): void { if (changes.entities) { this.entitiesService.setEntities(this.entities); @@ -80,35 +83,4 @@ export class ActiveFieldsListingComponent extends ListingComponent implem itemMouseEnterFn = (field: Field) => this.setHoveredColumn.emit(field.csvColumn); itemMouseLeaveFn = () => this.setHoveredColumn.emit(); - - private _configureTableColumns() { - this.tableColumnConfigs = [ - { - label: _('file-attributes-csv-import.table-col-names.name'), - class: 'name', - template: this.labelTemplate, - width: 'minmax(0, 350px)' - }, - { - label: _('file-attributes-csv-import.table-col-names.type'), - template: this.typeTemplate, - width: '150px' - }, - { - label: _('file-attributes-csv-import.table-col-names.read-only'), - class: 'flex-center', - leftIcon: 'red:read-only', - template: this.readonlyTemplate, - width: 'auto' - }, - { - label: _('file-attributes-csv-import.table-col-names.primary'), - class: 'flex-center', - rightIcon: 'red:status-info', - rightIconTooltip: _('file-attributes-csv-import.table-col-names.primary-info-tooltip'), - template: this.primaryTemplate, - width: 'auto' - } - ]; - } } diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html index 9311d73f9..0f97a58ed 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html @@ -97,24 +97,20 @@
- -
- {{ log.message }} + +
+
+ {{ log.message }} +
+ +
+ {{ log.recordDate | date: 'd MMM. yyyy, hh:mm a' }} +
+ +
+ +
+ +
- - -
- {{ log.recordDate | date: 'd MMM. yyyy, hh:mm a' }} -
-
- - -
- -
-
- - -
-
diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts index 635d4b141..ad2c4c828 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, forwardRef, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { Component, forwardRef, Injector, OnDestroy, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { AuditControllerService, AuditResponse, AuditSearchRequest, IAudit } from '@redaction/red-ui-http'; import { Moment } from 'moment'; @@ -22,15 +22,16 @@ export class AuditScreenComponent extends ListingComponent implements OnD readonly ALL_USERS = _('audit-screen.all-users'); readonly translations = auditCategoriesTranslations; readonly currentUser = this._userService.currentUser; - @ViewChild('messageTemplate', { static: true }) messageTemplate: TemplateRef; - @ViewChild('dateTemplate', { static: true }) dateTemplate: TemplateRef; - @ViewChild('userTemplate', { static: true }) userTemplate: TemplateRef; - @ViewChild('categoryTemplate', { static: true }) categoryTemplate: TemplateRef; filterForm: FormGroup; categories: string[] = []; userIds: Set; logs: AuditResponse; - tableColumnConfigs: TableColumnConfig[]; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { label: _('audit-screen.table-col-names.message') }, + { label: _('audit-screen.table-col-names.date') }, + { label: _('audit-screen.table-col-names.user'), class: 'user-column' }, + { label: _('audit-screen.table-col-names.category') } + ]; readonly tableHeaderLabel = _('audit-screen.table-header.title'); private _previousFrom: Moment; private _previousTo: Moment; @@ -69,32 +70,9 @@ export class AuditScreenComponent extends ListingComponent implements OnD } async ngOnInit() { - this._configureTableColumns(); await this._fetchData(); } - private _configureTableColumns() { - this.tableColumnConfigs = [ - { - label: _('audit-screen.table-col-names.message'), - template: this.messageTemplate - }, - { - label: _('audit-screen.table-col-names.date'), - template: this.dateTemplate - }, - { - label: _('audit-screen.table-col-names.user'), - class: 'user-column', - template: this.userTemplate - }, - { - label: _('audit-screen.table-col-names.category'), - template: this.categoryTemplate - } - ]; - } - private _updateDateFilters(value): boolean { if (applyIntervalConstraints(value, this._previousFrom, this._previousTo, this.filterForm, 'from', 'to')) { return true; diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index 9635022f1..def1dfab3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -22,7 +22,6 @@
- -
- + +
+
+ {{ attribute.label }} +
- -
-
- - -
- {{ attribute.label }} -
-
- - -
- {{ attribute.placeholder }} -
-
- - -
- {{ translations[attribute.type] | translate }} +
+ {{ attribute.placeholder }} +
+ +
+ {{ translations[attribute.type] | translate }} +
+ +
+
+ + + +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts index 09cd2466f..d087bb15a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { Component, forwardRef, Injector, OnInit } from '@angular/core'; import { CircleButtonTypes, DefaultListingServices, @@ -31,10 +31,11 @@ export class DossierAttributesListingScreenComponent extends ListingComponent[]; - @ViewChild('labelTemplate', { static: true }) labelTemplate: TemplateRef; - @ViewChild('placeholderTemplate', { static: true }) placeholderTemplate: TemplateRef; - @ViewChild('typeTemplate', { static: true }) typeTemplate: TemplateRef; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { label: _('dossier-attributes-listing.table-col-names.label'), sortByKey: 'label', width: '2fr' }, + { label: _('dossier-attributes-listing.table-col-names.placeholder'), width: '2fr' }, + { label: _('dossier-attributes-listing.table-col-names.type'), sortByKey: 'type' } + ]; constructor( protected readonly _injector: Injector, @@ -50,7 +51,6 @@ export class DossierAttributesListingScreenComponent extends ListingComponent - -
- - -
-
- - -
- {{ attribute.label }} -
-
- - -
-
- - -
- -
-
- - -
- {{ attribute.csvColumnHeader }} -
-
- - -
- -
-
- - -
- -
-
- - -
- + +
+
+ {{ attribute.label }} +
+ +
+ +
+ +
+ +
+ {{ attribute.csvColumnHeader }} +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss index 6b4d12879..14a44a51a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss @@ -1,10 +1,6 @@ @use 'common-mixins'; -:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell { - &.center { - align-items: center; - } - +.cell { &.label span { @include common-mixins.line-clamp(1); } diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts index 70f0e6f2d..0a277efda 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts @@ -1,14 +1,4 @@ -import { - ChangeDetectionStrategy, - Component, - ElementRef, - forwardRef, - Injector, - OnDestroy, - OnInit, - TemplateRef, - ViewChild -} from '@angular/core'; +import { ChangeDetectionStrategy, Component, ElementRef, forwardRef, Injector, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FileAttributesConfig, IFileAttributeConfig } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { ActivatedRoute } from '@angular/router'; @@ -42,14 +32,20 @@ export class FileAttributesListingScreenComponent extends ListingComponent[]; - @ViewChild('labelTemplate', { static: true }) labelTemplate: TemplateRef; - @ViewChild('typeTemplate', { static: true }) typeTemplate: TemplateRef; - @ViewChild('readonlyTemplate', { static: true }) readonlyTemplate: TemplateRef; - @ViewChild('csvColumnHeaderTemplate', { static: true }) csvColumnHeaderTemplate: TemplateRef; - @ViewChild('filterableTemplate', { static: true }) filterableTemplate: TemplateRef; - @ViewChild('displayedInFileListTemplate', { static: true }) displayedInFileListTemplate: TemplateRef; - @ViewChild('primaryAttributeTemplate', { static: true }) primaryAttributeTemplate: TemplateRef; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { label: _('file-attributes-listing.table-col-names.name'), sortByKey: 'searchKey', width: '2fr' }, + { label: _('file-attributes-listing.table-col-names.type'), sortByKey: 'type' }, + { label: _('file-attributes-listing.table-col-names.read-only'), sortByKey: 'editable', class: 'flex-center' }, + { label: _('file-attributes-listing.table-col-names.csv-column') }, + { label: _('file-attributes-listing.table-col-names.filterable'), class: 'flex-center' }, + { label: _('file-attributes-listing.table-col-names.displayed-in-file-list'), class: 'flex-center' }, + { + label: _('file-attributes-listing.table-col-names.primary'), + class: 'flex-center', + rightIcon: 'red:status-info', + rightIconTooltip: _('file-attributes-listing.table-col-names.primary-info-tooltip') + } + ]; private _existingConfiguration: FileAttributesConfig; @ViewChild('fileInput') private _fileInput: ElementRef; @@ -67,7 +63,6 @@ export class FileAttributesListingScreenComponent extends ListingComponent
- -
- -
-
- - -
{{ user.email || '-' }}
-
- - -
- -
-
- - -
{{ getDisplayRoles(user) }}
-
- - -
- - + +
+
+ +
+ +
{{ user.email || '-' }}
+ +
+ +
+ +
{{ getDisplayRoles(user) }}
+ +
+
+ + +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss index 5a09cdf01..097d651bc 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss @@ -1,7 +1,3 @@ -:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell.center { - align-items: center; -} - .right-container { display: flex; width: 353px; diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts index fa92bdd2f..ff0e8f244 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, forwardRef, Injector, OnInit, QueryList, TemplateRef, ViewChild, ViewChildren } from '@angular/core'; +import { Component, forwardRef, Injector, OnInit, QueryList, ViewChildren } from '@angular/core'; import { UserService } from '@services/user.service'; import { UserControllerService } from '@redaction/red-ui-http'; import { AdminDialogService } from '../../services/admin-dialog.service'; @@ -32,13 +32,14 @@ export class UserListingScreenComponent extends ListingComponent implement readonly currentUser = this.userService.currentUser; readonly canDeleteSelected$ = this._canDeleteSelected$; readonly tableHeaderLabel = _('user-listing.table-header.title'); - tableColumnConfigs: TableColumnConfig[]; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { label: _('user-listing.table-col-names.name'), width: '2fr' }, + { label: _('user-listing.table-col-names.email') }, + { label: _('user-listing.table-col-names.active'), class: 'flex-center' }, + { label: _('user-listing.table-col-names.roles') } + ]; collapsedDetails = false; chartData: DoughnutChartConfig[] = []; - @ViewChild('nameTemplate', { static: true }) nameTemplate: TemplateRef; - @ViewChild('emailTemplate', { static: true }) emailTemplate: TemplateRef; - @ViewChild('activeTemplate', { static: true }) activeTemplate: TemplateRef; - @ViewChild('rolesTemplate', { static: true }) rolesTemplate: TemplateRef; @ViewChildren(InitialsAvatarComponent) private readonly _avatars: QueryList; @@ -60,7 +61,6 @@ export class UserListingScreenComponent extends ListingComponent implement } async ngOnInit() { - this._configureTableColumns(); await this._loadData(); } @@ -96,15 +96,6 @@ export class UserListingScreenComponent extends ListingComponent implement this.openDeleteUsersDialog(this.entitiesService.all.filter(u => this.isSelected(u))); } - private _configureTableColumns() { - this.tableColumnConfigs = [ - { label: _('user-listing.table-col-names.name'), template: this.nameTemplate, width: '2fr' }, - { label: _('user-listing.table-col-names.email'), template: this.emailTemplate }, - { label: _('user-listing.table-col-names.active'), class: 'flex-center', template: this.activeTemplate }, - { label: _('user-listing.table-col-names.roles'), template: this.rolesTemplate } - ]; - } - private async _loadData() { this.entitiesService.setEntities(await this.userService.loadAllUsers()); await this.userService.loadAllUsers(); diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html index 019278fc4..81c1f8810 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html @@ -34,45 +34,41 @@ > - -
- {{ file.filename }} -
-
+ +
+
+ {{ file.filename }} +
- -
-
- - {{ file.numberOfPages }} -
-
-
- - -
- {{ file.softDeleted | date: 'exactDate' }} -
-
- - -
-
{{ file.restoreDate | date: 'timeFromNow' }}
-
- - - +
+
+ + {{ file.numberOfPages }} +
+
+ +
+ {{ file.softDeleted | date: 'exactDate' }} +
+ +
+
{{ file.restoreDate | date: 'timeFromNow' }}
+
+ + + +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.scss b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.scss index d7bf4a0af..305ab6377 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.scss +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.scss @@ -9,8 +9,8 @@ :host ::ng-deep iqser-table cdk-virtual-scroll-viewport { height: calc(100% - 81px) !important; - - .cdk-virtual-scroll-content-wrapper .table-item > div.cell.filename span { - @include common-mixins.line-clamp(1); - } +} + +.cell.filename span { + @include common-mixins.line-clamp(1); } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts index 920cff75e..f408458d9 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, forwardRef, Injector, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { Component, EventEmitter, forwardRef, Injector, Input, OnInit, Output } from '@angular/core'; import { EditDossierSectionInterface } from '../edit-dossier-section.interface'; import { Dossier } from '@state/model/dossier'; import { @@ -42,14 +42,15 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent[]; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { label: _('edit-dossier-dialog.deleted-documents.table-col-names.name'), width: '3fr' }, + { label: _('edit-dossier-dialog.deleted-documents.table-col-names.pages') }, + { label: _('edit-dossier-dialog.deleted-documents.table-col-names.deleted-on'), sortByKey: 'softDeleted', width: '2fr' }, + { label: _('edit-dossier-dialog.deleted-documents.table-col-names.time-to-restore'), sortByKey: 'softDeleted', width: '2fr' } + ]; readonly tableHeaderLabel = _('edit-dossier-dialog.deleted-documents.table-header.label'); readonly circleButtonTypes = CircleButtonTypes; readonly deleteRetentionHours = this._configService.values.DELETE_RETENTION_HOURS; - @ViewChild('filenameTemplate', { static: true }) filenameTemplate: TemplateRef; - @ViewChild('pagesTemplate', { static: true }) pagesTemplate: TemplateRef; - @ViewChild('deletedDateTemplate', { static: true }) deletedDateTemplate: TemplateRef; - @ViewChild('restoreDateTemplate', { static: true }) restoreDateTemplate: TemplateRef; constructor( protected readonly _injector: Injector, @@ -89,7 +90,6 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent !file.canRestore; - private _configureTableColumns() { - this.tableColumnConfigs = [ - { - label: _('edit-dossier-dialog.deleted-documents.table-col-names.name'), - template: this.filenameTemplate, - width: '3fr' - }, - { - label: _('edit-dossier-dialog.deleted-documents.table-col-names.pages'), - template: this.pagesTemplate - }, - { - label: _('edit-dossier-dialog.deleted-documents.table-col-names.deleted-on'), - template: this.deletedDateTemplate, - sortByKey: 'softDeleted', - width: '2fr' - }, - { - label: _('edit-dossier-dialog.deleted-documents.table-col-names.time-to-restore'), - template: this.restoreDateTemplate, - sortByKey: 'softDeleted', - width: '2fr' - } - ]; - } - private async _restore(files: FileListItem[]): Promise { const fileIds = files.map(f => f.fileId); await this._fileManagementController.restoreFiles(fileIds, this.dossier.id).toPromise(); diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html index f8c54b661..01c25929a 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html @@ -21,66 +21,64 @@
- -
-
- - {{ item.filename }} -
- - -
- + +
+
+
+ + {{ item.filename }}
-
- + + +
+ +
+
+ +
+
+ +
+ + {{ 'search-screen.missing' | translate }}: {{ term }}. {{ 'search-screen.must-contain' | translate }}: +  {{ term }} +
- +
-
- - {{ 'search-screen.missing' | translate }}: {{ term }}. {{ 'search-screen.must-contain' | translate }}: -  {{ term }} - -
-
- - - -
- -
-
- - -
- {{ item.dossierName }} -
-
- - -
-
- - {{ item.numberOfPages }} +
+ +
+ +
+ {{ item.dossierName }} +
+ +
+
+ + {{ item.numberOfPages }} +
diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.scss b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.scss index da9d39c30..25f846e32 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.scss +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.scss @@ -1,11 +1,9 @@ @use 'common-mixins'; -:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell { - .highlights { - @include common-mixins.line-clamp(1); +.cell .highlights::ng-deep { + @include common-mixins.line-clamp(1); - em { - background-color: #fffcc4; - } + em { + background-color: #fffcc4; } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts index 7ffcb6273..bba7db62b 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, forwardRef, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { Component, forwardRef, Injector, OnDestroy } from '@angular/core'; import { DefaultListingServices, IListable, @@ -40,17 +40,17 @@ interface SearchInput { styleUrls: ['./search-screen.component.scss'], providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => SearchScreenComponent) }] }) -export class SearchScreenComponent extends ListingComponent implements OnDestroy, OnInit { +export class SearchScreenComponent extends ListingComponent implements OnDestroy { readonly fileStatusTranslations = fileStatusTranslations; readonly searchPositions = SearchPositions; - @ViewChild('filenameTemplate', { static: true }) readonly filenameTemplate: TemplateRef; - @ViewChild('statusTemplate', { static: true }) readonly statusTemplate: TemplateRef; - @ViewChild('dossierTemplate', { static: true }) readonly dossierTemplate: TemplateRef; - @ViewChild('pagesTemplate', { static: true }) readonly pagesTemplate: TemplateRef; - readonly tableHeaderLabel = _('search-screen.table-header'); - tableColumnConfigs: TableColumnConfig[]; + readonly tableColumnConfigs: TableColumnConfig[] = [ + { label: _('search-screen.cols.document'), width: '2fr' }, + { label: _('search-screen.cols.status') }, + { label: _('search-screen.cols.dossier') }, + { label: _('search-screen.cols.pages'), width: 'auto' } + ]; readonly search$ = new BehaviorSubject(null); readonly searchResults$: Observable = this.search$.asObservable().pipe( switchMap(query => this._search(query)), @@ -108,19 +108,6 @@ export class SearchScreenComponent extends ListingComponent implements this._router.navigate([], { queryParams }).then(); } - ngOnInit(): void { - this._configureTableColumns(); - } - - private _configureTableColumns() { - this.tableColumnConfigs = [ - { label: _('search-screen.cols.document'), template: this.filenameTemplate, width: '2fr' }, - { label: _('search-screen.cols.status'), template: this.statusTemplate }, - { label: _('search-screen.cols.dossier'), template: this.dossierTemplate }, - { label: _('search-screen.cols.pages'), template: this.pagesTemplate, width: 'auto' } - ]; - } - private _search(searchInput: SearchInput): Observable { return this._searchControllerService.search({ dossierIds: [...searchInput.dossierIds], diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index ebc96a5b5..3bc887fcb 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1375,7 +1375,7 @@ "table-header": "{length} search {length, plural, one{result} other{results}}" }, "search": { - "entire-platform": "accross all dossiers", + "entire-platform": "across all dossiers", "placeholder": "Search documents...", "this-dossier": "in this dossier" },