Skip to content

Commit cd8d8f2

Browse files
committed
last fixes
1 parent c1e0513 commit cd8d8f2

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowserHeader.js

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
148148
break;
149149
case "share-layout":
150150
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({
151-
maringLeft: 10,
152-
alignY: "middle"
153-
}));
151+
alignY: "middle",
152+
})).set({
153+
marginLeft: 10,
154+
});
154155
this._addAt(control, this.self().POS.SHARE_LAYOUT);
155156
break;
156157
case "share-text": {
@@ -163,9 +164,10 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
163164
}
164165
case "role-layout":
165166
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(5).set({
166-
maringLeft: 10,
167-
alignY: "middle"
168-
}));
167+
alignY: "middle",
168+
})).set({
169+
marginLeft: 10,
170+
});
169171
this._addAt(control, this.self().POS.ROLE_LAYOUT);
170172
break;
171173
case "role-text": {
@@ -216,25 +218,45 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
216218
},
217219

218220
__buildLayout: function() {
219-
this._removeAll();
220-
221-
this.__spacers = [];
222-
223221
this.getChildControl("icon");
224222
const title = this.getChildControl("title");
223+
224+
const locationBreadcrumbs = this.getChildControl("breadcrumbs").set({
225+
visibility: "excluded"
226+
});
227+
const editWorkspace = this.getChildControl("edit-button").set({
228+
visibility: "excluded"
229+
});
230+
const shareWorkspaceLayout = this.getChildControl("share-layout").set({
231+
visibility: "excluded"
232+
});
233+
const roleWorkspaceLayout = this.getChildControl("role-layout").set({
234+
visibility: "excluded"
235+
});
236+
237+
const description = this.getChildControl("description").set({
238+
visibility: "excluded"
239+
});
240+
// the study browser will take care of making it visible
241+
this.getChildControl("empty-trash-button").set({
242+
visibility: "excluded"
243+
});
244+
225245
const currentContext = osparc.store.Store.getInstance().getStudyBrowserContext();
226246
switch (currentContext) {
227247
case "studiesAndFolders": {
228248
const workspaceId = this.getCurrentWorkspaceId();
229249
title.setCursor("pointer");
230250
title.addListener("tap", this.__titleTapped, this);
231-
this.getChildControl("breadcrumbs");
232-
this.getChildControl("edit-button").exclude();
251+
locationBreadcrumbs.show();
233252
const workspace = osparc.store.Workspaces.getInstance().getWorkspace(workspaceId);
234253
if (workspace) {
235254
const thumbnail = workspace.getThumbnail();
236255
this.__setIcon(thumbnail ? thumbnail : osparc.store.Workspaces.iconPath(32));
237256
workspace.bind("name", title, "value");
257+
editWorkspace.show();
258+
shareWorkspaceLayout.show();
259+
roleWorkspaceLayout.show();
238260
workspace.bind("accessRights", this, "accessRights");
239261
workspace.bind("myAccessRights", this, "myAccessRights");
240262
} else {
@@ -255,11 +277,10 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
255277
this.__setIcon("@FontAwesome5Solid/trash/20");
256278
title.setValue(this.tr("Trash"));
257279
const trashDays = osparc.store.StaticInfo.getInstance().getTrashRetentionDays();
258-
this.getChildControl("description").set({
259-
value: this.tr(`Items in the bin will be permanently deleted after ${trashDays} days.`)
280+
description.set({
281+
value: this.tr(`Items in the bin will be permanently deleted after ${trashDays} days.`),
282+
visibility: "visible",
260283
});
261-
// the study browser will take care of making it visible
262-
this.getChildControl("empty-trash-button").exclude();
263284
break;
264285
}
265286
}
@@ -323,7 +344,8 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
323344
const editButton = this.getChildControl("edit-button");
324345
const roleText = this.getChildControl("role-text");
325346
const roleIcon = this.getChildControl("role-icon");
326-
if (value && Object.keys(value).length) {
347+
const currentContext = osparc.store.Store.getInstance().getStudyBrowserContext();
348+
if (currentContext === "studiesAndFolders" && value && Object.keys(value).length) {
327349
editButton.setVisibility(value["delete"] ? "visible" : "excluded");
328350
const menu = new qx.ui.menu.Menu().set({
329351
position: "bottom-right"
@@ -355,6 +377,7 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
355377
win.close();
356378
this.__buildLayout();
357379
}, this);
380+
workspaceEditor.addListener("cancel", () => win.close());
358381
},
359382

360383
__openShareWith: function() {

0 commit comments

Comments
 (0)