Skip to content

Commit 135be29

Browse files
authored
🎨 [Frontend] Restore standalone view (#7242)
1 parent bc3acc1 commit 135be29

File tree

15 files changed

+77
-31
lines changed

15 files changed

+77
-31
lines changed

services/static-webserver/client/source/class/osparc/NewRelease.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ qx.Class.define("osparc.NewRelease", {
7070
});
7171
this._add(introLabel);
7272

73-
const rData = osparc.store.StaticInfo.getInstance().getReleaseData();
74-
const url = rData["url"] || osparc.utils.LibVersions.getVcsRefUrl();
73+
const releaseTag = osparc.utils.Utils.getReleaseTag();
74+
const releaseLink = osparc.utils.Utils.getReleaseLink();
7575
const linkLabel = new osparc.ui.basic.LinkLabel().set({
76-
value: this.tr("What's new"),
77-
url,
76+
value: this.tr("What's new in ") + releaseTag,
77+
url: releaseLink,
7878
font: "link-label-14"
7979
});
8080
this._add(linkLabel);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
384384
const button = new qx.ui.form.ToggleButton(null, "@FontAwesome5Solid/tag/16");
385385
button.id = tag.getTagId();
386386
tag.bind("name", button, "label");
387+
tag.bind("name", button, "toolTipText");
387388
tag.bind("color", button.getChildControl("icon"), "textColor");
388389
osparc.utils.Utils.setIdToWidget(button, this.__resourceType + "-tagFilterItem");
389390
button.set({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,9 +2203,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
22032203
let msg = this.tr("Are you sure you want to delete");
22042204
if (studyNames.length > 1) {
22052205
const studiesText = osparc.product.Utils.getStudyAlias({plural: true});
2206-
msg += ` ${studyNames.length} ${studiesText} `
2206+
msg += ` ${studyNames.length} ${studiesText}?`;
22072207
} else {
2208-
msg += ` '${studyNames[0]}' `;
2208+
msg += ` '${studyNames[0]}'?`;
22092209
}
22102210
const trashDays = osparc.store.StaticInfo.getInstance().getTrashRetentionDays();
22112211
msg += "<br><br>" + (studyNames.length > 1 ? "They" : "It") + this.tr(` will be permanently deleted after ${trashDays} days.`);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ qx.Class.define("osparc.desktop.MainPage", {
5656
// Some resources request before building the main stack
5757
osparc.MaintenanceTracker.getInstance().startTracker();
5858
osparc.CookieExpirationTracker.getInstance().startTracker();
59-
osparc.NewUITracker.getInstance().startTracker();
59+
// osparc.NewUITracker.getInstance().startTracker();
6060

6161
const store = osparc.store.Store.getInstance();
6262
const preloadPromises = [];

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
719719
if (oldUIMode === "standalone") {
720720
// in this transition, show workbenchUI
721721
this.__workbenchView.setMaximized(false);
722-
this.__workbenchView.showPipeline();
722+
// uncomment this when we release the osparc<->s4l integration
723+
// this.__workbenchView.showPipeline();
723724
} else {
724725
const currentNodeId = this.getStudy().getUi().getCurrentNodeId();
725726
if (currentNodeId && this.getStudy().getWorkbench().getNode(currentNodeId)) {

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,18 @@ qx.Class.define("osparc.desktop.credits.BuyCreditsInput", {
5757
paddingRight: 0
5858
});
5959
this.__totalInput = totalInput;
60-
amountInput.addListener("changeValue", e => {
61-
const value = e.getData();
60+
const amountChanged = value => {
6261
totalInput.setValue(value ? 1 * (value * this.__pricePerCredit).toFixed(2) + this.__currencySymbol : "-");
6362
this.fireDataEvent("input", this.getValues());
64-
});
63+
}
64+
amountInput.getChildControl("textfield").addListener("input", e => amountChanged(e.getData()));
65+
amountInput.addListener("changeValue", e => amountChanged(e.getData()));
6566
this._add(totalContainer);
6667

6768
osparc.store.Store.getInstance().getMinimumAmount()
6869
.then(minimum => {
6970
amountInput.set({
70-
maximum: 10000,
71+
maximum: 100000,
7172
minimum: Math.ceil(minimum/this.__pricePerCredit),
7273
value: Math.ceil(minimum/this.__pricePerCredit)
7374
});
@@ -81,7 +82,7 @@ qx.Class.define("osparc.desktop.credits.BuyCreditsInput", {
8182
const input = new qx.ui.form.TextField().set({
8283
appearance: "appmotion-buy-credits-input",
8384
textAlign: "center",
84-
width: 90,
85+
width: 100,
8586
...inputProps
8687
});
8788
const label = new qx.ui.basic.Label(labelText);
@@ -96,7 +97,7 @@ qx.Class.define("osparc.desktop.credits.BuyCreditsInput", {
9697
}));
9798
const input = new qx.ui.form.Spinner().set({
9899
appearance: "appmotion-buy-credits-spinner",
99-
width: 100,
100+
width: 110,
100101
...inputProps
101102
});
102103
input.getChildControl("textfield").set({

services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,15 @@ qx.Class.define("osparc.navigation.NavigationBar", {
304304

305305
osparc.utils.Utils.setIdToWidget(menu, "helpNavigationMenu");
306306

307-
// menus
307+
// quick starts and manuals
308308
osparc.store.Support.addQuickStartToMenu(menu);
309309
osparc.store.Support.addGuidedToursToMenu(menu);
310310
osparc.store.Support.addManualButtonsToMenu(menu, menuButton);
311311
menu.addSeparator();
312312

313313
// feedback
314314
osparc.store.Support.addSupportButtonsToMenu(menu, menuButton);
315+
osparc.store.Support.addReleaseNotesToMenu(menu);
315316

316317
osparc.utils.Utils.prettifyMenu(menu);
317318

services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
9393
this.getStudy().getUi().setMode("standalone");
9494
});
9595
break;
96+
case "study-menu-restore":
97+
control = new qx.ui.menu.Button().set({
98+
label: this.tr("Restore"),
99+
icon: osparc.theme.common.Image.URLS["window-restore"] + "/20",
100+
});
101+
control.addListener("execute", () => {
102+
this.getStudy().getUi().setMode("workbench");
103+
});
104+
break;
96105
case "study-menu-open-logger":
97106
control = new qx.ui.menu.Button().set({
98107
label: this.tr("Platform Logs..."),
@@ -107,6 +116,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
107116
optionsMenu.add(this.getChildControl("study-menu-reload"));
108117
optionsMenu.add(this.getChildControl("study-menu-convert-to-pipeline"));
109118
optionsMenu.add(this.getChildControl("study-menu-convert-to-standalone"));
119+
optionsMenu.add(this.getChildControl("study-menu-restore"));
110120
optionsMenu.add(this.getChildControl("study-menu-open-logger"));
111121
control = new qx.ui.form.MenuButton().set({
112122
appearance: "fab-button",
@@ -168,6 +178,16 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
168178
convertToPipelineButton.exclude();
169179
convertToStandaloneButton.exclude();
170180
}
181+
182+
const restoreButton = this.getChildControl("study-menu-restore");
183+
study.getUi().bind("mode", restoreButton, "visibility", {
184+
converter: mode => mode === "standalone" ? "visible" : "excluded"
185+
});
186+
187+
const loggerButton = this.getChildControl("study-menu-open-logger");
188+
study.getUi().bind("mode", loggerButton, "visibility", {
189+
converter: mode => mode === "standalone" ? "visible" : "excluded"
190+
});
171191
} else {
172192
this.exclude();
173193
}

services/static-webserver/client/source/class/osparc/navigation/UserMenu.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,15 @@ qx.Class.define("osparc.navigation.UserMenu", {
214214
}
215215
this.addSeparator();
216216

217-
// quick starts
217+
// quick starts and manuals
218218
osparc.store.Support.addQuickStartToMenu(this);
219219
osparc.store.Support.addGuidedToursToMenu(this);
220-
221-
// manuals
222220
osparc.store.Support.addManualButtonsToMenu(this);
223221
this.addSeparator();
224222

225223
// feedbacks
226224
osparc.store.Support.addSupportButtonsToMenu(this);
225+
osparc.store.Support.addReleaseNotesToMenu(this);
227226
this.addSeparator();
228227

229228
this.getChildControl("theme-switcher");

services/static-webserver/client/source/class/osparc/product/Utils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,8 @@ qx.Class.define("osparc.product.Utils", {
188188
return "REGISTER";
189189
},
190190

191-
// oSPARC only
192191
hasConvertToPipelineEnabled: function() {
193-
const product = this.getProductName();
194-
return product === "osparc";
192+
return false;
195193
},
196194

197195
// oSPARC only
@@ -269,7 +267,7 @@ qx.Class.define("osparc.product.Utils", {
269267
},
270268

271269
getIconUrl: function(asset = "Default.png") {
272-
const base = "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/"
270+
const base = "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons"
273271
let url;
274272
switch (osparc.product.Utils.getProductName()) {
275273
case "osparc":

0 commit comments

Comments
 (0)