File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
services/static-webserver/client/source/class/osparc/desktop Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
293293 if ( data [ "projectId" ] === this . getStudy ( ) . getUuid ( ) ) {
294294 const myStudy = this . getStudy ( ) . serialize ( ) ;
295295 const updatedStudy = data [ "document" ] ;
296+
296297 // the updatedStudy model doesn't contain the following properties
297298 [
298299 "accessRights" ,
@@ -304,12 +305,27 @@ qx.Class.define("osparc.desktop.StudyEditor", {
304305 ] . forEach ( prop => {
305306 delete myStudy [ prop ] ;
306307 } ) ;
308+
307309 // ignore the ``state`` property, it has its own channel
308310 [
309311 "state" ,
310312 ] . forEach ( prop => {
311313 delete updatedStudy [ prop ] ;
312314 } ) ;
315+ // in order to pair it the with frontend's node serialization
316+ // remove null entries
317+ // remove state entries
318+ Object . keys ( updatedStudy [ "workbench" ] ) . forEach ( nodeId => {
319+ const node = updatedStudy [ "workbench" ] [ nodeId ] ;
320+ Object . keys ( node ) . forEach ( nodeProp => {
321+ if ( nodeProp === "state" ) {
322+ delete node [ nodeProp ] ;
323+ }
324+ if ( node [ nodeProp ] === null ) {
325+ delete node [ nodeProp ] ;
326+ }
327+ } ) ;
328+ } ) ;
313329
314330 const delta = osparc . wrapper . JsonDiffPatch . getInstance ( ) . diff ( myStudy , updatedStudy ) ;
315331 console . log ( "projectDocument:updated delta" , myStudy , updatedStudy , delta ) ;
You can’t perform that action at this time.
0 commit comments