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

View File

@ -65,6 +65,9 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy {
private _categoryNameControlVisible = false;
private readonly existingCategoriesListLimit = 15;
initialCategories: Category[] = [];
noCategoriesMsg = '';
removeCategoryTitle = '';
existingCategoriesMsg = '';
/** Categories to display initially */
@Input()
@ -149,6 +152,10 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy {
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) {
this._categoryNameControl.removeValidators(Validators.required);
this.categories.forEach((category) => this.initialCategories.push(category));

View File

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