mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-2468] add check if nodeid is present in tag components (#3076)
* add check if nodeid is present in tag components * fix test
This commit is contained in:
@@ -67,15 +67,17 @@ export class TagActionsComponent implements OnChanges {
|
||||
}
|
||||
|
||||
refreshTag() {
|
||||
this.tagService.getTagsByNodeId(this.nodeId).subscribe((data) => {
|
||||
this.tagsEntries = data.list.entries;
|
||||
this.disableAddTag = false;
|
||||
this.result.emit(this.tagsEntries);
|
||||
}, () => {
|
||||
this.tagsEntries = null;
|
||||
this.disableAddTag = true;
|
||||
this.result.emit(this.tagsEntries);
|
||||
});
|
||||
if (this.nodeId) {
|
||||
this.tagService.getTagsByNodeId(this.nodeId).subscribe((data) => {
|
||||
this.tagsEntries = data.list.entries;
|
||||
this.disableAddTag = false;
|
||||
this.result.emit(this.tagsEntries);
|
||||
}, () => {
|
||||
this.tagsEntries = null;
|
||||
this.disableAddTag = true;
|
||||
this.result.emit(this.tagsEntries);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
addTag() {
|
||||
|
@@ -78,8 +78,6 @@ describe('TagList', () => {
|
||||
});
|
||||
|
||||
it('Tag list relative a single node should be rendered', (done) => {
|
||||
component.nodeId = 'fake-node-id';
|
||||
|
||||
component.result.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
|
||||
|
@@ -55,10 +55,12 @@ export class TagNodeListComponent implements OnChanges {
|
||||
}
|
||||
|
||||
refreshTag() {
|
||||
this.tagService.getTagsByNodeId(this.nodeId).subscribe((data) => {
|
||||
this.tagsEntries = data.list.entries;
|
||||
this.results.emit(this.tagsEntries);
|
||||
});
|
||||
if (this.nodeId) {
|
||||
this.tagService.getTagsByNodeId(this.nodeId).subscribe((data) => {
|
||||
this.tagsEntries = data.list.entries;
|
||||
this.results.emit(this.tagsEntries);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
removeTag(tag: string) {
|
||||
|
Reference in New Issue
Block a user