Skip to content

Study Browser cleanup #1393

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 83 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
c85d991
minor
odeimaiz Mar 9, 2020
bfd5449
Show "Today" and "Tomorrow"
odeimaiz Mar 9, 2020
008ed5c
MenuButton on studySheet
odeimaiz Mar 9, 2020
a4a2cf0
minor
odeimaiz Mar 9, 2020
446d8f8
menu comes as an argument
odeimaiz Mar 9, 2020
615298e
minor refactoring
odeimaiz Mar 9, 2020
ee81047
minor
odeimaiz Mar 9, 2020
f4d9220
Toggled items show a check icon
odeimaiz Mar 9, 2020
0d6f770
Update sleepers.js
odeimaiz Mar 16, 2020
e5096f3
minor
odeimaiz Mar 16, 2020
da45bd1
merge master
odeimaiz Mar 16, 2020
d415e35
tabs to the top
odeimaiz Mar 16, 2020
189b2fa
minor refactoring
odeimaiz Mar 16, 2020
000c374
minor
odeimaiz Mar 16, 2020
d3fe6f8
templates first
odeimaiz Mar 16, 2020
554f3b9
minor
odeimaiz Mar 16, 2020
ec5c552
narrower and centered dashboard
odeimaiz Mar 16, 2020
35b4818
minor
odeimaiz Mar 16, 2020
f58338d
moving files
odeimaiz Mar 17, 2020
96fc2e5
New Study button follows StudyBrowserList style
odeimaiz Mar 17, 2020
6a54359
New Study Button part if the templates list
odeimaiz Mar 17, 2020
e93640a
__deleteStudy -> __deleteStudies
odeimaiz Mar 17, 2020
155355d
Edit Study pops up in a new window
odeimaiz Mar 17, 2020
0dfe44e
feature access thought button menu
odeimaiz Mar 17, 2020
c9450b4
saveAsTemplate Button added
odeimaiz Mar 17, 2020
6005fdb
Merge branch 'master' into feature/new-study-sheet
odeimaiz Mar 17, 2020
16ba81f
minor
odeimaiz Mar 17, 2020
2f6d86f
setMenu
odeimaiz Mar 17, 2020
72e3369
Selection logic improved
odeimaiz Mar 17, 2020
d4891b6
minor
odeimaiz Mar 18, 2020
8de6589
minor
odeimaiz Mar 18, 2020
8700a3f
minor
odeimaiz Mar 18, 2020
f483c2e
minor
odeimaiz Mar 18, 2020
e4e1fcf
minor
odeimaiz Mar 18, 2020
754c2b0
initResources improved
odeimaiz Mar 18, 2020
0e0656b
More promises
odeimaiz Mar 18, 2020
9a67294
minor
odeimaiz Mar 18, 2020
45b5009
minor
odeimaiz Mar 18, 2020
9ffa1ba
refactoring
odeimaiz Mar 18, 2020
514aec6
SaveAsTemplate from Menu working
odeimaiz Mar 18, 2020
a72b5a4
minor
odeimaiz Mar 18, 2020
a35fd0d
simplied multiSelection logic
odeimaiz Mar 18, 2020
fe7eadd
delete multiple templates working
odeimaiz Mar 18, 2020
11a6fb2
tick - untick multiSelection logic working
odeimaiz Mar 18, 2020
d8a1ea7
minor
odeimaiz Mar 18, 2020
d766a26
studyTitle moved to base class
odeimaiz Mar 18, 2020
cc610f1
minor
odeimaiz Mar 18, 2020
b6bd45f
minor
odeimaiz Mar 18, 2020
b476282
minor fix
odeimaiz Mar 18, 2020
3a75775
close studyDetailsEditor window when finished editing
odeimaiz Mar 18, 2020
e4a782a
allow multiline study title
odeimaiz Mar 18, 2020
589e240
ticks are Images (visibility logic improved)
odeimaiz Mar 18, 2020
49ef9de
fixed size for study cards
odeimaiz Mar 18, 2020
aacb3c6
icon moved to base class, fixed heights removed
odeimaiz Mar 18, 2020
b4d2567
make eslint happy
odeimaiz Mar 18, 2020
da58f0a
Merge branch 'master' into feature/new-study-sheet
odeimaiz Mar 19, 2020
b98bd78
more generic StudyBrowserListBase
odeimaiz Mar 20, 2020
3f6955b
Merge branch 'feature/new-study-sheet' of github.com:odeimaiz/osparc-…
odeimaiz Mar 20, 2020
5edf0b7
Filter out of scroll
odeimaiz Mar 20, 2020
69a932d
Commands and focuses added to login pages
odeimaiz Mar 20, 2020
0e76872
Padding added to study cards
odeimaiz Mar 20, 2020
aa475b5
Merge branch 'master' into feature/new-study-sheet
odeimaiz Mar 20, 2020
604d9de
adapt e2e: study opens with one click
odeimaiz Mar 20, 2020
7a72e1b
Merge branch 'feature/new-study-sheet' of github.com:odeimaiz/osparc-…
odeimaiz Mar 20, 2020
26967ae
LoadingIFrame logic improved
odeimaiz Mar 20, 2020
90ee4dd
Update StudyBrowser.js
odeimaiz Mar 20, 2020
7aed8c2
[bug fix] Bring back the automatic output update
odeimaiz Mar 23, 2020
abf6b2c
minor
odeimaiz Mar 23, 2020
c0368fd
show/hide studies container label
odeimaiz Mar 23, 2020
921b35a
minor
odeimaiz Mar 23, 2020
5b3f828
Routes to statics are always set
Mar 23, 2020
8693570
Show description instead of lastChange in template cards
odeimaiz Mar 23, 2020
25c66de
info shown depends on isTemplate
odeimaiz Mar 23, 2020
81d23fc
Added cleanup of tmp if any
Mar 23, 2020
2200c12
Fixes statis setup
Mar 23, 2020
7bb865e
Merge pull request #61 from pcrespov/odeimaiz-feature/new-study-sheet
odeimaiz Mar 23, 2020
2593b90
minor fix
odeimaiz Mar 23, 2020
69548a0
Merge branch 'master' into feature/new-study-sheet
odeimaiz Mar 24, 2020
146aa5a
minor
odeimaiz Mar 24, 2020
ca647e2
minor fix
odeimaiz Mar 24, 2020
61e98da
file renamings
odeimaiz Mar 24, 2020
6833f9c
minor
odeimaiz Mar 24, 2020
72c8005
Merge branch 'feature/new-study-sheet' of github.com:odeimaiz/osparc-…
odeimaiz Mar 24, 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
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
],
"indent": [
"warn",
2
2,
{
"SwitchCase": 1
}
],
"object-property-newline": "warn",
"object-curly-newline": [
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ prof/

# outputs from make
.stack-*.yml
services/catalog/log.txt
services/web/server/tests/data/static/resource/statics.json
Empty file modified scripts/check_requirements.bash
100755 → 100644
Empty file.
Empty file modified scripts/code-climate.bash
100755 → 100644
Empty file.
Empty file modified scripts/shellcheck.bash
100755 → 100644
Empty file.
Empty file modified scripts/upgrade_test_requirements.bash
100755 → 100644
Empty file.
Empty file modified scripts/url-encoder.bash
100755 → 100644
Empty file.
11 changes: 11 additions & 0 deletions services/web/client/source/class/osparc/auth/core/BaseAuthPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ qx.Class.define("osparc.auth.core.BaseAuthPage", {
el.insertInto(form);
});
this._buildPage();

this.addListener("appear", this._onAppear, this);
this.addListener("disappear", this._onDisappear, this);
},

/*
Expand Down Expand Up @@ -108,6 +111,14 @@ qx.Class.define("osparc.auth.core.BaseAuthPage", {
this.add(lbl, {
flex:1
});
},

_onAppear: function() {
return;
},

_onDisappear: function() {
return;
}
}
});
20 changes: 13 additions & 7 deletions services/web/client/source/class/osparc/auth/ui/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ qx.Class.define("osparc.auth.ui.LoginView", {
members: {
// overrides base
__form: null,
__loginBtn: null,

_buildPage: function() {
this.__form = new qx.ui.form.Form();

Expand Down Expand Up @@ -85,17 +87,11 @@ qx.Class.define("osparc.auth.ui.LoginView", {
this.add(pass);
this.__form.add(pass, "", null, "password", null);

const loginBtn = new osparc.ui.form.FetchButton(this.tr("Sign in"));
const loginBtn = this.__loginBtn = new osparc.ui.form.FetchButton(this.tr("Sign in"));
loginBtn.addListener("execute", () => {
loginBtn.setFetching(true);
this.__login(loginBtn);
}, this);
// Listen to "Enter" key
this.addListener("keypress", keyEvent => {
if (keyEvent.getKeyIdentifier() === "Enter") {
this.__login();
}
}, this);
osparc.utils.Utils.setIdToWidget(loginBtn, "loginSubmitBtn");
this.add(loginBtn);

Expand Down Expand Up @@ -201,6 +197,16 @@ qx.Class.define("osparc.auth.ui.LoginView", {
for (const key in fieldItems) {
fieldItems[key].resetValue();
}
},

_onAppear: function() {
// Listen to "Enter" key
const command = new qx.ui.command.Command("Enter");
this.__loginBtn.setCommand(command);
},

_onDisappear: function() {
this.__loginBtn.setCommand(null);
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ qx.Class.define("osparc.auth.ui.RegistrationView", {

members: {
__email: null,
__submitBtn: null,
__cancelBtn: null,

// overrides base
_buildPage: function() {
Expand All @@ -47,6 +49,10 @@ qx.Class.define("osparc.auth.ui.RegistrationView", {
this.add(email);
osparc.utils.Utils.setIdToWidget(email, "registrationEmailFld");
this.__email = email;
this.addListener("appear", () => {
email.focus();
email.activate();
});

// const uname = new qx.ui.form.TextField().set({
// required: true,
Expand Down Expand Up @@ -86,13 +92,13 @@ qx.Class.define("osparc.auth.ui.RegistrationView", {
// submit & cancel buttons
const grp = new qx.ui.container.Composite(new qx.ui.layout.HBox(10));

const submitBtn = new qx.ui.form.Button(this.tr("Submit"));
const submitBtn = this.__submitBtn = new qx.ui.form.Button(this.tr("Submit"));
osparc.utils.Utils.setIdToWidget(submitBtn, "registrationSubmitBtn");
grp.add(submitBtn, {
flex:1
});

const cancelBtn = new qx.ui.form.Button(this.tr("Cancel"));
const cancelBtn = this.__cancelBtn = new qx.ui.form.Button(this.tr("Cancel"));
osparc.utils.Utils.setIdToWidget(cancelBtn, "registrationCancelBtn");
grp.add(cancelBtn, {
flex:1
Expand Down Expand Up @@ -132,7 +138,21 @@ qx.Class.define("osparc.auth.ui.RegistrationView", {
};

manager.register(userData, successFun, failFun, this);
}
},

_onAppear: function() {
// Listen to "Enter" key
const commandEnter = new qx.ui.command.Command("Enter");
this.__submitBtn.setCommand(commandEnter);

// Listen to "Esc" key
const commandEsc = new qx.ui.command.Command("Esc");
this.__cancelBtn.setCommand(commandEsc);
},

_onDisappear: function() {
this.__submitBtn.setCommand(null);
this.__cancelBtn.setCommand(null);
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,36 @@ qx.Class.define("osparc.auth.ui.ResetPassRequestView", {
*/

members: {
__submitBtn: null,
__cancelBtn: null,

// overrides base
_buildPage: function() {
let manager = new qx.ui.form.validation.Manager();
const manager = new qx.ui.form.validation.Manager();

this._addTitleHeader(this.tr("Reset Password"));

// email
let email = new qx.ui.form.TextField();
const email = new qx.ui.form.TextField();
email.setRequired(true);
email.setPlaceholder(this.tr("Introduce your registration email"));
this.add(email);
this.addListener("appear", () => {
email.focus();
email.activate();
});

manager.add(email, qx.util.Validate.email());

// submit and cancel buttons
let grp = new qx.ui.container.Composite(new qx.ui.layout.HBox(10));
const grp = new qx.ui.container.Composite(new qx.ui.layout.HBox(10));

let submitBtn = new qx.ui.form.Button(this.tr("Submit"));
const submitBtn = this.__submitBtn = new qx.ui.form.Button(this.tr("Submit"));
grp.add(submitBtn, {
flex:1
});

let cancelBtn = new qx.ui.form.Button(this.tr("Cancel"));
const cancelBtn = this.__cancelBtn = new qx.ui.form.Button(this.tr("Cancel"));
grp.add(cancelBtn, {
flex:1
});
Expand All @@ -73,20 +79,34 @@ qx.Class.define("osparc.auth.ui.ResetPassRequestView", {
__submit: function(email) {
console.debug("sends email to reset password to ", email);

let manager = osparc.auth.Manager.getInstance();
const manager = osparc.auth.Manager.getInstance();

let successFun = function(log) {
const successFun = function(log) {
this.fireDataEvent("done", log.message);
osparc.component.message.FlashMessenger.getInstance().log(log);
};

let failFun = function(msg) {
const failFun = function(msg) {
msg = msg || this.tr("Could not request password reset");
osparc.component.message.FlashMessenger.getInstance().logAs(msg, "ERROR");
};

manager.resetPasswordRequest(email.getValue(), successFun, failFun, this);
}
},

_onAppear: function() {
// Listen to "Enter" key
const commandEnter = new qx.ui.command.Command("Enter");
this.__submitBtn.setCommand(commandEnter);

// Listen to "Esc" key
const commandEsc = new qx.ui.command.Command("Esc");
this.__cancelBtn.setCommand(commandEsc);
},

_onDisappear: function() {
this.__submitBtn.setCommand(null);
this.__cancelBtn.setCommand(null);
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

/**
* Container for StudyBrowserListItems or any other ToggleButtons, with some convenient methods.
* Container for StudyBrowserButtonItems or any other ToggleButtons, with some convenient methods.
*/
qx.Class.define("osparc.component.form.ToggleButtonContainer", {
extend: qx.ui.container.Composite,
Expand All @@ -16,7 +16,8 @@ qx.Class.define("osparc.component.form.ToggleButtonContainer", {
},

events: {
changeSelection: "qx.event.type.Data"
changeSelection: "qx.event.type.Data",
changeVisibility: "qx.event.type.Data"
},

members: {
Expand All @@ -27,6 +28,9 @@ qx.Class.define("osparc.component.form.ToggleButtonContainer", {
child.addListener("changeValue", e => {
this.fireDataEvent("changeSelection", this.getSelection());
}, this);
child.addListener("changeVisibility", e => {
this.fireDataEvent("changeVisibility", this.getVisibles());
}, this);
} else {
console.error("ToggleButtonContainer only allows ToggleButton as its children.");
}
Expand All @@ -46,6 +50,13 @@ qx.Class.define("osparc.component.form.ToggleButtonContainer", {
return this.getChildren().filter(button => button.getValue());
},

/**
* Returns an array that contains all visible buttons.
*/
getVisibles: function() {
return this.getChildren().filter(button => button.isVisible());
},

/**
* Sets the given button's value to true (checks it) and unchecks all other buttons. If the given button is not present,
* every button in the container will get a false value (unchecked).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ qx.Class.define("osparc.component.metadata.StudyDetailsEditor", {
btn.resetIcon();
btn.getChildControl("icon").getContentElement()
.removeClass("rotate");
this.fireDataEvent(this.__isTemplate ? "updatedTemplate" : "updatedStudy", data);
this.__model.set(data);
this.setMode("display");
this.fireDataEvent(this.__isTemplate ? "updatedTemplate" : "updatedStudy", data);
})
.catch(err => {
btn.resetIcon();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
* Here is a little example of how to use the widget.
*
* <pre class='javascript'>
* let dashboard = new osparc.desktop.Dashboard();
* let dashboard = new osparc.dashboard.Dashboard();
* this.getRoot().add(dashboard);
* </pre>
*/

qx.Class.define("osparc.desktop.Dashboard", {
qx.Class.define("osparc.dashboard.Dashboard", {
extend: qx.ui.tabview.TabView,

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

this.setBarPosition("left");
this.setBarPosition("top");

osparc.wrapper.JsonDiffPatch.getInstance().init();
osparc.wrapper.JsonTreeViewer.getInstance().init();
Expand Down Expand Up @@ -71,9 +71,9 @@ qx.Class.define("osparc.desktop.Dashboard", {

__createMainViewLayout: function() {
[
[this.tr("Studies"), this.__createStudiesView],
[this.tr("Services"), this.__createServicesLayout],
[this.tr("Data"), this.__createDataManagerLayout]
[this.tr("Studies"), this.__createStudyBrowser],
[this.tr("Services"), this.__createServiceBrowser],
[this.tr("Data"), this.__createDataBrowser]
].forEach(tuple => {
const tabPage = new qx.ui.tabview.Page(tuple[0]).set({
appearance: "dashboard-page"
Expand All @@ -97,18 +97,18 @@ qx.Class.define("osparc.desktop.Dashboard", {
}, this);
},

__createStudiesView: function() {
const studiesView = this.__prjBrowser = new osparc.desktop.StudyBrowser();
__createStudyBrowser: function() {
const studiesView = this.__prjBrowser = new osparc.dashboard.StudyBrowser();
return studiesView;
},

__createServicesLayout: function() {
const servicesView = this.__serviceBrowser = new osparc.desktop.ServiceBrowser();
__createServiceBrowser: function() {
const servicesView = this.__serviceBrowser = new osparc.dashboard.ServiceBrowser();
return servicesView;
},

__createDataManagerLayout: function() {
const dataManagerView = this.__dataManager = new osparc.desktop.DataBrowser();
__createDataBrowser: function() {
const dataManagerView = this.__dataManager = new osparc.dashboard.DataBrowser();
return dataManagerView;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
* Here is a little example of how to use the widget.
*
* <pre class='javascript'>
* let dataManager = new osparc.desktop.DataBrowser();
* let dataManager = new osparc.dashboard.DataBrowser();
* this.getRoot().add(dataManager);
* </pre>
*/

qx.Class.define("osparc.desktop.DataBrowser", {
qx.Class.define("osparc.dashboard.DataBrowser", {
extend: qx.ui.core.Widget,

construct: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
* Here is a little example of how to use the widget.
*
* <pre class='javascript'>
* let servicesView = this.__serviceBrowser = new osparc.desktop.ServiceBrowser();
* let servicesView = this.__serviceBrowser = new osparc.dashboard.ServiceBrowser();
* this.getRoot().add(servicesView);
* </pre>
*/

qx.Class.define("osparc.desktop.ServiceBrowser", {
qx.Class.define("osparc.dashboard.ServiceBrowser", {
extend: qx.ui.core.Widget,

construct: function() {
Expand Down Expand Up @@ -150,7 +150,7 @@ qx.Class.define("osparc.desktop.ServiceBrowser", {
const servCtrl = new qx.data.controller.List(latestServicesModel, servicesUIList, "name");
servCtrl.setDelegate({
createItem: () => {
const item = new osparc.desktop.ServiceBrowserListItem();
const item = new osparc.dashboard.ServiceBrowserListItem();
item.subscribeToFilterGroup("serviceBrowser");
item.addListener("tap", e => {
servicesUIList.setSelection([item]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* <pre class='javascript'>
* tree.setDelegate({
* createItem: () => new osparc.desktop.ServiceBrowserListItem(),
* createItem: () => new osparc.dashboard.ServiceBrowserListItem(),
* bindItem: (c, item, id) => {
* c.bindProperty("key", "model", null, item, id);
* c.bindProperty("name", "title", null, item, id);
Expand All @@ -41,7 +41,7 @@
* </pre>
*/

qx.Class.define("osparc.desktop.ServiceBrowserListItem", {
qx.Class.define("osparc.dashboard.ServiceBrowserListItem", {
extend: qx.ui.core.Widget,
implement : [qx.ui.form.IModel, osparc.component.filter.IFilterable],
include : [qx.ui.form.MModelProperty, osparc.component.filter.MFilterable],
Expand Down
Loading