Some fixes

This commit is contained in:
Adina Țeudan 2021-07-27 15:27:56 +03:00
parent 93204a8b36
commit d49b20b712
6 changed files with 20 additions and 18 deletions

View File

@ -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
}

View File

@ -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'
}
];

View File

@ -62,7 +62,7 @@
[config]="[
{
color: item.status,
label: item.status | translate,
label: fileStatusTranslations[item.status] | translate,
length: 1,
cssClass: 'all-caps-label'
}

View File

@ -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<ListItem> implements OnDestroy {
fileStatusTranslations = fileStatusTranslations;
readonly itemSize = 85;
readonly search$ = new BehaviorSubject<string>(null);
readonly searchResults$: Observable<ListItem[]> = this.search$.asObservable().pipe(
@ -43,16 +45,16 @@ export class SearchScreenComponent extends BaseListingComponent<ListItem> 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<ListItem> 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
) {

View File

@ -1,8 +1,8 @@
<div class="page-header">
<div *ngIf="pageLabel" class="breadcrumb">{{ pageLabel }}</div>
<div class="filters" [style.max-width]="computedWidth" [style.width]="computedWidth" *ngIf="filters$ | async as filters">
<div translate="filters.filter-by" *ngIf="filters.length"></div>
<div *ngIf="filters$ | async as filters" [style.max-width]="computedWidth" [style.width]="computedWidth" class="filters">
<div *ngIf="filters.length" translate="filters.filter-by"></div>
<ng-container *ngFor="let config of filters; trackBy: trackByLabel">
<redaction-popup-filter
@ -16,10 +16,10 @@
</ng-container>
<redaction-input-with-action
[width]="searchWidth"
*ngIf="searchPlaceholder"
[form]="searchService.searchForm"
[placeholder]="searchPlaceholder"
[width]="searchWidth"
type="search"
></redaction-input-with-action>
@ -32,7 +32,7 @@
(action)="config.action($event)"
*ngIf="!config.hide"
[icon]="config.icon"
[label]="config.label"
[label]="config.label | translate"
[type]="config.type"
></redaction-icon-button>
</ng-container>

View File

@ -11,7 +11,7 @@
*ngFor="let config of tableColConfigs"
[class]="config.class"
[column]="config.column"
[label]="config.label"
[label]="config.label | translate"
[leftIcon]="config.leftIcon"
[rightIconTooltip]="config.rightIconTooltip"
[rightIcon]="config.rightIcon"