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 434db87bc..fba752dd7 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 @@ -8,8 +8,7 @@ [selectionEnabled]="true" emptyColumnWidth="auto" noDataIcon="red:attribute" -> - +> 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 39d8362c4..4d3a9bbf0 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 @@ -32,8 +32,7 @@ [showNoDataButton]="currentUser.isAdmin" emptyColumnWidth="1fr" noDataIcon="red:attribute" - > - + > diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index 6fafd4ac6..eabd996b9 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -29,8 +29,7 @@ [selectionEnabled]="true" emptyColumnWidth="1fr" noDataIcon="red:attribute" - > - + >
diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html index f66db631a..6d0f99f30 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html @@ -9,80 +9,14 @@
- - - - - - - -
-
- -
- -
-
- {{ entity.dossierName }} -
-
-
- - {{ entity.memberIds.length }} -
-
- - {{ entity.date | date: 'mediumDate' }} -
-
- - {{ entity.dueDate | date: 'mediumDate' }} -
-
-
- -
- -
- -
- {{ entity.softDeletedTime | date: 'd MMM. yyyy, hh:mm a' }} -
- -
-
- {{ entity.restoreDate | date: 'timeFromNow' }} -
-
- - - -
-
- -
-
-
+ noDataIcon="red:template" + >
@@ -106,3 +40,61 @@ >
+ + +
+
+ {{ entity.dossierName }} +
+
+
+ + {{ entity.memberIds.length }} +
+
+ + {{ entity.date | date: 'mediumDate' }} +
+
+ + {{ entity.dueDate | date: 'mediumDate' }} +
+
+
+
+ + +
+ +
+
+ + +
+ {{ entity.softDeletedTime | date: 'd MMM. yyyy, hh:mm a' }} +
+
+ + +
+
+ {{ entity.restoreDate | date: 'timeFromNow' }} +
+
+ + + +
+
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.scss index f1ade43fa..064a5c043 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.scss @@ -8,32 +8,3 @@ margin-right: 2px; } } - -.content-container { - cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 1fr 1fr 1fr 1fr 11px; - - .table-item { - > div:not(.scrollbar-placeholder) { - padding-left: 10px; - - .table-item-title { - max-width: 100%; - } - } - - > div { - height: 80px; - padding: 0 24px; - } - } - } - - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 1fr 1fr 1fr 1fr; - } - } - } -} diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts index 0586c5a5d..e91bae050 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts @@ -1,6 +1,6 @@ -import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { Dossier } from '@redaction/red-ui-http'; -import { CircleButtonTypes, DefaultListingServices, ListingComponent, LoadingService, Listable, TableColumnConfig } from '@iqser/common-ui'; +import { CircleButtonTypes, DefaultListingServices, Listable, ListingComponent, LoadingService, TableColumnConfig } from '@iqser/common-ui'; import { AppConfigKey, AppConfigService } from '@app-config/app-config.service'; import * as moment from 'moment'; import { DossiersService } from '../../../dossier/services/dossiers.service'; @@ -21,31 +21,21 @@ interface DossierListItem extends Dossier, Listable { templateUrl: './trash-screen.component.html', styleUrls: ['./trash-screen.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, - providers: [...DefaultListingServices, DossiersService] + providers: [ + ...DefaultListingServices, + DossiersService, + { provide: ListingComponent, useExisting: forwardRef(() => TrashScreenComponent) } + ] }) export class TrashScreenComponent extends ListingComponent implements OnInit { - readonly itemSize = 80; readonly circleButtonTypes = CircleButtonTypes; readonly tableHeaderLabel = _('trash.table-header.title'); readonly canRestoreSelected$ = this._canRestoreSelected$; - readonly tableColumnConfigs: readonly TableColumnConfig[] = [ - { - label: _('trash.table-col-names.name'), - sortByKey: 'dossierName' - }, - { - label: _('trash.table-col-names.owner'), - class: 'user-column' - }, - { - label: _('trash.table-col-names.deleted-on'), - sortByKey: 'softDeletedTime' - }, - { - label: _('trash.table-col-names.time-to-restore'), - sortByKey: 'softDeletedTime' - } - ]; + tableColumnConfigs: TableColumnConfig[]; + @ViewChild('filenameTemplate', { static: true }) filenameTemplate: TemplateRef; + @ViewChild('ownerTemplate', { static: true }) ownerTemplate: TemplateRef; + @ViewChild('deletedTimeTemplate', { static: true }) deletedTimeTemplate: TemplateRef; + @ViewChild('restoreDateTemplate', { static: true }) restoreDateTemplate: TemplateRef; protected readonly _primaryKey = 'dossierName'; private readonly _deleteRetentionHours = this._appConfigService.getConfig(AppConfigKey.DELETE_RETENTION_HOURS); @@ -68,6 +58,7 @@ export class TrashScreenComponent extends ListingComponent impl } async ngOnInit(): Promise { + this._configureTableColumns(); this._loadingService.start(); await this._loadDossiersData(); this._loadingService.stop(); @@ -96,6 +87,31 @@ export class TrashScreenComponent extends ListingComponent impl this._loadingService.loadWhile(this._restore(dossiers)); } + private _configureTableColumns() { + this.tableColumnConfigs = [ + { + label: _('trash.table-col-names.name'), + sortByKey: 'dossierName', + template: this.filenameTemplate + }, + { + label: _('trash.table-col-names.owner'), + class: 'user-column', + template: this.ownerTemplate + }, + { + label: _('trash.table-col-names.deleted-on'), + sortByKey: 'softDeletedTime', + template: this.deletedTimeTemplate + }, + { + label: _('trash.table-col-names.time-to-restore'), + sortByKey: 'softDeletedTime', + template: this.restoreDateTemplate + } + ]; + } + private _getRestoreDate(softDeletedTime: string): string { return moment(softDeletedTime).add(this._deleteRetentionHours, 'hours').toISOString(); }