mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ACS-5021] Fixed displaying label above existing tags list (#8453)
* ACS-5021 Fixed displaying label above existing tags list * ACS-5021 Fixed lint issues
This commit is contained in:
parent
ee3f1cdf55
commit
0ebdecbe74
@ -62,7 +62,7 @@
|
||||
{{ 'TAG.TAGS_CREATOR.CREATE_TAG' | translate : { tag: tagNameControl.value } }}
|
||||
</span>
|
||||
<p class="adf-existing-tags-label">
|
||||
{{ existingTagsLabelKey | translate }}
|
||||
{{ (isOnlyCreateMode() ? 'TAG.TAGS_CREATOR.EXISTING_TAGS' : 'TAG.TAGS_CREATOR.EXISTING_TAGS_SELECTION') | translate }}
|
||||
</p>
|
||||
</ng-container>
|
||||
<div class="adf-tags-list">
|
||||
|
@ -137,6 +137,10 @@ describe('TagsCreatorComponent', () => {
|
||||
return fixture.debugElement.query(By.directive(MatSelectionList)).componentInstance;
|
||||
}
|
||||
|
||||
function getExistingTagsLabel(): string {
|
||||
return fixture.debugElement.query(By.css('.adf-existing-tags-label')).nativeElement.textContent.trim();
|
||||
}
|
||||
|
||||
describe('Created tags list', () => {
|
||||
it('should display no tags created message after initialization', () => {
|
||||
const message = fixture.debugElement.query(By.css('.adf-no-tags-message')).nativeElement.textContent.trim();
|
||||
@ -388,6 +392,20 @@ describe('TagsCreatorComponent', () => {
|
||||
expect(getPanel()).toBeFalsy();
|
||||
}));
|
||||
|
||||
it('should have correct label when mode is Create and Assign', fakeAsync(() => {
|
||||
component.mode = TagsCreatorMode.CREATE_AND_ASSIGN;
|
||||
|
||||
typeTag('some tag');
|
||||
expect(getExistingTagsLabel()).toBe('TAG.TAGS_CREATOR.EXISTING_TAGS_SELECTION');
|
||||
}));
|
||||
|
||||
it('should have correct label when mode is Create', fakeAsync(() => {
|
||||
component.mode = TagsCreatorMode.CREATE;
|
||||
|
||||
typeTag('some tag');
|
||||
expect(getExistingTagsLabel()).toBe('TAG.TAGS_CREATOR.EXISTING_TAGS');
|
||||
}));
|
||||
|
||||
describe('Label for tag creation', () => {
|
||||
it('should be visible', fakeAsync(() => {
|
||||
typeTag('some tag');
|
||||
|
@ -161,7 +161,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
|
||||
private cancelExistingTagsLoading$ = new Subject<void>();
|
||||
private existingExactTag: TagEntry;
|
||||
private _existingTagsPanelVisible: boolean;
|
||||
private _existingTagsLabelKey: string;
|
||||
|
||||
@ViewChild('tagsList')
|
||||
private tagsListElement: ElementRef;
|
||||
@ -243,10 +242,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
|
||||
return this._existingTagsPanelVisible;
|
||||
}
|
||||
|
||||
get existingTagsLabelKey(): string {
|
||||
return this._existingTagsLabelKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide input for typing name for new tag or for searching. When input is hidden then panel of existing tags is hidden as well.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user