Skip to content

Fixes + some UI/UX #1471

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 22 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d79612f
openStudyLink gets timeout as parameter
odeimaiz Apr 24, 2020
87c1317
minor
odeimaiz Apr 24, 2020
4285fa4
upgrade theme contrib + include OSparcPortal theme
odeimaiz Apr 24, 2020
b6a82b2
Merge branch 'master' into feature/ui-ux
odeimaiz Apr 28, 2020
6ccee76
Merge branch 'feature/ui-ux' of github.com:odeimaiz/osparc-simcore in…
odeimaiz Apr 28, 2020
b1024ed
Merge branch 'master' into feature/ui-ux
odeimaiz Apr 29, 2020
5d1d776
Merge branch 'feature/ui-ux' of github.com:odeimaiz/osparc-simcore in…
odeimaiz Apr 29, 2020
ae8edf5
minor
odeimaiz Apr 29, 2020
6dbd86f
Title in one line and cropped. Tooltip if needed
odeimaiz Apr 29, 2020
fe1d380
Title in one line and cropped. Tooltip if needed (2)
odeimaiz Apr 29, 2020
e161acb
Merge branch 'master' into feature/ui-ux
odeimaiz Apr 30, 2020
eafb9ef
Merge branch 'feature/ui-ux' of github.com:odeimaiz/osparc-simcore in…
odeimaiz Apr 30, 2020
81529a9
Fixed always present iFrame
odeimaiz Apr 30, 2020
8be7a8c
@pcrespov fixes devel
odeimaiz Apr 30, 2020
8acf9dd
minor
odeimaiz Apr 30, 2020
db4639a
Do not upper limit sidePanel's width
odeimaiz Apr 30, 2020
b1d5aaf
Merge branch 'master' into feature/ui-ux
odeimaiz May 7, 2020
12fdd7e
No Portal theme for now
odeimaiz May 7, 2020
033d64c
Fix export setEnabled
odeimaiz May 7, 2020
6efe138
Fixed always present iFrame
odeimaiz May 7, 2020
cab9ad8
Only TESTERs can crud templates
odeimaiz May 7, 2020
68c918e
prjOwner contains email again
odeimaiz May 7, 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
2 changes: 1 addition & 1 deletion services/web/client/Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@qooxdoo/compiler": "^1.0.0-beta",
"@qooxdoo/framework": "^6.0.0-beta",
"ITISFoundation/qx-iconfont-fontawesome5": "^0.2.0",
"ITISFoundation/qx-osparc-theme": "^0.5.3",
"ITISFoundation/qx-osparc-theme": "^0.5.4",
"qooxdoo/qxl.testtapper": "^0.4.3",
"qooxdoo/qxl.apiviewer": "^1.0.0-beta",
"ITISFoundation/qx-iconfont-material": "^0.1.5"
Expand Down
6 changes: 3 additions & 3 deletions services/web/client/qx-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
},
{
"library_name": "qx-osparc-theme",
"library_version": "0.5.3",
"path": "qx_packages/ITISFoundation_qx-osparc-theme_v0_5_3",
"library_version": "0.5.4",
"path": "qx_packages/ITISFoundation_qx-osparc-theme_v0_5_4",
"uri": "ITISFoundation/qx-osparc-theme",
"repo_name": "ITISFoundation/qx-osparc-theme",
"repo_tag": "v0.5.3"
"repo_tag": "v0.5.4"
},
{
"library_name": "qx-iconfont-material",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,10 @@ qx.Class.define("osparc.component.metadata.StudyDetailsEditor", {
},

__isUserOwner: function() {
// return true until fine grain operation right are implemented. For now: I get it, I can write it
return true;
/*
if (this.__model) {
return this.__model.getPrjOwner() === osparc.auth.Data.getInstance().getEmail();
}
return false;
*/
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
__filesButton: null,

populateLayout: function() {
this.__cleanLayout();

this.getNode().bind("label", this.__title, "value");
this.__addInputPortsUIs();
this.__addOutputPortsUIs();
Expand All @@ -90,17 +92,29 @@ qx.Class.define("osparc.component.node.BaseNodeView", {

__buildLayout: function() {
const inputs = this.__buildSideView(true);

const vBox = new qx.ui.container.Composite(new qx.ui.layout.VBox(5));
const toolbar = this.__buildToolbar();
const mainView = this.__buildMainView();
vBox.add(toolbar);
vBox.add(mainView, {
flex: 1
});

const outputs = this.__buildSideView(false);

const pane2 = this.__pane2 = new qx.ui.splitpane.Pane();
this.add(inputs, 0); // flex 0
this.add(pane2, 1); // flex 1

pane2.add(mainView, 1); // flex 1
pane2.add(vBox, 1); // flex 1
pane2.add(outputs, 0); // flex 0
},

__cleanLayout: function() {
this.__mainView.removeAll();
},

__buildSideView: function(isInput) {
const collapsedWidth = 35;
const sidePanel = new osparc.desktop.SidePanel().set({
Expand Down Expand Up @@ -198,8 +212,6 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
this._mapperLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
this._iFrameLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox());

mainView.add(this.__buildToolbar());

return mainView;
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ qx.Class.define("osparc.component.node.NodeView", {
},

__iFrameChanged: function() {
this._iFrameLayout.removeAll();

const loadingPage = this.getNode().getLoadingPage();
const iFrame = this.getNode().getIFrame();

this._iFrameLayout.removeAll();
const src = iFrame.getSource();
if (src === null || src === "about:blank") {
this._iFrameLayout.add(loadingPage, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ qx.Class.define("osparc.component.widget.NodesTree", {
}, this);
item.addListener("tap", e => {
this.fireDataEvent("changeSelectedNode", item.getModel().getNodeId());
this.__exportButton.setEnabled(item.getLevel() && item.getModel().getIsContainer());
this.__exportButton.setEnabled((Boolean(item.getLevel()) && item.getModel().getIsContainer()));
}, this);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
},

__createStudyListLayout: function() {
return new osparc.component.form.ToggleButtonContainer(new qx.ui.layout.Flow(15, 15));
const spacing = osparc.dashboard.StudyBrowserButtonBase.SPACING;
return new osparc.component.form.ToggleButtonContainer(new qx.ui.layout.Flow(spacing, spacing));
},

__createStudyItem: function(study, isTemplate) {
Expand Down Expand Up @@ -714,17 +715,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
},

__isUserOwner: function(studyData) {
// return true until fine grain operation rights are implemented. For now: I get it, I can write it
return true;
/*
const myEmail = osparc.auth.Data.getInstance().getEmail();
if ("prjOwner" in studyData) {
return studyData.prjOwner === myEmail;
} else if ("getCreator" in studyData) {
return studyData.getCreator() === myEmail;
}
return false;
*/
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", {
construct: function() {
this.base(arguments);
this.set({
width: this.self().WIDTH,
height: this.self().HEIGHT,
width: this.self().ITEM_WIDTH,
height: this.self().ITEM_HEIGHT,
padding: this.self().PADDING,
allowGrowX: false
});
Expand All @@ -52,9 +52,10 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", {
},

statics: {
WIDTH: 200,
HEIGHT: 230,
PADDING: 8
ITEM_WIDTH: 200,
ITEM_HEIGHT: 200,
PADDING: 8,
SPACING: 12
},

events: {
Expand Down Expand Up @@ -86,8 +87,8 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", {
control = new qx.ui.basic.Label().set({
margin: [5, 0],
font: "title-14",
rich : true,
anonymous: true
maxWidth: this.self().ITEM_WIDTH - 2*this.self().PADDING - 30,
breakWithinWords: true
});
this._mainLayout.addAt(control, 0);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,16 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonItem", {
},

_applyStudyTitle: function(value, old) {
let label = this.getChildControl("title");
const label = this.getChildControl("title");
label.setValue(value);
label.addListener("appear", () => {
qx.event.Timer.once(() => {
const labelDom = label.getContentElement().getDomElement();
if (label.getMaxWidth() === parseInt(labelDom.style.width)) {
label.setToolTipText(value);
}
}, this, 50);
});
},

_applyStudyDescription: function(value, old) {
Expand Down
6 changes: 3 additions & 3 deletions services/web/client/source/class/osparc/data/Permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ qx.Class.define("osparc.data.Permissions", {
"user": [
"studies.user.read",
"studies.user.create",
"studies.template.create",
"studies.template.update",
"studies.template.delete",
"storage.datcore.read",
"preferences.user.update",
"preferences.apikey.create",
Expand All @@ -158,6 +155,9 @@ qx.Class.define("osparc.data.Permissions", {
"study.tag"
],
"tester": [
"studies.template.create",
"studies.template.update",
"studies.template.delete",
"services.all.read",
"preferences.role.update",
"study.nodestree.uuid.read",
Expand Down
4 changes: 3 additions & 1 deletion services/web/client/source/class/osparc/desktop/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ qx.Class.define("osparc.desktop.MainPage", {
__createMainView: function() {
const prjStack = new qx.ui.container.Stack();

const nStudyItemsPerRow = 5;
const studyButtons = osparc.dashboard.StudyBrowserButtonBase;
const dashboard = this.__dashboard = new osparc.dashboard.Dashboard().set({
width: 1200
width: nStudyItemsPerRow * (studyButtons.ITEM_WIDTH + studyButtons.SPACING) + 25 // padding + scrollbar
});
dashboard.getStudyBrowser().addListener("startStudy", e => {
const studyEditor = e.getData();
Expand Down
61 changes: 32 additions & 29 deletions services/web/client/source/class/osparc/desktop/StudyEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
const mainPanel = this.__mainPanel = new osparc.desktop.MainPanel();
const sidePanel = this.__sidePanel = new osparc.desktop.SidePanel().set({
minWidth: 0,
maxWidth: 700,
width: 400
});
sidePanel.getContentElement().setStyle("border-left", "1px solid " + qx.theme.manager.Color.getInstance().resolve("material-button-background"));
Expand Down Expand Up @@ -180,35 +179,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
}
});
nodesTree.addListener("exportNode", e => {
if (!osparc.data.Permissions.getInstance().canDo("study.node.export", true)) {
return;
}
const nodeId = e.getData();
const node = this.getStudy().getWorkbench().getNode(nodeId);
if (node && node.isContainer()) {
const exportGroupView = new osparc.component.export.ExportDAG(node);
const window = new qx.ui.window.Window(this.tr("Export: ") + node.getLabel()).set({
appearance: "service-window",
layout: new qx.ui.layout.Grow(),
autoDestroy: true,
contentPadding: 0,
width: 700,
maxHeight: 700,
showMinimize: false,
modal: true
});
window.add(exportGroupView);
window.center();
window.open();

window.addListener("close", () => {
exportGroupView.tearDown();
}, this);

exportGroupView.addListener("finished", () => {
window.close();
}, this);
}
this.__exportMacro(nodeId);
});

workbenchUI.addListener("changeSelectedNode", e => {
Expand All @@ -217,6 +189,37 @@ qx.Class.define("osparc.desktop.StudyEditor", {
});
},

__exportMacro: function(nodeId) {
if (!osparc.data.Permissions.getInstance().canDo("study.node.export", true)) {
return;
}
const node = this.getStudy().getWorkbench().getNode(nodeId);
if (node && node.isContainer()) {
const exportGroupView = new osparc.component.export.ExportGroup(node);
const window = new qx.ui.window.Window(this.tr("Export: ") + node.getLabel()).set({
appearance: "service-window",
layout: new qx.ui.layout.Grow(),
autoDestroy: true,
contentPadding: 0,
width: 700,
height: 700,
showMinimize: false,
modal: true
});
window.add(exportGroupView);
window.center();
window.open();

window.addListener("close", () => {
exportGroupView.tearDown();
}, this);

exportGroupView.addListener("finished", () => {
window.close();
}, this);
}
},

nodeSelected: function(nodeId) {
if (!nodeId) {
this.__loggerView.setCurrentNodeId();
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/tutorials/tutorialBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ class TutorialBase {
await utils.takeScreenshot(this.__page, this.__templateName + "_landingPage_" + domain);
}

async openStudyLink() {
async openStudyLink(openStudyTimeout = 20000) {
this.__responsesQueue.addResponseListener("open");

await this.goTo();

let resp = null;
try {
const openStudyTimeout = 20000;
resp = await this.__responsesQueue.waitUntilResponse("open", openStudyTimeout);
}
catch(err) {
Expand Down