From d49b20b712041b907250bb31247d3294b0e3dc4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 27 Jul 2021 15:27:56 +0300 Subject: [PATCH] Some fixes --- .../license-information-screen.component.ts | 3 ++- .../dossier-listing-screen.component.ts | 10 +++++----- .../search-screen/search-screen.component.html | 2 +- .../search-screen/search-screen.component.ts | 13 +++++++------ .../page-header/page-header.component.html | 8 ++++---- .../table-header/table-header.component.html | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts index a9f9c95fa..112675cae 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts @@ -7,6 +7,7 @@ import { TranslateService } from '@ngx-translate/core'; import { LoadingService } from '@services/loading.service'; import { ButtonConfig } from '@shared/components/page-header/models/button-config.model'; import { IconButtonTypes } from '@shared/components/buttons/icon-button/icon-button.component'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-license-information-screen', @@ -35,7 +36,7 @@ export class LicenseInformationScreenComponent implements OnInit { }; buttonConfigs: ButtonConfig[] = [ { - label: this._translateService.instant('license-info-screen.email-report'), + label: _('license-info-screen.email-report'), action: () => this.sendMail(), type: IconButtonTypes.PRIMARY } 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 24e1bcf50..b77729f18 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 @@ -47,7 +47,7 @@ export class DossierListingScreenComponent readonly itemSize = 95; buttonConfigs: ButtonConfig[] = [ { - label: this._translateService.instant('dossier-listing.add-new'), + label: _('dossier-listing.add-new'), action: () => this.openAddDossierDialog(), hide: !this.permissionsService.isManager(), icon: 'red:plus', @@ -56,19 +56,19 @@ export class DossierListingScreenComponent ]; tableColConfigs: TableColConfig[] = [ { - label: this._translateService.instant('dossier-listing.table-col-names.name'), + label: _('dossier-listing.table-col-names.name'), withSort: true, column: 'dossierName' }, { - label: this._translateService.instant('dossier-listing.table-col-names.needs-work') + label: _('dossier-listing.table-col-names.needs-work') }, { - label: this._translateService.instant('dossier-listing.table-col-names.owner'), + label: _('dossier-listing.table-col-names.owner'), class: 'user-column' }, { - label: this._translateService.instant('dossier-listing.table-col-names.status'), + label: _('dossier-listing.table-col-names.status'), class: 'flex-end' } ]; 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 9188f1344..ffa974b0a 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 @@ -62,7 +62,7 @@ [config]="[ { color: item.status, - label: item.status | translate, + label: fileStatusTranslations[item.status] | translate, length: 1, cssClass: 'all-caps-label' } 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 a73654db7..f705e2497 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 @@ -11,9 +11,9 @@ import { ScreenStateService } from '../../../shared/services/screen-state.servic import { SortingService } from '../../../../services/sorting.service'; import { AppStateService } from '../../../../state/app-state.service'; import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; -import { TranslateService } from '@ngx-translate/core'; import { LoadingService } from '../../../../services/loading.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; interface ListItem { fileName: string; @@ -32,6 +32,8 @@ interface ListItem { providers: [FilterService, SearchService, ScreenStateService, SortingService] }) export class SearchScreenComponent extends BaseListingComponent implements OnDestroy { + fileStatusTranslations = fileStatusTranslations; + readonly itemSize = 85; readonly search$ = new BehaviorSubject(null); readonly searchResults$: Observable = this.search$.asObservable().pipe( @@ -43,16 +45,16 @@ export class SearchScreenComponent extends BaseListingComponent implem ); readonly tableColConfigs: TableColConfig[] = [ { - label: this._translateService.instant('search-screen.cols.document') + label: _('search-screen.cols.document') }, { - label: this._translateService.instant('search-screen.cols.status') + label: _('search-screen.cols.status') }, { - label: this._translateService.instant('search-screen.cols.dossier') + label: _('search-screen.cols.dossier') }, { - label: this._translateService.instant('search-screen.cols.pages') + label: _('search-screen.cols.pages') } ]; protected readonly _primaryKey = 'fileName'; @@ -64,7 +66,6 @@ export class SearchScreenComponent extends BaseListingComponent implem private readonly _searchControllerService: SearchControllerService, private readonly _activatedRoute: ActivatedRoute, private readonly _appStateService: AppStateService, - private readonly _translateService: TranslateService, private readonly _loadingService: LoadingService, private readonly _router: Router ) { 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 04eb13716..696c58c36 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,8 +1,8 @@