Skip to content
Permalink
Browse files
chore(lists): adds changes required for lists to work due to the chan…
…ge in js-lib (#599)
  • Loading branch information
mdelez committed Dec 1, 2021
1 parent faebe3e commit ca8358451624c8b8af4a3a58051b3f60140378eb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.

Some generated files are not rendered by default. Learn more.

@@ -33,7 +33,7 @@
"@angular/platform-browser-dynamic": "^12.2.13",
"@angular/router": "^12.2.13",
"@ckeditor/ckeditor5-angular": "^2.0.2",
"@dasch-swiss/dsp-js": "^4.2.0",
"@dasch-swiss/dsp-js": "^5.0.0",
"@datadog/browser-rum": "^3.7.0",
"@ngx-translate/core": "^12.1.2",
"@ngx-translate/http-loader": "5.0.0",
@@ -73,15 +73,17 @@ export class EditListItemComponent implements OnInit {
ngOnInit(): void {
this.loading = true;

// get the project data from cache
this._cache.get(this.projectCode).subscribe(
(response: ReadProject) => {
this.projectIri = response.id;
},
(error: ApiResponseError) => {
this._errorHandler.showMessage(error);
}
);
// get the project iri from cache if the project code was provided
if (this.projectCode) {
this._cache.get(this.projectCode).subscribe(
(response: ReadProject) => {
this.projectIri = response.id;
},
(error: ApiResponseError) => {
this._errorHandler.showMessage(error);
}
);
}

// if updating a node, get the existing node info
if (this.mode === 'update') {
@@ -157,7 +159,7 @@ export class EditListItemComponent implements OnInit {
childNodeUpdateData.projectIri = this.projectIri;
childNodeUpdateData.listIri = this.iri;
childNodeUpdateData.labels = this.labels;
childNodeUpdateData.comments = this.comments.length > 0 ? this.comments : [];
childNodeUpdateData.comments = this.comments.length > 0 ? this.comments : undefined;

this._dspApiConnection.admin.listsEndpoint.updateChildNode(childNodeUpdateData).subscribe(
(response: ApiResponseData<ChildNodeInfoResponse>) => {
@@ -181,7 +183,7 @@ export class EditListItemComponent implements OnInit {
createChildNodeRequest.name = this.projectCode + '-' + Math.random().toString(36).substr(2) + Math.random().toString(36).substr(2);
createChildNodeRequest.parentNodeIri = this.parentIri;
createChildNodeRequest.labels = this.labels;
createChildNodeRequest.comments = this.comments.length > 0 ? this.comments : [];
createChildNodeRequest.comments = this.comments.length > 0 ? this.comments : undefined;
createChildNodeRequest.projectIri = this.projectIri;
createChildNodeRequest.position = this.position;

@@ -157,7 +157,7 @@ export class ListItemFormComponent implements OnInit {
childNode.labels[i].value = l.value;
i++;
}
childNode.comments = []; // --> TODO comments are not yet implemented in the template
// childNode.comments = []; // --> TODO comments are not yet implemented in the template

// init data to emit to parent
const listNodeOperation: ListNodeOperation = new ListNodeOperation();

0 comments on commit ca83584

Please sign in to comment.