[ACS-4523] Fix translation and label (#8505)

This commit is contained in:
MichalKinas 2023-04-24 11:26:51 +02:00 committed by GitHub
parent c68dd82279
commit 1ae178a436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 14 deletions

View File

@ -1,7 +1,7 @@
<div class="adf-categories-management"> <div class="adf-categories-management">
<p *ngIf="!categories.length && !categoryNameControlVisible" <p *ngIf="!categories.length && !categoryNameControlVisible"
class="adf-no-categories-message"> class="adf-no-categories-message">
{{ isCRUDMode ? 'CATEGORIES_MANAGEMENT.NO_CATEGORIES_CREATED' : 'CATEGORIES_MANAGEMENT.NO_CATEGORIES_ASSIGNED' | translate }} {{ noCategoriesMsg | translate }}
</p> </p>
<div class="adf-categories-list" <div class="adf-categories-list"
[class.adf-categories-list-fixed]="!categoryNameControlVisible"> [class.adf-categories-list-fixed]="!categoryNameControlVisible">
@ -15,7 +15,7 @@
mat-icon-button mat-icon-button
[class.adf-btn-padded]="!isCRUDMode" [class.adf-btn-padded]="!isCRUDMode"
(click)="removeCategory(category)" (click)="removeCategory(category)"
[attr.title]="isCRUDMode ? 'CATEGORIES_MANAGEMENT.DELETE_CATEGORY' : 'CATEGORIES_MANAGEMENT.UNASSIGN_CATEGORY' | translate" [attr.title]="removeCategoryTitle | translate"
[disabled]="disableRemoval"> [disabled]="disableRemoval">
<mat-icon>remove</mat-icon> <mat-icon>remove</mat-icon>
</button> </button>
@ -60,7 +60,7 @@
<div *ngIf="categoryNameControlVisible" class="adf-categories-list"> <div *ngIf="categoryNameControlVisible" class="adf-categories-list">
<ng-container *ngIf="!existingCategoriesLoading && existingCategories"> <ng-container *ngIf="!existingCategoriesLoading && existingCategories">
<p class="adf-existing-categories-label"> <p class="adf-existing-categories-label">
{{ isCRUDMode ? 'CATEGORIES_MANAGEMENT.EXISTING_CATEGORIES' : 'CATEGORIES_MANAGEMENT.SELECT_EXISTING_CATEGORY' | translate }} {{ existingCategoriesMsg | translate }}
</p> </p>
<mat-selection-list <mat-selection-list
[disabled]="isCRUDMode" [disabled]="isCRUDMode"

View File

@ -65,6 +65,9 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy {
private _categoryNameControlVisible = false; private _categoryNameControlVisible = false;
private readonly existingCategoriesListLimit = 15; private readonly existingCategoriesListLimit = 15;
initialCategories: Category[] = []; initialCategories: Category[] = [];
noCategoriesMsg = '';
removeCategoryTitle = '';
existingCategoriesMsg = '';
/** Categories to display initially */ /** Categories to display initially */
@Input() @Input()
@ -149,6 +152,10 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy {
this.setCategoryNameControlErrorMessageKey(); this.setCategoryNameControlErrorMessageKey();
this.noCategoriesMsg = this.isCRUDMode ? 'CATEGORIES_MANAGEMENT.NO_CATEGORIES_CREATED' : 'CATEGORIES_MANAGEMENT.NO_CATEGORIES_ASSIGNED';
this.removeCategoryTitle = this.isCRUDMode ? 'CATEGORIES_MANAGEMENT.DELETE_CATEGORY' : 'CATEGORIES_MANAGEMENT.UNASSIGN_CATEGORY';
this.existingCategoriesMsg = this.isCRUDMode ? 'CATEGORIES_MANAGEMENT.EXISTING_CATEGORIES' : 'CATEGORIES_MANAGEMENT.SELECT_EXISTING_CATEGORY';
if (!this.isCRUDMode) { if (!this.isCRUDMode) {
this._categoryNameControl.removeValidators(Validators.required); this._categoryNameControl.removeValidators(Validators.required);
this.categories.forEach((category) => this.initialCategories.push(category)); this.categories.forEach((category) => this.initialCategories.push(category));

View File

@ -54,17 +54,15 @@
<div <div
class="adf-existing-tags-panel" class="adf-existing-tags-panel"
*ngIf="existingTagsPanelVisible"> *ngIf="existingTagsPanelVisible">
<ng-container *ngIf="!spinnerVisible || existingTags"> <span *ngIf="!spinnerVisible || existingTags"
<span class="adf-create-tag-label"
class="adf-create-tag-label" (click)="addTag()"
(click)="addTag()" [hidden]="tagNameControl.invalid || typing">
[hidden]="tagNameControl.invalid || typing"> {{ 'TAG.TAGS_CREATOR.CREATE_TAG' | translate : { tag: tagNameControl.value } }}
{{ 'TAG.TAGS_CREATOR.CREATE_TAG' | translate : { tag: tagNameControl.value } }} </span>
</span> <p *ngIf="!spinnerVisible && existingTags" class="adf-existing-tags-label">
<p class="adf-existing-tags-label"> {{ (isOnlyCreateMode() ? 'TAG.TAGS_CREATOR.EXISTING_TAGS' : 'TAG.TAGS_CREATOR.EXISTING_TAGS_SELECTION') | translate }}
{{ (isOnlyCreateMode() ? 'TAG.TAGS_CREATOR.EXISTING_TAGS' : 'TAG.TAGS_CREATOR.EXISTING_TAGS_SELECTION') | translate }} </p>
</p>
</ng-container>
<div class="adf-tags-list"> <div class="adf-tags-list">
<mat-selection-list <mat-selection-list
*ngIf="!spinnerVisible && existingTags" *ngIf="!spinnerVisible && existingTags"