Skip to content

Commit 4466eb4

Browse files
authored
Merge branch 'master' into bugfix/access-rights-templates
2 parents 2e7e4ba + 4ed5831 commit 4466eb4

File tree

10 files changed

+105
-32
lines changed

10 files changed

+105
-32
lines changed

.env-devel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ REDIS_HOST=redis
161161
REDIS_PORT=6379
162162
REDIS_PASSWORD=adminadmin
163163
REDIS_SECURE=false
164+
REDIS_USER=null
164165

165166
REGISTRY_AUTH=True
166167
REGISTRY_PW=adminadminadmin

services/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ services:
119119
REDIS_PASSWORD: ${REDIS_PASSWORD}
120120
REDIS_PORT: ${REDIS_PORT}
121121
REDIS_SECURE: ${REDIS_SECURE}
122+
REDIS_USER: ${REDIS_USER}
122123
REGISTRY_USER: ${REGISTRY_USER}
123124
REGISTRY_PW: ${REGISTRY_PW}
124125
REGISTRY_URL: ${REGISTRY_URL}
@@ -211,6 +212,7 @@ services:
211212
REDIS_HOST: ${REDIS_HOST}
212213
REDIS_PORT: ${REDIS_PORT}
213214
REDIS_SECURE: ${REDIS_SECURE}
215+
REDIS_USER: ${REDIS_USER}
214216
REDIS_PASSWORD: ${REDIS_PASSWORD}
215217
SWARM_STACK_NAME: ${SWARM_STACK_NAME}
216218
CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES: ${CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES}
@@ -341,6 +343,7 @@ services:
341343
REDIS_HOST: ${REDIS_HOST}
342344
REDIS_PORT: ${REDIS_PORT}
343345
REDIS_SECURE: ${REDIS_SECURE}
346+
REDIS_USER: ${REDIS_USER}
344347
REDIS_PASSWORD: ${REDIS_PASSWORD}
345348

346349
REGISTRY_AUTH: ${REGISTRY_AUTH}
@@ -492,6 +495,7 @@ services:
492495
REDIS_HOST: ${REDIS_HOST}
493496
REDIS_PORT: ${REDIS_PORT}
494497
REDIS_SECURE: ${REDIS_SECURE}
498+
REDIS_USER: ${REDIS_USER}
495499
REDIS_PASSWORD: ${REDIS_PASSWORD}
496500
RESOURCE_USAGE_TRACKER_LOGLEVEL: ${RESOURCE_USAGE_TRACKER_LOGLEVEL}
497501
RESOURCE_USAGE_TRACKER_MISSED_HEARTBEAT_CHECK_ENABLED: ${RESOURCE_USAGE_TRACKER_MISSED_HEARTBEAT_CHECK_ENABLED}
@@ -518,6 +522,7 @@ services:
518522
REDIS_HOST: ${REDIS_HOST}
519523
REDIS_PORT: ${REDIS_PORT}
520524
REDIS_SECURE: ${REDIS_SECURE}
525+
REDIS_USER: ${REDIS_USER}
521526
REDIS_PASSWORD: ${REDIS_PASSWORD}
522527
DIRECTOR_V2_HOST: ${DIRECTOR_V2_HOST}
523528
DIRECTOR_V2_PORT: ${DIRECTOR_V2_PORT}
@@ -681,6 +686,7 @@ services:
681686
REDIS_HOST: ${REDIS_HOST}
682687
REDIS_PORT: ${REDIS_PORT}
683688
REDIS_SECURE: ${REDIS_SECURE}
689+
REDIS_USER: ${REDIS_USER}
684690
REDIS_PASSWORD: ${REDIS_PASSWORD}
685691

686692
# WEBSERVER_REST
@@ -870,6 +876,7 @@ services:
870876
REDIS_HOST: ${REDIS_HOST}
871877
REDIS_PORT: ${REDIS_PORT}
872878
REDIS_SECURE: ${REDIS_SECURE}
879+
REDIS_USER: ${REDIS_USER}
873880
REDIS_PASSWORD: ${REDIS_PASSWORD}
874881

875882
RESOURCE_MANAGER_RESOURCE_TTL_S: ${RESOURCE_MANAGER_RESOURCE_TTL_S}
@@ -919,6 +926,7 @@ services:
919926
REDIS_HOST: ${REDIS_HOST}
920927
REDIS_PORT: ${REDIS_PORT}
921928
REDIS_SECURE: ${REDIS_SECURE}
929+
REDIS_USER: ${REDIS_USER}
922930
REDIS_PASSWORD: ${REDIS_PASSWORD}
923931

924932
SWARM_STACK_NAME: ${SWARM_STACK_NAME}
@@ -1059,6 +1067,7 @@ services:
10591067
REDIS_HOST: ${REDIS_HOST}
10601068
REDIS_PORT: ${REDIS_PORT}
10611069
REDIS_SECURE: ${REDIS_SECURE}
1070+
REDIS_USER: ${REDIS_USER}
10621071
REDIS_PASSWORD: ${REDIS_PASSWORD}
10631072
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
10641073
S3_BUCKET_NAME: ${S3_BUCKET_NAME}

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

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,49 +102,54 @@ qx.Class.define("osparc.dashboard.ContainerHeader", {
102102
return this.__createFolderButton(currentFolder);
103103
},
104104

105-
__createRootButton: function(workspaceId) {
105+
__changeContext: function(workspaceId, folderId) {
106+
this.set({
107+
currentWorkspaceId: workspaceId,
108+
currentFolderId: folderId,
109+
});
110+
this.fireDataEvent("changeContext", {
111+
workspaceId,
112+
folderId,
113+
});
114+
},
115+
116+
__createRootButton: function() {
117+
const workspaceId = this.getCurrentWorkspaceId();
106118
let rootButton = null;
107119
if (workspaceId) {
108120
if (workspaceId === -1) {
109121
rootButton = new qx.ui.form.Button(this.tr("Shared Workspaces"), osparc.store.Workspaces.iconPath());
110122
} else {
111123
const workspace = osparc.store.Workspaces.getInstance().getWorkspace(workspaceId);
112-
rootButton = new qx.ui.form.Button(workspace.getName(), osparc.store.Workspaces.iconPath());
124+
rootButton = new qx.ui.form.Button(workspace.getName(), osparc.store.Workspaces.iconPath()).set({
125+
maxWidth: 200
126+
});
127+
workspace.bind("name", rootButton, "label");
113128
}
114129
} else {
115130
rootButton = new qx.ui.form.Button(this.tr("My Workspace"), "@FontAwesome5Solid/home/14");
116131
}
117132
rootButton.addListener("execute", () => {
118133
const folderId = null;
119-
this.set({
120-
currentFolderId: null,
121-
});
122-
this.fireDataEvent("changeContext", {
123-
workspaceId,
124-
folderId,
125-
});
134+
this.__changeContext(workspaceId, folderId);
126135
});
127136
return rootButton;
128137
},
129138

130139
__createFolderButton: function(folder) {
131140
let folderButton = null;
132141
if (folder) {
133-
folderButton = new qx.ui.form.Button(folder.getName(), "@FontAwesome5Solid/folder/14");
142+
folderButton = new qx.ui.form.Button(folder.getName(), "@FontAwesome5Solid/folder/14").set({
143+
maxWidth: 200
144+
});
145+
folder.bind("name", folderButton, "label");
134146
folderButton.addListener("execute", () => {
135147
const workspaceId = this.getCurrentWorkspaceId();
136148
const folderId = folder ? folder.getFolderId() : null;
137-
this.set({
138-
currentFolderId: folderId,
139-
});
140-
this.fireDataEvent("changeContext", {
141-
workspaceId,
142-
folderId,
143-
});
149+
this.__changeContext(workspaceId, folderId);
144150
}, this);
145151
} else {
146-
const workspaceId = this.getCurrentWorkspaceId();
147-
folderButton = this.__createRootButton(workspaceId);
152+
folderButton = this.__createRootButton();
148153
}
149154
folderButton.set({
150155
backgroundColor: "transparent",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ qx.Class.define("osparc.dashboard.FolderButtonBase", {
8383
row: 0,
8484
rowSpan: 2
8585
}
86-
}
86+
},
8787
},
8888

8989
members: { // eslint-disable-line qx-rules/no-refs-in-members

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
105105
control = new qx.ui.basic.Label().set({
106106
anonymous: true,
107107
font: "text-14",
108-
rich: true,
109108
});
110109
this._add(control, osparc.dashboard.FolderButtonBase.POS.TITLE);
111110
break;
@@ -169,6 +168,8 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
169168
__applyTitle: function(value) {
170169
const label = this.getChildControl("title");
171170
label.setValue(value);
171+
172+
this.setToolTipText(value);
172173
},
173174

174175
__applyLastModified: function(value) {

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,32 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
251251
resourcesContainer.addListener("publishTemplate", e => this.fireDataEvent("publishTemplate", e.getData()));
252252
resourcesContainer.addListener("tagClicked", e => this._searchBarFilter.addTagActiveFilter(e.getData()));
253253
resourcesContainer.addListener("emptyStudyClicked", e => this._deleteResourceRequested(e.getData()));
254-
resourcesContainer.addListener("folderSelected", e => this._folderSelected(e.getData()));
255254
resourcesContainer.addListener("folderUpdated", e => this._folderUpdated(e.getData()));
256255
resourcesContainer.addListener("moveFolderToFolderRequested", e => this._moveFolderToFolderRequested(e.getData()));
257256
resourcesContainer.addListener("moveFolderToWorkspaceRequested", e => this._moveFolderToWorkspaceRequested(e.getData()));
258257
resourcesContainer.addListener("deleteFolderRequested", e => this._deleteFolderRequested(e.getData()));
258+
resourcesContainer.addListener("folderSelected", e => {
259+
const folderId = e.getData();
260+
this._folderSelected(folderId);
261+
this._resourceFilter.folderSelected(folderId);
262+
}, this);
259263
resourcesContainer.addListener("workspaceSelected", e => {
260264
const workspaceId = e.getData();
261265
this._workspaceSelected(workspaceId);
262266
this._resourceFilter.workspaceSelected(workspaceId);
263-
});
267+
}, this);
264268
resourcesContainer.addListener("workspaceUpdated", e => this._workspaceUpdated(e.getData()));
265269
resourcesContainer.addListener("deleteWorkspaceRequested", e => this._deleteWorkspaceRequested(e.getData()));
270+
271+
const containerHeader = this._resourcesContainer.getContainerHeader();
272+
containerHeader.addListener("changeContext", e => {
273+
const {
274+
workspaceId,
275+
folderId,
276+
} = e.getData();
277+
this._resourceFilter.contextChanged(workspaceId, folderId);
278+
}, this);
279+
266280
this._addToLayout(resourcesContainer);
267281
},
268282

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

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
6262
}
6363
},
6464

65+
66+
/* WORKSPACES AND FOLDERS */
6567
__createWorkspacesAndFoldersTree: function() {
6668
const workspacesAndFoldersTree = this.__workspacesAndFoldersTree = new osparc.dashboard.WorkspacesAndFoldersTree();
6769
// Height needs to be calculated manually to make it flexible
@@ -82,6 +84,32 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
8284
return this.__workspacesAndFoldersTree;
8385
},
8486

87+
contextChanged: function(workspaceId, folderId) {
88+
this.__workspacesAndFoldersTree.set({
89+
currentWorkspaceId: workspaceId,
90+
currentFolderId: folderId,
91+
});
92+
this.__workspacesAndFoldersTree.contextChanged();
93+
},
94+
95+
workspaceSelected: function(workspaceId) {
96+
this.__workspacesAndFoldersTree.set({
97+
currentWorkspaceId: workspaceId,
98+
currentFolderId: null,
99+
});
100+
this.__workspacesAndFoldersTree.contextChanged();
101+
},
102+
103+
folderSelected: function(folderId) {
104+
const workspaceId = this.__workspacesAndFoldersTree.getCurrentWorkspaceId();
105+
this.__workspacesAndFoldersTree.set({
106+
currentWorkspaceId: workspaceId,
107+
currentFolderId: folderId,
108+
});
109+
this.__workspacesAndFoldersTree.contextChanged();
110+
},
111+
/* /WORKSPACES AND FOLDERS */
112+
85113
/* SHARED WITH */
86114
__createSharedWithFilterLayout: function() {
87115
const sharedWithLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(5));
@@ -137,12 +165,6 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
137165
},
138166
/* /SHARED WITH */
139167

140-
/* WORKSPACES */
141-
workspaceSelected: function(workspaceId) {
142-
// OM: select folder
143-
},
144-
/* /WORKSPACES */
145-
146168
/* TAGS */
147169
__createTagsFilterLayout: function() {
148170
const layout = new qx.ui.container.Composite(new qx.ui.layout.VBox(5));

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -882,15 +882,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
882882

883883
const containerHeader = this._resourcesContainer.getContainerHeader();
884884
if (containerHeader) {
885-
this.bind("currentWorkspaceId", containerHeader, "currentWorkspaceId", {
886-
onUpdate: () => containerHeader.setCurrentFolderId(null)
887-
});
885+
this.bind("currentWorkspaceId", containerHeader, "currentWorkspaceId");
888886
this.bind("currentFolderId", containerHeader, "currentFolderId");
889887
containerHeader.addListener("changeContext", e => {
890888
const {
891889
workspaceId,
892890
folderId,
893891
} = e.getData();
892+
this.set({
893+
currentWorkspaceId: workspaceId,
894+
currentFolderId: folderId,
895+
})
894896
this._changeContext(workspaceId, folderId);
895897
});
896898
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTree", {
4646

4747
this.__initTree();
4848

49+
// preselect "My Workspace"
50+
this.contextChanged(null, null);
51+
4952
osparc.store.Folders.getInstance().addListener("folderAdded", e => {
5053
const folder = e.getData();
5154
this.__folderAdded(folder);
@@ -249,5 +252,17 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTree", {
249252
}
250253
}
251254
},
255+
256+
contextChanged: function() {
257+
const workspaceId = this.getCurrentWorkspaceId();
258+
const folderId = this.getCurrentFolderId();
259+
260+
const contextModel = this.__getModel(workspaceId, folderId);
261+
if (contextModel) {
262+
const selection = this.getSelection();
263+
selection.removeAll();
264+
selection.push(contextModel);
265+
}
266+
},
252267
}
253268
});

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTreeItem", {
2929
"border-radius": "8px"
3030
});
3131

32+
this.set({
33+
maxWidth: 200 - 10
34+
});
35+
3236
this.setNotHoveredStyle();
3337
this.__attachEventHandlers();
3438
},

0 commit comments

Comments
 (0)