From 4d20349512fa7896e764a3f361af13fa1eb6380d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Fri, 27 Aug 2021 16:58:30 +0300 Subject: [PATCH] Moved empty states, templates listing --- .../downloads-list-screen.component.html | 4 +- .../notifications.component.html | 4 +- .../active-fields-listing.component.html | 4 +- .../screens/audit/audit-screen.component.html | 4 +- .../dictionary-listing-screen.component.html | 34 ++--- .../dictionary-listing-screen.component.scss | 75 +++++----- .../dictionary-listing-screen.component.ts | 2 - .../digital-signature-screen.component.html | 4 +- ...r-attributes-listing-screen.component.html | 8 +- ...er-templates-listing-screen.component.html | 141 +++++++++--------- ...er-templates-listing-screen.component.scss | 32 ++-- ...sier-templates-listing-screen.component.ts | 51 ++++--- ...e-attributes-listing-screen.component.html | 9 +- .../screens/trash/trash-screen.component.html | 6 +- .../user-listing-screen.component.html | 2 +- .../file-workload.component.html | 4 +- .../edit-dossier-attributes.component.html | 8 +- ...t-dossier-deleted-documents.component.html | 4 +- .../dossier-listing-screen.component.html | 6 +- .../dossier-overview-screen.component.html | 6 +- .../file-preview-screen.component.html | 4 +- .../search-screen.component.html | 4 +- .../empty-state/empty-state.component.html | 21 --- .../empty-state/empty-state.component.scss | 27 ---- .../empty-state/empty-state.component.ts | 25 ---- .../src/app/modules/shared/shared.module.ts | 2 - libs/common-ui | 2 +- 27 files changed, 202 insertions(+), 291 deletions(-) delete mode 100644 apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.html delete mode 100644 apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.scss delete mode 100644 apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.ts 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 a3f0a0e32..30cd28881 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 @@ -14,11 +14,11 @@ [tableHeaderLabel]="tableHeaderLabel" > - + > 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/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 ef90a9d75..4af65e5b0 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 @@ -6,11 +6,11 @@ [tableHeaderLabel]="tableHeaderLabel" > - +>
- + >
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 2998054d6..bb8e5cf28 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 @@ -21,29 +21,21 @@
- - - - - - - - - - - - - -
@@ -107,29 +99,29 @@
- +
- {{ entity.rank }} + {{ dict.rank }}
- +
- +
- +
div.cell { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; +: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; - &.center { + &.center { + justify-content: center; + } + + .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; + } + } + + .right-container { + display: flex; + width: 353px; + min-width: 353px; justify-content: center; + padding: 50px 20px 30px 20px; + + &.has-scrollbar:hover { + padding-right: 9px; + } } - .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; + .page-header .actions { + display: flex; + justify-content: flex-end; } } - -.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 41d72020a..fe876f8c5 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 @@ -112,13 +112,11 @@ export class DictionaryListingScreenComponent extends ListingComponent - + >
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 d2ab0c2da..a3f02e84f 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 @@ -28,19 +28,19 @@ [tableHeaderLabel]="tableHeaderLabel" > - + > - + >
- -
- - - -
-
- - - - - - -
-
- -
- -
-
- {{ dossierTemplate.name }} -
-
-
- - {{ - 'dossier-templates-listing.dictionaries' | translate: { length: dossierTemplate.dictionariesCount } - }} -
-
-
- -
- -
-
- {{ dossierTemplate.dateAdded | date: 'd MMM. yyyy' }} -
-
-
- {{ dossierTemplate.dateModified | date: 'd MMM. yyyy' }} -
- - -
-
-
-
+ >
@@ -103,3 +38,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 86d6ceed6..31a91ff16 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'; @@ -20,28 +20,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( @@ -57,7 +50,10 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent [dossierTemplate.dossierTemplateId, 'dictionaries']; + ngOnInit(): void { + this._setColumnConfig(); this.loadDossierTemplatesData(); } @@ -79,6 +75,27 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent d.dossierTemplateId)) { await this._dossierTemplateControllerService.deleteDossierTemplates(templateIds).toPromise(); this.entitiesService.setSelected([]); 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 116f0be0f..1982e494e 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 @@ -28,16 +28,13 @@ [tableHeaderLabel]="tableHeaderLabel" > - + > - +
diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html index a0a6b8c86..f66db631a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html @@ -16,13 +16,13 @@ [tableHeaderLabel]="tableHeaderLabel" > - + > - +
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 c7b86e9eb..de2939987 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 @@ -40,7 +40,7 @@ [tableHeaderLabel]="tableHeaderLabel" > - + 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 bcb0c1f7a..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 @@ -138,7 +138,7 @@ tabindex="1" > - . - +
- + >
@@ -34,11 +34,11 @@ {{ 'edit-dossier-dialog.attributes.image-attributes' | translate }}
- + >
- +>
diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html index a3c5f1211..a3639eba2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html @@ -10,16 +10,16 @@
- + > - +
- + > - +
- + > - + >
- -
- -
-
{{ text }}
- -
diff --git a/apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.scss b/apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.scss deleted file mode 100644 index 2676a3071..000000000 --- a/apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.scss +++ /dev/null @@ -1,27 +0,0 @@ -@import '../../../../../assets/styles/variables'; - -.empty-state { - display: flex; - flex-direction: column; - align-items: center; - text-align: center; - - > mat-icon { - height: 60px; - width: 60px; - opacity: 0.1; - } - - .heading-l { - color: $grey-7; - } - - > .heading-l, - iqser-icon-button { - margin-top: 24px; - } - - .ng-content-wrapper:not(:empty) + .heading-l { - display: none; - } -} diff --git a/apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.ts b/apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.ts deleted file mode 100644 index 973f75a07..000000000 --- a/apps/red-ui/src/app/modules/shared/components/empty-state/empty-state.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { IconButtonTypes } from '@iqser/common-ui'; - -@Component({ - selector: 'redaction-empty-state', - templateUrl: './empty-state.component.html', - styleUrls: ['./empty-state.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class EmptyStateComponent implements OnInit { - readonly iconButtonTypes = IconButtonTypes; - - @Input() text: string; - @Input() icon: string; - @Input() showButton = true; - @Input() buttonIcon = 'red:plus'; - @Input() buttonLabel: string; - @Input() horizontalPadding = 100; - @Input() verticalPadding = 120; - @Output() action = new EventEmitter(); - - ngOnInit(): void { - this.showButton = this.showButton && this.action.observers.length > 0; - } -} diff --git a/apps/red-ui/src/app/modules/shared/shared.module.ts b/apps/red-ui/src/app/modules/shared/shared.module.ts index c5528b409..74c3200a4 100644 --- a/apps/red-ui/src/app/modules/shared/shared.module.ts +++ b/apps/red-ui/src/app/modules/shared/shared.module.ts @@ -13,7 +13,6 @@ import { SimpleDoughnutChartComponent } from './components/simple-doughnut-chart import { DictionaryAnnotationIconComponent } from './components/dictionary-annotation-icon/dictionary-annotation-icon.component'; import { HiddenActionComponent } from './components/hidden-action/hidden-action.component'; import { ConfirmationDialogComponent } from './dialogs/confirmation-dialog/confirmation-dialog.component'; -import { EmptyStateComponent } from './components/empty-state/empty-state.component'; import { CommonUiModule } from '@iqser/common-ui'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; import { MomentDateAdapter } from '@angular/material-moment-adapter'; @@ -36,7 +35,6 @@ const components = [ DictionaryAnnotationIconComponent, HiddenActionComponent, ConfirmationDialogComponent, - EmptyStateComponent, SelectComponent, SideNavComponent, DictionaryManagerComponent, diff --git a/libs/common-ui b/libs/common-ui index 1b7104ba1..a659dcecd 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 1b7104ba14b1e3fae3276fd5f82d098e8a3b90c8 +Subproject commit a659dcecd7115eda1320d9d7188788e1e00ccb18