Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock links when pipeline is running: frontend #2795

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a754afc
isPipelineRunning method
odeimaiz Feb 4, 2022
7744339
Merge branch 'master' into feature/read-only-link-while-running
odeimaiz Feb 4, 2022
33700cf
disable forms if pipeline is running
odeimaiz Feb 4, 2022
234d7cb
Merge branch 'feature/read-only-link-while-running' of github.com:ode…
odeimaiz Feb 4, 2022
1e6d042
minor
odeimaiz Feb 4, 2022
66b1764
logic moved to note
odeimaiz Feb 4, 2022
9f39867
moves state logic to model
pcrespov Feb 4, 2022
657d541
tmp
pcrespov Feb 4, 2022
927a6fd
stops from saving project if pipeline still runs
pcrespov Feb 4, 2022
e446c95
Revert "tmp"
pcrespov Feb 4, 2022
8276811
doc
pcrespov Feb 4, 2022
b95093c
Minor rename and started error handling
pcrespov Feb 4, 2022
d6392c0
Merge branch 'master' into enh/avoid-saving-while-running
pcrespov Feb 4, 2022
77ff24e
Merge branch 'master' into feature/read-only-link-while-running
odeimaiz Feb 6, 2022
fabac00
Update StartStopButtons.js
odeimaiz Feb 7, 2022
27aa3ec
Merge branch 'master' into feature/read-only-link-while-running
odeimaiz Feb 7, 2022
22ddb5c
Merge branch 'enh/avoid-saving-while-running' of https://github.com/p…
odeimaiz Feb 7, 2022
8d47f0f
show message coming from backend when 409
odeimaiz Feb 7, 2022
8d052e1
Revert "Merge branch 'enh/avoid-saving-while-running' of https://gith…
odeimaiz Feb 7, 2022
bc578fb
refactoring
odeimaiz Feb 7, 2022
ab53f4a
Merge branch 'master' into feature/read-only-link-while-running
odeimaiz Feb 7, 2022
7b52aca
e2e fix: 2D_plot
odeimaiz Feb 8, 2022
5b78298
revert
odeimaiz Feb 8, 2022
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
12 changes: 11 additions & 1 deletion services/web/client/source/class/osparc/data/model/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ qx.Class.define("osparc.data.model.Node", {
propsForm: {
check: "osparc.component.form.renderer.PropForm",
init: null,
nullable: true
nullable: true,
apply: "__applyPropsForm"
},

propsFormEditor: {
Expand Down Expand Up @@ -513,6 +514,15 @@ qx.Class.define("osparc.data.model.Node", {
}
},

__applyPropsForm: function() {
const checkIsPipelineRunning = () => {
const isPipelineRunning = this.getStudy().isPipelineRunning();
this.getPropsForm().setEnabled(!isPipelineRunning);
};
this.getStudy().addListener("changeState", () => checkIsPipelineRunning(), this);
checkIsPipelineRunning();
},

getInputsDefaultWidget: function() {
return this.__inputsDefaultWidget;
},
Expand Down
10 changes: 10 additions & 0 deletions services/web/client/source/class/osparc/data/model/Study.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ qx.Class.define("osparc.data.model.Study", {
return null;
},

isPipelineRunning: function() {
const pipelineState = this.getPipelineState();
return [
"PUBLISHED",
"PENDING",
"STARTED",
"RETRY"
].includes(pipelineState);
},

isLocked: function() {
if (this.getState() && "locked" in this.getState()) {
return this.getState()["locked"]["value"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ qx.Class.define("osparc.desktop.StartStopButtons", {
__checkButtonsVisible: function() {
const allNodes = this.getStudy().getWorkbench().getNodes(true);
const isRunnable = Object.values(allNodes).some(node => (node.isComputational() || node.isIterator()));
this.__getStartButtons().forEach(startBtn => startBtn.setEnabled(isRunnable));
this.__getStartButtons().forEach(startBtn => {
if (!startBtn.isFetching()) {
startBtn.setEnabled(isRunnable);
}
}, this);

const isReadOnly = this.getStudy().isReadOnly();
this.setVisibility(isReadOnly ? "excluded" : "visible");
Expand All @@ -206,26 +210,7 @@ qx.Class.define("osparc.desktop.StartStopButtons", {
__updateRunButtonsStatus: function() {
const study = this.getStudy();
if (study) {
const startButtons = this.__getStartButtons();
const stopButton = this.__stopButton;
const pipelineState = study.getPipelineState();
if (pipelineState) {
switch (pipelineState) {
case "PENDING":
case "PUBLISHED":
case "STARTED":
startButtons.forEach(startButton => startButton.setFetching(true));
stopButton.setEnabled(true);
break;
case "NOT_STARTED":
case "SUCCESS":
case "FAILED":
default:
startButtons.forEach(startButton => startButton.setFetching(false));
stopButton.setEnabled(false);
break;
}
}
this.setRunning(study.isPipelineRunning());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,12 @@ qx.Class.define("osparc.desktop.StudyEditor", {
this.__lastSavedStudy = osparc.wrapper.JsonDiffPatch.getInstance().clone(newObj);
})
.catch(error => {
console.error(error);
osparc.component.message.FlashMessenger.getInstance().logAs(this.tr("Error saving the study"), "ERROR");
if ("status" in error && error.status === 409) {
osparc.component.message.FlashMessenger.getInstance().logAs(error.message, "ERROR");
} else {
console.error(error);
osparc.component.message.FlashMessenger.getInstance().logAs(this.tr("Error saving the study"), "ERROR");
}
this.__getStudyLogger().error(null, "Error updating pipeline");
// Need to throw the error to be able to handle it later
throw error;
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/portal/2D_Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ async function runTutorial () {
await tutorial.waitFor(5000, 'Some time for starting the service');
await utils.takeScreenshot(page, screenshotPrefix + 'service_started');

await tutorial.openNode(1);

await tutorial.waitFor(2000);
await utils.takeScreenshot(page, screenshotPrefix + 'iFrame0');

Expand Down
2 changes: 1 addition & 1 deletion tests/performance/locust_files/director_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, *args, **kwargs):
@task()
def get_services(self):
self.client.get(
"v0/services?user_id=" + self.user_id,
f"v0/services?user_id={self.user_id}",
headers={
"x-simcore-products-name": "osparc",
},
Expand Down