[ACS-5645]Implemented changes as per the review comments

This commit is contained in:
Yasa-Nataliya
2023-10-13 16:29:15 +05:30
committed by Anukriti Singh
parent b4b995889f
commit def3943940
2 changed files with 11 additions and 2 deletions
@@ -105,7 +105,7 @@ describe('ContentMetadataComponent', () => {
const clickOnTagsSave = () => {
findSaveTagsButton().click();
fixture.detectChanges();
}
};
const findTagsCreator = (): TagsCreatorComponent => fixture.debugElement.query(By.directive(TagsCreatorComponent))?.componentInstance;
@@ -324,7 +324,7 @@ describe('ContentMetadataComponent', () => {
tag2.tag = tagName2;
expect(tagService.removeTag).toHaveBeenCalledWith(node.id, tagPaging.list.entries[1].entry.id);
expect(tagService.assignTagsToNode).toHaveBeenCalledWith(node.id, [tag1, tag2]);
}));
}));
it('should call getTagsByNodeId on TagService on save click', () => {
component.editableTags = true;
@@ -813,6 +813,7 @@ describe('ContentMetadataComponent', () => {
describe('Display properties with aspect oriented config', () => {
let appConfig: AppConfigService;
let classesApi: ClassesApi;
let expectedNode: Node;
const verResponse: PropertyGroup = {
@@ -196,6 +196,10 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
@Input()
group: CardViewGroup;
/** Emitted when content's editable state is changed. **/
@Output()
editableChange = new EventEmitter<boolean>();
private _assignedTags: string[] = [];
private assignedTagsEntries: TagEntry[] = [];
private _editable = false;
@@ -571,6 +575,10 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
);
}
private isEmpty(value: any): boolean {
return value === undefined || value === null || value === '';
}
private loadCategoriesForNode(nodeId: string) {
this.assignedCategories = [];
this.categoryService.getCategoryLinksForNode(nodeId).subscribe((categoryPaging) => {