File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -258,14 +258,12 @@ qx.Class.define("osparc.desktop.MainPage", {
258258 // these operations need to be done after template creation
259259 osparc . store . Study . addCollaborators ( templateData , templateAccessRights ) ;
260260 if ( templateType ) {
261- const studyUI = osparc . utils . Utils . deepCloneObject ( templateData [ "ui" ] ) ;
262- studyUI [ "templateType" ] = templateType ;
263- osparc . store . Study . patchStudyData ( templateData , "ui" , studyUI )
261+ osparc . store . Study . patchTemplateType ( templateData , templateType )
264262 . then ( ( ) => {
265- if ( tutorialBrowser ) {
263+ if ( tutorialBrowser && templateType === osparc . data . model . StudyUI . TUTORIAL_TYPE ) {
266264 tutorialBrowser . reloadResources ( ) ;
267265 }
268- if ( appBrowser ) {
266+ if ( appBrowser && templateType === osparc . data . model . StudyUI . HYPERTOOL_TYPE ) {
269267 // OM: reload hypertools only
270268 appBrowser . reloadResources ( ) ;
271269 }
Original file line number Diff line number Diff line change @@ -41,6 +41,19 @@ qx.Class.define("osparc.store.Study", {
4141 } ) ;
4242 } ,
4343
44+ patchTemplateType : function ( templateData , templateType ) {
45+ const params = {
46+ url : {
47+ "studyId" : templateData [ "uuid" ]
48+ } ,
49+ data : {
50+ "templateType" : templateType ,
51+ }
52+ } ;
53+ return osparc . data . Resources . fetch ( "studies" , "patch" , params )
54+ . catch ( err => osparc . FlashMessenger . logError ( err ) ) ;
55+ } ,
56+
4457 patchNodeData : function ( studyData , nodeId , patchData ) {
4558 const params = {
4659 url : {
You can’t perform that action at this time.
0 commit comments