diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html index abc5a0ec2..0b07b15ba 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html @@ -6,70 +6,15 @@
- - - - - - -
-
- -
- -
-
- {{ download.filename }} -
-
-
-
- {{ download.size }} -
-
-
-
- {{ download.creationDate | date: 'd MMM. yyyy, hh:mm a' }} -
-
-
-
- {{ download.status }} -
-
-
-
- - - - - -
-
-
-
-
+ emptyColumnWidth="auto" + noDataIcon="red:download" + >
@@ -79,7 +24,60 @@ (action)="deleteItems()" *ngIf="entitiesService.areSomeSelected$ | async" [tooltip]="'downloads-list.bulk.delete' | translate" - icon="red:trash" [type]="circleButtonTypes.dark" + icon="red:trash" > + + +
+
+ {{ download.filename }} +
+
+
+ + +
+
+ {{ download.size }} +
+
+
+ + +
+
+ {{ download.creationDate | date: 'd MMM. yyyy, hh:mm a' }} +
+
+
+ + +
+
+ {{ download.status }} +
+
+
+ + +
+ + + + + +
+
diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.scss b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.scss index ce9b00a52..696ad9daa 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.scss +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.scss @@ -1,27 +1,3 @@ -.content-container { - cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr auto 11px; - - .table-item { - > div:not(.scrollbar-placeholder) { - padding-left: 10px; - } - } - } - - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr auto; - } - } - } -} - -.page-header .actions { - justify-content: flex-end; -} - .no-bold { font-weight: normal !important; } diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.ts b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.ts index 53846e45a..dd7ed4d72 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.ts +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, Injector, OnInit } from '@angular/core'; +import { Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { FileDownloadService } from '@upload-download/services/file-download.service'; import { DownloadStatusWrapper } from '@upload-download/model/download-status.wrapper'; import { DownloadControllerService } from '@redaction/red-ui-http'; @@ -11,18 +11,16 @@ import { RouterHistoryService } from '@services/router-history.service'; selector: 'redaction-downloads-list-screen', templateUrl: './downloads-list-screen.component.html', styleUrls: ['./downloads-list-screen.component.scss'], - providers: [...DefaultListingServices] + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DownloadsListScreenComponent) }] }) export class DownloadsListScreenComponent extends ListingComponent implements OnInit { - readonly itemSize = 80; readonly circleButtonTypes = CircleButtonTypes; readonly tableHeaderLabel = _('downloads-list.table-header.title'); - readonly tableColumnConfigs: readonly TableColumnConfig[] = [ - { label: _('downloads-list.table-col-names.name') }, - { label: _('downloads-list.table-col-names.size') }, - { label: _('downloads-list.table-col-names.date') }, - { label: _('downloads-list.table-col-names.status') } - ]; + tableColumnConfigs: TableColumnConfig[]; + @ViewChild('filenameTemplate', { static: true }) filenameTemplate: TemplateRef; + @ViewChild('sizeTemplate', { static: true }) sizeTemplate: TemplateRef; + @ViewChild('creationDateTemplate', { static: true }) creationDateTemplate: TemplateRef; + @ViewChild('statusTemplate', { static: true }) statusTemplate: TemplateRef; protected readonly _primaryKey = 'storageId'; constructor( @@ -36,10 +34,13 @@ export class DownloadsListScreenComponent extends ListingComponent { await this._loadData(); }); + this._loadingService.stop(); } downloadItem(download: DownloadStatusWrapper) { @@ -50,6 +51,15 @@ export class DownloadsListScreenComponent extends ListingComponent d.storageId); await this._downloadControllerService.deleteDownload({ storageIds }).toPromise(); diff --git a/apps/red-ui/src/app/components/notifications/notifications.component.html b/apps/red-ui/src/app/components/notifications/notifications.component.html index fb790d059..36fe9dfb8 100644 --- a/apps/red-ui/src/app/components/notifications/notifications.component.html +++ b/apps/red-ui/src/app/components/notifications/notifications.component.html @@ -1,11 +1,11 @@ - + >
{{ group.dateString }}
diff --git a/apps/red-ui/src/app/models/audit-model-wrapper.model.ts b/apps/red-ui/src/app/models/audit-model-wrapper.model.ts new file mode 100644 index 000000000..f14207327 --- /dev/null +++ b/apps/red-ui/src/app/models/audit-model-wrapper.model.ts @@ -0,0 +1,38 @@ +import { AuditModel } from '@redaction/red-ui-http'; +import { Listable } from '@iqser/common-ui'; + +export class AuditModelWrapper implements Listable { + constructor(public auditModel: AuditModel) {} + + get category(): string { + return this.auditModel.category; + } + + get details(): any { + return this.auditModel.details; + } + + get message(): string { + return this.auditModel.message; + } + + get recordId(): string { + return this.auditModel.recordId; + } + + get recordDate(): string { + return this.auditModel.recordDate; + } + + get objectId(): string { + return this.auditModel.objectId; + } + + get userId(): string { + return this.auditModel.userId; + } + + get id() { + return this.auditModel.recordDate; + } +} diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html index be329fdb1..477d76338 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html @@ -63,8 +63,8 @@ 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 6da51b99b..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 @@ -1,74 +1,14 @@ - - - - - -
-
- -
- -
- -
- -
-
- - - - {{ translations[type] | translate }} - - - -
-
- -
- -
- -
- -
- -
-
- -
-
-
-
-
+ emptyColumnWidth="auto" + noDataIcon="red:attribute" +> @@ -113,3 +53,55 @@ + + +
+ +
+
+ + +
+ +
+
+ + +
+
+ + + + {{ 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 dbff36713..be28d9506 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 @@ -1,47 +1,37 @@ @import '../../../../../../assets/styles/variables'; -iqser-table-header::ng-deep iqser-table-column-name .name { - padding-left: 22px; -} +:host ::ng-deep iqser-table { + iqser-table-header { + iqser-table-column-name .name { + padding-left: 22px; + } -iqser-table-header::ng-deep .header-item { - box-shadow: none; - border-top: 1px solid $separator; + .header-item { + box-shadow: none; + border-top: 1px solid $separator; - .all-caps-label { - margin-right: 10px; - } - - iqser-circle-button { - margin-right: 2px; - } - - .separator { - margin-left: 14px; - background-color: $separator; - width: 1px; - height: 30px; - margin-right: 16px; - } -} - -cdk-virtual-scroll-viewport { - height: calc(100% - 80px); - - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 30px minmax(0, 350px) 150px auto auto auto 11px; - - .table-item > div { - height: 50px; - - &:not(.scrollbar-placeholder) { - padding-left: 10px; - - &.center { - align-items: center; - } + .all-caps-label { + margin-right: 10px; } + iqser-circle-button { + margin-right: 2px; + } + + .separator { + margin-left: 14px; + background-color: $separator; + width: 1px; + height: 30px; + margin-right: 16px; + } + } + } + + 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; } @@ -55,10 +45,4 @@ cdk-virtual-scroll-viewport { } } } - - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 30px minmax(0, 350px) 150px auto auto auto; - } - } } 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 f2bfbeb36..126288f6a 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,4 +1,16 @@ -import { Component, EventEmitter, Injector, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; +import { + Component, + EventEmitter, + forwardRef, + Injector, + Input, + OnChanges, + OnInit, + Output, + SimpleChanges, + TemplateRef, + ViewChild +} from '@angular/core'; import { Field } from '../file-attributes-csv-import-dialog.component'; import { FileAttributeConfig } from '@redaction/red-ui-http'; import { CircleButtonTypes, DefaultListingServices, ListingComponent, TableColumnConfig } from '@iqser/common-ui'; @@ -9,46 +21,36 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; selector: 'redaction-active-fields-listing', templateUrl: './active-fields-listing.component.html', styleUrls: ['./active-fields-listing.component.scss'], - providers: [...DefaultListingServices] + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => ActiveFieldsListingComponent) }] }) -export class ActiveFieldsListingComponent extends ListingComponent implements OnChanges { - protected readonly _primaryKey = 'csvColumn'; +export class ActiveFieldsListingComponent extends ListingComponent implements OnChanges, OnInit { readonly circleButtonTypes = CircleButtonTypes; readonly translations = fileAttributeTypesTranslations; readonly tableHeaderLabel = _('file-attributes-csv-import.table-header.title'); - readonly tableColumnConfigs: TableColumnConfig[] = [ - { - label: _('file-attributes-csv-import.table-col-names.name'), - class: 'name' - }, - { label: _('file-attributes-csv-import.table-col-names.type') }, - { - label: _('file-attributes-csv-import.table-col-names.read-only'), - class: 'flex-center', - leftIcon: 'red:read-only' - }, - { - 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') - } - ]; + tableColumnConfigs: TableColumnConfig[]; readonly typeOptions = [ FileAttributeConfig.TypeEnum.TEXT, FileAttributeConfig.TypeEnum.NUMBER, FileAttributeConfig.TypeEnum.DATE ] as const; - + @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() entitiesChange = new EventEmitter(); @Output() setHoveredColumn = new EventEmitter(); @Output() toggleFieldActive = new EventEmitter(); + protected readonly _primaryKey = 'csvColumn'; constructor(protected readonly _injector: Injector) { super(_injector); } + ngOnInit(): void { + this._configureTableColumns(); + } + ngOnChanges(changes: SimpleChanges): void { if (changes.entities) { this.entitiesService.setEntities(this.entities); @@ -80,4 +82,38 @@ export class ActiveFieldsListingComponent extends ListingComponent implem } field.primaryAttribute = true; } + + 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/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts index 62337bc6b..6c5f23c5b 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts @@ -34,6 +34,7 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent
-
- - {{ 'audit-screen.table-header.title' | translate: { length: logs?.totalHits || 0 } }} - -
- -
·
-
-
- - - - {{ translations[category] | translate }} - - - -
-
- - - - -
-
- - -
-
-
-
-
-
·
-
- - - - - -
- -
- -
- - - - - -
-
-
-
- -
- - - - -
-
- - - - -
-
- {{ log.message }} -
-
- {{ log.recordDate | date: 'd MMM. yyyy, hh:mm a' }} -
-
- -
-
-
-
-
+ +
+ + +
+ +
·
+
+
+ + + + {{ translations[category] | translate }} + + + +
+
+ + + + +
+
+ + +
+
+
+
+
+
·
+
+ + + + + +
+ +
+ +
+ + + + + +
+
+
+
+ + +
+ {{ log.message }} +
+
+ + +
+ {{ log.recordDate | date: 'd MMM. yyyy, hh:mm a' }} +
+
+ + +
+ +
+
+ + +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss index 7d1dd7e64..010d52fd9 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss @@ -1,44 +1,27 @@ -.content-container { - .header-item { - justify-content: space-between; - } +:host ::ng-deep iqser-table iqser-table-header .header-item { + justify-content: space-between; +} - .actions-wrapper, - form { - display: flex; - align-items: center; +form { + display: flex; + align-items: center; - .iqser-input-group { - margin-top: 0 !important; - } - - .separator { - margin: 0 20px; - font-weight: bold; - font-size: 16px; - opacity: 0.7; - } - - .mr-20 { - margin-right: 20px; - } - } - - cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 1fr 1fr 1fr 1fr 11px; - - .table-item { - > div { - padding: 0 24px; - } - } - } - - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 1fr 1fr 1fr 1fr; - } - } + .iqser-input-group { + margin-top: 0 !important; } } + +.separator { + margin: 0 20px; + font-weight: bold; + font-size: 16px; + opacity: 0.7; +} + +.mr-0 { + margin-right: 0; +} + +.mr-20 { + margin-right: 20px; +} 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 f2d195b81..5451a3c57 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,41 +1,49 @@ -import { Component, OnDestroy } from '@angular/core'; +import { Component, forwardRef, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { AuditControllerService, AuditResponse, AuditSearchRequest } from '@redaction/red-ui-http'; +import { AuditControllerService, AuditModel, AuditResponse, AuditSearchRequest } from '@redaction/red-ui-http'; import { Moment } from 'moment'; import { applyIntervalConstraints } from '@utils/date-inputs-utils'; -import { AutoUnsubscribe, LoadingService } from '@iqser/common-ui'; +import { DefaultListingServices, KeysOf, ListingComponent, LoadingService, TableColumnConfig } from '@iqser/common-ui'; import { auditCategoriesTranslations } from '../../translations/audit-categories-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { UserService } from '@services/user.service'; +import { AuditModelWrapper } from '../../../../models/audit-model-wrapper.model'; const PAGE_SIZE = 50; @Component({ selector: 'redaction-audit-screen', templateUrl: './audit-screen.component.html', - styleUrls: ['./audit-screen.component.scss'] + styleUrls: ['./audit-screen.component.scss'], + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => AuditScreenComponent) }] }) -export class AuditScreenComponent extends AutoUnsubscribe implements OnDestroy { +export class AuditScreenComponent extends ListingComponent implements OnDestroy, OnInit { readonly ALL_CATEGORIES = 'allCategories'; 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 tableHeaderLabel = _('audit-screen.table-header.title'); + protected readonly _primaryKey: KeysOf = 'recordDate'; private _previousFrom: Moment; private _previousTo: Moment; constructor( private readonly _userService: UserService, + protected readonly _injector: Injector, private readonly _formBuilder: FormBuilder, private readonly _loadingService: LoadingService, private readonly _auditControllerService: AuditControllerService ) { - super(); + super(_injector); this.filterForm = this._formBuilder.group({ category: [this.ALL_CATEGORIES], userId: [this.ALL_USERS], @@ -43,13 +51,11 @@ export class AuditScreenComponent extends AutoUnsubscribe implements OnDestroy { to: [] }); - this.addSubscription = this.filterForm.valueChanges.subscribe(value => { + this.addSubscription = this.filterForm.valueChanges.subscribe(async value => { if (!this._updateDateFilters(value)) { - this._fetchData(); + await this._fetchData(); } }); - - this._fetchData(); } get totalPages(): number { @@ -59,8 +65,35 @@ export class AuditScreenComponent extends AutoUnsubscribe implements OnDestroy { return Math.ceil(this.logs.totalHits / PAGE_SIZE); } - pageChanged(page: number) { - this._fetchData(page); + async pageChanged(page: number) { + await this._fetchData(page); + } + + 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 { @@ -73,7 +106,7 @@ export class AuditScreenComponent extends AutoUnsubscribe implements OnDestroy { return false; } - private _fetchData(page?: number) { + private async _fetchData(page?: number) { this._loadingService.start(); const promises = []; const category = this.filterForm.get('category').value; @@ -96,15 +129,16 @@ export class AuditScreenComponent extends AutoUnsubscribe implements OnDestroy { promises.push(this._auditControllerService.getAuditCategories().toPromise()); promises.push(this._auditControllerService.searchAuditLog(logsRequestBody).toPromise()); - Promise.all(promises).then(data => { - this.categories = data[0].map(c => c.category); - this.categories.splice(0, 0, this.ALL_CATEGORIES); - this.logs = data[1]; - this.userIds = new Set([this.ALL_USERS]); - for (const id of this.logs.data.map(log => log.userId).filter(uid => !!uid)) { - this.userIds.add(id); - } - this._loadingService.stop(); - }); + const data = await Promise.all(promises); + this.categories = data[0].map(c => c.category); + this.categories.splice(0, 0, this.ALL_CATEGORIES); + this.logs = data[1]; + const entities = this.logs.data.map((log: AuditModel) => new AuditModelWrapper(log)); + this.entitiesService.setEntities(entities); + this.userIds = new Set([this.ALL_USERS]); + for (const id of this.logs.data.map(log => log.userId).filter(uid => !!uid)) { + this.userIds.add(id); + } + this._loadingService.stop(); } } diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html index 3a1c8dced..460f9c2c9 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html @@ -20,36 +20,31 @@
- - - -
-
-
-
- -
-
-
- -
-
- -
-
-
-
-
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+ +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.scss index 89fce9593..c24b7ea42 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.scss @@ -1,30 +1,15 @@ -.content-container cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 2fr 1fr 2fr 11px; +:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell { + &:not(.scrollbar-placeholder) { + padding-left: 24px; + } - .table-item { - > div:not(.scrollbar-placeholder) { - padding-left: 24px; - } + &.color-wrapper { + align-items: center; - .color-wrapper { - align-items: center; - - .color-square { - width: 16px; - height: 16px; - min-width: 16px; - } - } + .color-square { + width: 16px; + height: 16px; + min-width: 16px; } } - - &.has-scrollbar:hover ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: 2fr 1fr 2fr; - } -} - -.page-header .actions { - display: flex; - justify-content: flex-end; } diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts index 3fdb6fe75..65dd139b6 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { AppStateService } from '@state/app-state.service'; import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; import { ActivatedRoute } from '@angular/router'; @@ -18,20 +18,16 @@ interface ListItem extends Listable { templateUrl: './default-colors-screen.component.html', styleUrls: ['./default-colors-screen.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, - providers: [...DefaultListingServices] + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DefaultColorsScreenComponent) }] }) export class DefaultColorsScreenComponent extends ListingComponent implements OnInit { + @ViewChild('nameTemplate', { static: true }) nameTemplate: TemplateRef; + @ViewChild('colorTemplate', { static: true }) colorTemplate: TemplateRef; readonly circleButtonTypes = CircleButtonTypes; readonly currentUser = this._userService.currentUser; readonly translations = defaultColorsTranslations; readonly tableHeaderLabel = _('default-colors-screen.table-header.title'); - readonly tableColumnConfigs: TableColumnConfig[] = [ - { - label: _('default-colors-screen.table-col-names.key'), - sortByKey: 'key' - }, - { label: _('default-colors-screen.table-col-names.color'), class: 'flex-center' } - ]; + tableColumnConfigs: TableColumnConfig[]; protected readonly _primaryKey = 'key'; private _colorsObj: Colors; @@ -49,6 +45,7 @@ export class DefaultColorsScreenComponent extends ListingComponent imp } async ngOnInit() { + this._configureTableColumns(); await this._loadColors(); } @@ -68,6 +65,22 @@ export class DefaultColorsScreenComponent extends ListingComponent imp ); } + private _configureTableColumns() { + this.tableColumnConfigs = [ + { + label: _('default-colors-screen.table-col-names.key'), + sortByKey: 'key', + template: this.nameTemplate, + width: '2fr' + }, + { + label: _('default-colors-screen.table-col-names.color'), + class: 'flex-center', + template: this.colorTemplate + } + ]; + } + private async _loadColors() { this._loadingService.start(); const data = await this._dictionaryControllerService.getColors(this._appStateService.activeDossierTemplateId).toPromise(); diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index 18a0b5f1b..77d1ff07a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -20,88 +20,23 @@
- - - - - - - -
-
- -
- -
-
-
-
- {{ dict.label }} -
-
-
- - {{ dict.entries?.length }} -
-
- - {{ 'dictionary-listing.case-sensitive' | translate }} -
-
-
-
- -
- {{ dict.rank }} -
- -
- -
- -
-
- - - -
-
-
-
-
+ [showNoDataButton]="currentUser.isAdmin" + emptyColumnWidth="1fr" + noDataIcon="red:dictionary" + >
-
+
+ -
+ +
+ + +
+
+
+
+ {{ entity.label }} +
+
+
+ + {{ entity.entries?.length }} +
+
+ + {{ 'dictionary-listing.case-sensitive' | translate }} +
+
+
+
+
+ + +
+ {{ dict.rank }} +
+
+ + +
+ +
+
+ + +
+ + + +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss index ef2c038ad..93f51990a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss @@ -1,58 +1,39 @@ -iqser-table-header::ng-deep .header-item { - padding-right: 16px; -} +:host { + ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell { + flex-direction: row; + align-items: center; + justify-content: flex-start; -.content-container cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr 11px; + &.center { + justify-content: center; + } - .table-item > div:not(.scrollbar-placeholder) { - display: flex; - flex-direction: row; - padding-left: 10px; - align-items: center; - justify-content: flex-start; + .color-square { + width: 16px; + height: 16px; + min-width: 16px; + margin-right: 16px; + } - &.center { - justify-content: center; - } + .dict-name { + z-index: 1; + max-width: 100%; + } - .color-square { - width: 16px; - height: 16px; - min-width: 16px; - margin-right: 16px; - } - - .dict-name { - z-index: 1; - max-width: 100%; - } - - .stats-subtitle { - margin-top: 4px; - } + .stats-subtitle { + margin-top: 4px; } } - &.has-scrollbar:hover ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr; + .right-container { + display: flex; + width: 353px; + min-width: 353px; + justify-content: center; + padding: 50px 20px 30px 20px; + + &.has-scrollbar:hover { + padding-right: 9px; + } } } - -.right-container { - display: flex; - width: 353px; - min-width: 353px; - justify-content: center; - padding: 50px 20px 30px 20px; - - &.has-scrollbar:hover { - padding-right: 9px; - } -} - -.page-header .actions { - display: flex; - justify-content: flex-end; -} diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts index 65e86bd61..e6eff876d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, Injector, OnInit } from '@angular/core'; +import { Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; import { DictionaryControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; @@ -29,29 +29,18 @@ const toChartConfig = (dict: TypeValueWrapper): DoughnutChartConfig => ({ @Component({ templateUrl: './dictionary-listing-screen.component.html', styleUrls: ['./dictionary-listing-screen.component.scss'], - providers: [...DefaultListingServices] + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DictionaryListingScreenComponent) }] }) export class DictionaryListingScreenComponent extends ListingComponent implements OnInit { readonly iconButtonTypes = IconButtonTypes; readonly circleButtonTypes = CircleButtonTypes; readonly currentUser = this._userService.currentUser; readonly tableHeaderLabel = _('dictionary-listing.table-header.title'); - readonly tableColumnConfigs: TableColumnConfig[] = [ - { - label: _('dictionary-listing.table-col-names.type'), - sortByKey: 'label' - }, - { - label: _('dictionary-listing.table-col-names.order-of-importance'), - sortByKey: 'rank', - class: 'flex-center' - }, - { - label: _('dictionary-listing.table-col-names.hint-redaction'), - class: 'flex-center' - } - ]; + tableColumnConfigs: TableColumnConfig[]; chartData: DoughnutChartConfig[] = []; + @ViewChild('labelTemplate', { static: true }) labelTemplate: TemplateRef; + @ViewChild('rankTemplate', { static: true }) rankTemplate: TemplateRef; + @ViewChild('iconTemplate', { static: true }) iconTemplate: TemplateRef; protected readonly _primaryKey = 'type'; constructor( @@ -69,7 +58,10 @@ export class DictionaryListingScreenComponent extends ListingComponent [entity.type]; + ngOnInit(): void { + this._configureTableColumns(); this._loadDictionaryData(); } @@ -108,6 +100,28 @@ export class DictionaryListingScreenComponent extends ListingComponent !d.virtual); diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html index 97eefcf76..1dc0a9cfc 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html @@ -16,13 +16,13 @@
- + >
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 fef0715c2..9635022f1 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 @@ -20,68 +20,20 @@
- - - - - - - -
-
- -
- -
- {{ attribute.label }} -
- -
- {{ attribute.placeholder }} -
- -
- {{ translations[attribute.type] | translate }} -
-
-
- - - -
-
-
-
-
+ [showNoDataButton]="currentUser.isAdmin" + emptyColumnWidth="1fr" + noDataIcon="red:attribute" + >
@@ -91,11 +43,13 @@ (action)="openConfirmDeleteAttributeDialog($event)" *ngIf="currentUser.isAdmin && entitiesService.areSomeSelected$ | async" [tooltip]="'dossier-attributes-listing.bulk.delete' | translate" - icon="red:trash" [type]="circleButtonTypes.dark" + icon="red:trash" > + -
+ +
+ + +
+ + + +
+
+ + +
+ {{ attribute.label }} +
+
+ + +
+ {{ 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.scss b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.scss index 187b51b58..e69de29bb 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.scss @@ -1,34 +0,0 @@ -.page-header .actions { - display: flex; - justify-content: flex-end; -} - -iqser-table-header::ng-deep .attributes-actions-container { - display: flex; - flex: 1; - justify-content: flex-end; - - > *:not(:last-child) { - margin-right: 10px; - } -} - -cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 2fr 1fr 1fr 11px; - - .table-item > div { - height: 50px; - - &:not(.scrollbar-placeholder) { - padding-left: 10px; - } - } - } - - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 2fr 1fr 1fr; - } - } -} 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 a42bb4a9c..8ed266871 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, Injector, OnInit } from '@angular/core'; +import { Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { CircleButtonTypes, DefaultListingServices, @@ -19,7 +19,10 @@ import { UserService } from '@services/user.service'; @Component({ templateUrl: './dossier-attributes-listing-screen.component.html', styleUrls: ['./dossier-attributes-listing-screen.component.scss'], - providers: [...DefaultListingServices] + providers: [ + ...DefaultListingServices, + { provide: ListingComponent, useExisting: forwardRef(() => DossierAttributesListingScreenComponent) } + ] }) export class DossierAttributesListingScreenComponent extends ListingComponent implements OnInit { readonly iconButtonTypes = IconButtonTypes; @@ -27,17 +30,10 @@ export class DossierAttributesListingScreenComponent extends ListingComponent[] = [ - { - label: _('dossier-attributes-listing.table-col-names.label'), - sortByKey: 'label' - }, - { label: _('dossier-attributes-listing.table-col-names.placeholder') }, - { - label: _('dossier-attributes-listing.table-col-names.type'), - sortByKey: 'type' - } - ]; + tableColumnConfigs: TableColumnConfig[]; + @ViewChild('labelTemplate', { static: true }) labelTemplate: TemplateRef; + @ViewChild('placeholderTemplate', { static: true }) placeholderTemplate: TemplateRef; + @ViewChild('typeTemplate', { static: true }) typeTemplate: TemplateRef; protected readonly _primaryKey = 'label'; constructor( @@ -54,6 +50,7 @@ export class DossierAttributesListingScreenComponent extends ListingComponent item.id); await this._dossierAttributesService.deleteConfigs(ids); + this.entitiesService.setSelected([]); await this._loadData(); }); } @@ -77,6 +75,27 @@ export class DossierAttributesListingScreenComponent extends ListingComponent
- -
- - - -
-
- - - - - - -
-
- -
- -
-
- {{ dossierTemplate.name }} -
-
-
- - {{ - 'dossier-templates-listing.dictionaries' | translate: { length: dossierTemplate.dictionariesCount } - }} -
-
-
- -
- -
-
- {{ dossierTemplate.dateAdded | date: 'd MMM. yyyy' }} -
-
-
- {{ dossierTemplate.dateModified | date: 'd MMM. yyyy' }} -
- - -
-
-
-
+ noDataIcon="red:template" + >
@@ -103,3 +35,63 @@ icon="red:trash" > + + + + + + +
+ + + +
+
+ + +
+
+ {{ dossierTemplate.name }} +
+
+
+ + {{ 'dossier-templates-listing.dictionaries' | translate: { length: dossierTemplate.dictionariesCount } }} +
+
+
+
+ + +
+ +
+
+ + +
+ {{ dossierTemplate.dateAdded | date: 'd MMM. yyyy' }} +
+
+ + +
+
+ {{ dossierTemplate.dateModified | date: 'd MMM. yyyy' }} +
+ +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.scss index 351bb7095..009e0d63a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.scss @@ -1,29 +1,15 @@ -cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 1fr 1fr 1fr 1fr 11px; +:host { + ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell { + .stats-subtitle { + margin-top: 4px; + } - .table-item { - > div:not(.scrollbar-placeholder) { - padding-left: 10px; - - .stats-subtitle { - margin-top: 4px; - } - - .table-item-title { - max-width: 100%; - } - } + .table-item-title { + max-width: 100%; } } - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 1fr 1fr 1fr 1fr; - } + .page-header .actions > *:not(:last-child) { + margin-right: 16px; } } - -.page-header .actions > *:not(:last-child) { - margin-right: 16px; -} diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts index 981d970e8..ab5ceccdf 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { AppStateService } from '@state/app-state.service'; import { UserPreferenceService } from '@services/user-preference.service'; import { AdminDialogService } from '../../services/admin-dialog.service'; @@ -21,28 +21,21 @@ import { RouterHistoryService } from '@services/router-history.service'; templateUrl: './dossier-templates-listing-screen.component.html', styleUrls: ['./dossier-templates-listing-screen.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, - providers: [...DefaultListingServices] + providers: [ + ...DefaultListingServices, + { provide: ListingComponent, useExisting: forwardRef(() => DossierTemplatesListingScreenComponent) } + ] }) export class DossierTemplatesListingScreenComponent extends ListingComponent implements OnInit { readonly iconButtonTypes = IconButtonTypes; readonly circleButtonTypes = CircleButtonTypes; readonly currentUser = this._userService.currentUser; readonly tableHeaderLabel = _('dossier-templates-listing.table-header.title'); - readonly tableColumnConfigs: readonly TableColumnConfig[] = [ - { - label: _('dossier-templates-listing.table-col-names.name'), - sortByKey: 'name' - }, - { label: _('dossier-templates-listing.table-col-names.created-by'), class: 'user-column' }, - { - label: _('dossier-templates-listing.table-col-names.created-on'), - sortByKey: 'dateAdded' - }, - { - label: _('dossier-templates-listing.table-col-names.modified-on'), - sortByKey: 'dateModified' - } - ]; + tableColumnConfigs: TableColumnConfig[]; + @ViewChild('nameTemplate', { static: true }) nameTemplate: TemplateRef; + @ViewChild('userTemplate', { static: true }) userTemplate: TemplateRef; + @ViewChild('dateAddedTemplate', { static: true }) dateAddedTemplate: TemplateRef; + @ViewChild('dateModifiedTemplate', { static: true }) dateModifiedTemplate: TemplateRef; protected readonly _primaryKey = 'name'; constructor( @@ -59,7 +52,10 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent [dossierTemplate.dossierTemplateId, 'dictionaries']; + ngOnInit(): void { + this._configureTableColumns(); this.loadDossierTemplatesData(); } @@ -81,6 +77,31 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent d.dossierTemplateId)) { await this._dossierTemplateControllerService .deleteDossierTemplates(templateIds) 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 081fa4e27..ce9844247 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 @@ -20,76 +20,17 @@
- - - - - - - -
-
- -
- -
- {{ attribute.label }} -
- -
- -
- -
-
- {{ attribute.csvColumnHeader }} -
-
- -
-
- -
-
- -
-
-
- - -
-
-
-
-
+ emptyColumnWidth="1fr" + noDataIcon="red:attribute" + >
@@ -101,11 +42,13 @@ (click)="openConfirmDeleteAttributeDialog($event)" *ngIf="currentUser.isAdmin && (entitiesService.areSomeSelected$ | async)" [tooltip]="'file-attributes-listing.bulk-actions.delete' | translate" - icon="red:trash" [type]="circleButtonTypes.dark" + icon="red:trash" > + -
+ +
+ + +
+ + +
+
+ + +
+ {{ 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 dc6d57c73..2f729c071 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,38 +1,21 @@ @import 'libs/common-ui/src/assets/styles/mixins'; -.page-header .actions { - display: flex; - justify-content: flex-end; -} - -.content-container cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 11px; - - .table-item { - > div:not(.scrollbar-placeholder) { - padding-left: 10px; - } - - > div { - &.center { - align-items: center; - } - - &.label span { - @include line-clamp(1); - } - - &.read-only mat-icon { - width: 14px; - height: 34px; - } - } - } +:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell { + &.center { + align-items: center; } - &.has-scrollbar:hover ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; + &.label span { + @include line-clamp(1); + } + + &.read-only mat-icon { + width: 14px; + height: 34px; + } + + iqser-round-checkbox { + cursor: default; } } @@ -40,7 +23,3 @@ display: none; visibility: hidden; } - -.table-item > div:not(.selection-column) iqser-round-checkbox { - cursor: default; -} 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 00547481c..3aa23b284 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,4 +1,14 @@ -import { ChangeDetectionStrategy, Component, ElementRef, Injector, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + ElementRef, + forwardRef, + Injector, + OnDestroy, + OnInit, + TemplateRef, + ViewChild +} from '@angular/core'; import { FileAttributeConfig, FileAttributesConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { ActivatedRoute } from '@angular/router'; @@ -19,7 +29,10 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; templateUrl: './file-attributes-listing-screen.component.html', styleUrls: ['./file-attributes-listing-screen.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, - providers: [...DefaultListingServices] + providers: [ + ...DefaultListingServices, + { provide: ListingComponent, useExisting: forwardRef(() => FileAttributesListingScreenComponent) } + ] }) export class FileAttributesListingScreenComponent extends ListingComponent implements OnInit, OnDestroy { readonly iconButtonTypes = IconButtonTypes; @@ -27,36 +40,14 @@ export class FileAttributesListingScreenComponent extends ListingComponent[] = [ - { - label: _('file-attributes-listing.table-col-names.name'), - sortByKey: 'label' - }, - { - 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') - } - ]; + tableColumnConfigs: TableColumnConfig[]; + @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; protected readonly _primaryKey = 'label'; private _existingConfiguration: FileAttributesConfig; @ViewChild('fileInput') private _fileInput: ElementRef; @@ -75,6 +66,7 @@ export class FileAttributesListingScreenComponent extends ListingComponent
- - - - - -
@@ -95,12 +89,6 @@
{{ unlicensedInfo.numberOfAnalyzedPages }}
- - - - - - -
+
@@ -42,7 +42,7 @@
-
+
- - - - - - - -
-
- -
- -
-
- {{ entity.dossierName }} -
-
-
- - {{ entity.memberIds.length }} -
-
- - {{ entity.date | date: 'mediumDate' }} -
-
- - {{ entity.dueDate | date: 'mediumDate' }} -
-
-
- -
- -
- -
-
- {{ entity.softDeletedTime === '-' ? '-' : (entity.softDeletedTime | date: 'd MMM. yyyy, hh:mm a') }} -
-
- -
-
- {{ entity.restoreDate | date: 'timeFromNow' }} -
-
- - - -
-
- -
-
-
+ [tableItemClasses]="{ disabled: disabledFn }" + noDataIcon="red:template" + >
-
- + - + + + + +
+
+ {{ 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 c1577647d..e69de29bb 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 @@ -1,46 +0,0 @@ -@import '../../../../../assets/styles/variables'; - -.bulk-actions { - display: flex; - align-items: center; - - > *:not(:last-child) { - 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; - } - } - } -} - -.disabled { - > div { - background-color: $grey-2; - color: $grey-7; - } -} 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 b3fcd0baa..6dcf85ce1 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,13 +1,13 @@ -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, + Listable, ListingComponent, LoadingService, - Listable, - TableColumnConfig, - SortingOrders + SortingOrders, + TableColumnConfig } from '@iqser/common-ui'; import { AppConfigKey, AppConfigService } from '@app-config/app-config.service'; import * as moment from 'moment'; @@ -29,31 +29,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); @@ -75,7 +65,10 @@ export class TrashScreenComponent extends ListingComponent impl ); } + disabledFn = (dossier: DossierListItem) => !dossier.canRestore; + async ngOnInit(): Promise { + this._configureTableColumns(); this._loadingService.start(); await this._loadDossiersData(); this.sortingService.setSortingOption({ @@ -108,6 +101,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(); } diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html index 155d19494..a050c77b9 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html @@ -16,8 +16,8 @@ (action)="openAddEditUserDialog($event)" *ngIf="currentUser.isUserAdmin" [label]="'user-listing.add-new' | translate" - icon="red:plus" [type]="iconButtonTypes.primary" + icon="red:plus" >
- - - - - - -
-
- -
- -
- -
-
{{ user.email || '-' }}
-
- -
-
{{ getDisplayRoles(user) }}
-
-
- - -
-
-
-
-
+ emptyColumnWidth="1fr" + >
-
+
+ + +
+ +
+
+ + +
{{ 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 73674cbd8..5a09cdf01 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,23 +1,5 @@ -cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr auto 11px; - - .table-item { - > div:not(.scrollbar-placeholder) { - padding-left: 10px; - - &.center { - align-items: center; - } - } - } - } - - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 2fr 1fr 1fr 1fr auto; - } - } +:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item > div.cell.center { + align-items: center; } .right-container { @@ -36,8 +18,6 @@ cdk-virtual-scroll-viewport { } .page-header .actions { - justify-content: flex-end; - iqser-input-with-action:not(:last-child) { margin-right: 16px; } 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 7f5c31cfd..0bb3f1e65 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, Injector, OnInit, QueryList, ViewChildren } from '@angular/core'; +import { Component, forwardRef, Injector, OnInit, QueryList, TemplateRef, ViewChild, ViewChildren } from '@angular/core'; import { UserService, UserWrapper } from '@services/user.service'; import { UserControllerService } from '@redaction/red-ui-http'; import { AdminDialogService } from '../../services/admin-dialog.service'; @@ -22,7 +22,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ templateUrl: './user-listing-screen.component.html', styleUrls: ['./user-listing-screen.component.scss'], - providers: [...DefaultListingServices] + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => UserListingScreenComponent) }] }) export class UserListingScreenComponent extends ListingComponent implements OnInit { readonly translations = rolesTranslations; @@ -31,14 +31,13 @@ export class UserListingScreenComponent extends ListingComponent im readonly currentUser = this.userService.currentUser; readonly canDeleteSelected$ = this._canDeleteSelected$; readonly tableHeaderLabel = _('user-listing.table-header.title'); - readonly tableColumnConfigs: TableColumnConfig[] = [ - { label: _('user-listing.table-col-names.name') }, - { label: _('user-listing.table-col-names.email') }, - { label: _('user-listing.table-col-names.active'), class: 'flex-center' }, - { label: _('user-listing.table-col-names.roles') } - ]; + tableColumnConfigs: TableColumnConfig[]; 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; protected readonly _primaryKey = 'id'; @ViewChildren(InitialsAvatarComponent) private readonly _avatars: QueryList; @@ -61,6 +60,7 @@ export class UserListingScreenComponent extends ListingComponent im } async ngOnInit() { + this._configureTableColumns(); await this._loadData(); this.searchService.setSearchKey('searchKey'); } @@ -97,6 +97,15 @@ export class UserListingScreenComponent extends ListingComponent im 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/admin/screens/watermark/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html index cd8b6cf54..8040ae9e3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html @@ -26,14 +26,14 @@ (action)="save()" [disabled]="configForm.invalid" [label]="'watermark-screen.action.save' | translate" - icon="iqser:check" [type]="iconButtonTypes.primary" + icon="iqser:check" >
-
+
@@ -42,8 +42,8 @@ [placeholder]="'watermark-screen.form.text-placeholder' | translate" class="w-full" formControlName="text" + iqserHasScrollbar name="text" - redactionHasScrollbar rows="4" type="text" > diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss index e251b5942..23d6f68f5 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss @@ -1,10 +1,5 @@ @import '../../../../../assets/styles/variables'; -.page-header .actions { - display: flex; - justify-content: flex-end; -} - .content-container { order: 1; diff --git a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html index 5e0e2b8e8..c717583fb 100644 --- a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html @@ -15,7 +15,7 @@
-
+
{{ attr.label }}:
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html index e6b143bf6..27a895164 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html @@ -61,8 +61,8 @@
@@ -134,11 +134,11 @@ (keyup)="preventKeyDefault($event)" [class.active-panel]="!pagesPanelActive" class="annotations" - redactionHasScrollbar + iqserHasScrollbar tabindex="1" > - . - +
diff --git a/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.scss b/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.scss index 16a25a86a..098092c17 100644 --- a/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.scss +++ b/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.scss @@ -11,6 +11,7 @@ } mat-icon { + min-width: 16px; width: 16px; height: 16px; fill-opacity: 0.6; diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html index 9c9971824..e1923ce1f 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html @@ -13,7 +13,7 @@
-
+
{{ range.startPage }} diff --git a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html b/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html deleted file mode 100644 index d303ac067..000000000 --- a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.scss b/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.scss deleted file mode 100644 index 4667400ec..000000000 --- a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -@import '../../../../../assets/styles/variables'; - -.scroll-button { - background-color: $white; - position: absolute; - right: 0; - height: 40px; - width: 44px; - border: none; - border-radius: 8px 0 0 8px; - box-shadow: -1px 1px 5px 0 rgba(40, 50, 65, 0.25); - - &.bottom { - bottom: 30px; - } - - &.top { - top: 100px; - - mat-icon { - transform: rotate(180deg); - } - } -} - -mat-icon { - width: 22px; - height: 22px; - color: $grey-7; -} diff --git a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.ts b/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.ts deleted file mode 100644 index 335bbfa26..000000000 --- a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Component, HostListener, Input, OnInit } from '@angular/core'; -import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; -import { concatMap, delay, distinctUntilChanged, map, startWith } from 'rxjs/operators'; -import { Observable, of } from 'rxjs'; - -const ButtonTypes = { - top: 'top', - bottom: 'bottom' -} as const; - -type ButtonType = keyof typeof ButtonTypes; - -@Component({ - selector: 'redaction-scroll-button', - templateUrl: './scroll-button.component.html', - styleUrls: ['./scroll-button.component.scss'] -}) -export class ScrollButtonComponent implements OnInit { - readonly buttonType = ButtonTypes; - - @Input() - scrollViewport: CdkVirtualScrollViewport; - @Input() - itemSize: number; - - showScrollUp$: Observable; - showScrollDown$: Observable; - - ngOnInit() { - const scrollSize = () => this.scrollViewport.getDataLength() * this.itemSize; - const scrollIsNeeded = () => this.scrollViewport.getViewportSize() < scrollSize(); - const reachedEnd = (type: ButtonType) => this.scrollViewport.measureScrollOffset(type) === 0; - - const showScrollUp = () => scrollIsNeeded() && !reachedEnd(ButtonTypes.top); - const showScrollDown = () => scrollIsNeeded() && !reachedEnd(ButtonTypes.bottom); - - const scroll$ = this.scrollViewport.elementScrolled().pipe( - startWith(''), - /** Delay first value so that we can wait for items to be rendered in viewport and get correct values */ - concatMap((value, index) => (index === 0 ? of(value).pipe(delay(0)) : of(value))) - ); - this.showScrollUp$ = scroll$.pipe(map(showScrollUp), distinctUntilChanged()); - this.showScrollDown$ = scroll$.pipe(map(showScrollDown), distinctUntilChanged()); - } - - scroll(type: ButtonType): void { - const viewportSize = (this.scrollViewport?.getViewportSize() - this.itemSize) * (type === ButtonTypes.top ? -1 : 1); - const scrollOffset = this.scrollViewport?.measureScrollOffset('top'); - this.scrollViewport?.scrollToOffset(scrollOffset + viewportSize, 'smooth'); - } - - @HostListener('document:keyup', ['$event']) - spaceAndPageDownScroll(event: KeyboardEvent): void { - if (['Space', 'PageDown'].includes(event.code) && (event.target as any).tagName === 'BODY') { - this.scroll(ButtonTypes.bottom); - } else if (['PageUp'].includes(event.code) && (event.target as any).tagName === 'BODY') { - this.scroll(ButtonTypes.top); - } - } -} diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html index 32cb58be2..c0c360868 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html @@ -34,8 +34,8 @@ @@ -63,8 +63,8 @@
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html index 3d585594f..1324714b3 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html @@ -23,7 +23,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html index f8adc89e5..427774292 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html @@ -4,11 +4,11 @@ {{ 'edit-dossier-dialog.attributes.custom-attributes' | translate }}
- + >
@@ -34,11 +34,11 @@ {{ 'edit-dossier-dialog.attributes.image-attributes' | translate }}
- + >
+ noDataIcon="red:document" +> + +
- - - - - -
-
- -
-
- {{ file.filename }} -
-
-
- - {{ file.numberOfPages }} -
-
-
{{ file.softDeleted | date: 'exactDate' }}
-
-
{{ file.restoreDate | date: 'timeFromNow' }}
-
- - - -
-
-
-
-
+
-
- + - + + + + +
+ {{ file.filename }} +
+
+ + +
+
+ + {{ 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 31eed9396..38c543ba0 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 @@ -7,35 +7,10 @@ text-align: end; } -cdk-virtual-scroll-viewport { - height: calc(100% - 81px); +:host ::ng-deep iqser-table cdk-virtual-scroll-viewport { + height: calc(100% - 81px) !important; - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 3fr 1fr 2fr 2fr 11px; - - .table-item > div { - height: 50px; - - &.filename span { - @include line-clamp(1); - } - - &.stats-subtitle > div { - width: fit-content; - } - } - } - - &.has-scrollbar:hover ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 3fr 1fr 2fr 2fr; - } -} - -.bulk-actions { - display: flex; - align-items: center; - - > *:not(:last-child) { - margin-right: 2px; + .cdk-virtual-scroll-content-wrapper .table-item > div.cell.filename span { + @include 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 85965c19e..9738be0f8 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,7 +1,7 @@ -import { Component, EventEmitter, Injector, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, forwardRef, Injector, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; import { EditDossierSectionInterface } from '../edit-dossier-section.interface'; import { DossierWrapper } from '@state/model/dossier.wrapper'; -import { CircleButtonTypes, DefaultListingServices, ListingComponent, Listable, LoadingService, TableColumnConfig } from '@iqser/common-ui'; +import { CircleButtonTypes, DefaultListingServices, Listable, ListingComponent, LoadingService, TableColumnConfig } from '@iqser/common-ui'; import { FileManagementControllerService, FileStatus, StatusControllerService } from '@redaction/red-ui-http'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import * as moment from 'moment'; @@ -22,7 +22,10 @@ interface FileListItem extends FileStatus, Listable { selector: 'redaction-edit-dossier-deleted-documents', templateUrl: './edit-dossier-deleted-documents.component.html', styleUrls: ['./edit-dossier-deleted-documents.component.scss'], - providers: [...DefaultListingServices] + providers: [ + ...DefaultListingServices, + { provide: ListingComponent, useExisting: forwardRef(() => EditDossierDeletedDocumentsComponent) } + ] }) export class EditDossierDeletedDocumentsComponent extends ListingComponent implements EditDossierSectionInterface, OnInit { @Input() dossierWrapper: DossierWrapper; @@ -30,16 +33,14 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent[] = [ - { label: _('edit-dossier-dialog.deleted-documents.table-col-names.name') }, - { label: _('edit-dossier-dialog.deleted-documents.table-col-names.pages') }, - { label: _('edit-dossier-dialog.deleted-documents.table-col-names.deleted-on') }, - { label: _('edit-dossier-dialog.deleted-documents.table-col-names.time-to-restore') } - ]; + tableColumnConfigs: TableColumnConfig[]; readonly tableHeaderLabel = _('edit-dossier-dialog.deleted-documents.table-header.label'); - readonly itemSize = 50; readonly circleButtonTypes = CircleButtonTypes; readonly deleteRetentionHours = this._appConfigService.getConfig(AppConfigKey.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; protected readonly _primaryKey = 'fileId'; constructor( @@ -80,6 +81,7 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent { const fileIds = files.map(f => f.fileId); await this._fileManagementController.restoreFiles(fileIds, this.dossierWrapper.dossierId).toPromise(); diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html index 446f3db4a..bfbb5075a 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html @@ -30,8 +30,8 @@ @@ -60,8 +60,8 @@ (action)="deleteDossier()" *ngIf="permissionsService.canDeleteDossier(dossierWrapper)" [label]="'dossier-listing.delete.action' | translate" - icon="red:trash" [type]="iconButtonTypes.dark" + icon="red:trash" >
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html index ecd205571..cb10c3df8 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html @@ -23,7 +23,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index 88256bdff..8696056f2 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -41,7 +41,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html index 6894e0b13..aeafba369 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html @@ -18,7 +18,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html index e7c7ccbdb..e1b1b8d84 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html @@ -41,12 +41,12 @@
- +
-