Skip to content

Commit 2b6b0a9

Browse files
authored
🎨 [Frontend] Rephrase sharing messages (#6683)
1 parent 4abb9f2 commit 2b6b0a9

File tree

6 files changed

+53
-52
lines changed

6 files changed

+53
-52
lines changed

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/share/CollaboratorsService.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,13 @@ qx.Class.define("osparc.share.CollaboratorsService", {
9393
osparc.store.Services.patchServiceData(this._serializedDataCopy, "accessRights", newAccessRights)
9494
.then(() => {
9595
this.fireDataEvent("updateAccessRights", this._serializedDataCopy);
96-
let text = this.tr("Editor(s) successfully added.");
97-
text += "<br>";
98-
text += this.tr("The user will not get notified.");
96+
const text = this.tr("Service successfully shared");
9997
osparc.FlashMessenger.getInstance().logAs(text);
10098
this._reloadCollaboratorsList();
10199
})
102100
.catch(err => {
103101
console.error(err);
104-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong adding editor(s)"), "ERROR");
102+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong sharing the Service"), "ERROR");
105103
});
106104
},
107105

@@ -122,12 +120,12 @@ qx.Class.define("osparc.share.CollaboratorsService", {
122120
osparc.store.Services.patchServiceData(this._serializedDataCopy, "accessRights", this._serializedDataCopy["accessRights"])
123121
.then(() => {
124122
this.fireDataEvent("updateAccessRights", this._serializedDataCopy);
125-
osparc.FlashMessenger.getInstance().logAs(this.tr("Member successfully removed"));
123+
osparc.FlashMessenger.getInstance().logAs(collaborator["name"] + this.tr(" successfully removed"));
126124
this._reloadCollaboratorsList();
127125
})
128126
.catch(err => {
129127
console.error(err);
130-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong removing Member"), "ERROR");
128+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong removing ") + collaborator["name"], "ERROR");
131129
})
132130
.finally(() => {
133131
if (item) {
@@ -156,8 +154,8 @@ qx.Class.define("osparc.share.CollaboratorsService", {
156154
this.__make(
157155
collaborator["gid"],
158156
this.self().getOwnerAccessRight(),
159-
this.tr("Viewer successfully made Editor"),
160-
this.tr("Something went wrong making Viewer Editor"),
157+
this.tr(`Successfully promoted to ${osparc.data.Roles.SERVICE[2].label}`),
158+
this.tr(`Something went wrong promoting to ${osparc.data.Roles.SERVICE[2].label}`),
161159
item
162160
);
163161
},
@@ -170,8 +168,8 @@ qx.Class.define("osparc.share.CollaboratorsService", {
170168
this.__make(
171169
collaborator["gid"],
172170
this.self().getCollaboratorAccessRight(),
173-
this.tr("Editor successfully made Viewer"),
174-
this.tr("Something went wrong making Editor Viewer"),
171+
this.tr(`Successfully demoted to ${osparc.data.Roles.SERVICE[1].label}`),
172+
this.tr(`Something went wrong demoting ${osparc.data.Roles.SERVICE[1].label}`),
175173
item
176174
);
177175
},

services/static-webserver/client/source/class/osparc/share/CollaboratorsStudy.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,26 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
127127
return;
128128
}
129129

130+
const resourceAlias = this._resourceType === "template" ?
131+
osparc.product.Utils.getTemplateAlias({firstUpperCase: true}) :
132+
osparc.product.Utils.getStudyAlias({firstUpperCase: true});
130133
const newCollaborators = {};
131134
gids.forEach(gid => {
132135
newCollaborators[gid] = this._resourceType === "study" ? this.self().getCollaboratorAccessRight() : this.self().getViewerAccessRight();
133136
});
134137
osparc.info.StudyUtils.addCollaborators(this._serializedDataCopy, newCollaborators)
135138
.then(() => {
136-
this.fireDataEvent("updateAccessRights", this._serializedDataCopy);
137-
const text = this.tr("User(s) successfully added.");
139+
const text = resourceAlias + this.tr(" successfully shared");
138140
osparc.FlashMessenger.getInstance().logAs(text);
141+
this.fireDataEvent("updateAccessRights", this._serializedDataCopy);
139142
this._reloadCollaboratorsList();
140143

141144
this.__pushNotifications(gids);
142145
this.__checkShareePermissions(gids);
143146
})
144147
.catch(err => {
145148
console.error(err);
146-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went adding user(s)"), "ERROR");
149+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong sharing the ") + resourceAlias, "ERROR");
147150
});
148151
},
149152

@@ -155,12 +158,12 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
155158
return osparc.info.StudyUtils.removeCollaborator(this._serializedDataCopy, collaborator["gid"])
156159
.then(() => {
157160
this.fireDataEvent("updateAccessRights", this._serializedDataCopy);
158-
osparc.FlashMessenger.getInstance().logAs(this.tr("Member successfully removed"));
161+
osparc.FlashMessenger.getInstance().logAs(collaborator["name"] + this.tr(" successfully removed"));
159162
this._reloadCollaboratorsList();
160163
})
161164
.catch(err => {
162165
console.error(err);
163-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong removing Member"), "ERROR");
166+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong removing ") + collaborator["name"], "ERROR");
164167
})
165168
.finally(() => {
166169
if (item) {
@@ -193,8 +196,8 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
193196
this.__make(
194197
collaborator["gid"],
195198
this.self().getCollaboratorAccessRight(),
196-
this.tr(`${osparc.data.Roles.STUDY[1].label} successfully changed ${osparc.data.Roles.STUDY[2].label}`),
197-
this.tr(`Something went wrong changing ${osparc.data.Roles.STUDY[1].label} to ${osparc.data.Roles.STUDY[2].label}`),
199+
this.tr(`Successfully promoted to ${osparc.data.Roles.STUDY[2].label}`),
200+
this.tr(`Something went wrong promoting to ${osparc.data.Roles.STUDY[2].label}`),
198201
item
199202
);
200203
},
@@ -203,8 +206,8 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
203206
this.__make(
204207
collaborator["gid"],
205208
this.self().getOwnerAccessRight(),
206-
this.tr(`${osparc.data.Roles.STUDY[2].label} successfully changed to ${osparc.data.Roles.STUDY[3].label}`),
207-
this.tr(`Something went wrong changing ${osparc.data.Roles.STUDY[2].label} to ${osparc.data.Roles.STUDY[3].label}`),
209+
this.tr(`Successfully promoted to ${osparc.data.Roles.STUDY[3].label}`),
210+
this.tr(`Something went wrong promoting to ${osparc.data.Roles.STUDY[3].label}`),
208211
item
209212
);
210213
},
@@ -215,8 +218,8 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
215218
this.__make(
216219
gid,
217220
this.self().getViewerAccessRight(),
218-
this.tr(`${osparc.data.Roles.STUDY[2].label} successfully changed to ${osparc.data.Roles.STUDY[1].label}`),
219-
this.tr(`Something went wrong changing ${osparc.data.Roles.STUDY[2].label} to ${osparc.data.Roles.STUDY[1].label}`),
221+
this.tr(`Successfully demoted to ${osparc.data.Roles.STUDY[1].label}`),
222+
this.tr(`Something went wrong demoting to ${osparc.data.Roles.STUDY[1].label}`),
220223
itm
221224
);
222225
};
@@ -246,8 +249,8 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
246249
this.__make(
247250
collaborator["gid"],
248251
this.self().getCollaboratorAccessRight(),
249-
this.tr(`${osparc.data.Roles.STUDY[3].label} successfully changed to ${osparc.data.Roles.STUDY[2].label}`),
250-
this.tr(`Something went wrong changing ${osparc.data.Roles.STUDY[3].label} to ${osparc.data.Roles.STUDY[2].label}`),
252+
this.tr(`Successfully demoted to ${osparc.data.Roles.STUDY[2].label}`),
253+
this.tr(`Something went wrong demoting to ${osparc.data.Roles.STUDY[2].label}`),
251254
item
252255
);
253256
},

services/static-webserver/client/source/class/osparc/share/CollaboratorsWorkspace.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ qx.Class.define("osparc.share.CollaboratorsWorkspace", {
7272
gids.forEach(gid => newCollaborators[gid] = this.self().getCollaboratorAccessRight());
7373
osparc.store.Workspaces.getInstance().addCollaborators(this.__workspace.getWorkspaceId(), newCollaborators)
7474
.then(() => {
75-
this.fireDataEvent("updateAccessRights", this.__workspace.serialize());
76-
const text = this.tr("User(s) successfully added.");
75+
const text = this.tr("Workspace successfully shared");
7776
osparc.FlashMessenger.getInstance().logAs(text);
77+
this.fireDataEvent("updateAccessRights", this.__workspace.serialize());
7878
this._reloadCollaboratorsList();
7979
})
8080
.catch(err => {
8181
console.error(err);
82-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went adding user(s)"), "ERROR");
82+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong sharing the Workspace"), "ERROR");
8383
});
8484
},
8585

@@ -91,12 +91,12 @@ qx.Class.define("osparc.share.CollaboratorsWorkspace", {
9191
osparc.store.Workspaces.getInstance().removeCollaborator(this.__workspace.getWorkspaceId(), collaborator["gid"])
9292
.then(() => {
9393
this.fireDataEvent("updateAccessRights", this.__workspace.serialize());
94-
osparc.FlashMessenger.getInstance().logAs(this.tr("Member successfully removed"));
94+
osparc.FlashMessenger.getInstance().logAs(collaborator["name"] + this.tr(" successfully removed"));
9595
this._reloadCollaboratorsList();
9696
})
9797
.catch(err => {
9898
console.error(err);
99-
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong removing Member"), "ERROR");
99+
osparc.FlashMessenger.getInstance().logAs(this.tr("Something went wrong removing ") + collaborator["name"], "ERROR");
100100
})
101101
.finally(() => {
102102
if (item) {
@@ -129,8 +129,8 @@ qx.Class.define("osparc.share.CollaboratorsWorkspace", {
129129
this.__make(
130130
collaborator["gid"],
131131
this.self().getCollaboratorAccessRight(),
132-
this.tr(`${osparc.data.Roles.WORKSPACE[1].label} successfully changed ${osparc.data.Roles.WORKSPACE[2].label}`),
133-
this.tr(`Something went wrong changing ${osparc.data.Roles.WORKSPACE[1].label} to ${osparc.data.Roles.WORKSPACE[2].label}`),
132+
this.tr(`Successfully promoted to ${osparc.data.Roles.WORKSPACE[2].label}`),
133+
this.tr(`Something went wrong promoting to ${osparc.data.Roles.WORKSPACE[2].label}`),
134134
item
135135
);
136136
},
@@ -139,8 +139,8 @@ qx.Class.define("osparc.share.CollaboratorsWorkspace", {
139139
this.__make(
140140
collaborator["gid"],
141141
this.self().getOwnerAccessRight(),
142-
this.tr(`${osparc.data.Roles.WORKSPACE[2].label} successfully changed to ${osparc.data.Roles.WORKSPACE[3].label}`),
143-
this.tr(`Something went wrong changing ${osparc.data.Roles.WORKSPACE[2].label} to ${osparc.data.Roles.WORKSPACE[3].label}`),
142+
this.tr(`Successfully promoted to ${osparc.data.Roles.WORKSPACE[3].label}`),
143+
this.tr(`Something went wrong promoting to ${osparc.data.Roles.WORKSPACE[3].label}`),
144144
item
145145
);
146146
},
@@ -151,8 +151,8 @@ qx.Class.define("osparc.share.CollaboratorsWorkspace", {
151151
this.__make(
152152
gid,
153153
this.self().getViewerAccessRight(),
154-
this.tr(`${osparc.data.Roles.WORKSPACE[2].label} successfully changed to ${osparc.data.Roles.WORKSPACE[1].label}`),
155-
this.tr(`Something went wrong changing ${osparc.data.Roles.WORKSPACE[2].label} to ${osparc.data.Roles.WORKSPACE[1].label}`),
154+
this.tr(`Successfully demoted to ${osparc.data.Roles.WORKSPACE[1].label}`),
155+
this.tr(`Something went wrong demoting to ${osparc.data.Roles.WORKSPACE[1].label}`),
156156
itm
157157
);
158158
};
@@ -182,8 +182,8 @@ qx.Class.define("osparc.share.CollaboratorsWorkspace", {
182182
this.__make(
183183
collaborator["gid"],
184184
this.self().getCollaboratorAccessRight(),
185-
this.tr(`${osparc.data.Roles.WORKSPACE[3].label} successfully changed to ${osparc.data.Roles.WORKSPACE[2].label}`),
186-
this.tr(`Something went wrong changing ${osparc.data.Roles.WORKSPACE[3].label} to ${osparc.data.Roles.WORKSPACE[2].label}`),
185+
this.tr(`Successfully demoted to ${osparc.data.Roles.WORKSPACE[2].label}`),
186+
this.tr(`Something went wrong demoting to ${osparc.data.Roles.WORKSPACE[2].label}`),
187187
item
188188
);
189189
}

0 commit comments

Comments
 (0)