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 fe876f8c5..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 @@ -61,7 +61,7 @@ export class DictionaryListingScreenComponent extends ListingComponent [entity.type]; ngOnInit(): void { - this._setColumnConfig(); + this._configureTableColumns(); this._loadDictionaryData(); } @@ -100,7 +100,7 @@ export class DictionaryListingScreenComponent extends ListingComponent [dossierTemplate.dossierTemplateId, 'dictionaries']; ngOnInit(): void { - this._setColumnConfig(); + this._configureTableColumns(); this.loadDossierTemplatesData(); } @@ -75,7 +75,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent div { - width: fit-content; - } + //&.stats-subtitle > div { + // width: fit-content; + //} } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts index 53120ca67..41fe06aac 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts @@ -86,7 +86,7 @@ export class DossierListingScreenComponent routerLinkFn = (dossier: DossierWrapper) => ['/main/dossiers/' + dossier.dossierId]; ngOnInit(): void { - this._setColumnConfig(); + this._configureTableColumns(); this.calculateData(); this.addSubscription = timer(0, 10000).subscribe(async () => { @@ -152,7 +152,7 @@ export class DossierListingScreenComponent this.documentsChartData = this._translateChartService.translateStatus(this.documentsChartData); } - private _setColumnConfig() { + private _configureTableColumns() { this.tableColumnConfigs = [ { label: _('dossier-listing.table-col-names.name'), diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html index 8deea4678..031f05107 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html @@ -36,143 +36,19 @@
- - - - - - - -
-
- -
- -
-
-
- - {{ fileStatus.filename }} - -
-
-
-
- - {{ fileStatus.primaryAttribute }} - -
-
-
-
- - {{ fileStatus.numberOfPages }} -
-
- - {{ fileStatus.excludedPagesCount }} -
-
- - {{ fileStatus.lastOCRTime | date: 'mediumDate' }} -
-
-
- -
-
- {{ fileStatus.added | date: 'd MMM. yyyy, hh:mm a' }} -
-
- -
- {{ fileStatus.fileAttributes.attributeIdToValue[config.id] }} -
- - -
- -
- -
- -
-
- -
- -
-
- - {{ fileStatus.numberOfPages }} -
-
- -
-
-
-
- - - -
-
-
-
- - + [showNoDataButton]="true" + [tableItemClasses]="{ disabled: disabledFn, 'last-opened': lastOpenedFn }" + >
@@ -186,7 +62,7 @@
- + @@ -195,3 +71,104 @@ + + +
+
+
+ + {{ fileStatus.filename }} + +
+
+
+
+ + {{ fileStatus.primaryAttribute }} + +
+
+
+
+ + {{ fileStatus.numberOfPages }} +
+
+ + {{ fileStatus.excludedPagesCount }} +
+
+ + {{ fileStatus.lastOCRTime | date: 'mediumDate' }} +
+
+
+
+ + +
+
+ {{ fileStatus.added | date: 'd MMM. yyyy, hh:mm a' }} +
+
+
+ + +
+ {{ fileStatus.fileAttributes.attributeIdToValue[config.id] }} +
+
+ + + +
+ +
+ +
+ +
+
+ + +
+ +
+
+ + +
+
+ + {{ fileStatus.numberOfPages }} +
+
+
+ + +
+
+
+
+ + + +
+
diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.scss b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.scss index 204ec3589..f52d41a2e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.scss +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.scss @@ -1,62 +1,56 @@ @import '../../../../../assets/styles/variables'; -:root { - --dynamic-columns: '1fr'; -} - .file-upload-input { display: none; } -cdk-virtual-scroll-viewport { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 3fr 2fr repeat(var(--dynamic-columns, 1), 1fr) 2fr 1fr auto 11px; +:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item { + &.disabled { + > div { + background-color: $grey-2; + color: $grey-7; + } - .table-item { - .disabled { - color: $grey-7; - } - - .error { - color: $primary; - } - - .extend-cols { - grid-column-end: span 3; - align-items: flex-end; - } - - .table-item-title { - max-width: 25vw; - } - - .quick-navigation { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; - opacity: 0.7; - color: $accent; - font-size: 11px; - letter-spacing: 0; - line-height: 14px; - - .mat-icon { - width: 10px; - height: 10px; - margin-right: 4px; - } - } - - .status-container { - align-items: flex-end; - } + redaction-file-actions { + color: initial; } } - &.has-scrollbar:hover { - ::ng-deep.cdk-virtual-scroll-content-wrapper { - grid-template-columns: auto 3fr 2fr repeat(var(--dynamic-columns, 1), 1fr) 2fr 1fr auto; + &.last-opened { + > .selection-column { + padding-left: 6px !important; + border-left: 4px solid $primary; + } + + > div { + animation: red-fading-background 3s 1; + } + } + + > div.cell { + .disabled { + color: $grey-7; + } + + .error { + color: $primary; + } + + .table-item-title { + max-width: 25vw; + } + + .primary-attribute { + padding-top: 6px; + } + + &.extend-cols { + grid-column-end: span 3; + align-items: flex-end; + } + + &.status-container { + align-items: flex-end; } } } @@ -76,45 +70,6 @@ cdk-virtual-scroll-viewport { } } -.reanalyse-link { - color: $accent; - text-decoration: underline; - - &:hover { - color: lighten($accent, 10%); - } -} - -.mr-4 { - margin-right: 4px; -} - -.disabled { - > div { - background-color: $grey-2; - color: $grey-7; - } - - redaction-file-actions { - color: initial; - } -} - -.primary-attribute { - padding-top: 6px; -} - -.last-opened { - > .selection-column { - padding-left: 6px !important; - border-left: 4px solid $primary; - } - - > div { - animation: red-fading-background 3s 1; - } -} - @keyframes red-fading-background { 0% { background-color: rgba($primary, 0.1); diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts index 0dd563231..17653cb3e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts @@ -2,6 +2,7 @@ import { ChangeDetectorRef, Component, ElementRef, + forwardRef, HostListener, Injector, OnDestroy, @@ -37,6 +38,7 @@ import { LoadingService, NestedFilter, TableColumnConfig, + TableComponent, Toaster } from '@iqser/common-ui'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; @@ -47,17 +49,16 @@ import { fileStatusTranslations } from '../../translations/file-status-translati import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { annotationFilterChecker } from '@utils/filter-utils'; import { PermissionsService } from '@services/permissions.service'; -import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { RouterHistoryService } from '@services/router-history.service'; import { FileAttributeConfig } from '@redaction/red-ui-http'; +import { DossierWrapper } from '../../../../state/model/dossier.wrapper'; @Component({ templateUrl: './dossier-overview-screen.component.html', styleUrls: ['./dossier-overview-screen.component.scss'], - providers: [...DefaultListingServices] + providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DossierOverviewScreenComponent) }] }) export class DossierOverviewScreenComponent extends ListingComponent implements OnInit, OnDestroy, OnDetach, OnAttach { - readonly itemSize = 80; readonly circleButtonTypes = CircleButtonTypes; readonly currentUser = this._userService.currentUser; currentDossier = this._appStateService.activeDossier; @@ -74,43 +75,21 @@ export class DossierOverviewScreenComponent extends ListingComponent; + @ViewChild('addedOnTemplate', { static: true }) addedOnTemplate: TemplateRef; + @ViewChild('attributeTemplate', { static: true }) attributeTemplate: TemplateRef; + @ViewChild('needsWorkTemplate', { static: true }) needsWorkTemplate: TemplateRef; + @ViewChild('reviewerTemplate', { static: true }) reviewerTemplate: TemplateRef; + @ViewChild('pagesTemplate', { static: true }) pagesTemplate: TemplateRef; + @ViewChild('statusTemplate', { static: true }) statusTemplate: TemplateRef; protected readonly _primaryKey = 'filename'; - private readonly _defaultTableConfigs: readonly TableColumnConfig[] = [ - { - label: _('dossier-overview.table-col-names.name'), - sortByKey: 'filename' - }, - { - label: _('dossier-overview.table-col-names.added-on'), - sortByKey: 'added' - }, - { - label: _('dossier-overview.table-col-names.needs-work') - }, - { - label: _('dossier-overview.table-col-names.assigned-to'), - class: 'user-column', - sortByKey: 'reviewerName' - }, - { - label: _('dossier-overview.table-col-names.pages'), - sortByKey: 'pages' - }, - { - label: _('dossier-overview.table-col-names.status'), - class: 'flex-end', - sortByKey: 'statusSort' - } - ]; @ViewChild(DossierDetailsComponent, { static: false }) private readonly _dossierDetailsComponent: DossierDetailsComponent; private _lastScrolledIndex: number; - @ViewChild('needsWorkTemplate', { read: TemplateRef, static: true }) - private readonly _needsWorkTemplate: TemplateRef; + @ViewChild('needsWorkFilterTemplate', { read: TemplateRef, static: true }) + private readonly _needsWorkFilterTemplate: TemplateRef; @ViewChild('fileInput') private readonly _fileInput: ElementRef; - @ViewChild(CdkVirtualScrollViewport) - private readonly _scrollViewport: CdkVirtualScrollViewport; + @ViewChild(TableComponent) private readonly _tableComponent: TableComponent; constructor( private readonly _toaster: Toaster, @@ -151,7 +130,14 @@ export class DossierOverviewScreenComponent extends ListingComponent config.displayedInFileList); } + routerLinkFn = (fileStatus: FileStatusWrapper) => + fileStatus.canBeOpened ? [`/main/dossiers/${this.currentDossier.dossierId}/file/${fileStatus.fileId}`] : []; + + disabledFn = (fileStatus: FileStatusWrapper) => fileStatus.excluded; + lastOpenedFn = (fileStatus: FileStatusWrapper) => fileStatus.lastOpened; + async ngOnInit(): Promise { + this._configureTableColumns(); this._loadingService.start(); try { this._fileDropOverlayService.initFileDropHandling(); @@ -173,12 +159,11 @@ export class DossierOverviewScreenComponent extends ListingComponent (this._lastScrolledIndex = index))) .subscribe(); this.searchService.setSearchKey('filename'); - this._configureTableColumns(); this.dossierAttributes = await this._dossierAttributesService.getValues(this.currentDossier); } catch (e) { @@ -196,7 +181,7 @@ export class DossierOverviewScreenComponent extends ListingComponent[] = []; for (const config of this.displayedInFileListAttributes) { if (config.displayedInFileList) { - dynamicColumns.push({ label: config.label, notTranslatable: true }); + dynamicColumns.push({ label: config.label, notTranslatable: true, template: this.attributeTemplate, extra: config }); } } this.tableColumnConfigs = [ - this._defaultTableConfigs[0], - this._defaultTableConfigs[1], + { + label: _('dossier-overview.table-col-names.name'), + sortByKey: 'filename', + template: this.filenameTemplate, + width: '3fr' + }, + { + label: _('dossier-overview.table-col-names.added-on'), + sortByKey: 'added', + template: this.addedOnTemplate, + width: '2fr' + }, ...dynamicColumns, - ...this._defaultTableConfigs.slice(2) + { + label: _('dossier-overview.table-col-names.needs-work'), + template: this.needsWorkTemplate + }, + { + label: _('dossier-overview.table-col-names.assigned-to'), + class: 'user-column', + sortByKey: 'reviewerName', + template: this.reviewerTemplate, + width: '2fr' + }, + { + label: _('dossier-overview.table-col-names.pages'), + sortByKey: 'pages', + template: this.pagesTemplate + }, + { + label: _('dossier-overview.table-col-names.status'), + class: 'flex-end', + sortByKey: 'statusSort', + template: this.statusTemplate + } ]; - this.dynamicColumnsCount = dynamicColumns.length + 1; // zero is not allowed in repeat, by default we repeat 1 column - document.documentElement.style.setProperty('--dynamic-columns', `${this.dynamicColumnsCount}`); } private _loadEntitiesFromState() { @@ -417,7 +427,7 @@ export class DossierOverviewScreenComponent extends ListingComponent div { - width: fit-content; - } + //.stats-subtitle > div { + // width: fit-content; + //} } } diff --git a/apps/red-ui/src/assets/styles/red-components.scss b/apps/red-ui/src/assets/styles/red-components.scss index a21ebad07..9a29adaa0 100644 --- a/apps/red-ui/src/assets/styles/red-components.scss +++ b/apps/red-ui/src/assets/styles/red-components.scss @@ -77,6 +77,7 @@ display: flex; justify-content: center; align-items: center; + width: fit-content; mat-icon { width: 10px; diff --git a/apps/red-ui/src/assets/styles/red-page-layout.scss b/apps/red-ui/src/assets/styles/red-page-layout.scss index faa75892c..1ba938455 100644 --- a/apps/red-ui/src/assets/styles/red-page-layout.scss +++ b/apps/red-ui/src/assets/styles/red-page-layout.scss @@ -349,6 +349,10 @@ section.settings { cursor: pointer; } +.mr-4 { + margin-right: 4px !important; +} + .mr-8 { margin-right: 8px !important; } diff --git a/libs/common-ui b/libs/common-ui index 704ea8221..3c693625e 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 704ea8221e6a6a198811c91f2a5fd15ed25c46da +Subproject commit 3c693625e774ff61f89a49bf8a915e012320acc8