File tree Expand file tree Collapse file tree 3 files changed +19
-21
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 3 files changed +19
-21
lines changed Original file line number Diff line number Diff line change @@ -251,8 +251,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
251251 return ;
252252 }
253253
254- const tasks = osparc . store . PollTasks . getInstance ( ) . getTasks ( ) ;
255- this . __tasksToCards ( tasks ) ;
254+ this . __tasksToCards ( ) ;
256255
257256 this . _loadingResourcesBtn . setFetching ( true ) ;
258257 this . _loadingResourcesBtn . setVisibility ( "visible" ) ;
@@ -2129,13 +2128,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
21292128 } ,
21302129
21312130 // TASKS //
2132- __tasksToCards : function ( tasks ) {
2131+ __tasksToCards : function ( ) {
2132+ const tasks = osparc . store . PollTasks . getInstance ( ) . getDuplicateStudyTasks ( ) ;
21332133 tasks . forEach ( task => {
2134- if ( task . getTaskId ( ) . includes ( "from_study" ) && ! task . getTaskId ( ) . includes ( "as_template" ) ) {
2135- // duplicating
2136- const studyName = "" ;
2137- this . __taskDuplicateReceived ( task , studyName ) ;
2138- }
2134+ const studyName = "" ;
2135+ this . __taskDuplicateReceived ( task , studyName ) ;
21392136 } ) ;
21402137 } ,
21412138
Original file line number Diff line number Diff line change @@ -75,8 +75,7 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
7575 } ,
7676
7777 __reloadTemplates : function ( ) {
78- const tasks = osparc . store . PollTasks . getInstance ( ) . getTasks ( ) ;
79- this . __tasksToCards ( tasks ) ;
78+ this . __tasksToCards ( ) ;
8079
8180 osparc . data . Resources . getInstance ( ) . getAllPages ( "templates" )
8281 . then ( templates => this . __setResourcesToList ( templates ) )
@@ -383,13 +382,11 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
383382 } ) ;
384383 } ,
385384
386- __tasksToCards : function ( tasks ) {
385+ __tasksToCards : function ( ) {
386+ const tasks = osparc . store . PollTasks . getInstance ( ) . getPublishTemplateTasks ( ) ;
387387 tasks . forEach ( task => {
388- if ( task . getTaskId ( ) . includes ( "from_study" ) && task . getTaskId ( ) . includes ( "as_template" ) ) {
389- // creating template
390- const studyName = "" ;
391- this . taskToTemplateReceived ( task , studyName ) ;
392- }
388+ const studyName = "" ;
389+ this . taskToTemplateReceived ( task , studyName ) ;
393390 } ) ;
394391 } ,
395392
Original file line number Diff line number Diff line change @@ -19,10 +19,6 @@ qx.Class.define("osparc.store.PollTasks", {
1919 extend : qx . core . Object ,
2020 type : "singleton" ,
2121
22- construct : function ( ) {
23- this . initTasks ( ) ;
24- } ,
25-
2622 properties : {
2723 tasks : {
2824 check : "Array" ,
@@ -73,6 +69,14 @@ qx.Class.define("osparc.store.PollTasks", {
7369 removeTasks : function ( ) {
7470 const tasks = this . getTasks ( ) ;
7571 tasks . forEach ( task => task . dispose ( ) ) ;
76- }
72+ } ,
73+
74+ getDuplicateStudyTasks : function ( ) {
75+ return this . getTasks ( ) . filter ( task => task . getTaskId ( ) . includes ( "from_study" ) && ! task . getTaskId ( ) . includes ( "as_template" ) ) ;
76+ } ,
77+
78+ getPublishTemplateTasks : function ( ) {
79+ return this . getTasks ( ) . filter ( task => task . getTaskId ( ) . includes ( "from_study" ) && task . getTaskId ( ) . includes ( "as_template" ) ) ;
80+ } ,
7781 }
7882} ) ;
You can’t perform that action at this time.
0 commit comments