Skip to content

Commit 25a2fd0

Browse files
authored
🎨 [Frontend] S4L: Include deprecated versions in plus button, they should all be updatable to a non deprecated one (#6480)
1 parent 22c86fa commit 25a2fd0

File tree

1 file changed

+10
-3
lines changed
  • services/static-webserver/client/source/class/osparc/dashboard

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,14 +837,20 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
837837
});
838838
},
839839

840+
// Used in S4L products
840841
__addNewStudyFromServiceButtons: function(key, newButtonInfo) {
841-
const versions = osparc.service.Utils.getVersions(key);
842+
// Include deprecated versions, they should all be updatable to a non deprecated version
843+
const versions = osparc.service.Utils.getVersions(key, false);
842844
if (versions.length && newButtonInfo) {
843845
// scale to latest compatible
844846
const latestVersion = versions[0];
845847
const latestCompatible = osparc.service.Utils.getLatestCompatible(key, latestVersion);
846848
osparc.store.Services.getService(latestCompatible["key"], latestCompatible["version"])
847849
.then(latestMetadata => {
850+
// make sure this one is not deprecated
851+
if (osparc.service.Utils.isDeprecated(latestMetadata)) {
852+
return;
853+
}
848854
const title = newButtonInfo.title + " " + osparc.service.Utils.extractVersionDisplay(latestMetadata);
849855
const desc = newButtonInfo.description;
850856
const mode = this._resourcesContainer.getMode();
@@ -1687,8 +1693,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
16871693
},
16881694

16891695
__createConfirmWindow: function(studyNames) {
1690-
const rUSure = this.tr("Are you sure you want to delete ");
1691-
const msg = studyNames.length > 1 ? rUSure + studyNames.length + this.tr(" studies?") : rUSure + "<b>" + studyNames[0] + "</b>?";
1696+
const rUSure = this.tr("Are you sure you want to delete");
1697+
const studiesText = osparc.product.Utils.getStudyAlias({plural: true});
1698+
const msg = rUSure + (studyNames.length > 1 ? ` ${studyNames.length} ${studiesText} ?` : ` <b>${studyNames[0]}</b>?`)
16921699
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
16931700
confirmText: this.tr("Delete"),
16941701
confirmAction: "delete"

0 commit comments

Comments
 (0)