diff --git a/src/app/workspace/resource/values/list-value/list-value.component.html b/src/app/workspace/resource/values/list-value/list-value.component.html
index 26dde2a617..0e26f42879 100644
--- a/src/app/workspace/resource/values/list-value/list-value.component.html
+++ b/src/app/workspace/resource/values/list-value/list-value.component.html
@@ -1,8 +1,17 @@
-
+
+
+
+
+
@@ -22,6 +31,7 @@
+
New value must be different than the current value.
diff --git a/src/app/workspace/resource/values/list-value/list-value.component.spec.ts b/src/app/workspace/resource/values/list-value/list-value.component.spec.ts
index 9eb2d319fc..e3b2e83818 100644
--- a/src/app/workspace/resource/values/list-value/list-value.component.spec.ts
+++ b/src/app/workspace/resource/values/list-value/list-value.component.spec.ts
@@ -160,7 +160,7 @@ describe('ListValueComponent', () => {
expect(valuesSpy.v2.list.getList).toHaveBeenCalledTimes(1);
expect(valuesSpy.v2.list.getList).toHaveBeenCalledWith('http://rdfh.ch/lists/0001/treeList');
- expect(testHostComponent.inputValueComponent.listRootNode.children.length).toEqual(1);
+ expect(testHostComponent.inputValueComponent.listRootNode.children.length).toEqual(0);
const openListButtonDe = valueComponentDe.query(By.css('button'));
diff --git a/src/app/workspace/resource/values/list-value/list-value.component.ts b/src/app/workspace/resource/values/list-value/list-value.component.ts
index ff27bd527b..3fc7bc7785 100644
--- a/src/app/workspace/resource/values/list-value/list-value.component.ts
+++ b/src/app/workspace/resource/values/list-value/list-value.component.ts
@@ -68,14 +68,12 @@ export class ListValueComponent extends BaseValueDirective implements OnInit, On
}
if (this.valueFormControl !== undefined) {
if (this.mode !== 'read') {
- this.listRootNode = new ListNodeV2();
const rootNodeIris = this.propertyDef.guiAttributes;
for (const rootNodeIri of rootNodeIris) {
- // get rid of the "hlist"
const trimmedRootNodeIRI = rootNodeIri.substr(7, rootNodeIri.length - (1 + 7));
this._dspApiConnection.v2.list.getList(trimmedRootNodeIRI).subscribe(
- (response2: ListNodeV2) => {
- this.listRootNode.children.push(response2);
+ (response: ListNodeV2) => {
+ this.listRootNode = response;
}, (error: ApiResponseError) => {
this._errorHandler.showMessage(error);
});
@@ -126,11 +124,8 @@ export class ListValueComponent extends BaseValueDirective implements OnInit, On
}
const newListValue = new CreateListValue();
-
-
newListValue.listNode = this.valueFormControl.value;
-
if (this.commentFormControl.value !== null && this.commentFormControl.value !== '') {
newListValue.valueHasComment = this.commentFormControl.value;
}