Skip to content

Homogenize studies and services #1569

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

Merged
merged 62 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
526dfdd
minor
odeimaiz Jun 18, 2020
1408284
StudyBrowserButtonItem: isTemplate -> resourceType
odeimaiz Jun 19, 2020
c4e31e2
minor
odeimaiz Jun 19, 2020
164e4a1
minor renaming
odeimaiz Jun 19, 2020
96350cc
refactoring
odeimaiz Jun 19, 2020
cc1d978
good practices
odeimaiz Jun 19, 2020
e380bec
minor
odeimaiz Jun 19, 2020
c33e196
Merge branch 'master' into feature/stuvices
odeimaiz Jun 19, 2020
8ff791a
Services listed with studies. Clicking on a service creates a new stu…
odeimaiz Jun 19, 2020
e36e7b4
Merge branch 'feature/stuvices' of github.com:odeimaiz/osparc-simcore…
odeimaiz Jun 19, 2020
4b8c09c
bad merge
odeimaiz Jun 19, 2020
5888741
minor
odeimaiz Jun 19, 2020
03eaead
added "idle" state for interactiveStatus
odeimaiz Jun 19, 2020
21ae3e6
cleanup
odeimaiz Jun 19, 2020
4358d37
minor
odeimaiz Jun 19, 2020
7e52707
maximize dynamic service if it has no input node connected
odeimaiz Jun 19, 2020
e3afc00
minor
odeimaiz Jun 19, 2020
81619ee
ServiceInfo uses our own Thumbnail
odeimaiz Jun 19, 2020
a6d6f4c
minor
odeimaiz Jun 19, 2020
5a44db3
adapting service to study
odeimaiz Jun 19, 2020
abc8f61
removed unused images
odeimaiz Jun 22, 2020
266df4a
Cleanup: Plotly is not used
odeimaiz Jun 22, 2020
a2acb13
Bring error message to FlashMessenger
odeimaiz Jun 23, 2020
b1e7a45
minor refactoring
odeimaiz Jun 23, 2020
fb5afdb
minor
odeimaiz Jun 23, 2020
9c8338b
attachToggler to arrow and label
odeimaiz Jun 23, 2020
862e678
minor
odeimaiz Jun 23, 2020
457bfcc
minor
odeimaiz Jun 25, 2020
edba880
minor
odeimaiz Jun 25, 2020
05921fd
newStudyBtn moved to myStudies
odeimaiz Jun 25, 2020
7ee82bc
Discover view and tab added
odeimaiz Jun 25, 2020
6d126ab
all functionalities working with the Explorer tab
odeimaiz Jun 25, 2020
0d6d1d2
minor
odeimaiz Jun 25, 2020
25f922c
minor
odeimaiz Jun 25, 2020
8b61d55
minor
odeimaiz Jun 25, 2020
46ccf2e
minor
odeimaiz Jun 26, 2020
3bac478
minor
odeimaiz Jun 26, 2020
6131799
explorer standalone app added
odeimaiz Jun 26, 2020
cceab18
minor
odeimaiz Jun 26, 2020
20ecc98
minor
odeimaiz Jun 26, 2020
40033bf
minor
odeimaiz Jun 26, 2020
98ee3f2
Explorer main view ready
odeimaiz Jun 26, 2020
400ce51
minor renaming
odeimaiz Jun 26, 2020
a66c249
minor
odeimaiz Jun 26, 2020
0e676f9
refactoring
odeimaiz Jun 26, 2020
01a5159
minor
odeimaiz Jun 26, 2020
2f744cf
minor
odeimaiz Jun 26, 2020
30d747f
minor
odeimaiz Jun 26, 2020
60529ea
optimizing
odeimaiz Jun 26, 2020
807e6f9
Bring back newServiceButtons
odeimaiz Jun 26, 2020
f0676fa
Open to the right
odeimaiz Jun 26, 2020
063249f
cleanup
odeimaiz Jun 26, 2020
0ee8e97
Allow starting any version of the service
odeimaiz Jun 26, 2020
a4d9a53
Allow starting any version of the service working
odeimaiz Jun 26, 2020
180fc50
minor
odeimaiz Jun 26, 2020
5489d32
cleanup
odeimaiz Jun 29, 2020
b6ab005
more cleanup
odeimaiz Jun 29, 2020
23dddab
Merge branch 'master' into feature/stuvices
odeimaiz Jun 29, 2020
2bd99f2
Merge branch 'master' into feature/stuvices
odeimaiz Jun 30, 2020
2a9e2d9
Update Application.js
odeimaiz Jul 2, 2020
f9f9288
skip system-test-e2e
odeimaiz Jul 2, 2020
1242a19
Merge branch 'feature/stuvices' of github.com:odeimaiz/osparc-simcore…
odeimaiz Jul 2, 2020
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
3 changes: 3 additions & 0 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,9 @@ jobs:
run: ./ci/github/system-testing/swarm-deploy.bash clean_up

system-test-e2e:
# FIXME: skip the job until make it faster and more reliable
# https://github.com/ITISFoundation/osparc-simcore/issues/1594
if: "false"
name: System-testing e2e
needs: [build-test-images]
runs-on: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions services/web/client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"q": false,
"qxWeb": false,
"osparc": false,
"explorer": false,
"Ajv": false,
"objectPath": false
},
Expand Down
1 change: 0 additions & 1 deletion services/web/client/Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"svg/svg.path.js",
"jsondiffpatch/jsondiffpatch.min.js",
"jsontreeviewer/jsonTree.js",
"plotly/plotly.min.js",
"marked/marked.js",
"DOMPurify/purify.min.js"
],
Expand Down
12 changes: 12 additions & 0 deletions services/web/client/compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
],
"bootPath": "source/boot"
},
{
"class": "explorer.Application",
"theme": "osparc.theme.Theme",
"name": "explorer",
"title": "oSPARC Explorer",
"include": [
"iconfont.material.Load",
"iconfont.fontawesome5.Load",
"osparc.theme.OSparcLight"
],
"bootPath": "source/boot"
},
{
"class": "qxl.apiviewer.Application",
"theme": "qxl.apiviewer.Theme",
Expand Down
60 changes: 60 additions & 0 deletions services/web/client/source/class/explorer/Application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* ************************************************************************

explorer - an entry point to oSparc

https://osparc.io/explorer

Copyright:
2020 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */

/**
* This is the main application class of "explorer"
*
* @asset(explorer/*)
* @asset(common/common.css)
*/

qx.Class.define("explorer.Application", {
extend: qx.application.Standalone,
include: [
qx.locale.MTranslation
],

members: {
/**
* This method contains the initial application code and gets called
* during startup of the application
*/
main: function() {
this.base();

// Enable logging in debug variant
if (qx.core.Environment.get("qx.debug")) {
// support native logging capabilities, e.g. Firebug for Firefox
qx.log.appender.Native;
}

this.__loadMainPage();
},

__loadMainPage: function() {
const padding = 0;
const view = new explorer.MainPage();
const doc = this.getRoot();
doc.add(view, {
top: padding,
bottom: padding,
left: padding,
right: padding
});
}
}
});
55 changes: 55 additions & 0 deletions services/web/client/source/class/explorer/MainPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* ************************************************************************

explorer - an entry point to oSparc

https://osparc.io

Copyright:
2020 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */

qx.Class.define("explorer.MainPage", {
extend: qx.ui.core.Widget,

construct: function() {
this.base();

this._setLayout(new qx.ui.layout.VBox());

const navBar = this.__navBar = this.__createNavigationBar();
this._add(navBar);

const exploreBrowser = this.__exploreBrowser = this.__createMainView();
this._add(exploreBrowser, {
flex: 1
});
},

members: {
__navBar: null,
__exploreBrowser: null,

__createNavigationBar: function() {
const navBar = new explorer.NavigationBar();
navBar.buildLayout();
return navBar;
},

__createMainView: function() {
const nStudyItemsPerRow = 5;
const studyButtons = osparc.dashboard.StudyBrowserButtonBase;
const exploreBrowser = new osparc.dashboard.ExploreBrowser().set({
alignX: "center",
maxWidth: nStudyItemsPerRow * (studyButtons.ITEM_WIDTH + studyButtons.SPACING) + 10 // padding + scrollbar
});
return exploreBrowser;
}
}
});
35 changes: 35 additions & 0 deletions services/web/client/source/class/explorer/NavigationBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* ************************************************************************

explorer - an entry point to oSparc

https://osparc.io

Copyright:
2020 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */

qx.Class.define("explorer.NavigationBar", {
extend: osparc.desktop.NavigationBar,

members: {
buildLayout: function() {
this.getChildControl("logo");
this.getChildControl("platform");

this._add(new qx.ui.core.Spacer(), {
flex: 1
});

this.getChildControl("user-manual");
this.getChildControl("feedback");
this.getChildControl("theme-switch");
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ qx.Class.define("osparc.component.message.FlashMessenger", {
* @param {*} logMessage.logger IDK
*/
log: function(logMessage) {
let message = logMessage.message;
let message = ("message" in logMessage.message) ? logMessage.message["message"] : logMessage.message;
const level = logMessage.level.toUpperCase(); // "DEBUG", "INFO", "WARNING", "ERROR"
let logger = logMessage.logger;
if (logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ qx.Class.define("osparc.component.metadata.ServiceInfo", {
members: {
__metadata: null,

setService: function(metadata) {
this._removeAll();
if (metadata) {
this.__metadata = metadata;
this.__createServiceInfoView();
}
},

__createServiceInfoView: function() {
const container = new qx.ui.container.Composite(new qx.ui.layout.VBox(8).set({
alignY: "middle"
}));

const hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(8));
hBox.add(this.__createThumbnail());
hBox.add(this.__createExtraInfo(), {
hBox.add(this.__createExtraInfo());
hBox.add(this.__createThumbnail(), {
flex: 1
});
container.add(hBox);
Expand All @@ -68,12 +76,7 @@ qx.Class.define("osparc.component.metadata.ServiceInfo", {
},

__createThumbnail: function() {
return new qx.ui.basic.Image(this.__metadata.thumbnail || "@FontAwesome5Solid/flask/50").set({
scale: true,
width: 300,
height: 180,
paddingTop: this.__metadata.thumbnail ? 0 : 60
});
return new osparc.component.widget.Thumbnail(this.__metadata.thumbnail || "@FontAwesome5Solid/flask/50", 300, 180);
},

__createExtraInfo: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ qx.Class.define("osparc.component.metadata.ServiceInfoWindow", {
const windowWidth = 700;
const windowHeight = 800;
this.set({
layout: new qx.ui.layout.Grow(),
layout: new qx.ui.layout.VBox(10),
autoDestroy: true,
contentPadding: 10,
showMinimize: false,
Expand All @@ -42,16 +42,22 @@ qx.Class.define("osparc.component.metadata.ServiceInfoWindow", {
height: windowHeight
});

const serviceDetails = new osparc.component.metadata.ServiceInfo(metadata);
const serviceInfo = this._serviceInfo = new osparc.component.metadata.ServiceInfo(metadata);
const scroll = new qx.ui.container.Scroll();
scroll.add(serviceDetails);
this.add(scroll);
scroll.add(serviceInfo);
this.add(scroll, {
flex: 1
});
},

properties: {
appearance: {
refine: true,
init: "info-service-window"
}
},

members: {
_serviceInfo: null
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/* ************************************************************************

osparc - the simcore frontend

https://osparc.io

Copyright:
2020 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */


qx.Class.define("osparc.component.metadata.ServiceStarterWindow", {
extend: osparc.component.metadata.ServiceInfoWindow,

/**
* @param metadata {Object} Service metadata
*/
construct: function(metadata) {
this.base(arguments, metadata);

this.__service = metadata;

const toolboxContainer = this.__createToolbox();
this.addAt(toolboxContainer, 0);
},

events: {
"startService": "qx.event.type.Data"
},

members: {
__serviceKey: null,
__versionsUIBox: null,

__createToolbox: function() {
const toolboxContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox());

const versionsList = this.__createVersionsList();
toolboxContainer.add(versionsList);

toolboxContainer.add(new qx.ui.core.Spacer(), {
flex: 1
});

const openButton = new qx.ui.form.Button(this.tr("Open")).set({
appearance: "md-button"
});
openButton.addListener("execute", () => {
const data = {
"serviceKey": this.__service.key,
"serviceVersion": this.__getSelectedVersion()
};
this.fireDataEvent("startService", data);
});
toolboxContainer.add(openButton);

return toolboxContainer;
},

__createVersionsList: function() {
const versionsList = this.__versionsUIBox = new qx.ui.form.SelectBox().set({
font: "text-14"
});
// populate versions
const store = osparc.store.Store.getInstance();
store.getServicesDAGs()
.then(services => {
const versions = osparc.utils.Services.getVersions(services, this.__service.key);
if (versions) {
let lastItem = null;
versions.forEach(version => {
lastItem = new qx.ui.form.ListItem(version).set({
font: "text-14"
});
versionsList.add(lastItem);
});
if (lastItem) {
versionsList.setSelection([lastItem]);
this.__versionSelected(lastItem.getLabel());
}
}
});
versionsList.addListener("changeSelection", e => {
const serviceVersion = this.__getSelectedVersion();
if (serviceVersion) {
this.__versionSelected(serviceVersion);
}
}, this);

return versionsList;
},

__getSelectedVersion: function() {
const selection = this.__versionsUIBox.getSelection();
if (selection && selection.length) {
return selection[0].getLabel();
}
return null;
},

__versionSelected: function(serviceVersion) {
const store = osparc.store.Store.getInstance();
store.getServicesDAGs()
.then(services => {
const selectedService = osparc.utils.Services.getFromObject(services, this.__service.key, serviceVersion);
this._serviceInfo.setService(selectedService);
});
}
}
});
Loading