From 3bebc49d9693693e8db6c22216d1c7083ac4a158 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Thu, 19 Aug 2021 17:27:10 +0300 Subject: [PATCH 01/11] move popup filter to common lib --- .../file-workload.component.html | 4 +- .../dossier-listing-screen.component.ts | 7 +- .../dossier-overview-screen.component.ts | 2 +- .../file-preview-screen.component.ts | 2 +- .../popup-filter/popup-filter.component.html | 109 ------------------ .../popup-filter/popup-filter.component.scss | 41 ------- .../popup-filter/popup-filter.component.ts | 102 ---------------- .../page-header/page-header.component.html | 2 +- .../src/app/modules/shared/shared.module.ts | 2 - .../popup-filter => }/utils/filter-utils.ts | 0 apps/red-ui/src/assets/styles/_variables.scss | 1 + libs/common-ui | 2 +- 12 files changed, 8 insertions(+), 266 deletions(-) delete mode 100644 apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html delete mode 100644 apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.scss delete mode 100644 apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts rename apps/red-ui/src/app/{modules/shared/components/filters/popup-filter => }/utils/filter-utils.ts (100%) 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 c52caa0e3..6f929ff40 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 @@ -9,11 +9,11 @@ class="all-caps-label primary pointer" translate="file-preview.tabs.annotations.select" > - + > 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 68718440f..fcd588b0d 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 @@ -20,12 +20,7 @@ import { DefaultListingServices, ListingComponent, NestedFilter, TableColumnConf import { workloadTranslations } from '../../translations/workload-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { fileStatusTranslations } from '../../translations/file-status-translations'; -import { - annotationFilterChecker, - dossierMemberChecker, - dossierStatusChecker, - dossierTemplateChecker -} from '@shared/components/filters/popup-filter/utils/filter-utils'; +import { annotationFilterChecker, dossierMemberChecker, dossierStatusChecker, dossierTemplateChecker } from '@utils/filter-utils'; import { PermissionsService } from '@services/permissions.service'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; 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 5e91c0cd1..74e03def6 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 @@ -38,7 +38,7 @@ import { UserPreferenceService } from '@services/user-preference.service'; import { workloadTranslations } from '../../translations/workload-translations'; import { fileStatusTranslations } from '../../translations/file-status-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { annotationFilterChecker } from '@shared/components/filters/popup-filter/utils/filter-utils'; +import { annotationFilterChecker } from '@utils/filter-utils'; import { PermissionsService } from '@services/permissions.service'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { FileAttributeConfig } from '@redaction/red-ui-http'; diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 630093728..1e9e14b39 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -34,7 +34,7 @@ import { LoadingService } from '@services/loading.service'; import { clearStamps, stampPDFPage } from '@utils/page-stamper'; import { TranslateService } from '@ngx-translate/core'; import { fileStatusTranslations } from '../../translations/file-status-translations'; -import { handleFilterDelta } from '@shared/components/filters/popup-filter/utils/filter-utils'; +import { handleFilterDelta } from '@utils/filter-utils'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f']; diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html deleted file mode 100644 index 335429b53..000000000 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - -
-
-
-
-
-
-
- -
- -
- -
-
-
-
- -
- -
-
-
-
- - - {{ filter?.label }} - - - -
-
- - -
-
 
- - - - -
- -
-
- - - - - -
-
-
-
diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.scss b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.scss deleted file mode 100644 index f5bd6e27e..000000000 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.scss +++ /dev/null @@ -1,41 +0,0 @@ -@import '../../../../../../assets/styles/variables'; - -.filter-menu-options, -.filter-menu-header { - display: flex; - justify-content: space-between; - padding: 8px 16px 16px 16px; - width: 350px; - - .actions { - display: flex; - - > *:not(:last-child) { - margin-right: 8px; - } - } -} - -.filter-content { - max-height: 570px; - overflow: auto; -} - -.filter-menu-options { - margin-top: 8px; - padding: 16px 16px 3px; -} - -.filter-options { - background-color: $grey-2; - padding-bottom: 8px; -} - -::ng-deep .filter-menu-checkbox { - width: 100%; - - label { - width: 100%; - height: 100%; - } -} diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts deleted file mode 100644 index c40c56257..000000000 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { ChangeDetectionStrategy, Component, Input, OnInit, TemplateRef } from '@angular/core'; -import { FilterGroup, FilterService, handleCheckedValue, NestedFilter } from '@iqser/common-ui'; -import { MAT_CHECKBOX_DEFAULT_OPTIONS } from '@angular/material/checkbox'; -import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; -import { delay, distinctUntilChanged, map, shareReplay } from 'rxjs/operators'; - -@Component({ - selector: 'redaction-popup-filter', - templateUrl: './popup-filter.component.html', - styleUrls: ['./popup-filter.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - { - provide: MAT_CHECKBOX_DEFAULT_OPTIONS, - useValue: { - clickAction: 'noop', - color: 'primary' - } - } - ] -}) -export class PopupFilterComponent implements OnInit { - @Input() actionsTemplate: TemplateRef; - @Input() primaryFiltersSlug: string; - @Input() secondaryFiltersSlug: string; - - atLeastOneFilterIsExpandable$?: Observable; - atLeastOneSecondaryFilterIsExpandable$?: Observable; - hasActiveFilters$?: Observable; - readonly expanded = new BehaviorSubject(null); - readonly expanded$ = this.expanded.asObservable().pipe(delay(200)); - - primaryFilterGroup$?: Observable; - secondaryFilterGroup$?: Observable; - - constructor(readonly filterService: FilterService) {} - - ngOnInit(): void { - this.primaryFilterGroup$ = this.filterService.getGroup$(this.primaryFiltersSlug); - this.secondaryFilterGroup$ = this.filterService.getGroup$(this.secondaryFiltersSlug); - this.hasActiveFilters$ = combineLatest([this.primaryFilterGroup$, this.secondaryFilterGroup$]).pipe( - map(([primary, secondary]) => [...primary.filters, ...(secondary?.filters || [])]), - map(filters => filters.some(f => f.checked || f.indeterminate)), - distinctUntilChanged() - ); - this.atLeastOneFilterIsExpandable$ = this.primaryFilterGroup$.pipe( - map(group => group.filters.some(f => this.isExpandable(f))), - distinctUntilChanged(), - shareReplay() - ); - this.atLeastOneSecondaryFilterIsExpandable$ = this.secondaryFilterGroup$.pipe( - map(group => group?.filters.some(f => this.isExpandable(f))), - distinctUntilChanged(), - shareReplay() - ); - } - - filterCheckboxClicked($event: MouseEvent, nestedFilter: NestedFilter, parent?: NestedFilter): void { - $event.stopPropagation(); - - nestedFilter.checked = !nestedFilter.checked; - - if (parent) { - handleCheckedValue(parent); - } else { - if (nestedFilter.indeterminate) nestedFilter.checked = false; - nestedFilter.indeterminate = false; - nestedFilter.children?.forEach(f => (f.checked = nestedFilter.checked)); - } - - this.filterService.refresh(); - } - - activatePrimaryFilters(): void { - this._setFilters(this.primaryFiltersSlug, true); - } - - deactivateFilters(): void { - this._setFilters(this.primaryFiltersSlug); - if (this.secondaryFiltersSlug) this._setFilters(this.secondaryFiltersSlug); - } - - toggleFilterExpanded($event: MouseEvent, nestedFilter: NestedFilter): void { - $event.stopPropagation(); - nestedFilter.expanded = !nestedFilter.expanded; - this.filterService.refresh(); - } - - isExpandable(nestedFilter: NestedFilter): boolean { - return nestedFilter?.children?.length > 0; - } - - private _setFilters(filterGroup: string, checked = false) { - const filters = this.filterService.getGroup(filterGroup).filters; - filters.forEach(f => { - f.checked = checked; - f.indeterminate = false; - f.children?.forEach(ff => (ff.checked = checked)); - }); - this.filterService.refresh(); - } -} diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index 4f620c312..486a71672 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -7,7 +7,7 @@ - + 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 46abe1990..4513ac018 100644 --- a/apps/red-ui/src/app/modules/shared/shared.module.ts +++ b/apps/red-ui/src/app/modules/shared/shared.module.ts @@ -24,7 +24,6 @@ import { NavigateLastDossiersScreenDirective } from './directives/navigate-last- import { DictionaryManagerComponent } from './components/dictionary-manager/dictionary-manager.component'; import { SideNavComponent } from '@shared/components/side-nav/side-nav.component'; import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'; -import { PopupFilterComponent } from '@shared/components/filters/popup-filter/popup-filter.component'; import { AssignUserDropdownComponent } from './components/assign-user-dropdown/assign-user-dropdown.component'; import { InputWithActionComponent } from '@shared/components/input-with-action/input-with-action.component'; import { PageHeaderComponent } from './components/page-header/page-header.component'; @@ -42,7 +41,6 @@ const components = [ SimpleDoughnutChartComponent, DictionaryAnnotationIconComponent, HiddenActionComponent, - PopupFilterComponent, ConfirmationDialogComponent, EmptyStateComponent, SelectComponent, diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/utils/filter-utils.ts b/apps/red-ui/src/app/utils/filter-utils.ts similarity index 100% rename from apps/red-ui/src/app/modules/shared/components/filters/popup-filter/utils/filter-utils.ts rename to apps/red-ui/src/app/utils/filter-utils.ts diff --git a/apps/red-ui/src/assets/styles/_variables.scss b/apps/red-ui/src/assets/styles/_variables.scss index be6a0f8ce..9aeb20b26 100644 --- a/apps/red-ui/src/assets/styles/_variables.scss +++ b/apps/red-ui/src/assets/styles/_variables.scss @@ -36,6 +36,7 @@ $dark: $black; $btn-bg-hover: $grey-4; $btn-bg: $grey-6; +$filter-bg: $grey-2; $quick-filter-border: $grey-5; $separator: rgba(226, 228, 233, 0.9); diff --git a/libs/common-ui b/libs/common-ui index d31b702c2..c20bac823 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit d31b702c22ac1a9e925db673ef83f56c7137071b +Subproject commit c20bac823277e659c1c9797bdd034a9f5b2fc539 From 56aea20a878c7f6e19b95e996ef906d3c3055423 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 20 Aug 2021 00:06:10 +0300 Subject: [PATCH 02/11] move toaster service --- .../app/components/toast/toast.component.ts | 2 +- .../add-edit-dictionary-dialog.component.ts | 2 +- ...edit-dossier-attribute-dialog.component.ts | 2 +- .../edit-color-dialog.component.ts | 2 +- ...-attributes-csv-import-dialog.component.ts | 2 +- .../digital-signature-screen.component.ts | 2 +- .../general-config-screen.component.ts | 2 +- .../reports/reports-screen.component.ts | 2 +- .../screens/rules/rules-screen.component.ts | 2 +- .../watermark/watermark-screen.component.ts | 2 +- .../dossier-details.component.ts | 2 +- .../page-exclusion.component.ts | 20 ++--- .../team-members-manager.component.ts | 2 +- ...sign-reviewer-approver-dialog.component.ts | 2 +- .../edit-dossier-dialog.component.ts | 2 +- .../edit-dossier-general-info.component.ts | 4 +- .../force-redaction-dialog.component.ts | 2 +- .../manual-annotation-dialog.component.ts | 2 +- .../dossier-overview-screen.component.ts | 15 +--- .../file-preview-screen.component.ts | 2 +- .../services/manual-annotation.service.ts | 2 +- .../file-download-btn.component.ts | 2 +- .../services/dictionary-save.service.ts | 2 +- .../services/file-upload.service.ts | 2 +- .../src/app/services/error-message.service.ts | 18 ---- .../src/app/services/toaster.service.ts | 82 ------------------- .../red-ui/src/app/state/app-state.service.ts | 2 +- 27 files changed, 36 insertions(+), 147 deletions(-) delete mode 100644 apps/red-ui/src/app/services/error-message.service.ts delete mode 100644 apps/red-ui/src/app/services/toaster.service.ts diff --git a/apps/red-ui/src/app/components/toast/toast.component.ts b/apps/red-ui/src/app/components/toast/toast.component.ts index e61e2b967..ade7b422e 100644 --- a/apps/red-ui/src/app/components/toast/toast.component.ts +++ b/apps/red-ui/src/app/components/toast/toast.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { Toast, ToastPackage, ToastrService } from 'ngx-toastr'; -import { ToasterOptions } from '@services/toaster.service'; +import { ToasterOptions } from '@iqser/common-ui'; @Component({ templateUrl: './toast.component.html', diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts index e0ad040e5..2184356a8 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts @@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DictionaryControllerService, TypeValue } from '@redaction/red-ui-http'; import { Observable } from 'rxjs'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { TypeValueWrapper } from '@models/file/type-value.wrapper'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts index 508c5a280..5563bd8a2 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts @@ -4,7 +4,7 @@ import { DossierAttributeConfig, FileAttributeConfig } from '@redaction/red-ui-h import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { LoadingService } from '@services/loading.service'; import { HttpErrorResponse } from '@angular/common/http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts index c67a8dd1c..6846684b7 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts @@ -1,7 +1,7 @@ import { Component, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { DefaultColorType } from '@models/default-color-key.model'; 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 73479ab63..57cd81b44 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 @@ -5,7 +5,7 @@ import * as Papa from 'papaparse'; import { FileAttributeConfig, FileAttributesConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; import { Observable } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { DefaultListingServices, ListingComponent, TableColumnConfig } from '@iqser/common-ui'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts index c161cd8a4..f986861cf 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts @@ -1,7 +1,7 @@ import { Component, OnDestroy } from '@angular/core'; import { DigitalSignature, DigitalSignatureControllerService } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { lastIndexOfEnd } from '@utils/functions'; import { AutoUnsubscribe, IconButtonTypes } from '@iqser/common-ui'; import { LoadingService } from '@services/loading.service'; diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts index 942bcb2e6..81d6d9218 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts @@ -9,7 +9,7 @@ import { } from '@redaction/red-ui-http'; import { AppConfigService } from '@app-config/app-config.service'; import { AutoUnsubscribe, IconButtonTypes } from '@iqser/common-ui'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { LoadingService } from '@services/loading.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { UserService } from '@services/user.service'; diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts index 7f50f8688..4d5c05610 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts @@ -10,7 +10,7 @@ import { placeholdersDescriptionsTranslations } from '../../translations/placeholders-descriptions-translations'; import { removeBraces } from '@utils/functions'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component'; import { AdminDialogService } from '../../services/admin-dialog.service'; diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts index 0b89b29d4..0316c83cc 100644 --- a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts @@ -1,7 +1,7 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; import { RulesControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { saveAs } from 'file-saver'; import { ComponentHasChanges } from '@guards/can-deactivate.guard'; diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts index cf2bada3b..36a020d0a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts @@ -7,7 +7,7 @@ import { HttpClient } from '@angular/common/http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Debounce, IconButtonTypes } from '@iqser/common-ui'; import { WatermarkControllerService, WatermarkModelRes } from '@redaction/red-ui-http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { ActivatedRoute } from '@angular/router'; import { BASE_HREF } from '../../../../tokens'; import { stampPDFPage } from '@utils/page-stamper'; diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts index 02da71057..5b8d6a7c1 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts @@ -5,7 +5,7 @@ import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/si import { TranslateChartService } from '@services/translate-chart.service'; import { StatusSorter } from '@utils/sorters/status-sorter'; import { UserService, UserWrapper } from '@services/user.service'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { FilterService } from '@iqser/common-ui'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; import { fileStatusTranslations } from '../../translations/file-status-translations'; diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts index 2e3756ed0..c564e2b4c 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts @@ -1,11 +1,11 @@ -import {Component, EventEmitter, Input, OnChanges, Output} from '@angular/core'; -import {PermissionsService} from '@services/permissions.service'; -import {FormBuilder, FormGroup} from '@angular/forms'; -import {PageRange, ReanalysisControllerService} from '@redaction/red-ui-http'; -import {Toaster} from '@services/toaster.service'; -import {LoadingService} from '@services/loading.service'; -import {marker as _} from '@biesbjerg/ngx-translate-extract-marker'; -import {FileStatusWrapper} from '../../../../models/file/file-status.wrapper'; +import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; +import { PermissionsService } from '@services/permissions.service'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { PageRange, ReanalysisControllerService } from '@redaction/red-ui-http'; +import { Toaster } from '@iqser/common-ui'; +import { LoadingService } from '@services/loading.service'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { FileStatusWrapper } from '@models/file/file-status.wrapper'; @Component({ selector: 'redaction-page-exclusion', @@ -35,13 +35,13 @@ export class PageExclusionComponent implements OnChanges { const excludedPages = (this.fileStatus?.excludedPages || []).sort((p1, p2) => p1 - p2); this.excludedPagesRanges = excludedPages.reduce((ranges, page) => { if (!ranges.length) { - return [{startPage: page, endPage: page}]; + return [{ startPage: page, endPage: page }]; } if (page === ranges[ranges.length - 1].endPage + 1) { ranges[ranges.length - 1].endPage = page; } else { - ranges.push({startPage: page, endPage: page}); + ranges.push({ startPage: page, endPage: page }); } return ranges; }, []); diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts index bf5f37939..2c6e89a78 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Dossier } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { UserService } from '@services/user.service'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { DossierWrapper } from '@state/model/dossier.wrapper'; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts index 55ba06aff..f41c987d4 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts @@ -3,7 +3,7 @@ import { StatusControllerService } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AppStateService } from '@state/app-state.service'; import { UserService } from '@services/user.service'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { DossierWrapper } from '@state/model/dossier.wrapper'; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts index 4d77b2a95..1291080b7 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts @@ -4,7 +4,7 @@ import { DossierWrapper } from '@state/model/dossier.wrapper'; import { EditDossierGeneralInfoComponent } from './general-info/edit-dossier-general-info.component'; import { EditDossierDownloadPackageComponent } from './download-package/edit-dossier-download-package.component'; import { EditDossierSectionInterface } from './edit-dossier-section.interface'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { EditDossierDictionaryComponent } from './dictionary/edit-dossier-dictionary.component'; import { EditDossierTeamMembersComponent } from './team-members/edit-dossier-team-members.component'; import { EditDossierAttributesComponent } from './attributes/edit-dossier-attributes.component'; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts index 20b811360..0864fe2e5 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts @@ -3,14 +3,14 @@ import { DossierTemplateModel } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '../../../../../state/app-state.service'; import * as moment from 'moment'; -import { DossierWrapper } from '../../../../../state/model/dossier.wrapper'; +import { DossierWrapper } from '@state/model/dossier.wrapper'; import { EditDossierSectionInterface } from '../edit-dossier-section.interface'; import { DossiersDialogService } from '../../../services/dossiers-dialog.service'; import { PermissionsService } from '@services/permissions.service'; import { Router } from '@angular/router'; import { MatDialogRef } from '@angular/material/dialog'; import { EditDossierDialogComponent } from '../edit-dossier-dialog.component'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { IconButtonTypes } from '@iqser/common-ui'; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts index d5f1293c4..f89f44a36 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts @@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { MatDialogRef } from '@angular/material/dialog'; import { ForceRedactionRequest, LegalBasisMappingControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; import { ManualAnnotationService } from '../../services/manual-annotation.service'; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 6e0d912b6..476092dcc 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AddRedactionRequest, LegalBasisMappingControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper'; 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 74e03def6..8395c9f32 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 @@ -1,16 +1,5 @@ -import { - ChangeDetectorRef, - Component, - ElementRef, - HostListener, - Injector, - OnDestroy, - OnInit, - Renderer2, - TemplateRef, - ViewChild -} from '@angular/core'; -import { Toaster } from '@services/toaster.service'; +import { ChangeDetectorRef, Component, ElementRef, HostListener, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { Toaster } from '@iqser/common-ui'; import { AppStateService } from '@state/app-state.service'; import { FileDropOverlayService } from '@upload-download/services/file-drop-overlay.service'; import { FileUploadModel } from '@upload-download/model/file-upload.model'; diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 1e9e14b39..aa71543f6 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -12,7 +12,7 @@ import { AnnotationData, FileDataModel } from '@models/file/file-data.model'; import { FileActionService } from '../../services/file-action.service'; import { AnnotationDrawService } from '../../services/annotation-draw.service'; import { AnnotationProcessingService } from '../../services/annotation-processing.service'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { PermissionsService } from '@services/permissions.service'; import { timer } from 'rxjs'; diff --git a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts index 8a9462653..db88b7afa 100644 --- a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts @@ -7,7 +7,7 @@ import { ManualRedactionControllerService } from '@redaction/red-ui-http'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { tap } from 'rxjs/operators'; import { UserService } from '@services/user.service'; diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts index d45738b4f..7cf584f88 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts @@ -3,7 +3,7 @@ import { PermissionsService } from '@services/permissions.service'; import { DossierWrapper } from '@state/model/dossier.wrapper'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { FileDownloadService } from '@upload-download/services/file-download.service'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { AutoUnsubscribe, CircleButtonType, CircleButtonTypes } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; diff --git a/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts b/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts index 87523196d..7b32010e9 100644 --- a/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Observable, throwError } from 'rxjs'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { DictionaryControllerService } from '@redaction/red-ui-http'; import { tap } from 'rxjs/operators'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts index 58aa957b6..c4caebff1 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts @@ -9,7 +9,7 @@ import { UploadDownloadDialogService } from './upload-download-dialog.service'; import { toNumber } from '@utils/functions'; import { UploadControllerService } from '@redaction/red-ui-http'; import { isCsv } from '@utils/file-drop-utils'; -import { ErrorMessageService } from '@services/error-message.service'; +import { ErrorMessageService } from '@iqser/common-ui'; export interface ActiveUpload { subscription: Subscription; diff --git a/apps/red-ui/src/app/services/error-message.service.ts b/apps/red-ui/src/app/services/error-message.service.ts deleted file mode 100644 index 68fd90874..000000000 --- a/apps/red-ui/src/app/services/error-message.service.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Injectable } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { HttpErrorResponse } from '@angular/common/http'; - -@Injectable({ - providedIn: 'root' -}) -export class ErrorMessageService { - constructor(private readonly _translateService: TranslateService) {} - - _parseErrorResponse(err: HttpErrorResponse): string { - return err?.error?.message?.includes('message') ? ` ${err.error.message.match('"message":"(.*?)\\"')[1]}` : ''; - } - - getMessage(error: HttpErrorResponse, defaultMessage: string): string { - return this._translateService.instant(defaultMessage) + this._parseErrorResponse(error); - } -} diff --git a/apps/red-ui/src/app/services/toaster.service.ts b/apps/red-ui/src/app/services/toaster.service.ts deleted file mode 100644 index d7c4095bd..000000000 --- a/apps/red-ui/src/app/services/toaster.service.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Injectable } from '@angular/core'; -import { ActiveToast, ToastrService } from 'ngx-toastr'; -import { IndividualConfig } from 'ngx-toastr/toastr/toastr-config'; -import { NavigationStart, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { HttpErrorResponse } from '@angular/common/http'; -import { ErrorMessageService } from '@services/error-message.service'; -import { filter } from 'rxjs/operators'; - -const enum NotificationType { - SUCCESS = 'SUCCESS', - WARNING = 'WARNING', - INFO = 'INFO' -} - -export interface ToasterOptions extends IndividualConfig { - readonly title?: string; - /** - * These params are used as interpolateParams for translate service - */ - readonly params?: object; - readonly actions?: { readonly title?: string; readonly action: () => void }[]; -} - -export interface ErrorToasterOptions extends ToasterOptions { - /** - * Pass an http error that will be processed by error message service and shown in toast - */ - readonly error?: HttpErrorResponse; -} - -@Injectable({ - providedIn: 'root' -}) -export class Toaster { - constructor( - private readonly _toastr: ToastrService, - private readonly _router: Router, - private readonly _translateService: TranslateService, - private readonly _errorMessageService: ErrorMessageService - ) { - _router.events.pipe(filter(event => event instanceof NavigationStart)).subscribe(() => { - _toastr.clear(); - }); - } - - error(message: string, options?: Partial) { - if (options?.error) message = this._errorMessageService.getMessage(options.error, message); - else message = this._translateService.instant(message, options?.params); - - return this._toastr.error(message, options?.title, options); - } - - info(message: string, options?: Partial) { - return this._showToastNotification(message, NotificationType.INFO, options); - } - - success(message: string, options?: Partial) { - return this._showToastNotification(message, NotificationType.SUCCESS, options); - } - - warning(message: string, options?: Partial) { - return this._showToastNotification(message, NotificationType.WARNING, options); - } - - private _showToastNotification( - message: string, - notificationType = NotificationType.INFO, - options?: Partial - ): ActiveToast { - message = this._translateService.instant(message, options?.params); - - switch (notificationType) { - case NotificationType.SUCCESS: - return this._toastr.success(message, options?.title, options); - case NotificationType.WARNING: - return this._toastr.warning(message, options?.title, options); - case NotificationType.INFO: - return this._toastr.info(message, options?.title, options); - } - } -} diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index 08f4047e4..73145c855 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -9,7 +9,7 @@ import { ReanalysisControllerService, StatusControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '@services/toaster.service'; +import { Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; import { Event, NavigationEnd, ResolveStart, Router } from '@angular/router'; import { UserService } from '@services/user.service'; From 5bbe8ce80b38267b71bb25aa0c58b2ee53fa1bae Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Sat, 21 Aug 2021 00:42:58 +0300 Subject: [PATCH 03/11] refactor input with action --- ...ttributes-csv-import-dialog.component.html | 3 +- .../dictionary-listing-screen.component.html | 3 +- ...r-attributes-listing-screen.component.html | 3 +- ...er-templates-listing-screen.component.html | 3 +- ...e-attributes-listing-screen.component.html | 3 +- .../user-listing-screen.component.html | 3 +- .../comments/comments.component.html | 4 +- .../components/comments/comments.component.ts | 45 +++++++--------- .../file-workload/file-workload.component.ts | 7 ++- .../page-exclusion.component.html | 4 +- .../page-exclusion.component.ts | 52 ++++++++----------- .../team-members-manager.component.html | 4 +- .../team-members-manager.component.ts | 19 +++---- .../search-screen/search-screen.component.ts | 5 +- .../annotation-icon.component.ts | 2 - .../input-with-action.component.html | 51 ++++++++---------- .../input-with-action.component.ts | 32 ++++++------ .../page-header/page-header.component.html | 3 +- apps/red-ui/src/app/services/user.service.ts | 8 +-- 19 files changed, 103 insertions(+), 151 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html index 142aee418..9187425af 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html @@ -90,9 +90,8 @@
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 8443f12e3..05df1370f 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 @@ -126,9 +126,8 @@
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 83537ffec..61ecdb6a4 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 @@ -9,9 +9,8 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts index 006223e29..6b49b7fea 100644 --- a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts @@ -1,11 +1,8 @@ -import { ChangeDetectorRef, Component, HostBinding, Input } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { Component, HostBinding, Input } from '@angular/core'; import { Comment } from '@redaction/red-ui-http'; import { ManualAnnotationService } from '../../services/manual-annotation.service'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { UserService } from '@services/user.service'; -import { AppStateService } from '@state/app-state.service'; -import { TranslateService } from '@ngx-translate/core'; import { PermissionsService } from '@services/permissions.service'; @Component({ @@ -15,49 +12,43 @@ import { PermissionsService } from '@services/permissions.service'; }) export class CommentsComponent { @Input() annotation: AnnotationWrapper; - commentForm: FormGroup; @HostBinding('class.hidden') private _hidden = true; constructor( - readonly translateService: TranslateService, readonly permissionsService: PermissionsService, - private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _appStateService: AppStateService, - private readonly _formBuilder: FormBuilder, private readonly _userService: UserService, private readonly _manualAnnotationService: ManualAnnotationService - ) { - this.commentForm = this._formBuilder.group({ - value: [''] - }); - } + ) {} - addComment(): void { - const value = this.commentForm.value.value; - if (value) { - this._manualAnnotationService.addComment(value, this.annotation.id).subscribe(commentResponse => { + addComment(value: string): void { + if (!value) return; + this._manualAnnotationService + .addComment(value, this.annotation.id) + .toPromise() + .then(commentResponse => { this.annotation.comments.push({ text: value, id: commentResponse.commentId, user: this._userService.currentUser.id }); }); - this.commentForm.reset(); - } } - toggleExpandComments($event?: MouseEvent) { + toggleExpandComments($event?: MouseEvent): void { $event?.stopPropagation(); this._hidden = !this._hidden; } deleteComment(comment: Comment): void { - this._manualAnnotationService.deleteComment(comment.id, this.annotation.id).subscribe(() => { - this.annotation.comments.splice(this.annotation.comments.indexOf(comment), 1); - if (!this.annotation.comments.length) { - this._hidden = true; - } - }); + this._manualAnnotationService + .deleteComment(comment.id, this.annotation.id) + .toPromise() + .then(() => { + this.annotation.comments.splice(this.annotation.comments.indexOf(comment), 1); + if (!this.annotation.comments.length) { + this._hidden = true; + } + }); } getOwnerName(comment: Comment): string { diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts index 18aef5bbd..ed99585ad 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts @@ -26,6 +26,10 @@ import { map } from 'rxjs/operators'; const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape']; const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; +interface Target extends EventTarget { + localName: string; +} + @Component({ selector: 'redaction-file-workload', templateUrl: './file-workload.component.html', @@ -155,6 +159,7 @@ export class FileWorkloadComponent { } annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void { + if (($event.target as Target).localName === 'input') return; this.pagesPanelActive = false; this.logAnnotation(annotation); if (this.isSelected(annotation)) { @@ -175,7 +180,7 @@ export class FileWorkloadComponent { if ( !ALL_HOTKEY_ARRAY.includes($event.key) || this.dialogRef?.getState() === MatDialogState.OPEN || - ($event.target as any).localName === 'input' + ($event.target as Target).localName === 'input' ) { return; } 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 3d0bc5b17..1194b3321 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 @@ -1,12 +1,10 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts index c564e2b4c..5e5b9e1ed 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts @@ -1,11 +1,11 @@ -import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; -import { FormBuilder, FormGroup } from '@angular/forms'; import { PageRange, ReanalysisControllerService } from '@redaction/red-ui-http'; import { Toaster } from '@iqser/common-ui'; import { LoadingService } from '@services/loading.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; +import { InputWithActionComponent } from '@shared/components/input-with-action/input-with-action.component'; @Component({ selector: 'redaction-page-exclusion', @@ -14,24 +14,19 @@ import { FileStatusWrapper } from '@models/file/file-status.wrapper'; }) export class PageExclusionComponent implements OnChanges { @Input() fileStatus: FileStatusWrapper; - @Output() actionPerformed = new EventEmitter(); + @Output() readonly actionPerformed = new EventEmitter(); - excludePagesForm: FormGroup; excludedPagesRanges: PageRange[] = []; + @ViewChild(InputWithActionComponent) private readonly _inputComponent: InputWithActionComponent; constructor( readonly permissionsService: PermissionsService, - private readonly _formBuilder: FormBuilder, private readonly _reanalysisControllerService: ReanalysisControllerService, private readonly _toaster: Toaster, private readonly _loadingService: LoadingService - ) { - this.excludePagesForm = this._formBuilder.group({ - value: [''] - }); - } + ) {} - ngOnChanges() { + ngOnChanges(): void { const excludedPages = (this.fileStatus?.excludedPages || []).sort((p1, p2) => p1 - p2); this.excludedPagesRanges = excludedPages.reduce((ranges, page) => { if (!ranges.length) { @@ -47,24 +42,21 @@ export class PageExclusionComponent implements OnChanges { }, []); } - async excludePagesRange() { + async excludePagesRange(value: string): Promise { this._loadingService.start(); try { - const pageRanges = this.excludePagesForm - .get('value') - .value.split(',') - .map(range => { - const splitted = range.split('-'); - const startPage = parseInt(splitted[0], 10); - const endPage = splitted.length > 1 ? parseInt(splitted[1], 10) : startPage; - if (!startPage || !endPage) { - throw new Error(); - } - return { - startPage, - endPage - }; - }); + const pageRanges = value.split(',').map(range => { + const splitted = range.split('-'); + const startPage = parseInt(splitted[0], 10); + const endPage = splitted.length > 1 ? parseInt(splitted[1], 10) : startPage; + if (!startPage || !endPage) { + throw new Error(); + } + return { + startPage, + endPage + }; + }); await this._reanalysisControllerService .excludePages( { @@ -74,7 +66,7 @@ export class PageExclusionComponent implements OnChanges { this.fileStatus.fileId ) .toPromise(); - this.excludePagesForm.reset(); + this._inputComponent.reset(); this.actionPerformed.emit('exclude-pages'); } catch (e) { this._toaster.error(_('file-preview.tabs.exclude-pages.error')); @@ -82,7 +74,7 @@ export class PageExclusionComponent implements OnChanges { } } - async includePagesRange(range: PageRange) { + async includePagesRange(range: PageRange): Promise { this._loadingService.start(); await this._reanalysisControllerService .includePages( @@ -93,7 +85,7 @@ export class PageExclusionComponent implements OnChanges { this.fileStatus.fileId ) .toPromise(); - this.excludePagesForm.reset(); + this._inputComponent.reset(); this.actionPerformed.emit('exclude-pages'); } } diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html index 8e0bd8f9e..9e573d614 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html @@ -36,11 +36,11 @@

 
     
 
     
diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts index 2c6e89a78..d71cf0bdd 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts @@ -13,12 +13,12 @@ import { DossierWrapper } from '@state/model/dossier.wrapper'; }) export class TeamMembersManagerComponent implements OnInit { teamForm: FormGroup; - searchForm: FormGroup; + searchQuery = ''; @Input() dossierWrapper: DossierWrapper; - @Output() save = new EventEmitter(); - ownersSelectOptions: string[] = this.userService.managerUsers.map(m => m.id); + @Output() readonly save = new EventEmitter(); + readonly ownersSelectOptions = this.userService.managerUsers.map(m => m.id); selectedReviewersList: string[] = []; membersSelectOptions: string[] = []; changed = false; @@ -137,10 +137,9 @@ export class TeamMembersManagerComponent implements OnInit { this.selectedReviewersList = this.selectedMembersList.filter(m => this.selectedApproversList.indexOf(m) === -1); } - private _setMembersSelectOptions() { - const searchQuery = this.searchForm.get('query').value; + setMembersSelectOptions(): void { this.membersSelectOptions = this.userService.eligibleUsers - .filter(user => this.userService.getNameForId(user.id).toLowerCase().includes(searchQuery.toLowerCase())) + .filter(user => this.userService.getNameForId(user.id).toLowerCase().includes(this.searchQuery.toLowerCase())) .filter(user => this.selectedOwnerId !== user.id) .map(user => user.id); } @@ -151,9 +150,6 @@ export class TeamMembersManagerComponent implements OnInit { approvers: [[...this.dossierWrapper?.approverIds]], members: [[...this.dossierWrapper?.memberIds]] }); - this.searchForm = this._formBuilder.group({ - query: [''] - }); this.teamForm.get('owner').valueChanges.subscribe(owner => { if (!this.isApprover(owner)) { this.toggleApprover(owner); @@ -161,15 +157,12 @@ export class TeamMembersManagerComponent implements OnInit { // If it is an approver, it is already a member, no need to check this._updateLists(); }); - this.searchForm.get('query').valueChanges.subscribe(() => { - this._setMembersSelectOptions(); - }); this._updateLists(); } private _updateLists() { this._setSelectedReviewersList(); - this._setMembersSelectOptions(); + this.setMembersSelectOptions(); this._updateChanged(); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts index b0c4a2b50..1651d0392 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts @@ -85,10 +85,7 @@ export class SearchScreenComponent extends ListingComponent implements ) .subscribe(mappedValue => this._updateValues(mappedValue)); - this.addSubscription = this.searchService.searchForm - .get('query') - .valueChanges.pipe(debounceTime(300)) - .subscribe(value => this.updateNavigation(value)); + this.addSubscription = this.searchService.valueChanges$.pipe(debounceTime(300)).subscribe(value => this.updateNavigation(value)); this.addSubscription = this.filterService.filterGroups$.pipe(skip(1)).subscribe(group => { const dossierIds = group[0].filters.filter(v => v.checked).map(v => v.key); diff --git a/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts index b66f0a1be..f35c4566e 100644 --- a/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts @@ -14,8 +14,6 @@ export class AnnotationIconComponent implements OnChanges { @ViewChild('icon', { static: true }) icon: ElementRef; - constructor() {} - get isHint() { return this.type === 'circle' || this.dictType?.type === 'hint'; } diff --git a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html index 55f148d32..f05829b60 100644 --- a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html +++ b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html @@ -1,34 +1,25 @@ -
-
- +
+ - {{ hint }} + {{ hint }} - - + - + - - -
- + +
diff --git a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts index cc00278b3..1193c4310 100644 --- a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts @@ -1,5 +1,4 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { FormGroup } from '@angular/forms'; @Component({ selector: 'redaction-input-with-action', @@ -7,35 +6,36 @@ import { FormGroup } from '@angular/forms'; styleUrls: ['./input-with-action.component.scss'] }) export class InputWithActionComponent { - @Input() form: FormGroup; @Input() placeholder: string; @Input() hint: string; @Input() width: number | 'full' = 250; - @Input() type: 'search' | 'action'; @Input() icon: string; @Input() autocomplete: 'on' | 'off' = 'on'; - @Output() action = new EventEmitter(); + @Input() value = ''; + @Output() readonly action = new EventEmitter(); + @Output() readonly valueChange = new EventEmitter(); - get formControlName(): 'query' | 'value' { - return this.type === 'search' ? 'query' : 'value'; + get hasContent(): boolean { + return !!this.value.length; } - get hasContent() { - return !!this.form.get(this.formControlName).value?.length; - } - - get computedWidth() { + get computedWidth(): string { return this.width === 'full' ? '100%' : `${this.width}px`; } - clearContent() { - this.form.patchValue({ query: '' }, { emitEvent: true }); + reset(): void { + this.value = ''; } - executeAction($event?: MouseEvent) { - $event?.stopPropagation(); + get isSearch(): boolean { + return this.action.observers.length === 0; + } + + executeAction($event: MouseEvent): void { + $event.stopPropagation(); + if (this.hasContent) { - this.action.emit(); + this.action.emit(this.value); } } } diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index 486a71672..b041f0f17 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -53,11 +53,10 @@ diff --git a/apps/red-ui/src/app/services/user.service.ts b/apps/red-ui/src/app/services/user.service.ts index 8ab66e8c5..875d228e7 100644 --- a/apps/red-ui/src/app/services/user.service.ts +++ b/apps/red-ui/src/app/services/user.service.ts @@ -16,7 +16,7 @@ export interface ProfileModel { } export class UserWrapper { - constructor(private readonly _user: KeycloakProfile | User, public roles: string[], public id: string) {} + constructor(private readonly _user: KeycloakProfile | User, public roles: string[], readonly id: string) {} email = this._user.email; username = this._user.username || this.email; @@ -106,11 +106,7 @@ export class UserService { getNameForId(userId: string): string | undefined { const user = this.getUserById(userId); - return user ? this.getName(user) : undefined; - } - - getName({ firstName, lastName, username }: UserWrapper) { - return firstName && lastName ? `${firstName} ${lastName}` : username; + return user ? user.name : undefined; } isManager(user: UserWrapper = this._currentUser): boolean { From 7bd1e2a8e81660f03f006c69e9898959023fd82d Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Sat, 21 Aug 2021 15:29:20 +0300 Subject: [PATCH 04/11] move input with action to common lib, update icons namespace --- .../base-screen/base-screen.component.html | 2 +- .../help-mode-dialog.component.html | 2 +- .../help-mode/help-mode.component.html | 6 +- .../spotlight-search.component.html | 4 +- .../app/components/toast/toast.component.html | 2 +- .../user-profile-screen.component.html | 8 +- .../dossier-template-actions.component.html | 2 +- .../add-edit-dictionary-dialog.component.html | 20 +- .../add-edit-dictionary-dialog.component.scss | 2 +- ...it-dossier-attribute-dialog.component.html | 8 +- ...dit-dossier-template-dialog.component.html | 10 +- ...dit-dossier-template-dialog.component.scss | 2 +- ...-edit-file-attribute-dialog.component.html | 12 +- .../add-edit-user-dialog.component.html | 2 +- .../reset-password.component.html | 2 +- .../user-details/user-details.component.html | 8 +- ...elete-file-attribute-dialog.component.html | 4 +- ...confirm-delete-users-dialog.component.html | 4 +- .../edit-color-dialog.component.html | 4 +- .../edit-color-dialog.component.scss | 2 +- .../active-fields-listing.component.html | 2 +- ...ttributes-csv-import-dialog.component.html | 16 +- ...ttributes-csv-import-dialog.component.scss | 2 +- .../smtp-auth-dialog.component.html | 6 +- .../screens/audit/audit-screen.component.html | 10 +- .../screens/audit/audit-screen.component.scss | 2 +- .../default-colors-screen.component.html | 4 +- .../dictionary-listing-screen.component.html | 8 +- .../dictionary-overview-screen.component.html | 4 +- .../digital-signature-screen.component.html | 12 +- ...r-attributes-listing-screen.component.html | 8 +- ...er-templates-listing-screen.component.html | 4 +- ...e-attributes-listing-screen.component.html | 8 +- .../general-config-screen.component.html | 24 +- .../reports/reports-screen.component.html | 2 +- .../screens/rules/rules-screen.component.html | 4 +- .../user-listing-screen.component.html | 8 +- .../user-listing-screen.component.scss | 2 +- .../watermark/watermark-screen.component.html | 16 +- .../annotation-actions.component.html | 8 +- .../comments/comments.component.html | 4 +- .../comments/comments.component.scss | 2 +- .../document-info.component.html | 4 +- .../dossier-details.component.html | 2 +- .../dossier-listing-actions.component.html | 2 +- .../file-actions/file-actions.component.html | 2 +- .../file-workload.component.html | 8 +- .../file-workload.component.scss | 2 +- .../page-exclusion.component.html | 6 +- .../page-exclusion.component.ts | 3 +- .../team-members-manager.component.html | 8 +- .../team-members/team-members.component.html | 2 +- .../add-dossier-dialog.component.html | 10 +- ...gn-reviewer-approver-dialog.component.html | 4 +- .../change-legal-basis-dialog.component.html | 8 +- .../document-info-dialog.component.html | 4 +- .../edit-dossier-attributes.component.html | 4 +- .../edit-dossier-dialog.component.html | 2 +- .../edit-dossier-general-info.component.html | 8 +- .../force-redaction-dialog.component.html | 8 +- .../manual-annotation-dialog.component.html | 14 +- .../recategorize-image-dialog.component.html | 6 +- .../remove-annotations-dialog.component.html | 4 +- .../dossier-overview-screen.component.ts | 13 +- .../file-preview-screen.component.html | 4 +- .../search-screen.component.html | 2 +- .../src/app/modules/icons/icons.module.ts | 4 - .../assign-user-dropdown.component.html | 6 +- .../assign-user-dropdown.component.scss | 2 +- .../dictionary-manager.component.html | 12 +- .../dictionary-manager.component.scss | 4 +- .../input-with-action.component.html | 25 -- .../input-with-action.component.scss | 14 - .../input-with-action.component.ts | 41 --- .../page-header/page-header.component.html | 6 +- .../confirmation-dialog.component.html | 4 +- .../src/app/modules/shared/shared.module.ts | 2 - .../upload-status-overlay.component.html | 4 +- .../src/assets/icons/general/search.svg | 9 - apps/red-ui/src/assets/styles/red-input.scss | 267 ------------------ apps/red-ui/src/assets/styles/red-mixins.scss | 29 +- .../src/assets/styles/red-page-layout.scss | 6 +- apps/red-ui/src/assets/styles/red-theme.scss | 1 - 83 files changed, 224 insertions(+), 604 deletions(-) delete mode 100644 apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html delete mode 100644 apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.scss delete mode 100644 apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts delete mode 100644 apps/red-ui/src/assets/icons/general/search.svg delete mode 100644 apps/red-ui/src/assets/styles/red-input.scss diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index bbe17b2b4..6e70aca63 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -70,7 +70,7 @@

- + diff --git a/apps/red-ui/src/app/components/help-mode/help-mode.component.html b/apps/red-ui/src/app/components/help-mode/help-mode.component.html index cc3de9335..2e86423f1 100644 --- a/apps/red-ui/src/app/components/help-mode/help-mode.component.html +++ b/apps/red-ui/src/app/components/help-mode/help-mode.component.html @@ -10,7 +10,11 @@
(esc) - +
diff --git a/apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.html b/apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.html index 7eeab5d8c..91c6c3bb3 100644 --- a/apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.html +++ b/apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.html @@ -3,9 +3,9 @@ - + - +
diff --git a/apps/red-ui/src/app/components/toast/toast.component.html b/apps/red-ui/src/app/components/toast/toast.component.html index cfffe69b4..3006bdf3c 100644 --- a/apps/red-ui/src/app/components/toast/toast.component.html +++ b/apps/red-ui/src/app/components/toast/toast.component.html @@ -15,6 +15,6 @@
diff --git a/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html b/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html index 779d9a35d..a2b00defe 100644 --- a/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html +++ b/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html @@ -8,21 +8,21 @@
-
+
-
+
-
+
-
+
diff --git a/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.html b/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.html index 18ad21167..02ce08a65 100644 --- a/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.html +++ b/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.html @@ -11,7 +11,7 @@ (action)="openEditDossierTemplateDialog($event)" *ngIf="currentUser.isAdmin" [tooltip]="'dossier-templates-listing.action.edit' | translate" - icon="red:edit" + icon="iqser:edit" [type]="circleButtonTypes.dark" >
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 d8f2bb043..be329fdb1 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 @@ -5,18 +5,18 @@
-
+
{{ dictionary?.type || technicalName || '-' }}
-
+
{{ dictionary.label }}
-
+
-
+
-
+
-
+
-
+
{{ 'add-edit-dictionary.form.redaction' | translate }} @@ -81,13 +81,13 @@
-
+
{{ 'add-edit-dictionary.form.case-sensitive' | translate }}
-
+
{{ 'add-edit-dictionary.form.add-to-dictionary-action' | translate }} @@ -101,5 +101,5 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss index b1dd35aef..57077da4b 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss @@ -7,7 +7,7 @@ margin-right: 16px; } - .red-input-group { + .iqser-input-group { margin-top: 0; } } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html index 5c2678992..cfd34b1a0 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html @@ -10,7 +10,7 @@
-
+
-
+
-
+
@@ -41,5 +41,5 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html index 7b9674c1f..17ac0a2f8 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html @@ -10,7 +10,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
{{ comment.text }}
- +>
diff --git a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.scss b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.scss index 4529f63a5..422830c95 100644 --- a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.scss +++ b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.scss @@ -34,7 +34,7 @@ } } - redaction-input-with-action { + iqser-input-with-action { margin: 5px 0 10px 0; } 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 c47f87c2a..5e0e2b8e8 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 @@ -3,13 +3,13 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html index 103c64766..53e587bae 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html @@ -22,7 +22,7 @@ *ngIf="currentUser.isManager" [tooltip]="'dossier-details.edit-owner' | translate" class="ml-14" - icon="red:edit" + icon="iqser:edit" tooltipPosition="below" > diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html index f0d4832c2..e48919796 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html @@ -4,7 +4,7 @@ (action)="openEditDossierDialog($event, dossier)" *ngIf="currentUser.isManager" [tooltip]="'dossier-listing.edit.action' | translate" - icon="red:edit" + icon="iqser:edit" [type]="circleButtonTypes.dark" > diff --git a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html index 084cdbdb8..4e7fbf038 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html @@ -138,7 +138,7 @@ > -
+
@@ -59,7 +59,11 @@ tooltipPosition="above" >
- +
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss index 85ecf735e..c4e28e2a7 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss @@ -124,7 +124,7 @@ } .pages { - @include no-scroll-bar(); + @include no-scroll-bar; overflow: auto; flex: 1; } 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 1194b3321..9c9971824 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 @@ -1,12 +1,12 @@
- + >
diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts index 5e5b9e1ed..b738da092 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts @@ -1,11 +1,10 @@ import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; import { PageRange, ReanalysisControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '@iqser/common-ui'; +import { InputWithActionComponent, Toaster } from '@iqser/common-ui'; import { LoadingService } from '@services/loading.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; -import { InputWithActionComponent } from '@shared/components/input-with-action/input-with-action.component'; @Component({ selector: 'redaction-page-exclusion', diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html index 9e573d614..6885e0382 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html @@ -1,5 +1,5 @@ -
+
{{ 'assign-dossier-owner.dialog.single-user' | translate }} @@ -35,13 +35,13 @@

 
-    
+    >
 
     
- +
diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html b/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html index 2e2ca7728..07e3d5f33 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html @@ -8,7 +8,7 @@ >
- +
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 316c1a4f5..c9f5d68e6 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 @@ -3,7 +3,7 @@
-
+
-
+
{{ 'add-dossier-dialog.form.template' | translate }} @@ -29,7 +29,7 @@
-
+
@@ -35,5 +35,5 @@
- + diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.html index 14770bf97..e913530f5 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.html @@ -3,7 +3,7 @@
-
+
@@ -15,5 +15,5 @@
- + 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 72fe36b08..f8adc89e5 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 @@ -10,7 +10,7 @@ icon="red:attribute" > -
+
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html index d759c29a4..5a70a20a8 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html @@ -71,5 +71,5 @@
- + 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 49c7a04aa..446f3db4a 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 @@ -1,5 +1,5 @@
-
+
-
+
{{ 'edit-dossier-dialog.general-info.form.template' | translate }} @@ -25,7 +25,7 @@
-
+
@@ -34,5 +34,5 @@
- + 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 292862fd9..88256bdff 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 @@ -4,19 +4,19 @@
-
+
{{ format(manualRedactionEntryWrapper.manualRedactionEntry.value) }} -
+
-
+
-
+
-
+
-
+
@@ -70,5 +70,5 @@
- + 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 cf7ad05f8..6894e0b13 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 @@ -3,7 +3,7 @@
-
+
-
+
@@ -30,5 +30,5 @@
- + 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 8c6ccf153..e7c7ccbdb 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 @@ -39,7 +39,7 @@ -
+
@@ -55,5 +55,5 @@
- + 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 8395c9f32..c75d8864b 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 @@ -1,5 +1,13 @@ import { ChangeDetectorRef, Component, ElementRef, HostListener, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { Toaster } from '@iqser/common-ui'; +import { + CircleButtonTypes, + DefaultListingServices, + keyChecker, + ListingComponent, + NestedFilter, + TableColumnConfig, + Toaster +} from '@iqser/common-ui'; import { AppStateService } from '@state/app-state.service'; import { FileDropOverlayService } from '@upload-download/services/file-drop-overlay.service'; import { FileUploadModel } from '@upload-download/model/file-upload.model'; @@ -19,7 +27,6 @@ import { DossiersDialogService } from '../../services/dossiers-dialog.service'; import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy'; import { AppConfigKey, AppConfigService } from '@app-config/app-config.service'; import { ActionConfig } from '@shared/components/page-header/models/action-config.model'; -import { CircleButtonTypes, DefaultListingServices, keyChecker, ListingComponent, NestedFilter, TableColumnConfig } from '@iqser/common-ui'; import { LoadingService } from '@services/loading.service'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; @@ -47,7 +54,7 @@ export class DossierOverviewScreenComponent extends ListingComponent this.openEditDossierDialog($event), - icon: 'red:edit', + icon: 'iqser:edit', hide: !this.currentUser.isManager } ]; diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html index af0569a66..461d623bb 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html @@ -67,7 +67,7 @@ (action)="editingReviewer = true" *ngIf="permissionsService.canAssignUser() && currentReviewer" [tooltip]="assignTooltip" - icon="red:edit" + icon="iqser:edit" tooltipPosition="below" > @@ -119,7 +119,7 @@ [routerLink]="['/main/dossiers/' + appStateService.activeDossierId]" [tooltip]="'common.close' | translate" class="ml-8" - icon="red:close" + icon="iqser:close" tooltipPosition="below" >
diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html index ba1fc56ce..e461f463c 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html @@ -14,7 +14,7 @@ diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 3f353c20d..7b20094a0 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -22,8 +22,6 @@ export class IconsModule { 'attribute', 'calendar', 'case-sensitive', - 'check', - 'close', 'collapse', 'color-picker', 'comment', @@ -32,7 +30,6 @@ export class IconsModule { 'document', 'double-chevron-right', 'download', - 'edit', 'entries', 'enter', 'error', @@ -69,7 +66,6 @@ export class IconsModule { 'refresh', 'remove-from-dict', 'report', - 'search', 'secret', 'status', 'status-collapse', diff --git a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html index 2ed035b3b..78afc5948 100644 --- a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html +++ b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html @@ -1,5 +1,5 @@
-
+
@@ -14,14 +14,14 @@ (action)="save.emit(value)" [tooltip]="'assign-user.save' | translate" class="pl-1" - icon="red:check" + icon="iqser:check" tooltipPosition="below" >
diff --git a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.scss b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.scss index a96757204..6a6a23bb7 100644 --- a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.scss @@ -2,7 +2,7 @@ justify-content: space-between; } -.red-input-group mat-select { +.iqser-input-group mat-select { display: flex; flex-direction: column; justify-content: center; diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html index 6584addea..f5c16d073 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html @@ -1,6 +1,6 @@
-
+
- +
@@ -20,17 +20,17 @@
- +
-
+
{{ 'dictionary-overview.compare.compare' | translate }}
-
+
{{ selectDossier.dossierName | translate }} @@ -68,7 +68,7 @@ (action)="saveDictionary.emit(currentEntries)" [label]="'dictionary-overview.save-changes' | translate" [type]="iconButtonTypes.primary" - icon="red:check" + icon="iqser:check" >
diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss index 92f0772dc..f9469e4d1 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.scss @@ -14,7 +14,7 @@ form { align-items: center; height: 100%; - .red-input-group { + .iqser-input-group { margin-top: 0; } } @@ -66,7 +66,7 @@ ngx-monaco-editor { max-width: 450px; } - .red-input-group { + .iqser-input-group { input { padding-right: 32px; diff --git a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html deleted file mode 100644 index f05829b60..000000000 --- a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.html +++ /dev/null @@ -1,25 +0,0 @@ -
- - - {{ hint }} - - - - - - -
diff --git a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.scss b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.scss deleted file mode 100644 index f2c22fd06..000000000 --- a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.scss +++ /dev/null @@ -1,14 +0,0 @@ -:host { - display: block; -} - -mat-icon.disabled { - opacity: 0.7; - cursor: not-allowed; -} - -iqser-circle-button { - position: absolute; - top: 4px; - right: 5px; -} diff --git a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts deleted file mode 100644 index 1193c4310..000000000 --- a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; - -@Component({ - selector: 'redaction-input-with-action', - templateUrl: './input-with-action.component.html', - styleUrls: ['./input-with-action.component.scss'] -}) -export class InputWithActionComponent { - @Input() placeholder: string; - @Input() hint: string; - @Input() width: number | 'full' = 250; - @Input() icon: string; - @Input() autocomplete: 'on' | 'off' = 'on'; - @Input() value = ''; - @Output() readonly action = new EventEmitter(); - @Output() readonly valueChange = new EventEmitter(); - - get hasContent(): boolean { - return !!this.value.length; - } - - get computedWidth(): string { - return this.width === 'full' ? '100%' : `${this.width}px`; - } - - reset(): void { - this.value = ''; - } - - get isSearch(): boolean { - return this.action.observers.length === 0; - } - - executeAction($event: MouseEvent): void { - $event.stopPropagation(); - - if (this.hasContent) { - this.action.emit(this.value); - } - } -} diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index b041f0f17..fba997504 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -44,7 +44,7 @@ *ngIf="showCloseButton" [class.ml-6]="actionConfigs" [tooltip]="'common.close' | translate" - icon="red:close" + icon="iqser:close" redactionNavigateLastDossiersScreen tooltipPosition="below" > @@ -52,11 +52,11 @@
- + > diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.html b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.html index d1bc2137c..c9bc3dfc1 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.html +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.html @@ -7,7 +7,7 @@

-
+
@@ -33,5 +33,5 @@
- + 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 4513ac018..8a2b0a555 100644 --- a/apps/red-ui/src/app/modules/shared/shared.module.ts +++ b/apps/red-ui/src/app/modules/shared/shared.module.ts @@ -25,7 +25,6 @@ import { DictionaryManagerComponent } from './components/dictionary-manager/dict import { SideNavComponent } from '@shared/components/side-nav/side-nav.component'; import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'; import { AssignUserDropdownComponent } from './components/assign-user-dropdown/assign-user-dropdown.component'; -import { InputWithActionComponent } from '@shared/components/input-with-action/input-with-action.component'; import { PageHeaderComponent } from './components/page-header/page-header.component'; import { DatePipe } from '@shared/pipes/date.pipe'; import { HelpModeDirective } from '@shared/directives/help-mode.directive'; @@ -36,7 +35,6 @@ const components = [ FullPageLoadingIndicatorComponent, InitialsAvatarComponent, PaginationComponent, - InputWithActionComponent, AnnotationIconComponent, SimpleDoughnutChartComponent, DictionaryAnnotationIconComponent, diff --git a/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html index a101afe0c..9c1d467ee 100644 --- a/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html +++ b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html @@ -4,7 +4,7 @@ {{ 'upload-status.dialog.title' | translate: { len: uploadService.files.length } }}
- +
@@ -50,7 +50,7 @@ diff --git a/apps/red-ui/src/assets/icons/general/search.svg b/apps/red-ui/src/assets/icons/general/search.svg deleted file mode 100644 index 8609f0d87..000000000 --- a/apps/red-ui/src/assets/icons/general/search.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/apps/red-ui/src/assets/styles/red-input.scss b/apps/red-ui/src/assets/styles/red-input.scss deleted file mode 100644 index d619e8eca..000000000 --- a/apps/red-ui/src/assets/styles/red-input.scss +++ /dev/null @@ -1,267 +0,0 @@ -@import 'variables'; -@import 'red-mixins'; - -form .red-input-group:not(first-of-type) { - margin-top: 14px; -} - -.red-input-group { - display: flex; - flex-direction: column; - position: relative; - height: fit-content; - - .hint { - margin-top: 5px; - font-size: 11px; - line-height: 14px; - opacity: 0.7; - } - - .input-icon { - position: absolute; - right: 1px; - bottom: 1px; - background: $grey-5; - height: 34px; - width: 34px; - border-left: 1px solid $grey-5; - border-top-right-radius: 7px; - border-bottom-right-radius: 7px; - cursor: pointer; - transition: background-color 0.25s ease; - display: flex; - align-items: center; - justify-content: center; - - &:hover { - background: $grey-6; - } - - mat-icon { - width: 14px; - height: 14px; - color: $accent; - } - - &.disabled { - cursor: default; - } - } - - .mat-form-field-underline { - display: none; - } - - .mat-form-field-wrapper, - .mat-form-field-infix { - padding-bottom: 0; - } - - .mat-form-field-label { - opacity: 0.7 !important; - color: $accent !important; - transform: translateY(-1.34em) !important; - } - - &:first-child { - margin-top: 0; - } - - .icon-right { - width: 14px; - height: 14px; - position: absolute; - top: 10px; - right: 10px; - } - - .slider-row { - display: flex; - flex-direction: row; - align-items: center; - } - - .mat-button-toggle-checked { - background: $primary; - transition: background-color 0.25s ease; - color: $white; - } - - input, - textarea, - mat-select { - box-sizing: border-box; - padding-left: 11px; - padding-right: 11px; - border: 1px solid $grey-5; - font-family: Inter, sans-serif; - font-size: 13px; - background-color: #ffffff; - border-radius: 8px; - outline: none; - margin-top: 3px; - min-height: 36px; - - &.with-icon { - padding-right: 34px; - } - - &:focus:not(:disabled):not(.mat-select-disabled) { - border-color: $accent; - } - - &::placeholder { - color: $accent; - opacity: 0.7; - } - - &.ng-invalid.ng-touched { - border-color: rgba($primary, 0.3); - - &:focus { - border-color: $primary; - } - } - - &:disabled, - &.mat-select-disabled { - background-color: $grey-2; - color: rgba($accent, 0.3); - } - } - - textarea { - line-height: 18px; - } - - .hex-color-input { - width: 150px; - max-width: 150px; - } - - mat-select { - .mat-select-trigger { - height: 32px; - } - - .mat-select-value { - vertical-align: middle; - } - } - - textarea { - resize: vertical; - padding-top: 7px; - padding-bottom: 7px; - @include scroll-bar; - - &.has-scrollbar { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - } - - label:not(.mat-slide-toggle-label) { - opacity: 0.7; - font-size: 11px; - letter-spacing: 0; - line-height: 14px; - margin-bottom: 2px; - color: $accent; - - &.mat-checkbox-layout { - opacity: 1; - margin-bottom: 0; - } - } - - &.required label:after { - content: ' *'; - color: $primary; - } - - &.datepicker-wrapper { - position: relative; - display: flex; - margin-top: 0; - width: 120px; - - .mat-datepicker-input { - margin-top: 0; - width: 120px; - } - - .mat-datepicker-toggle { - position: absolute; - right: 0; - bottom: 0; - color: $accent; - - &.mat-datepicker-toggle-active { - color: $primary; - } - - .mat-icon-button { - width: 34px; - height: 34px; - line-height: 34px; - } - - mat-icon { - width: 14px; - height: 17px; - } - } - } - - &.w-75 { - width: 75px; - max-width: 75px; - } - - &.w-110 { - width: 110px; - max-width: 110px; - } - - &.w-150 { - max-width: 150px; - width: 150px; - } - - &.w-160 { - width: 160px; - max-width: 160px; - } - - &.w-200 { - width: 200px; - max-width: 200px; - } - - &.w-250 { - width: 250px; - max-width: 250px; - } - - &.w-300 { - width: 300px; - max-width: 300px; - } - - &.w-400 { - width: 400px; - max-width: 400px; - } - - &.w-450 { - width: 450px; - max-width: 450px; - } - - &.w-full { - width: 100%; - max-width: 100%; - } -} diff --git a/apps/red-ui/src/assets/styles/red-mixins.scss b/apps/red-ui/src/assets/styles/red-mixins.scss index 7236bd77b..0d8216a2a 100644 --- a/apps/red-ui/src/assets/styles/red-mixins.scss +++ b/apps/red-ui/src/assets/styles/red-mixins.scss @@ -1,4 +1,5 @@ @import 'variables'; +@import 'libs/common-ui/src/assets/styles/mixins'; @mixin line-clamp($lines) { display: -webkit-box; @@ -13,34 +14,6 @@ } } -@mixin no-scroll-bar { - scrollbar-width: none; /* Firefox */ - -ms-overflow-style: none; /* IE 10+ */ - &::-webkit-scrollbar { - width: 0; - background: transparent; /* Chrome/Safari/Webkit */ - } -} - -@mixin scroll-bar { - scrollbar-color: $grey-5 $grey-2; - scrollbar-width: thin; - - &::-webkit-scrollbar { - width: 11px; - } - - /* Track */ - &::-webkit-scrollbar-track { - background: $grey-2; - } - - /* Handle */ - &::-webkit-scrollbar-thumb { - background: $grey-5; - } -} - @mixin inset-shadow { box-shadow: inset 0 4px 3px -2px $grey-4; } 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 30aa9b684..c4db504ff 100644 --- a/apps/red-ui/src/assets/styles/red-page-layout.scss +++ b/apps/red-ui/src/assets/styles/red-page-layout.scss @@ -51,7 +51,7 @@ section.settings { form { margin-left: 6px; - .red-input-group { + .iqser-input-group { width: 250px; } } @@ -216,10 +216,6 @@ section.settings { flex: 2; } -.mt-0 { - margin-top: 0 !important; -} - .mt-5 { margin-top: 5px; } diff --git a/apps/red-ui/src/assets/styles/red-theme.scss b/apps/red-ui/src/assets/styles/red-theme.scss index 41738c02c..e50df826b 100644 --- a/apps/red-ui/src/assets/styles/red-theme.scss +++ b/apps/red-ui/src/assets/styles/red-theme.scss @@ -4,7 +4,6 @@ @import 'red-page-layout'; @import 'red-text-styles'; @import 'red-dialog'; -@import 'red-input'; @import 'red-select'; @import 'red-autocomplete'; @import 'red-list'; From f947e9ea46c46eb328009da60caa6bfc1474c753 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Sun, 22 Aug 2021 17:15:21 +0300 Subject: [PATCH 05/11] use action for close button instead of a directive --- .../downloads-list-screen.component.html | 5 ++++- .../downloads-list-screen.component.ts | 10 ++++++---- apps/red-ui/src/app/i18n/language.service.ts | 2 +- .../digital-signature-screen.component.html | 6 +++++- .../digital-signature-screen.component.ts | 5 +++-- .../dossier-templates-listing-screen.component.html | 6 +++++- .../dossier-templates-listing-screen.component.ts | 4 +++- .../license-information-screen.component.html | 1 + .../license-information-screen.component.ts | 6 ++++-- .../admin/screens/trash/trash-screen.component.html | 6 +++++- .../admin/screens/trash/trash-screen.component.ts | 2 ++ .../dossier-overview-screen.component.html | 1 + .../dossier-overview-screen.component.ts | 8 +++++--- .../search-screen/search-screen.component.html | 1 + .../screens/search-screen/search-screen.component.ts | 12 +++++++----- .../page-header/page-header.component.html | 2 +- .../components/page-header/page-header.component.ts | 3 ++- .../modules/shared/directives/help-mode.directive.ts | 2 +- .../src/app/services/router-history.service.ts | 2 +- 19 files changed, 58 insertions(+), 26 deletions(-) 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 d628bf93b..abc5a0ec2 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 @@ -1,5 +1,8 @@
- +
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 764603479..591829755 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 @@ -6,6 +6,7 @@ import { CircleButtonTypes, DefaultListingServices, ListingComponent, TableColum import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { LoadingService } from '@services/loading.service'; import { timer } from 'rxjs'; +import { RouterHistoryService } from '@services/router-history.service'; @Component({ selector: 'redaction-downloads-list-screen', @@ -18,7 +19,7 @@ export class DownloadsListScreenComponent extends ListingComponent[] = [ + 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') }, @@ -26,10 +27,11 @@ export class DownloadsListScreenComponent extends ListingComponent {}); + this._translateService.use(defaultLang).toPromise().then(); } async changeLanguage(language: string) { 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 25a1233a9..97eefcf76 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 @@ -4,7 +4,11 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts index f986861cf..12a8138dd 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts @@ -1,12 +1,12 @@ import { Component, OnDestroy } from '@angular/core'; import { DigitalSignature, DigitalSignatureControllerService } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Toaster } from '@iqser/common-ui'; +import { AutoUnsubscribe, IconButtonTypes, Toaster } from '@iqser/common-ui'; import { lastIndexOfEnd } from '@utils/functions'; -import { AutoUnsubscribe, IconButtonTypes } from '@iqser/common-ui'; import { LoadingService } from '@services/loading.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { UserService } from '@services/user.service'; +import { RouterHistoryService } from '@services/router-history.service'; @Component({ selector: 'redaction-digital-signature-screen', @@ -27,6 +27,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements private readonly _formBuilder: FormBuilder, private readonly _userService: UserService, private readonly _loadingService: LoadingService, + readonly routerHistoryService: RouterHistoryService, private readonly _digitalSignatureControllerService: DigitalSignatureControllerService ) { super(); diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html index 95f53ce83..64d1f2f61 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html @@ -4,7 +4,11 @@
- +
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 abda7f33e..27cb7e8f7 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 @@ -8,6 +8,7 @@ import { DossierTemplateControllerService } from '@redaction/red-ui-http'; import { CircleButtonTypes, DefaultListingServices, IconButtonTypes, ListingComponent, TableColumnConfig } from '@iqser/common-ui'; import { UserService } from '@services/user.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { RouterHistoryService } from '@services/router-history.service'; @Component({ templateUrl: './dossier-templates-listing-screen.component.html', @@ -21,7 +22,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent[] = [ + readonly tableColumnConfigs: readonly TableColumnConfig[] = [ { label: _('dossier-templates-listing.table-col-names.name'), sortByKey: 'name' @@ -43,6 +44,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent this.sendMail(), + action: (): void => this.sendMail(), type: IconButtonTypes.primary } ]; @@ -48,6 +49,7 @@ export class LicenseInformationScreenComponent implements OnInit { private readonly _userService: UserService, readonly appConfigService: AppConfigService, private readonly _loadingService: LoadingService, + readonly routerHistoryService: RouterHistoryService, private readonly _translateService: TranslateService, private readonly _licenseReportController: LicenseReportControllerService ) { 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 18d927115..3e9eabd9b 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 @@ -1,7 +1,11 @@
- +
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 9b5a836fa..c1bf02a6d 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 @@ -11,6 +11,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { Observable } from 'rxjs'; import { distinctUntilChanged, map } from 'rxjs/operators'; import { getLeftDateTime } from '@utils/functions'; +import { RouterHistoryService } from '@services/router-history.service'; interface DossierListItem extends Dossier { readonly canRestore: boolean; @@ -53,6 +54,7 @@ export class TrashScreenComponent extends ListingComponent impl protected readonly _injector: Injector, private readonly _loadingService: LoadingService, private readonly _dossiersService: DossiersService, + readonly routerHistoryService: RouterHistoryService, private readonly _appConfigService: AppConfigService, private readonly _adminDialogService: AdminDialogService ) { 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 b0103f5c6..037b89791 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 @@ -1,5 +1,6 @@
this.openEditDossierDialog($event), + action: ($event): void => this.openEditDossierDialog($event), icon: 'iqser:edit', hide: !this.currentUser.isManager } @@ -97,7 +98,7 @@ export class DossierOverviewScreenComponent extends ListingComponent; + private readonly _needsWorkTemplate: TemplateRef; @ViewChild('fileInput') private readonly _fileInput: ElementRef; @ViewChild(CdkVirtualScrollViewport) private readonly _scrollViewport: CdkVirtualScrollViewport; @@ -105,10 +106,11 @@ export class DossierOverviewScreenComponent extends ListingComponent implements ); constructor( + private readonly _router: Router, protected readonly _injector: Injector, - private readonly _searchControllerService: SearchControllerService, private readonly _activatedRoute: ActivatedRoute, - private readonly _appStateService: AppStateService, private readonly _loadingService: LoadingService, + private readonly _appStateService: AppStateService, + readonly routerHistoryService: RouterHistoryService, private readonly _translateService: TranslateService, - private readonly _router: Router + private readonly _searchControllerService: SearchControllerService ) { super(_injector); @@ -93,11 +95,11 @@ export class SearchScreenComponent extends ListingComponent implements }); } - setInitialConfig() { + setInitialConfig(): void { return; } - updateNavigation(query: string, mustContain?: string) { + updateNavigation(query: string, mustContain?: string): void { const newQuery = query?.replace(mustContain, `"${mustContain}"`); const queryParams = newQuery && newQuery !== '' ? { query: newQuery } : {}; this._router.navigate([], { queryParams }).then(); diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index fba997504..bb815c653 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -41,11 +41,11 @@
diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.ts b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.ts index 866c188df..04d3725a8 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Optional } from '@angular/core'; +import { Component, EventEmitter, Input, Optional, Output } from '@angular/core'; import { ActionConfig } from '@shared/components/page-header/models/action-config.model'; import { ButtonConfig } from '@shared/components/page-header/models/button-config.model'; import { FilterService, SearchService } from '@iqser/common-ui'; @@ -23,6 +23,7 @@ export class PageHeaderComponent { @Input() searchPlaceholder: string; @Input() searchWidth: number | 'full'; @Input() searchPosition: SearchPosition = SearchPositions.afterFilters; + @Output() readonly closeAction = new EventEmitter(); readonly filters$ = this.filterService?.filterGroups$.pipe(map(all => all.filter(f => f.icon))); readonly showResetFilters$ = this._showResetFilters$; diff --git a/apps/red-ui/src/app/modules/shared/directives/help-mode.directive.ts b/apps/red-ui/src/app/modules/shared/directives/help-mode.directive.ts index dfc6d0f9f..710433355 100644 --- a/apps/red-ui/src/app/modules/shared/directives/help-mode.directive.ts +++ b/apps/red-ui/src/app/modules/shared/directives/help-mode.directive.ts @@ -31,7 +31,7 @@ export class HelpModeDirective implements OnInit { this._helpModeService.addElement(this.elementName, element, helperElement); } - @HostListener('click') onClick() { + @HostListener('click') onClick(): void { if (this._helpModeService.isHelpModeActive) { const currentLocale = this._languageService.currentLanguage; window.open(links[this.elementName][currentLocale]); diff --git a/apps/red-ui/src/app/services/router-history.service.ts b/apps/red-ui/src/app/services/router-history.service.ts index c0ee27d62..023a64176 100644 --- a/apps/red-ui/src/app/services/router-history.service.ts +++ b/apps/red-ui/src/app/services/router-history.service.ts @@ -16,7 +16,7 @@ export class RouterHistoryService { }); } - navigateToLastDossiersScreen() { + navigateToLastDossiersScreen(): void { if (this._router.url === this._lastDossiersScreen) { this._router.navigate(['/main/dossiers']); } else { From c4c3fad6a5d7d97d2a9395e79235fa414f6097ea Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Sun, 22 Aug 2021 19:04:48 +0300 Subject: [PATCH 06/11] move help mode to common lib --- .editorconfig | 2 +- apps/red-ui/src/app/app.module.ts | 10 ++- .../base-screen/base-screen.component.html | 6 +- .../base-screen/base-screen.component.ts | 2 +- .../help-mode-dialog.component.html | 8 -- .../help-mode-dialog.component.scss | 18 ----- .../help-mode-dialog.component.ts | 10 --- .../help-mode/help-mode.component.html | 20 ----- .../help-mode/help-mode.component.scss | 72 ----------------- .../help-mode/help-mode.component.ts | 30 ------- .../file-workload/file-workload.component.ts | 10 +-- .../page-header/page-header.component.html | 4 +- .../shared/directives/help-mode.directive.ts | 40 ---------- .../shared/services/help-mode.service.ts | 78 ------------------- .../src/app/modules/shared/shared.module.ts | 3 +- apps/red-ui/src/assets/styles/red-dialog.scss | 40 ---------- .../src/assets/styles/red-text-styles.scss | 12 --- apps/red-ui/src/assets/styles/red-theme.scss | 1 - 18 files changed, 17 insertions(+), 349 deletions(-) delete mode 100644 apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.html delete mode 100644 apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.scss delete mode 100644 apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.ts delete mode 100644 apps/red-ui/src/app/components/help-mode/help-mode.component.html delete mode 100644 apps/red-ui/src/app/components/help-mode/help-mode.component.scss delete mode 100644 apps/red-ui/src/app/components/help-mode/help-mode.component.ts delete mode 100644 apps/red-ui/src/app/modules/shared/directives/help-mode.directive.ts delete mode 100644 apps/red-ui/src/app/modules/shared/services/help-mode.service.ts delete mode 100644 apps/red-ui/src/assets/styles/red-dialog.scss diff --git a/.editorconfig b/.editorconfig index 92c6e7b4b..7ac0fdd9b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,7 @@ indent_size = 4 insert_final_newline = true trim_trailing_whitespace = true ij_html_quote_style = double -max_line_length = 100 +max_line_length = 140 [*.md] max_line_length = off diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 80efd31cc..fef2bec0e 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -34,9 +34,9 @@ import { configurationInitializer } from '@app-config/configuration.initializer' import { AppConfigService } from '@app-config/app-config.service'; import { SpotlightSearchComponent } from '@components/spotlight-search/spotlight-search.component'; import { PruningTranslationLoader } from '@utils/pruning-translation-loader'; -import { HelpModeComponent } from '@components/help-mode/help-mode.component'; -import { HelpModeDialogComponent } from '@components/help-mode-dialog/help-mode-dialog.component'; import { DatePipe } from '@shared/pipes/date.pipe'; +import * as links from '../assets/help-mode/links.json'; +import { HELP_DOCS } from '@iqser/common-ui'; export function httpLoaderFactory(httpClient: HttpClient) { return new PruningTranslationLoader(httpClient, '/assets/i18n/', '.json'); @@ -61,8 +61,6 @@ const components = [ ToastComponent, NotificationsComponent, SpotlightSearchComponent, - HelpModeComponent, - HelpModeDialogComponent, ...screens ]; @@ -136,6 +134,10 @@ const components = [ provide: MissingTranslationHandler, useClass: REDMissingTranslationHandler }, + { + provide: HELP_DOCS, + useValue: links + }, DatePipe ], bootstrap: [AppComponent] diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index 6e70aca63..c1a5ff6a5 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -73,16 +73,16 @@ [icon]="'iqser:search'" [tooltip]="'search.header-label' | translate" tooltipPosition="below" - redactionHelpMode="search" + iqserHelpMode="search" > - +
diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index ae02a576b..1142c2e7c 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -12,7 +12,7 @@ import { SpotlightSearchAction } from '@components/spotlight-search/spotlight-se import { SpotlightSearchDialogData } from '@components/spotlight-search/spotlight-search-dialog-data'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { distinctUntilChanged, filter, map, startWith } from 'rxjs/operators'; -import { HelpModeService } from '@shared/services/help-mode.service'; +import { HelpModeService } from '@iqser/common-ui'; interface MenuItem { readonly name: string; diff --git a/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.html b/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.html deleted file mode 100644 index 42884bbd3..000000000 --- a/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.html +++ /dev/null @@ -1,8 +0,0 @@ -
-
-

- -

-
- -
diff --git a/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.scss b/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.scss deleted file mode 100644 index 3a3a69d4e..000000000 --- a/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.scss +++ /dev/null @@ -1,18 +0,0 @@ -@import '../../../assets/styles/variables'; - -section { - background: $grey-11; - display: flex; - justify-content: center; -} - -.content { - width: 440px; - display: flex; - flex-direction: column; - align-items: center; - text-align: center; - padding-top: 20px; - padding-bottom: 30px; - line-height: 18px; -} diff --git a/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.ts b/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.ts deleted file mode 100644 index f1aa6da46..000000000 --- a/apps/red-ui/src/app/components/help-mode-dialog/help-mode-dialog.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'redaction-help-mode-dialog', - templateUrl: './help-mode-dialog.component.html', - styleUrls: ['./help-mode-dialog.component.scss'] -}) -export class HelpModeDialogComponent { - constructor() {} -} diff --git a/apps/red-ui/src/app/components/help-mode/help-mode.component.html b/apps/red-ui/src/app/components/help-mode/help-mode.component.html deleted file mode 100644 index 2e86423f1..000000000 --- a/apps/red-ui/src/app/components/help-mode/help-mode.component.html +++ /dev/null @@ -1,20 +0,0 @@ -
- -
{{ 'help-mode.button-text' | translate }}
-
-
-
-

{{ 'help-mode.text' | translate }}

- - {{ 'help-mode.instructions' | translate }} - -
- (esc) - -
-
-
diff --git a/apps/red-ui/src/app/components/help-mode/help-mode.component.scss b/apps/red-ui/src/app/components/help-mode/help-mode.component.scss deleted file mode 100644 index 6b4d04a32..000000000 --- a/apps/red-ui/src/app/components/help-mode/help-mode.component.scss +++ /dev/null @@ -1,72 +0,0 @@ -@import '../../../assets/styles/variables'; - -.help-button { - width: 44px; - height: 40px; - position: absolute; - bottom: 20px; - right: 0; - z-index: 1; - background: $green-2; - border-top-left-radius: 8px; - border-bottom-left-radius: 8px; - box-shadow: -1px 1px 5px 0 rgba(40, 50, 65, 0.25); - display: flex; - align-items: center; - justify-content: center; - transition: all 0.25s; -} - -.help-button:hover { - cursor: pointer; - width: fit-content; - padding-left: 10px; - padding-right: 10px; - - .text { - display: block; - } - - mat-icon { - padding-right: 8px; - } -} - -.text { - display: none; -} - -.help-mode-border { - box-sizing: border-box; - height: 100%; - width: 100%; - border-left: 8px solid $green-2; - border-right: 8px solid $green-2; - border-top: 8px solid $green-2; - border-bottom: 60px solid $green-2; - z-index: 10; - position: absolute; - display: flex; - justify-content: center; - - .bottom { - position: fixed; - height: 60px; - width: 95%; - bottom: 0; - display: flex; - justify-content: space-between; - align-items: center; - pointer-events: visiblePainted; - - a { - color: black; - text-decoration: underline; - } - - .close { - display: flex; - align-items: center; - } - } -} diff --git a/apps/red-ui/src/app/components/help-mode/help-mode.component.ts b/apps/red-ui/src/app/components/help-mode/help-mode.component.ts deleted file mode 100644 index c50754e22..000000000 --- a/apps/red-ui/src/app/components/help-mode/help-mode.component.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Component, HostListener } from '@angular/core'; -import { HelpModeService } from '@shared/services/help-mode.service'; - -@Component({ - selector: 'redaction-help-mode', - templateUrl: './help-mode.component.html', - styleUrls: ['./help-mode.component.scss'] -}) -export class HelpModeComponent { - constructor(readonly helpModeService: HelpModeService) {} - - @HostListener('document:keydown.escape') onEscKeydownHandler() { - if (!this.helpModeService.helpModeDialogIsOpened) { - this.helpModeService.deactivateHelpMode(); - } - } - - @HostListener('document:keydown.h', ['$event']) onHKeydownHandler(event) { - const node = event?.target?.nodeName?.toLocaleLowerCase(); - if (!this.helpModeService.isHelpModeActive && node !== 'input' && node !== 'textarea') { - this.helpModeService.activateHelpMode(); - } - } - - @HostListener('click') onClick() { - if (this.helpModeService.isHelpModeActive) { - this.helpModeService.highlightHelperElements(); - } - } -} diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts index ed99585ad..a996ce166 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts @@ -15,7 +15,7 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { AnnotationProcessingService } from '../../services/annotation-processing.service'; import { MatDialogRef, MatDialogState } from '@angular/material/dialog'; import scrollIntoView from 'scroll-into-view-if-needed'; -import { CircleButtonTypes, Debounce, FilterService, IconButtonTypes, NestedFilter } from '@iqser/common-ui'; +import { CircleButtonTypes, Debounce, FilterService, IconButtonTypes, IqserEventTarget, NestedFilter } from '@iqser/common-ui'; import { FileDataModel } from '@models/file/file-data.model'; import { CommentsComponent } from '../comments/comments.component'; import { PermissionsService } from '@services/permissions.service'; @@ -26,10 +26,6 @@ import { map } from 'rxjs/operators'; const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape']; const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; -interface Target extends EventTarget { - localName: string; -} - @Component({ selector: 'redaction-file-workload', templateUrl: './file-workload.component.html', @@ -159,7 +155,7 @@ export class FileWorkloadComponent { } annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void { - if (($event.target as Target).localName === 'input') return; + if (($event.target as IqserEventTarget).localName === 'input') return; this.pagesPanelActive = false; this.logAnnotation(annotation); if (this.isSelected(annotation)) { @@ -180,7 +176,7 @@ export class FileWorkloadComponent { if ( !ALL_HOTKEY_ARRAY.includes($event.key) || this.dialogRef?.getState() === MatDialogState.OPEN || - ($event.target as Target).localName === 'input' + ($event.target as IqserEventTarget).localName === 'input' ) { return; } diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index bb815c653..cb2a0faa6 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -1,7 +1,7 @@