[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:
Eugenio Romano
2018-03-14 13:57:57 +00:00
committed by GitHub
parent 6734a02b86
commit 1959777a52
3 changed files with 17 additions and 15 deletions

View File

@@ -67,6 +67,7 @@ export class TagActionsComponent implements OnChanges {
}
refreshTag() {
if (this.nodeId) {
this.tagService.getTagsByNodeId(this.nodeId).subscribe((data) => {
this.tagsEntries = data.list.entries;
this.disableAddTag = false;
@@ -77,6 +78,7 @@ export class TagActionsComponent implements OnChanges {
this.result.emit(this.tagsEntries);
});
}
}
addTag() {
if (this.searchTag(this.newTagName)) {

View File

@@ -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();

View File

@@ -55,11 +55,13 @@ export class TagNodeListComponent implements OnChanges {
}
refreshTag() {
if (this.nodeId) {
this.tagService.getTagsByNodeId(this.nodeId).subscribe((data) => {
this.tagsEntries = data.list.entries;
this.results.emit(this.tagsEntries);
});
}
}
removeTag(tag: string) {
this.tagService.removeTag(this.nodeId, tag).subscribe(() => {