Skip to content

Commit b0c62b3

Browse files
authored
Merge branch 'master' into feature/trash-bin
2 parents 7e4d4e6 + d904673 commit b0c62b3

File tree

15 files changed

+107
-108
lines changed

15 files changed

+107
-108
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
197197
menu.addSeparator();
198198

199199
const deleteButton = new qx.ui.menu.Button(this.tr("Delete"), "@FontAwesome5Solid/trash/12");
200-
deleteButton.addListener("execute", () => this.__deleteStudyRequested(), this);
200+
deleteButton.addListener("execute", () => this.__deleteFolderRequested(), this);
201201
menu.add(deleteButton);
202202

203203
menuButton.setMenu(menu);
@@ -237,10 +237,10 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
237237
folderEditor.addListener("cancel", () => win.close());
238238
},
239239

240-
__deleteStudyRequested: function() {
240+
__deleteFolderRequested: function() {
241241
const msg = this.tr("Are you sure you want to delete") + " <b>" + this.getTitle() + "</b>?";
242242
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
243-
caption: this.tr("Delete"),
243+
caption: this.tr("Delete Folder"),
244244
confirmText: this.tr("Delete"),
245245
confirmAction: "delete"
246246
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,10 +1904,10 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
19041904

19051905
__createConfirmDeleteWindow: function(studyNames) {
19061906
let msg = this.tr("Are you sure you want to delete");
1907-
const studiesText = osparc.product.Utils.getStudyAlias({plural: true});
1908-
msg += (studyNames.length > 1 ? ` ${studyNames.length} ${studiesText}?` : ` <b>${studyNames[0]}</b>?`);
1907+
const studyAlias = osparc.product.Utils.getStudyAlias({plural: studyNames.length > 1});
1908+
msg += (studyNames.length > 1 ? ` ${studyNames.length} ${studyAlias}?` : ` <b>${studyNames[0]}</b>?`);
19091909
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
1910-
caption: this.tr("Delete"),
1910+
caption: this.tr("Delete") + " " + studyAlias,
19111911
confirmText: this.tr("Delete"),
19121912
confirmAction: "delete"
19131913
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
193193
});
194194
updateAllButton.exclude();
195195
updateAllButton.addListener("tap", () => {
196-
const templatesText = osparc.product.Utils.getTemplateAlias({plural: true});
197-
const msg = this.tr("Are you sure you want to update all ") + templatesText + "?";
196+
const templatesAlias = osparc.product.Utils.getTemplateAlias({plural: true});
197+
const msg = this.tr("Are you sure you want to update all ") + templatesAlias + "?";
198198
const win = new osparc.ui.window.Confirmation(msg).set({
199-
caption: this.tr("Update"),
199+
caption: this.tr("Update") + " " + templatesAlias,
200200
confirmText: this.tr("Update all"),
201201
confirmAction: "create"
202202
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
250250
let msg = this.tr("Are you sure you want to delete") + " <b>" + this.getTitle() + "</b>?";
251251
msg += "<br>" + this.tr("All the content of the workspace will be deleted.");
252252
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
253-
caption: this.tr("Delete"),
253+
caption: this.tr("Delete Workspace"),
254254
confirmText: this.tr("Delete"),
255255
confirmAction: "delete"
256256
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ qx.Class.define("osparc.dashboard.WorkspacesAndFoldersTreeItem", {
2525
indent: 12, // defaults to 19,
2626
decorator: "rounded",
2727
padding: 2,
28-
maxWidth: osparc.dashboard.ResourceBrowserBase.SIDE_SPACER_WIDTH - 12
28+
maxWidth: osparc.dashboard.ResourceBrowserBase.SIDE_SPACER_WIDTH - 12,
2929
});
3030

3131
this.setNotHoveredStyle();

services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
11191119
if (!avoidConfirmation && preferencesSettings.getConfirmDeleteNode()) {
11201120
const msg = this.tr("Are you sure you want to delete the selected node?");
11211121
const win = new osparc.ui.window.Confirmation(msg).set({
1122-
caption: this.tr("Delete"),
1122+
caption: this.tr("Delete Node"),
11231123
confirmText: this.tr("Delete"),
11241124
confirmAction: "delete"
11251125
});
@@ -1141,7 +1141,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
11411141
if (preferencesSettings.getConfirmDeleteNode()) {
11421142
const msg = this.tr("Are you sure you want to delete the selected ") + nodeIds.length + " nodes?";
11431143
const win = new osparc.ui.window.Confirmation(msg).set({
1144-
caption: this.tr("Delete"),
1144+
caption: this.tr("Delete Nodes"),
11451145
confirmText: this.tr("Delete"),
11461146
confirmAction: "delete"
11471147
});

services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
322322
};
323323
osparc.data.Resources.fetch("organizationMembers", "post", params)
324324
.then(() => {
325-
const text = orgMemberEmail + this.tr(" successfully added.");
325+
const text = orgMemberEmail + this.tr(" successfully added");
326326
if (productEveryone && productEveryone["gid"] === parseInt(orgId)) {
327327
// demote the new member to user
328328
const params2 = {
@@ -379,12 +379,12 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
379379
};
380380
osparc.data.Resources.fetch("organizationMembers", "patch", params)
381381
.then(() => {
382-
osparc.FlashMessenger.getInstance().logAs(orgMember["name"] + this.tr(` successfully promoted to ${osparc.data.Roles.ORG[1].label}`));
382+
osparc.FlashMessenger.getInstance().logAs(this.tr(`Successfully promoted to ${osparc.data.Roles.ORG[1].label}`));
383383
osparc.store.Store.getInstance().reset("organizationMembers");
384384
this.__reloadOrgMembers();
385385
})
386386
.catch(err => {
387-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong promoting ") + orgMember["name"], "ERROR");
387+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong promoting to ") + osparc.data.Roles.ORG[1].label, "ERROR");
388388
console.error(err);
389389
});
390390
},
@@ -406,14 +406,14 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
406406
osparc.data.Resources.fetch("organizationMembers", "patch", params)
407407
.then(() => {
408408
if (msg === undefined) {
409-
msg = orgMember["name"] + this.tr(` successfully demoted to ${osparc.data.Roles.ORG[0].label}`);
409+
msg = this.tr(`Successfully demoted to ${osparc.data.Roles.ORG[0].label}`);
410410
}
411411
osparc.FlashMessenger.getInstance().logAs(msg);
412412
osparc.store.Store.getInstance().reset("organizationMembers");
413413
this.__reloadOrgMembers();
414414
})
415415
.catch(err => {
416-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong demoting ") + orgMember["name"], "ERROR");
416+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong demoting to ") + osparc.data.Roles.ORG[0].label, "ERROR");
417417
console.error(err);
418418
});
419419
},
@@ -434,12 +434,12 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
434434
};
435435
osparc.data.Resources.fetch("organizationMembers", "patch", params)
436436
.then(() => {
437-
osparc.FlashMessenger.getInstance().logAs(orgMember["name"] + this.tr(` successfully promoted to ${osparc.data.Roles.ORG[2].label}`));
437+
osparc.FlashMessenger.getInstance().logAs(this.tr(`Successfully promoted to ${osparc.data.Roles.ORG[2].label}`));
438438
osparc.store.Store.getInstance().reset("organizationMembers");
439439
this.__reloadOrgMembers();
440440
})
441441
.catch(err => {
442-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong promoting ") + orgMember["name"], "ERROR");
442+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong promoting to ") + osparc.data.Roles.ORG[2].label, "ERROR");
443443
console.error(err);
444444
});
445445
},
@@ -460,12 +460,12 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
460460
};
461461
osparc.data.Resources.fetch("organizationMembers", "patch", params)
462462
.then(() => {
463-
osparc.FlashMessenger.getInstance().logAs(orgMember["name"] + this.tr(` successfully promoted to ${osparc.data.Roles.ORG[3].label}`));
463+
osparc.FlashMessenger.getInstance().logAs(this.tr(`Successfully promoted to ${osparc.data.Roles.ORG[3].label}`));
464464
osparc.store.Store.getInstance().reset("organizationMembers");
465465
this.__reloadOrgMembers();
466466
})
467467
.catch(err => {
468-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong promoting ") + orgMember["name"], "ERROR");
468+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong promoting to ") + osparc.data.Roles.ORG[3].label, "ERROR");
469469
console.error(err);
470470
});
471471
},
@@ -486,12 +486,12 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
486486
};
487487
osparc.data.Resources.fetch("organizationMembers", "patch", params)
488488
.then(() => {
489-
osparc.FlashMessenger.getInstance().logAs(orgMember["name"] + this.tr(` successfully demoted to ${osparc.data.Roles.ORG[1].label}`));
489+
osparc.FlashMessenger.getInstance().logAs(this.tr(`Successfully demoted to ${osparc.data.Roles.ORG[1].label}`));
490490
osparc.store.Store.getInstance().reset("organizationMembers");
491491
this.__reloadOrgMembers();
492492
})
493493
.catch(err => {
494-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong demoting ") + orgMember["name"], "ERROR");
494+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong demoting to ") + osparc.data.Roles.ORG[1].label, "ERROR");
495495
console.error(err);
496496
});
497497
},
@@ -512,12 +512,12 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
512512
};
513513
osparc.data.Resources.fetch("organizationMembers", "patch", params)
514514
.then(() => {
515-
osparc.FlashMessenger.getInstance().logAs(orgMember["name"] + this.tr(` successfully demoted to ${osparc.data.Roles.ORG[3].label}`));
515+
osparc.FlashMessenger.getInstance().logAs(this.tr(`Successfully demoted to ${osparc.data.Roles.ORG[3].label}`));
516516
osparc.store.Store.getInstance().reset("organizationMembers");
517517
this.__reloadOrgMembers();
518518
})
519519
.catch(err => {
520-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong demoting ") + orgMember["name"], "ERROR");
520+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong demoting to ") + osparc.data.Roles.ORG[3].label, "ERROR");
521521
console.error(err);
522522
});
523523
},

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ClustersPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,12 @@ qx.Class.define("osparc.desktop.preferences.pages.ClustersPage", {
488488
};
489489
osparc.data.Resources.fetch("clusters", "patch", params)
490490
.then(() => {
491-
osparc.FlashMessenger.getInstance().logAs(this.tr("Member(s) added"));
491+
osparc.FlashMessenger.getInstance().logAs(this.tr("Cluster successfully shared"));
492492
osparc.store.Store.getInstance().reset("clusters");
493493
this.__reloadClusters(true);
494494
})
495495
.catch(err => {
496-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong with the invitation"), "ERROR");
496+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong sharing the Cluster"), "ERROR");
497497
console.error(err);
498498
});
499499
},

services/static-webserver/client/source/class/osparc/node/UpdateResourceLimitsView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ qx.Class.define("osparc.node.UpdateResourceLimitsView", {
9292
value = osparc.utils.Utils.bytesToGiB(value);
9393
}
9494
const spinner = new qx.ui.form.Spinner(0, value, 512).set({
95-
singleStep: 0.1
95+
singleStep: 1.0
9696
});
9797
const nf = new qx.util.format.NumberFormat();
9898
nf.setMinimumFractionDigits(2);

services/static-webserver/client/source/class/osparc/notification/NotificationUI.js

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ qx.Class.define("osparc.notification.NotificationUI", {
112112
return control || this.base(arguments, id);
113113
},
114114

115-
__applyNotification: async function(notification) {
116-
console.log("notification", notification);
115+
__applyNotification: function(notification) {
117116
let resourceId = null;
118117
if (notification.getResourceId()) {
119118
resourceId = notification.getResourceId();
@@ -124,90 +123,88 @@ qx.Class.define("osparc.notification.NotificationUI", {
124123
}
125124
const userFromId = notification.getUserFromId();
126125

127-
let source = "";
128-
let title = "";
129-
let description = "";
126+
const icon = this.getChildControl("icon");
127+
const titleLabel = this.getChildControl("title");
128+
titleLabel.setValue(notification.getTitle());
129+
const descriptionLabel = this.getChildControl("text");
130+
descriptionLabel.setValue(notification.getText());
131+
130132
switch (notification.getCategory()) {
131133
case "NEW_ORGANIZATION":
132-
source = "@FontAwesome5Solid/users/14";
134+
icon.setSource("@FontAwesome5Solid/users/14");
133135
if (resourceId) {
134-
const group = await osparc.store.Store.getInstance().getGroup(resourceId);
135-
description = "You're now member of '" + group["name"] + "'";
136+
osparc.store.Store.getInstance().getGroup(resourceId)
137+
.then(group => descriptionLabel.setValue("You're now member of '" + group["label"] + "'"))
138+
.catch(() => this.setEnabled(false));
136139
}
137140
break;
138141
case "STUDY_SHARED":
139-
source = "@FontAwesome5Solid/file/14";
142+
icon.setSource("@FontAwesome5Solid/file/14");
140143
if (resourceId) {
141144
const params = {
142145
url: {
143146
"studyId": resourceId
144147
}
145148
};
146-
const study = await osparc.data.Resources.getOne("studies", params);
147-
const studyAlias = osparc.product.Utils.getStudyAlias({
148-
firstUpperCase: true
149-
});
150-
if (study) {
151-
title = `${studyAlias} '${study["name"]}'`;
152-
}
149+
osparc.data.Resources.getOne("studies", params)
150+
.then(study => {
151+
const studyAlias = osparc.product.Utils.getStudyAlias({
152+
firstUpperCase: true
153+
});
154+
titleLabel.setValue(`${studyAlias} '${study["name"]}'`);
155+
})
156+
.catch(() => this.setEnabled(false));
153157
}
154158
if (userFromId) {
155159
const user = osparc.store.Store.getInstance().getUser(userFromId);
156160
if (user) {
157-
description = "was shared by " + user["label"];
161+
descriptionLabel.setValue("was shared by " + user["label"]);
158162
}
159163
}
160164
break;
161165
case "TEMPLATE_SHARED":
162-
source = "@FontAwesome5Solid/copy/14";
166+
icon.setSource("@FontAwesome5Solid/copy/14");
163167
if (resourceId) {
164168
const template = osparc.store.Store.getInstance().getTemplate(resourceId);
165-
const templateAlias = osparc.product.Utils.getTemplateAlias({
166-
firstUpperCase: true
167-
});
168169
if (template) {
169-
title = `${templateAlias} '${template["name"]}'`;
170+
const templateAlias = osparc.product.Utils.getTemplateAlias({
171+
firstUpperCase: true
172+
});
173+
titleLabel.setValue(`${templateAlias} '${template["name"]}'`);
174+
} else {
175+
this.setEnabled(false);
170176
}
171177
}
172178
if (userFromId) {
173179
const user = osparc.store.Store.getInstance().getUser(userFromId);
174180
if (user) {
175-
description = "was shared by " + user["label"];
181+
descriptionLabel.setValue("was shared by " + user["label"]);
176182
}
177183
}
178184
break;
179185
case "ANNOTATION_NOTE":
180-
source = "@FontAwesome5Solid/file/14";
186+
icon.setSource("@FontAwesome5Solid/file/14");
181187
if (resourceId) {
182188
const params = {
183189
url: {
184190
"studyId": resourceId
185191
}
186192
};
187-
const study = await osparc.data.Resources.getOne("studies", params);
188-
if (study) {
189-
title = `Note added in '${study["name"]}'`;
190-
}
193+
osparc.data.Resources.getOne("studies", params)
194+
.then(study => titleLabel.setValue(`Note added in '${study["name"]}'`))
195+
.catch(() => this.setEnabled(false));
191196
}
192197
if (userFromId) {
193198
const user = osparc.store.Store.getInstance().getUser(userFromId);
194199
if (user) {
195-
description = "was added by " + user["label"];
200+
descriptionLabel.setValue("was added by " + user["label"]);
196201
}
197202
}
198203
break;
199204
case "WALLET_SHARED":
200-
source = "@MaterialIcons/account_balance_wallet/14";
205+
icon.setSource("@MaterialIcons/account_balance_wallet/14");
201206
break;
202207
}
203-
const icon = this.getChildControl("icon");
204-
icon.setSource(source);
205-
206-
const titleLabel = this.getChildControl("title");
207-
titleLabel.setValue(title ? title : notification.getTitle());
208-
209-
const descriptionLabel = this.getChildControl("text");
210-
descriptionLabel.setValue(description ? description : notification.getText());
211208

212209
const date = this.getChildControl("date");
213210
notification.bind("date", date, "value", {

0 commit comments

Comments
 (0)