@@ -90,22 +90,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
90
90
}
91
91
} ,
92
92
93
- statics : {
94
- sortFoldersList : function ( foldersList , propKey ) {
95
- const sortByProperty = prop => {
96
- return function ( a , b ) {
97
- const upKey = qx . lang . String . firstUp ( prop ) ;
98
- const getter = "get" + upKey ;
99
- if ( getter in a && getter in b ) {
100
- return b [ getter ] ( ) - a [ getter ] ( ) ;
101
- }
102
- return 0 ;
103
- } ;
104
- } ;
105
- foldersList . sort ( sortByProperty ( propKey || "lastModified" ) ) ;
106
- }
107
- } ,
108
-
109
93
members : {
110
94
__dontShowTutorial : null ,
111
95
__header : null ,
@@ -421,11 +405,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
421
405
} ,
422
406
423
407
__addNewFolderButton : function ( ) {
408
+ if ( this . getCurrentContext ( ) !== "studiesAndFolders" ) {
409
+ return ;
410
+ }
424
411
const currentWorkspaceId = this . getCurrentWorkspaceId ( ) ;
425
412
if ( currentWorkspaceId ) {
426
- if ( this . getCurrentContext ( ) !== "studiesAndFolders" ) {
427
- return ;
428
- }
429
413
const currentWorkspace = osparc . store . Workspaces . getInstance ( ) . getWorkspace ( this . getCurrentWorkspaceId ( ) ) ;
430
414
if ( currentWorkspace && ! currentWorkspace . getMyAccessRights ( ) [ "write" ] ) {
431
415
// If user can't write in workspace, do not show plus button
@@ -1276,6 +1260,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
1276
1260
menu . add ( openButton ) ;
1277
1261
}
1278
1262
1263
+ if ( this . getCurrentContext ( ) === "search" ) {
1264
+ const renameStudyButton = this . __getOpenLocationMenuButton ( studyData ) ;
1265
+ menu . add ( renameStudyButton ) ;
1266
+ }
1267
+
1279
1268
if ( writeAccess ) {
1280
1269
const renameStudyButton = this . __getRenameStudyMenuButton ( studyData ) ;
1281
1270
menu . add ( renameStudyButton ) ;
@@ -1339,6 +1328,14 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
1339
1328
card . evaluateMenuButtons ( ) ;
1340
1329
} ,
1341
1330
1331
+ __getOpenLocationMenuButton : function ( studyData ) {
1332
+ const openLocationButton = new qx . ui . menu . Button ( this . tr ( "Open location" ) , "@FontAwesome5Solid/external-link-alt/12" ) ;
1333
+ openLocationButton . addListener ( "execute" , ( ) => {
1334
+ this . __changeContext ( "studiesAndFolders" , studyData [ "workspaceId" ] , studyData [ "folderId" ] ) ;
1335
+ } , this ) ;
1336
+ return openLocationButton ;
1337
+ } ,
1338
+
1342
1339
__getRenameStudyMenuButton : function ( studyData ) {
1343
1340
const renameButton = new qx . ui . menu . Button ( this . tr ( "Rename..." ) , "@FontAwesome5Solid/pencil-alt/12" ) ;
1344
1341
renameButton . addListener ( "execute" , ( ) => {
0 commit comments