@@ -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 ) {
@@ -996,11 +994,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
996994 _createLayout : function ( ) {
997995 this . _createSearchBar ( ) ;
998996
999- if ( osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1000- const header = this . __header = new osparc . dashboard . StudyBrowserHeader ( ) ;
1001- this . __header . addListener ( "emptyTrashRequested" , ( ) => this . __emptyTrash ( ) , this ) ;
1002- this . _addToLayout ( header ) ;
1003- }
997+ const header = this . __header = new osparc . dashboard . StudyBrowserHeader ( ) ;
998+ this . __header . addListener ( "emptyTrashRequested" , ( ) => this . __emptyTrash ( ) , this ) ;
999+ this . _addToLayout ( header ) ;
10041000
10051001 this . _createResourcesLayout ( "studiesList" ) ;
10061002
@@ -1074,112 +1070,108 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
10741070 } ,
10751071
10761072 __connectContexts : function ( ) {
1077- if ( osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1078- const header = this . __header ;
1079- header . addListener ( "locationChanged" , ( ) => {
1080- const workspaceId = header . getCurrentWorkspaceId ( ) ;
1081- const folderId = header . getCurrentFolderId ( ) ;
1082- this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1083- } , this ) ;
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 ) ;
10841079
1085- const workspacesAndFoldersTree = this . _resourceFilter . getWorkspacesAndFoldersTree ( ) ;
1086- workspacesAndFoldersTree . addListener ( "locationChanged" , e => {
1087- const context = e . getData ( ) ;
1088- const workspaceId = context [ "workspaceId" ] ;
1089- if ( workspaceId === - 1 ) {
1090- this . _changeContext ( "workspaces" ) ;
1091- } else {
1092- const folderId = context [ "folderId" ] ;
1093- this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1094- }
1095- } , this ) ;
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 ) ;
10961091
1097- this . _resourceFilter . addListener ( "trashContext" , ( ) => {
1098- this . _changeContext ( "trash" ) ;
1099- } ) ;
1092+ this . _resourceFilter . addListener ( "trashContext" , ( ) => {
1093+ this . _changeContext ( "trash" ) ;
1094+ } ) ;
11001095
1101- this . _searchBarFilter . addListener ( "filterChanged" , e => {
1102- const filterData = e . getData ( ) ;
1103- if ( filterData . text ) {
1104- this . _changeContext ( "search" ) ;
1105- } else {
1106- const workspaceId = this . getCurrentWorkspaceId ( ) ;
1107- const folderId = this . getCurrentFolderId ( ) ;
1108- this . _changeContext ( "studiesAndFolders" , workspaceId , folderId ) ;
1109- }
1110- } ) ;
1111- }
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+ } ) ;
11121106 } ,
11131107
11141108 _changeContext : function ( context , workspaceId = null , folderId = null ) {
1115- if ( osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1116- if (
1117- context !== "search" && // reload studies for a new search
1118- context === this . getCurrentContext ( ) &&
1119- workspaceId === this . getCurrentWorkspaceId ( ) &&
1120- folderId === this . getCurrentFolderId ( )
1121- ) {
1122- // didn't really change
1123- return ;
1124- }
1125-
1126- osparc . store . Store . getInstance ( ) . setStudyBrowserContext ( context ) ;
1127- this . set ( {
1128- currentContext : context ,
1129- currentWorkspaceId : workspaceId ,
1130- currentFolderId : folderId ,
1131- } ) ;
1132- this . resetSelection ( ) ;
1133- this . setMultiSelection ( false ) ;
1109+ if (
1110+ context !== "search" && // reload studies for a new search
1111+ context === this . getCurrentContext ( ) &&
1112+ workspaceId === this . getCurrentWorkspaceId ( ) &&
1113+ folderId === this . getCurrentFolderId ( )
1114+ ) {
1115+ // didn't really change
1116+ return ;
1117+ }
11341118
1135- // reset lists
1136- this . __setWorkspacesToList ( [ ] ) ;
1137- this . __setFoldersToList ( [ ] ) ;
1138- this . _resourcesList = [ ] ;
1139- this . _resourcesContainer . setResourcesToList ( this . _resourcesList ) ;
1140- this . _resourcesContainer . reloadCards ( "studies" ) ;
1141-
1142- this . _toolbar . show ( ) ;
1143- switch ( this . getCurrentContext ( ) ) {
1144- case "studiesAndFolders" :
1145- this . _searchBarFilter . resetFilters ( ) ;
1146- this . __reloadFolders ( ) ;
1147- this . _loadingResourcesBtn . setFetching ( false ) ;
1148- this . invalidateStudies ( ) ;
1149- this . __reloadStudies ( ) ;
1150- break ;
1151- case "workspaces" :
1152- this . _toolbar . exclude ( ) ;
1153- this . _searchBarFilter . resetFilters ( ) ;
1154- this . __reloadWorkspaces ( ) ;
1155- break ;
1156- case "search" :
1157- this . __reloadWorkspaces ( ) ;
1158- this . __reloadFolders ( ) ;
1159- this . _loadingResourcesBtn . setFetching ( false ) ;
1160- this . invalidateStudies ( ) ;
1161- this . __reloadStudies ( ) ;
1162- break ;
1163- case "trash" :
1164- this . _searchBarFilter . resetFilters ( ) ;
1165- this . __reloadWorkspaces ( ) ;
1166- this . __reloadFolders ( ) ;
1167- this . _loadingResourcesBtn . setFetching ( false ) ;
1168- this . invalidateStudies ( ) ;
1169- this . __reloadStudies ( ) ;
1170- break ;
1171- }
1119+ osparc . store . Store . getInstance ( ) . setStudyBrowserContext ( context ) ;
1120+ this . set ( {
1121+ currentContext : context ,
1122+ currentWorkspaceId : workspaceId ,
1123+ currentFolderId : folderId ,
1124+ } ) ;
1125+ this . resetSelection ( ) ;
1126+ this . setMultiSelection ( false ) ;
11721127
1173- // notify header
1174- const header = this . __header ;
1175- header . set ( {
1176- currentWorkspaceId : workspaceId ,
1177- currentFolderId : folderId ,
1178- } ) ;
1128+ // reset lists
1129+ this . __setWorkspacesToList ( [ ] ) ;
1130+ this . __setFoldersToList ( [ ] ) ;
1131+ this . _resourcesList = [ ] ;
1132+ this . _resourcesContainer . setResourcesToList ( this . _resourcesList ) ;
1133+ this . _resourcesContainer . reloadCards ( "studies" ) ;
11791134
1180- // notify Filters on the left
1181- this . _resourceFilter . contextChanged ( context , workspaceId , folderId ) ;
1135+ this . _toolbar . show ( ) ;
1136+ switch ( this . getCurrentContext ( ) ) {
1137+ case "studiesAndFolders" :
1138+ this . _searchBarFilter . resetFilters ( ) ;
1139+ this . __reloadFolders ( ) ;
1140+ this . _loadingResourcesBtn . setFetching ( false ) ;
1141+ this . invalidateStudies ( ) ;
1142+ this . __reloadStudies ( ) ;
1143+ break ;
1144+ case "workspaces" :
1145+ this . _toolbar . exclude ( ) ;
1146+ this . _searchBarFilter . resetFilters ( ) ;
1147+ this . __reloadWorkspaces ( ) ;
1148+ break ;
1149+ case "search" :
1150+ this . __reloadWorkspaces ( ) ;
1151+ this . __reloadFolders ( ) ;
1152+ this . _loadingResourcesBtn . setFetching ( false ) ;
1153+ this . invalidateStudies ( ) ;
1154+ this . __reloadStudies ( ) ;
1155+ break ;
1156+ case "trash" :
1157+ this . _searchBarFilter . resetFilters ( ) ;
1158+ this . __reloadWorkspaces ( ) ;
1159+ this . __reloadFolders ( ) ;
1160+ this . _loadingResourcesBtn . setFetching ( false ) ;
1161+ this . invalidateStudies ( ) ;
1162+ this . __reloadStudies ( ) ;
1163+ break ;
11821164 }
1165+
1166+ // notify header
1167+ const header = this . __header ;
1168+ header . set ( {
1169+ currentWorkspaceId : workspaceId ,
1170+ currentFolderId : folderId ,
1171+ } ) ;
1172+
1173+ // notify Filters on the left
1174+ this . _resourceFilter . contextChanged ( context , workspaceId , folderId ) ;
11831175 } ,
11841176
11851177 __addSortByButton : function ( ) {
@@ -1565,13 +1557,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
15651557 menu . add ( billingsSettingsButton ) ;
15661558 }
15671559
1568- if ( writeAccess && osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ) {
1569- menu . addSeparator ( ) ;
1560+ menu . addSeparator ( ) ;
15701561
1571- const moveToButton = this . __getMoveStudyToMenuButton ( studyData ) ;
1572- if ( moveToButton ) {
1573- menu . add ( moveToButton ) ;
1574- }
1562+ const moveToButton = this . __getMoveStudyToMenuButton ( studyData ) ;
1563+ if ( moveToButton ) {
1564+ menu . add ( moveToButton ) ;
15751565 }
15761566
15771567 if ( deleteAccess ) {
0 commit comments