Skip to content

Commit

Permalink
[ACS-4523] Fix translation and label (#8505)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKinas authored Apr 24, 2023
1 parent c68dd82 commit 1ae178a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1ae178a

Please sign in to comment.