-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into is2757/gc-as-a-service-implementation
- Loading branch information
Showing
27 changed files
with
1,344 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,6 +158,7 @@ def create_new_project_for_job( | |
}, | ||
slideshow={}, | ||
currentNodeId=solver_id, | ||
annotations={}, | ||
), | ||
# FIXME: these should be unnecessary | ||
prjOwner="[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
services/web/client/source/class/osparc/component/editor/AnnotationEditor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* ************************************************************************ | ||
osparc - the simcore frontend | ||
https://osparc.io | ||
Copyright: | ||
2022 IT'IS Foundation, https://itis.swiss | ||
License: | ||
MIT: https://opensource.org/licenses/MIT | ||
Authors: | ||
* Odei Maiz (odeimaiz) | ||
************************************************************************ */ | ||
|
||
qx.Class.define("osparc.component.editor.AnnotationEditor", { | ||
extend: qx.ui.core.Widget, | ||
|
||
construct: function(annotation) { | ||
this.base(arguments); | ||
|
||
const layout = new qx.ui.layout.Grid(5, 5); | ||
layout.setColumnAlign(0, "right", "middle"); | ||
layout.setColumnAlign(1, "left", "middle"); | ||
this._setLayout(layout); | ||
|
||
this.set({ | ||
padding: 10 | ||
}); | ||
|
||
if (annotation) { | ||
this.setAnnotation(annotation); | ||
} | ||
}, | ||
|
||
properties: { | ||
annotation: { | ||
check: "osparc.component.workbench.Annotation", | ||
apply: "__applyAnnotation" | ||
} | ||
}, | ||
|
||
members: { | ||
__applyAnnotation: function(annotation) { | ||
this._removeAll(); | ||
|
||
let row = 0; | ||
this._add(new qx.ui.basic.Label(this.tr("Color")), { | ||
row, | ||
column: 0 | ||
}); | ||
const colorPicker = new osparc.component.form.ColorPicker(); | ||
annotation.bind("color", colorPicker, "color"); | ||
colorPicker.bind("color", annotation, "color"); | ||
this._add(colorPicker, { | ||
row, | ||
column: 1 | ||
}); | ||
row++; | ||
|
||
if (annotation.getType() === "text") { | ||
this._add(new qx.ui.basic.Label(this.tr("Text")), { | ||
row, | ||
column: 0 | ||
}); | ||
const textField = new qx.ui.form.TextField(annotation.getAttributes().text); | ||
textField.addListener("changeValue", e => annotation.setText(e.getData())); | ||
this._add(textField, { | ||
row, | ||
column: 1 | ||
}); | ||
} | ||
} | ||
} | ||
}); |
58 changes: 58 additions & 0 deletions
58
services/web/client/source/class/osparc/component/form/ColorPicker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* oSPARC - The SIMCORE frontend - https://osparc.io | ||
* Copyright: 2022 IT'IS Foundation - https://itis.swiss | ||
* License: MIT - https://opensource.org/licenses/MIT | ||
* Authors: Ignacio Pascual (ignapas) | ||
* Odei Maiz (odeimaiz) | ||
*/ | ||
|
||
qx.Class.define("osparc.component.form.ColorPicker", { | ||
extend: qx.ui.core.Widget, | ||
|
||
construct: function() { | ||
this.base(arguments); | ||
|
||
this._setLayout(new qx.ui.layout.HBox()); | ||
|
||
this._add(this.getChildControl("color-button")); | ||
this._add(this.getChildControl("color-input")); | ||
}, | ||
|
||
properties: { | ||
color: { | ||
check: "Color", | ||
event: "changeColor", | ||
init: "#303030" | ||
} | ||
}, | ||
|
||
members: { | ||
_createChildControlImpl: function(id) { | ||
let control; | ||
switch (id) { | ||
case "color-button": | ||
control = new qx.ui.form.Button(null, "@FontAwesome5Solid/sync-alt/12"); | ||
control.addListener("execute", () => this.setColor(osparc.utils.Utils.getRandomColor()), this); | ||
this.bind("color", control, "backgroundColor"); | ||
this.bind("color", control, "textColor", { | ||
converter: value => osparc.utils.Utils.getContrastedTextColor(qx.theme.manager.Color.getInstance().resolve(value)) | ||
}); | ||
break; | ||
case "color-input": | ||
control = new qx.ui.form.TextField().set({ | ||
width: 60, | ||
required: true | ||
}); | ||
this.bind("color", control, "value"); | ||
control.addListener("changeValue", e => { | ||
const newColor = e.getData(); | ||
if (osparc.utils.Validators.hexColor(newColor, control)) { | ||
this.setColor(newColor); | ||
} | ||
}); | ||
break; | ||
} | ||
return control || this.base(arguments, id); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.