From a99dae47aceb7ff86b4559c4f51432a3522fd0f8 Mon Sep 17 00:00:00 2001 From: Albert Corominas Date: Mon, 11 Nov 2024 08:21:05 +0100 Subject: [PATCH] temp push --- .../src/lib/data-tree/data-tree.component.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/frontend-gui/src/lib/data-tree/data-tree.component.ts b/src/app/frontend-gui/src/lib/data-tree/data-tree.component.ts index 83ac153..669ae1b 100644 --- a/src/app/frontend-gui/src/lib/data-tree/data-tree.component.ts +++ b/src/app/frontend-gui/src/lib/data-tree/data-tree.component.ts @@ -151,7 +151,12 @@ export class FileDatabase { setOrder(data: any[]){ for(let i=0; i< data.length; i++){ data[i].order=i; - if(! data[i].status) { data[i].status="Modified"; } + if(data[i].id && Number(data[i].id) < 0){ + data[i].status="pendingCreation"; + } + if(!data[i].status && !data[i]['status']) { + data[i].status="Modified"; + } } return data; } @@ -196,8 +201,8 @@ export class FileDatabase { queryableActive: node.queryableActive, radio: node.radio, tooltip: node.tooltip, - _links: node._links } as FileNode; - + _links: node._links, + status: null } as FileNode; return newItem; } @@ -206,8 +211,7 @@ export class FileDatabase { parent.children = []; } const newItem = this.getNewItem(node) - newItem.parent = parent==null || parent.id==undefined?null:parent.id; - + newItem.parent = parent==null || parent.id==undefined ? null : parent.id; parent.children.push(newItem); this.setOrder(parent.children) this.dataChange.next(changedData); @@ -547,7 +551,9 @@ export class DataTreeComponent { setOrder(data: any[]){ for(let i=0; i< data.length; i++){ data[i].order=i; - if(! data[i].status) { data[i].status="Modified"; } + if(! data[i].status) { + data[i].status="Modified"; + } } return data; }