File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ qx.Class.define("osparc.data.Job", {
2323
2424 this . set ( {
2525 projectUuid : jobData [ "projectUuid" ] ,
26- state : jobData [ "state" ] ,
26+ state : jobData [ "state" ] || "UNKNOWN" ,
2727 submittedAt : jobData [ "submittedAt" ] ? new Date ( jobData [ "submittedAt" ] ) : null ,
2828 startedAt : jobData [ "startedAt" ] ? new Date ( jobData [ "startedAt" ] ) : null ,
2929 endedAt : jobData [ "endedAt" ] ? new Date ( jobData [ "endedAt" ] ) : null ,
@@ -76,13 +76,14 @@ qx.Class.define("osparc.data.Job", {
7676
7777 info : {
7878 check : "Object" ,
79- nullable : false ,
79+ nullable : true ,
8080 init : null ,
8181 } ,
8282 } ,
8383
8484 statics : {
8585 STATUS_LABELS : {
86+ "UNKNOWN" : "Unknown" ,
8687 "NOT_STARTED" : "Not Started" ,
8788 "PUBLISHED" : "Published" ,
8889 "PENDING" : "Pending" ,
Original file line number Diff line number Diff line change @@ -103,13 +103,16 @@ qx.Class.define("osparc.store.Jobs", {
103103 } ,
104104
105105 addSubJob : function ( subJobData ) {
106- const jobs = this . getJobs ( ) ;
107- const jobFound = jobs . find ( job => job . getProjectUuid ( ) === subJobData [ "projectUuid" ] ) ;
108- if ( jobFound ) {
109- const subJob = jobFound . addSubJob ( subJobData ) ;
110- return subJob ;
106+ let job = this . getJob ( subJobData [ "projectUuid" ] ) ;
107+ if ( ! job ) {
108+ const jobs = this . getJobs ( ) ;
109+ const unknownJob = new osparc . data . Job ( {
110+ "projectUuid" : subJobData [ "projectUuid" ] ,
111+ } ) ;
112+ jobs . push ( unknownJob ) ;
111113 }
112- return null ;
114+ const subJob = job . addSubJob ( subJobData ) ;
115+ return subJob ;
113116 } ,
114117
115118 getJob : function ( projectUuid ) {
You can’t perform that action at this time.
0 commit comments