From def39439401b9b6ddbf1aaf385a8e3187e7f9c3f Mon Sep 17 00:00:00 2001 From: Yasa-Nataliya Date: Fri, 1 Sep 2023 00:13:08 +0530 Subject: [PATCH] [ACS-5645]Implemented changes as per the review comments --- .../content-metadata/content-metadata.component.spec.ts | 5 +++-- .../content-metadata/content-metadata.component.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts index 390f16ad81..77f44cf5f4 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts @@ -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 = { diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts index f663134c5f..39c0c16e94 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts @@ -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(); + 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) => {