@@ -144,7 +144,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
144144 } ,
145145
146146 __getActiveStudy : function ( ) {
147- return osparc . store . Study . getActive ( osparc . utils . Utils . getClientSessionID ( ) )
147+ return osparc . store . Study . getInstance ( ) . getActive ( osparc . utils . Utils . getClientSessionID ( ) )
148148 . then ( studyData => {
149149 if ( studyData ) {
150150 osparc . store . Store . getInstance ( ) . setCurrentStudyId ( studyData [ "uuid" ] ) ;
@@ -401,7 +401,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
401401 const delay = 2000 ;
402402 const studyId = study [ "uuid" ] ;
403403 setTimeout ( ( ) => {
404- osparc . store . Study . getOne ( studyId )
404+ osparc . store . Study . getInstance ( ) . getOne ( studyId )
405405 . then ( studyData => {
406406 this . __studyStateReceived ( study [ "uuid" ] , studyData [ "state" ] ) ;
407407 } ) ;
@@ -901,18 +901,18 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
901901 let request = null ;
902902 switch ( this . getCurrentContext ( ) ) {
903903 case osparc . dashboard . StudyBrowser . CONTEXT . PROJECTS :
904- request = osparc . store . Study . getPage ( params , options ) ;
904+ request = osparc . store . Study . getInstance ( ) . getPage ( params , options ) ;
905905 break ;
906906 case osparc . dashboard . StudyBrowser . CONTEXT . TEMPLATES :
907907 case osparc . dashboard . StudyBrowser . CONTEXT . PUBLIC_TEMPLATES :
908908 // The distinction is done in the frontend
909909 request = osparc . store . Templates . fetchTemplatesPaginated ( params , options ) ;
910910 break ;
911911 case osparc . dashboard . StudyBrowser . CONTEXT . TRASH :
912- request = osparc . store . Study . getPageTrashed ( params , options ) ;
912+ request = osparc . store . Study . getInstance ( ) . getPageTrashed ( params , options ) ;
913913 break ;
914914 case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PROJECTS :
915- request = osparc . store . Study . getPageSearch ( params , options ) ;
915+ request = osparc . store . Study . getInstance ( ) . getPageSearch ( params , options ) ;
916916 break ;
917917 case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_TEMPLATES :
918918 case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PUBLIC_TEMPLATES :
@@ -1590,7 +1590,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
15901590 const openCB = ( ) => this . _hideLoadingPage ( ) ;
15911591 const cancelCB = ( ) => {
15921592 this . _hideLoadingPage ( ) ;
1593- osparc . store . Study . deleteStudy ( studyId ) ;
1593+ osparc . store . Study . getInstance ( ) . deleteStudy ( studyId ) ;
15941594 } ;
15951595 const isStudyCreation = true ;
15961596 this . _startStudyById ( studyId , openCB , cancelCB , isStudyCreation ) ;
@@ -1779,13 +1779,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
17791779 } ,
17801780
17811781 __updateName : function ( studyData , name ) {
1782- osparc . store . Study . patchStudyData ( studyData , "name" , name )
1782+ osparc . store . Study . getInstance ( ) . patchStudyData ( studyData , "name" , name )
17831783 . then ( ( ) => this . _updateStudyData ( studyData ) )
17841784 . catch ( err => osparc . FlashMessenger . logError ( err , this . tr ( "Something went wrong while renaming" ) ) ) ;
17851785 } ,
17861786
17871787 __updateThumbnail : function ( studyData , url ) {
1788- osparc . store . Study . patchStudyData ( studyData , "thumbnail" , url )
1788+ osparc . store . Study . getInstance ( ) . patchStudyData ( studyData , "thumbnail" , url )
17891789 . then ( ( ) => this . _updateStudyData ( studyData ) )
17901790 . catch ( err => osparc . FlashMessenger . logError ( err , this . tr ( "Something went wrong while updating the thumbnail" ) ) ) ;
17911791 } ,
@@ -1852,7 +1852,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
18521852 // resolve right away
18531853 return new Promise ( resolve => resolve ( ) ) ;
18541854 }
1855- return osparc . store . Study . moveStudyToWorkspace ( studyData [ "uuid" ] , destWorkspaceId )
1855+ return osparc . store . Study . getInstance ( ) . moveStudyToWorkspace ( studyData [ "uuid" ] , destWorkspaceId )
18561856 . then ( ( ) => studyData [ "workspaceId" ] = destWorkspaceId ) ;
18571857 } ,
18581858
@@ -1861,7 +1861,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
18611861 // resolve right away
18621862 return new Promise ( resolve => resolve ( ) ) ;
18631863 }
1864- return osparc . store . Study . moveStudyToFolder ( studyData [ "uuid" ] , destFolderId )
1864+ return osparc . store . Study . getInstance ( ) . moveStudyToFolder ( studyData [ "uuid" ] , destFolderId )
18651865 . then ( ( ) => studyData [ "folderId" ] = destFolderId ) ;
18661866 } ,
18671867
@@ -1922,7 +1922,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
19221922 __updateUIMode : function ( studyData , uiMode ) {
19231923 const studyUI = osparc . utils . Utils . deepCloneObject ( studyData [ "ui" ] ) ;
19241924 studyUI [ "mode" ] = uiMode ;
1925- return osparc . store . Study . patchStudyData ( studyData , "ui" , studyUI )
1925+ return osparc . store . Study . getInstance ( ) . patchStudyData ( studyData , "ui" , studyUI )
19261926 . then ( ( ) => this . _updateStudyData ( studyData ) )
19271927 } ,
19281928
@@ -2087,7 +2087,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
20872087 importTaskUI . setSubtitle ( processingLabel ) ;
20882088 importingStudyCard . getChildControl ( "progress-bar" ) . exclude ( ) ;
20892089 const data = JSON . parse ( req . responseText ) ;
2090- osparc . store . Study . getOne ( data [ "data" ] [ "uuid" ] )
2090+ osparc . store . Study . getInstance ( ) . getOne ( data [ "data" ] [ "uuid" ] )
20912091 . then ( studyData => this . _updateStudyData ( studyData ) )
20922092 . catch ( err => osparc . FlashMessenger . logError ( err , this . tr ( "Something went wrong while fetching the study" ) ) )
20932093 . finally ( ( ) => {
@@ -2116,7 +2116,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
21162116 } ,
21172117
21182118 __untrashStudy : function ( studyData ) {
2119- osparc . store . Study . untrashStudy ( studyData . uuid )
2119+ osparc . store . Study . getInstance ( ) . untrashStudy ( studyData . uuid )
21202120 . then ( ( ) => {
21212121 this . __removeFromStudyList ( studyData . uuid ) ;
21222122 const msg = this . tr ( "Successfully restored" ) ;
@@ -2128,7 +2128,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
21282128 } ,
21292129
21302130 __trashStudy : function ( studyData ) {
2131- osparc . store . Study . trashStudy ( studyData . uuid )
2131+ osparc . store . Study . getInstance ( ) . trashStudy ( studyData . uuid )
21322132 . then ( ( ) => {
21332133 this . __removeFromStudyList ( studyData . uuid ) ;
21342134 const msg = this . tr ( "Successfully deleted" ) ;
@@ -2156,7 +2156,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
21562156 // remove me from collaborators
21572157 const myGid = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
21582158 delete arCopy [ myGid ] ;
2159- return osparc . store . Study . patchStudyData ( studyData , "accessRights" , arCopy ) ;
2159+ return osparc . store . Study . getInstance ( ) . patchStudyData ( studyData , "accessRights" , arCopy ) ;
21602160 } ,
21612161
21622162 __doDeleteStudy : function ( studyData ) {
@@ -2165,7 +2165,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
21652165 operationPromise = this . __removeMeFromCollaborators ( studyData ) ;
21662166 } else {
21672167 // delete study
2168- operationPromise = osparc . store . Study . deleteStudy ( studyData . uuid ) ;
2168+ operationPromise = osparc . store . Study . getInstance ( ) . deleteStudy ( studyData . uuid ) ;
21692169 }
21702170 operationPromise
21712171 . then ( ( ) => this . __removeFromStudyList ( studyData . uuid ) )
0 commit comments