@@ -166,7 +166,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
166166 __reloadWorkspaces : function ( ) {
167167 if (
168168 ! osparc . auth . Manager . getInstance ( ) . isLoggedIn ( ) ||
169- ! osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ||
170169 this . getCurrentContext ( ) === "studiesAndFolders" ||
171170 this . getCurrentContext ( ) === "search" || // not yet implemented for workspaces
172171 this . __loadingWorkspaces
@@ -212,7 +211,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
212211 __reloadFolders : function ( ) {
213212 if (
214213 ! osparc . auth . Manager . getInstance ( ) . isLoggedIn ( ) ||
215- ! osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ||
216214 this . getCurrentContext ( ) === "workspaces" ||
217215 this . __loadingFolders
218216 ) {
@@ -991,11 +989,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
991989 _createLayout : function ( ) {
992990 this . _createSearchBar ( ) ;
993991
994- if ( osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
995- const header = this . __header = new osparc . dashboard . StudyBrowserHeader ( ) ;
996- this . __header . addListener ( "emptyTrashRequested" , ( ) => this . __emptyTrash ( ) , this ) ;
997- this . _addToLayout ( header ) ;
998- }
992+ const header = this . __header = new osparc . dashboard . StudyBrowserHeader ( ) ;
993+ this . __header . addListener ( "emptyTrashRequested" , ( ) => this . __emptyTrash ( ) , this ) ;
994+ this . _addToLayout ( header ) ;
999995
1000996 this . _createResourcesLayout ( "studiesList" ) ;
1001997
@@ -1069,112 +1065,108 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
10691065 } ,
10701066
10711067 __connectContexts : function ( ) {
1072- if ( osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1073- const header = this . __header ;
1074- header . addListener ( "locationChanged" , ( ) => {
1075- const workspaceId = header . getCurrentWorkspaceId ( ) ;
1076- const folderId = header . getCurrentFolderId ( ) ;
1077- this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1078- } , this ) ;
1068+ const header = this . __header ;
1069+ header . addListener ( "locationChanged" , ( ) => {
1070+ const workspaceId = header . getCurrentWorkspaceId ( ) ;
1071+ const folderId = header . getCurrentFolderId ( ) ;
1072+ this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1073+ } , this ) ;
10791074
1080- const workspacesAndFoldersTree = this . _resourceFilter . getWorkspacesAndFoldersTree ( ) ;
1081- workspacesAndFoldersTree . addListener ( "locationChanged" , e => {
1082- const context = e . getData ( ) ;
1083- const workspaceId = context [ "workspaceId" ] ;
1084- if ( workspaceId === - 1 ) {
1085- this . _changeContext ( "workspaces" ) ;
1086- } else {
1087- const folderId = context [ "folderId" ] ;
1088- this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1089- }
1090- } , this ) ;
1075+ const workspacesAndFoldersTree = this . _resourceFilter . getWorkspacesAndFoldersTree ( ) ;
1076+ workspacesAndFoldersTree . addListener ( "locationChanged" , e => {
1077+ const context = e . getData ( ) ;
1078+ const workspaceId = context [ "workspaceId" ] ;
1079+ if ( workspaceId === - 1 ) {
1080+ this . _changeContext ( "workspaces" ) ;
1081+ } else {
1082+ const folderId = context [ "folderId" ] ;
1083+ this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1084+ }
1085+ } , this ) ;
10911086
1092- this . _resourceFilter . addListener ( "trashContext" , ( ) => {
1093- this . _changeContext ( "trash" ) ;
1094- } ) ;
1087+ this . _resourceFilter . addListener ( "trashContext" , ( ) => {
1088+ this . _changeContext ( "trash" ) ;
1089+ } ) ;
10951090
1096- this . _searchBarFilter . addListener ( "filterChanged" , e => {
1097- const filterData = e . getData ( ) ;
1098- if ( filterData . text ) {
1099- this . _changeContext ( "search" ) ;
1100- } else {
1101- const workspaceId = this . getCurrentWorkspaceId ( ) ;
1102- const folderId = this . getCurrentFolderId ( ) ;
1103- this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1104- }
1105- } ) ;
1106- }
1091+ this . _searchBarFilter . addListener ( "filterChanged" , e => {
1092+ const filterData = e . getData ( ) ;
1093+ if ( filterData . text ) {
1094+ this . _changeContext ( "search" ) ;
1095+ } else {
1096+ const workspaceId = this . getCurrentWorkspaceId ( ) ;
1097+ const folderId = this . getCurrentFolderId ( ) ;
1098+ this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1099+ }
1100+ } ) ;
11071101 } ,
11081102
11091103 _changeContext : function ( context , workspaceId = null , folderId = null ) {
1110- if ( osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1111- if (
1112- context !== "search" && // reload studies for a new search
1113- context === this . getCurrentContext ( ) &&
1114- workspaceId === this . getCurrentWorkspaceId ( ) &&
1115- folderId === this . getCurrentFolderId ( )
1116- ) {
1117- // didn't really change
1118- return ;
1119- }
1120-
1121- osparc . store . Store . getInstance ( ) . setStudyBrowserContext ( context ) ;
1122- this . set ( {
1123- currentContext : context ,
1124- currentWorkspaceId : workspaceId ,
1125- currentFolderId : folderId ,
1126- } ) ;
1127- this . resetSelection ( ) ;
1128- this . setMultiSelection ( false ) ;
1104+ if (
1105+ context !== "search" && // reload studies for a new search
1106+ context === this . getCurrentContext ( ) &&
1107+ workspaceId === this . getCurrentWorkspaceId ( ) &&
1108+ folderId === this . getCurrentFolderId ( )
1109+ ) {
1110+ // didn't really change
1111+ return ;
1112+ }
11291113
1130- // reset lists
1131- this . __setWorkspacesToList ( [ ] ) ;
1132- this . __setFoldersToList ( [ ] ) ;
1133- this . _resourcesList = [ ] ;
1134- this . _resourcesContainer . setResourcesToList ( this . _resourcesList ) ;
1135- this . _resourcesContainer . reloadCards ( "studies" ) ;
1136-
1137- this . _toolbar . show ( ) ;
1138- switch ( this . getCurrentContext ( ) ) {
1139- case "studiesAndFolders" :
1140- this . _searchBarFilter . resetFilters ( ) ;
1141- this . __reloadFolders ( ) ;
1142- this . _loadingResourcesBtn . setFetching ( false ) ;
1143- this . invalidateStudies ( ) ;
1144- this . __reloadStudies ( ) ;
1145- break ;
1146- case "workspaces" :
1147- this . _toolbar . exclude ( ) ;
1148- this . _searchBarFilter . resetFilters ( ) ;
1149- this . __reloadWorkspaces ( ) ;
1150- break ;
1151- case "search" :
1152- this . __reloadWorkspaces ( ) ;
1153- this . __reloadFolders ( ) ;
1154- this . _loadingResourcesBtn . setFetching ( false ) ;
1155- this . invalidateStudies ( ) ;
1156- this . __reloadStudies ( ) ;
1157- break ;
1158- case "trash" :
1159- this . _searchBarFilter . resetFilters ( ) ;
1160- this . __reloadWorkspaces ( ) ;
1161- this . __reloadFolders ( ) ;
1162- this . _loadingResourcesBtn . setFetching ( false ) ;
1163- this . invalidateStudies ( ) ;
1164- this . __reloadStudies ( ) ;
1165- break ;
1166- }
1114+ osparc . store . Store . getInstance ( ) . setStudyBrowserContext ( context ) ;
1115+ this . set ( {
1116+ currentContext : context ,
1117+ currentWorkspaceId : workspaceId ,
1118+ currentFolderId : folderId ,
1119+ } ) ;
1120+ this . resetSelection ( ) ;
1121+ this . setMultiSelection ( false ) ;
11671122
1168- // notify header
1169- const header = this . __header ;
1170- header . set ( {
1171- currentWorkspaceId : workspaceId ,
1172- currentFolderId : folderId ,
1173- } ) ;
1123+ // reset lists
1124+ this . __setWorkspacesToList ( [ ] ) ;
1125+ this . __setFoldersToList ( [ ] ) ;
1126+ this . _resourcesList = [ ] ;
1127+ this . _resourcesContainer . setResourcesToList ( this . _resourcesList ) ;
1128+ this . _resourcesContainer . reloadCards ( "studies" ) ;
11741129
1175- // notify Filters on the left
1176- this . _resourceFilter . contextChanged ( context , workspaceId , folderId ) ;
1130+ this . _toolbar . show ( ) ;
1131+ switch ( this . getCurrentContext ( ) ) {
1132+ case "studiesAndFolders" :
1133+ this . _searchBarFilter . resetFilters ( ) ;
1134+ this . __reloadFolders ( ) ;
1135+ this . _loadingResourcesBtn . setFetching ( false ) ;
1136+ this . invalidateStudies ( ) ;
1137+ this . __reloadStudies ( ) ;
1138+ break ;
1139+ case "workspaces" :
1140+ this . _toolbar . exclude ( ) ;
1141+ this . _searchBarFilter . resetFilters ( ) ;
1142+ this . __reloadWorkspaces ( ) ;
1143+ break ;
1144+ case "search" :
1145+ this . __reloadWorkspaces ( ) ;
1146+ this . __reloadFolders ( ) ;
1147+ this . _loadingResourcesBtn . setFetching ( false ) ;
1148+ this . invalidateStudies ( ) ;
1149+ this . __reloadStudies ( ) ;
1150+ break ;
1151+ case "trash" :
1152+ this . _searchBarFilter . resetFilters ( ) ;
1153+ this . __reloadWorkspaces ( ) ;
1154+ this . __reloadFolders ( ) ;
1155+ this . _loadingResourcesBtn . setFetching ( false ) ;
1156+ this . invalidateStudies ( ) ;
1157+ this . __reloadStudies ( ) ;
1158+ break ;
11771159 }
1160+
1161+ // notify header
1162+ const header = this . __header ;
1163+ header . set ( {
1164+ currentWorkspaceId : workspaceId ,
1165+ currentFolderId : folderId ,
1166+ } ) ;
1167+
1168+ // notify Filters on the left
1169+ this . _resourceFilter . contextChanged ( context , workspaceId , folderId ) ;
11781170 } ,
11791171
11801172 __addSortByButton : function ( ) {
@@ -1560,13 +1552,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
15601552 menu . add ( billingsSettingsButton ) ;
15611553 }
15621554
1563- if ( writeAccess && osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1564- menu . addSeparator ( ) ;
1555+ menu . addSeparator ( ) ;
15651556
1566- const moveToButton = this . __getMoveStudyToMenuButton ( studyData ) ;
1567- if ( moveToButton ) {
1568- menu . add ( moveToButton ) ;
1569- }
1557+ const moveToButton = this . __getMoveStudyToMenuButton ( studyData ) ;
1558+ if ( moveToButton ) {
1559+ menu . add ( moveToButton ) ;
15701560 }
15711561
15721562 if ( deleteAccess ) {
0 commit comments