Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ec6b8bf
"standalone" mode
odeimaiz Jan 29, 2025
dab85ea
[skip ci] add standalone where needed
odeimaiz Jan 29, 2025
51bafbb
[skip ci] minor
odeimaiz Jan 29, 2025
c3d9f4a
[skip ci] more switches
odeimaiz Jan 29, 2025
ec9f041
minor fix
odeimaiz Jan 29, 2025
fe5904b
menu-wider
odeimaiz Jan 29, 2025
18674d3
wider options button
odeimaiz Jan 29, 2025
ae69cbb
[skip ci] more menu entries
odeimaiz Jan 29, 2025
8a5fa39
minor
odeimaiz Jan 29, 2025
594f63e
Merge branch 'master' into feature/standalone-projects
odeimaiz Jan 30, 2025
a463f60
Merge branch 'feature/standalone-projects' of github.com:odeimaiz/osp…
odeimaiz Jan 30, 2025
3c4668a
minor
odeimaiz Jan 30, 2025
8d381d6
buttons visibility
odeimaiz Jan 30, 2025
9422a63
[skip ci] minor
odeimaiz Jan 30, 2025
90fe7a7
Merge branch 'master' into feature/standalone-projects
odeimaiz Jan 30, 2025
482898d
minor
odeimaiz Jan 30, 2025
a13f62e
Loading props
odeimaiz Jan 30, 2025
7ee5e87
Merge branch 'master' into feature/standalone-projects
odeimaiz Jan 30, 2025
4283d33
Merge branch 'feature/standalone-projects' of github.com:odeimaiz/osp…
odeimaiz Jan 30, 2025
3022792
[skip ci] more refactoring
odeimaiz Jan 30, 2025
fe51ceb
bring back hide toolbar logic
odeimaiz Jan 30, 2025
3801d55
connect reload button
odeimaiz Jan 30, 2025
3e922f8
Merge branch 'master' into feature/standalone-projects
odeimaiz Jan 30, 2025
3bd294a
minor
odeimaiz Jan 30, 2025
0742742
Simplify Loading page
odeimaiz Jan 30, 2025
9047535
refactor page contexts
odeimaiz Jan 30, 2025
0eefce2
less page context
odeimaiz Jan 30, 2025
b6ac892
[skip ci] minors
odeimaiz Jan 30, 2025
2d02148
convert to standalone
odeimaiz Jan 30, 2025
144cb37
minor
odeimaiz Jan 30, 2025
fc08c63
bind
odeimaiz Jan 30, 2025
a762dab
convert to standalone working
odeimaiz Jan 30, 2025
8a57934
refactor
odeimaiz Jan 30, 2025
c25f599
more checks
odeimaiz Jan 30, 2025
ed19d3a
minor
odeimaiz Jan 30, 2025
e1b0be4
[skip ci] getIcon
odeimaiz Jan 30, 2025
525778e
Merge branch 'master' into feature/standalone-projects
odeimaiz Jan 31, 2025
f747f45
listen to openWallets event from iframe
odeimaiz Jan 31, 2025
9fa4180
[skip ci] minors
odeimaiz Jan 31, 2025
358464f
minor
odeimaiz Jan 31, 2025
f8b2e81
one more check
odeimaiz Jan 31, 2025
c8c2d3d
minor
odeimaiz Jan 31, 2025
24cb70c
[skip ci] init minimized
odeimaiz Jan 31, 2025
cd6c172
maximize to loading
odeimaiz Jan 31, 2025
9e342cf
[skip ci] minor
odeimaiz Jan 31, 2025
e2f1607
currentNodeId more progress
odeimaiz Jan 31, 2025
dea9468
refactor
odeimaiz Jan 31, 2025
54932cf
transition
odeimaiz Jan 31, 2025
669f096
simplify
odeimaiz Jan 31, 2025
c8ce874
exclude until we have the export to standalone backend functionality
odeimaiz Jan 31, 2025
9c61212
no icon yet
odeimaiz Jan 31, 2025
11a954e
Convert to Pipeline from dashboard
odeimaiz Jan 31, 2025
a7935d4
Merge branch 'master' into feature/standalone-projects
mergify[bot] Feb 3, 2025
ca422b4
Merge branch 'master' into feature/standalone-projects
odeimaiz Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
},

uiMode: {
check: ["workbench", "guided", "app"],
check: ["workbench", "guided", "app", "standalone"], // "guided" is no longer used
nullable: true,
apply: "__applyUiMode"
},
Expand Down Expand Up @@ -582,21 +582,16 @@ qx.Class.define("osparc.dashboard.CardBase", {
},

__applyUiMode: function(uiMode) {
let source = null;
let toolTipText = null;
switch (uiMode) {
case "guided":
case "app":
source = osparc.dashboard.CardBase.MODE_APP;
toolTipText = this.tr("App mode");
case "app": {
const uiModeIcon = this.getChildControl("workbench-mode");
uiModeIcon.set({
source: osparc.dashboard.CardBase.MODE_APP,
toolTipText: this.tr("App mode"),
});
break;
}
if (source) {
const uiModeIcon = this.getChildControl("workbench-mode");
uiModeIcon.set({
source,
toolTipText,
});
}
}
},

Expand Down Expand Up @@ -882,6 +877,10 @@ qx.Class.define("osparc.dashboard.CardBase", {
if (duplicateButton) {
duplicateButton.setEnabled(osparc.study.Utils.canBeDuplicated(resourceData));
}
const convertToPipelineButton = menuButtons.find(menuBtn => "convertToPipelineButton" in menuBtn);
if (convertToPipelineButton) {
convertToPipelineButton.setEnabled(osparc.study.Utils.canBeDuplicated(resourceData));
}
const exportCMISButton = menuButtons.find(menuBtn => "exportCMISButton" in menuBtn);
if (exportCMISButton) {
exportCMISButton.setEnabled(osparc.study.Utils.canBeExported(resourceData));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
if (
osparc.utils.Resources.isService(resourceData) ||
!osparc.product.Utils.showStudyPreview() ||
osparc.data.model.Study.getUiMode(resourceData) === "app"
!osparc.data.model.Study.getUiMode(resourceData) === "workbench"
) {
// there is no pipelining or don't show it
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,17 +1119,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {

studiesMoveButton.set({
visibility: selection.length && currentContext === "studiesAndFolders" ? "visible" : "excluded",
label: this.tr("Move") + (selection.length > 1 ? this.tr(" selected ") + `(${selection.length})` : ""),
label: this.tr("Move") + (selection.length > 1 ? ` (${selection.length})` : ""),
});

studiesTrashButton.set({
visibility: selection.length && currentContext === "studiesAndFolders" ? "visible" : "excluded",
label: this.tr("Move to Bin") + (selection.length > 1 ? this.tr(" selected ") + `(${selection.length})` : ""),
label: this.tr("Move to Bin") + (selection.length > 1 ? ` (${selection.length})` : ""),
});

studiesDeleteButton.set({
visibility: selection.length && currentContext === "trash" ? "visible" : "excluded",
label: this.tr("Delete permanently") + (selection.length > 1 ? this.tr(" selected ") + `(${selection.length})` : ""),
label: this.tr("Delete permanently") + (selection.length > 1 ? ` (${selection.length})` : ""),
});
});

Expand Down Expand Up @@ -1648,6 +1648,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
const duplicateStudyButton = this.__getDuplicateMenuButton(studyData);
menu.add(duplicateStudyButton);

const convertToPipelineButton = this.__getConvertToPipelineMenuButton(studyData);
menu.add(convertToPipelineButton);

if (osparc.product.Utils.isProduct("osparc")) {
const exportStudyButton = this.__getExportMenuButton(studyData);
menu.add(exportStudyButton);
Expand Down Expand Up @@ -1722,6 +1725,16 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
return renameButton;
},

__updateName: function(studyData, name) {
osparc.info.StudyUtils.patchStudyData(studyData, "name", name)
.then(() => this._updateStudyData(studyData))
.catch(err => {
console.error(err);
const msg = err.message || this.tr("Something went wrong Renaming");
osparc.FlashMessenger.logAs(msg, "ERROR");
});
},

__getThumbnailStudyMenuButton: function(studyData) {
const thumbButton = new qx.ui.menu.Button(this.tr("Thumbnail..."), "@FontAwesome5Solid/image/12");
thumbButton.addListener("execute", () => {
Expand All @@ -1743,16 +1756,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
return thumbButton;
},

__updateName: function(studyData, name) {
osparc.info.StudyUtils.patchStudyData(studyData, "name", name)
.then(() => this._updateStudyData(studyData))
.catch(err => {
console.error(err);
const msg = err.message || this.tr("Something went wrong Renaming");
osparc.FlashMessenger.logAs(msg, "ERROR");
});
},

__updateThumbnail: function(studyData, url) {
osparc.info.StudyUtils.patchStudyData(studyData, "thumbnail", url)
.then(() => this._updateStudyData(studyData))
Expand Down Expand Up @@ -1860,6 +1863,29 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
return duplicateButton;
},

__getConvertToPipelineMenuButton: function(studyData) {
const convertToPipelineButton = new qx.ui.menu.Button(this.tr("Convert to Pipeline"), null);
convertToPipelineButton["convertToPipelineButton"] = true;
const uiMode = osparc.data.model.Study.getUiMode(studyData);
convertToPipelineButton.setVisibility(uiMode === "standalone" ? "visible" : "excluded");
convertToPipelineButton.addListener("execute", () => {
this.__updateUIMode(studyData, "workbench")
.catch(err => {
console.error(err);
const msg = err.message || this.tr("Something went wrong Converting to Pipeline");
osparc.FlashMessenger.logAs(msg, "ERROR");
});
}, this);
return convertToPipelineButton;
},

__updateUIMode: function(studyData, uiMode) {
const studyUI = osparc.utils.Utils.deepCloneObject(studyData["ui"]);
studyUI["mode"] = uiMode;
return osparc.info.StudyUtils.patchStudyData(studyData, "ui", studyUI)
.then(() => this._updateStudyData(studyData))
},

__getExportMenuButton: function(studyData) {
const exportButton = new qx.ui.menu.Button(this.tr("Export cMIS"), "@FontAwesome5Solid/cloud-download-alt/12");
exportButton["exportCMISButton"] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,27 @@ qx.Class.define("osparc.data.model.IframeHandler", {
osparc.utils.Utils.setIdToWidget(iframe.getIframe(), "iframe_"+this.getNode().getNodeId());
if (osparc.product.Utils.isProduct("s4llite")) {
iframe.setShowToolbar(false);
} else {
this.getStudy().getUi().bind("mode", iframe, "showToolbar", {
converter: mode => mode !== "standalone"
});
}
iframe.addListener("restart", () => this.__restartIFrame(), this);
iframe.addListener("restart", () => this.restartIFrame(), this);
iframe.getDiskUsageIndicator().setCurrentNode(this.getNode())
this.setIFrame(iframe);
},

__initLoadingPage: function() {
const showZoomMaximizeButton = !osparc.product.Utils.isProduct("s4llite");
const loadingPage = new osparc.ui.message.Loading(showZoomMaximizeButton);
loadingPage.set({
const loadingPage = new osparc.ui.message.Loading().set({
header: this.__getLoadingPageHeader()
});
if (osparc.product.Utils.isProduct("s4llite")) {
loadingPage.setShowToolbar(false);
} else {
this.getStudy().getUi().bind("mode", loadingPage, "showToolbar", {
converter: mode => mode !== "standalone"
});
}

const node = this.getNode();
const thumbnail = node.getMetaData()["thumbnail"];
Expand All @@ -115,7 +124,9 @@ qx.Class.define("osparc.data.model.IframeHandler", {
node.addListener("changeLabel", () => loadingPage.setHeader(this.__getLoadingPageHeader()), this);

const nodeStatus = node.getStatus();
const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage();
const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage().set({
width: 400
});
nodeStatus.bind("interactive", sequenceWidget, "visibility", {
converter: state => ["pending", "pulling", "starting", "connecting"].includes(state) ? "visible" : "excluded"
});
Expand Down Expand Up @@ -352,7 +363,7 @@ qx.Class.define("osparc.data.model.IframeHandler", {
node.fireDataEvent("showInLogger", msgData);

// will switch to iframe's content
this.__restartIFrame();
this.restartIFrame();
if (!node.isDynamicV2()) {
node.callRetrieveInputs();
}
Expand All @@ -374,7 +385,7 @@ qx.Class.define("osparc.data.model.IframeHandler", {
}
},

__restartIFrame: function() {
restartIFrame: function() {
const node = this.getNode();
if (node.getServiceUrl() !== null) {
// restart button pushed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,19 @@ qx.Class.define("osparc.data.model.Study", {
return parameters;
},

getNonFrontendNodes: function() {
const nodes = this.getWorkbench().getNodes();
return Object.values(nodes).filter(node => node.isComputational() || node.isDynamic());
},

isOnlyNodeDynamic: function() {
const validNodes = this.getNonFrontendNodes();
if (validNodes.length === 1) {
return validNodes[0].isDynamic();
}
return null;
},

hasSlideshow: function() {
return !this.getUi().getSlideshow().isEmpty();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ qx.Class.define("osparc.data.model.StudyUI", {
},

mode: {
check: ["workbench", "guided", "app"],
check: ["workbench", "guided", "app", "standalone"], // "guided" is no longer used
init: "workbench",
nullable: true,
event: "changeMode",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ qx.Class.define("osparc.desktop.SlideshowView", {
const nodeId = e.getData();
this.__hideNode(nodeId);
}, this);
slideshowToolbar.addListener("slidesStop", () => this.fireEvent("slidesStop"), this);
slideshowToolbar.addListener("slidesStop", () => this.getStudy().getUi().setMode("workbench"), this);
this._add(slideshowToolbar);

const mainView = this.__mainView = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({
Expand Down Expand Up @@ -109,7 +109,6 @@ qx.Class.define("osparc.desktop.SlideshowView", {
},

events: {
"slidesStop": "qx.event.type.Event",
"startPartialPipeline": "qx.event.type.Data",
"stopPipeline": "qx.event.type.Event",
"backToDashboardPressed": "qx.event.type.Event",
Expand All @@ -131,12 +130,6 @@ qx.Class.define("osparc.desktop.SlideshowView", {
apply: "__applyMaximized",
event: "changeMaximized"
},

pageContext: {
check: ["guided", "app"],
nullable: false,
init: "guided"
}
},

statics: {
Expand Down Expand Up @@ -270,9 +263,6 @@ qx.Class.define("osparc.desktop.SlideshowView", {
view = new osparc.node.slideshow.NodeView();
}
view.setNode(node);
if (node.isDynamic()) {
view.getSettingsLayout().setVisibility(this.getPageContext() === "app" ? "excluded" : "visible");
}
}
this.__connectMaximizeEvents(node);
this.__styleView(node, view);
Expand Down Expand Up @@ -377,7 +367,6 @@ qx.Class.define("osparc.desktop.SlideshowView", {
});
}
}
this.setPageContext("app");
this.__slideshowToolbar.populateButtons(true);
const currentNodeId = this.getStudy().getUi().getCurrentNodeId();
const isValid = slideshow.getPosition(currentNodeId) !== -1;
Expand Down
Loading
Loading