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

Snapshots in frontend #2474

Merged
merged 160 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from 157 commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
78bdea4
LinkButton supports icon
odeimaiz Jan 14, 2021
87c32cf
Revert "LinkButton supports icon"
odeimaiz Jan 14, 2021
1adee71
Merge branch 'master' of github.com:odeimaiz/osparc-simcore
odeimaiz Jan 20, 2021
99fbf9c
Merge branch 'master' of github.com:odeimaiz/osparc-simcore
odeimaiz Mar 2, 2021
8bc0e76
Merge remote-tracking branch 'upstream/master'
odeimaiz Mar 3, 2021
9bd0460
Merge remote-tracking branch 'upstream/master'
odeimaiz Mar 25, 2021
79c2029
Merge remote-tracking branch 'upstream/master'
odeimaiz Apr 26, 2021
b75083f
Merge remote-tracking branch 'upstream/master'
odeimaiz May 3, 2021
92ba53a
Merge branch 'master' of https://github.com/ITISFoundation/osparc-sim…
odeimaiz Jun 2, 2021
4ea3d45
Iterations -> Snapshots and table improved
odeimaiz Aug 9, 2021
37568f0
snapshots resources
odeimaiz Aug 9, 2021
c1c93d0
Snapshots view
odeimaiz Aug 9, 2021
27b973d
TakeSnapshotView
odeimaiz Aug 9, 2021
c857d09
Sweeper only shows Parameters
odeimaiz Aug 9, 2021
a27d590
create snapshots only for testers
odeimaiz Aug 9, 2021
6157462
minor
odeimaiz Aug 9, 2021
6dd2e3a
snapshot helper functions
odeimaiz Aug 9, 2021
2c7037b
minor
odeimaiz Aug 9, 2021
3204fe3
StartPipelineView (with cache)
odeimaiz Aug 9, 2021
9b73b59
call StartPipelineView with cache
odeimaiz Aug 9, 2021
e724dcf
snapshot buttons
odeimaiz Aug 9, 2021
630b5de
navigate through snapshot/primary
odeimaiz Aug 9, 2021
8787d85
isIterator
odeimaiz Aug 9, 2021
17adfe5
ask for using cache eonly for snapshots
odeimaiz Aug 9, 2021
6c737a9
aesthetics
odeimaiz Aug 9, 2021
076240f
Deprecates displayOrder
pcrespov Jul 1, 2021
94d9180
Adding dev-feature flag and cleanup
pcrespov Jul 8, 2021
bf39309
Adds module with setup and handlers
pcrespov Jul 8, 2021
530e9eb
WIP [skip ci]
pcrespov Jul 9, 2021
d1619bf
adds skipsetup exception in servicelib
pcrespov Jul 9, 2021
0a6b352
Uses skip setup and skips tests
pcrespov Jul 9, 2021
cc91606
name-mania
pcrespov Jul 9, 2021
0c33c85
WIP
pcrespov Jul 11, 2021
c42754c
WIP
pcrespov Jul 12, 2021
eea9406
WIP
pcrespov Jul 13, 2021
d74aec3
WIP
pcrespov Jul 14, 2021
879ae75
minor
pcrespov Jul 15, 2021
76c0508
cleanup fixtures
pcrespov Jul 15, 2021
6b01cad
cleanup fixtures
pcrespov Jul 15, 2021
9968362
cleanup and minor fix
pcrespov Jul 15, 2021
39a688b
adds snapshot table with minimal test
pcrespov Jul 15, 2021
89481e6
minor
pcrespov Jul 15, 2021
bbd113b
exploratory tests for snapshots
pcrespov Jul 16, 2021
f8475ad
table to pydantic models
pcrespov Jul 16, 2021
b0c8353
cleanup pydantic factory
pcrespov Aug 9, 2021
c46ec2c
adds pydantic dep
pcrespov Aug 9, 2021
b89dac0
pydantic models factory
pcrespov Aug 9, 2021
7290579
WIP
pcrespov Aug 9, 2021
1129014
cleanup pg snapshots table
pcrespov Aug 10, 2021
8673692
renamed module app from parametrization to snapshots
pcrespov Aug 10, 2021
71ddc60
Revert "adds pydantic dep"
pcrespov Aug 11, 2021
84dbe57
removes factory from pg database
pcrespov Aug 11, 2021
1f4478c
adds db modesl factory in models-library
pcrespov Aug 11, 2021
c2696fe
wip snapshots
pcrespov Aug 11, 2021
332ae3e
db snapshots pass
pcrespov Aug 11, 2021
628ccc2
updates web-server oas
pcrespov Aug 11, 2021
78e3c2d
list and get snapshots
pcrespov Aug 11, 2021
c7ac5f1
fixes OAS
pcrespov Aug 11, 2021
6208511
setup snapshot app module and connects handlers to routes
pcrespov Aug 11, 2021
503e800
cleanup
pcrespov Aug 11, 2021
13fd2fc
format oas
pcrespov Aug 11, 2021
3a1e080
db migration: adds snapshots table
pcrespov Aug 11, 2021
f390cc2
Drops child index from snapshot
pcrespov Aug 11, 2021
7eca214
implements create snapshot
pcrespov Aug 11, 2021
113ec37
auto-doc
pcrespov Aug 11, 2021
4737969
fixes dependency
pcrespov Aug 12, 2021
625b796
fixes linter on too many statements
pcrespov Aug 12, 2021
02433ab
fixes wrong imports
pcrespov Aug 12, 2021
43ae1be
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 12, 2021
bcbc8f4
Merge branch 'is2392/meta-modeling-backend' of https://github.com/pcr…
odeimaiz Aug 12, 2021
b15889e
Deprecates displayOrder
pcrespov Jul 1, 2021
f5bdb48
Adding dev-feature flag and cleanup
pcrespov Jul 8, 2021
c2236a2
Adds module with setup and handlers
pcrespov Jul 8, 2021
dd82036
WIP [skip ci]
pcrespov Jul 9, 2021
b63b77d
adds skipsetup exception in servicelib
pcrespov Jul 9, 2021
c70d372
Uses skip setup and skips tests
pcrespov Jul 9, 2021
035018f
name-mania
pcrespov Jul 9, 2021
e3159e2
WIP
pcrespov Jul 11, 2021
d96598f
WIP
pcrespov Jul 12, 2021
8de856d
WIP
pcrespov Jul 13, 2021
1020ee2
WIP
pcrespov Jul 14, 2021
a433cf9
minor
pcrespov Jul 15, 2021
eb46369
cleanup fixtures
pcrespov Jul 15, 2021
a71761c
cleanup fixtures
pcrespov Jul 15, 2021
18ee075
cleanup and minor fix
pcrespov Jul 15, 2021
4f2dea8
adds snapshot table with minimal test
pcrespov Jul 15, 2021
208d776
minor
pcrespov Jul 15, 2021
5a67984
exploratory tests for snapshots
pcrespov Jul 16, 2021
16fd418
table to pydantic models
pcrespov Jul 16, 2021
40ebfd8
cleanup pydantic factory
pcrespov Aug 9, 2021
163d2ed
adds pydantic dep
pcrespov Aug 9, 2021
e0802e9
pydantic models factory
pcrespov Aug 9, 2021
3ee6971
WIP
pcrespov Aug 9, 2021
e7636d2
cleanup pg snapshots table
pcrespov Aug 10, 2021
1e08bbd
renamed module app from parametrization to snapshots
pcrespov Aug 10, 2021
5bcca19
Revert "adds pydantic dep"
pcrespov Aug 11, 2021
81f4269
removes factory from pg database
pcrespov Aug 11, 2021
b900491
adds db modesl factory in models-library
pcrespov Aug 11, 2021
9267253
wip snapshots
pcrespov Aug 11, 2021
0edd132
db snapshots pass
pcrespov Aug 11, 2021
0c670b1
updates web-server oas
pcrespov Aug 11, 2021
a7fc154
list and get snapshots
pcrespov Aug 11, 2021
50ec88c
fixes OAS
pcrespov Aug 11, 2021
4d35ea1
setup snapshot app module and connects handlers to routes
pcrespov Aug 11, 2021
bf8cc5d
cleanup
pcrespov Aug 11, 2021
b0442f8
format oas
pcrespov Aug 11, 2021
1668af0
db migration: adds snapshots table
pcrespov Aug 11, 2021
21d7197
Drops child index from snapshot
pcrespov Aug 11, 2021
b53a9a5
implements create snapshot
pcrespov Aug 11, 2021
6358253
auto-doc
pcrespov Aug 11, 2021
0f741e2
fixes dependency
pcrespov Aug 12, 2021
00bf30f
fixes linter on too many statements
pcrespov Aug 12, 2021
8782760
fixes wrong imports
pcrespov Aug 12, 2021
61656e7
Fixes setup of snapshot app module
pcrespov Aug 12, 2021
050d59b
getSnapshots added
odeimaiz Aug 12, 2021
61651f9
show snapshots button if the study has snapshots
odeimaiz Aug 12, 2021
117b465
fixes field name suffix 'uuid'
pcrespov Aug 12, 2021
46de9b5
minor
pcrespov Aug 12, 2021
f7f7d8f
fixes on models projection
pcrespov Aug 12, 2021
affd19e
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 13, 2021
eae8728
minor
odeimaiz Aug 13, 2021
b06d4fb
Merge branch 'feature/snapshots-only' of https://github.com/odeimaiz/…
odeimaiz Aug 13, 2021
fa3f953
Merge branch 'is2392/meta-modeling-backend' of https://github.com/pcr…
odeimaiz Aug 13, 2021
2d062b9
bad merge
odeimaiz Aug 13, 2021
557ebe3
get snapshots
odeimaiz Aug 13, 2021
5f6c487
[skip ci] label -> snapshot_label
odeimaiz Aug 13, 2021
aabae99
fixes creating snapshots
pcrespov Aug 13, 2021
6b48389
minor
pcrespov Aug 13, 2021
59f6923
fixing url_for
pcrespov Aug 13, 2021
a7fad98
fixes from manual exploratory testing
pcrespov Aug 13, 2021
8146419
wip tests
pcrespov Aug 13, 2021
669c4fe
Merge branch 'is2392/meta-modeling-backend' of https://github.com/pcr…
odeimaiz Aug 13, 2021
d90659e
snapshot with label
odeimaiz Aug 13, 2021
cab75c4
[skip ci] populateSnapshotsTable
odeimaiz Aug 13, 2021
e92f416
clean up
odeimaiz Aug 16, 2021
482f343
Merge remote-tracking branch 'upstream/master'
odeimaiz Aug 16, 2021
6ada252
minor
odeimaiz Aug 16, 2021
78e0b3e
[skip ci] remove delete and recreate snapshots
odeimaiz Aug 18, 2021
c2a875e
git pushMerge remote-tracking branch 'upstream/master'
odeimaiz Aug 18, 2021
cff0e14
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 18, 2021
7680153
[skip ci] bad merge
odeimaiz Aug 18, 2021
d726342
[skip ci] minor
odeimaiz Aug 18, 2021
2922e93
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 18, 2021
b6fc59b
[skip ci] minor
odeimaiz Aug 18, 2021
b63ac9f
removed Sweeper related frontend code
odeimaiz Aug 19, 2021
cc1a2b2
[skip ci] more clean up
odeimaiz Aug 19, 2021
1f7aa38
loadStudy refactored
odeimaiz Aug 20, 2021
298bfd5
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 20, 2021
03580b7
load snapshot
odeimaiz Aug 20, 2021
d0a9f1a
cleanup
odeimaiz Aug 20, 2021
b78301f
fixed weird bug
odeimaiz Aug 20, 2021
3eb5150
minor
odeimaiz Aug 20, 2021
82f06cb
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 20, 2021
6dfffff
minor
odeimaiz Aug 20, 2021
cc28871
minor renaming
odeimaiz Aug 23, 2021
f2a0fb7
clean up
odeimaiz Aug 23, 2021
f29069f
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 24, 2021
c711d3f
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 25, 2021
cb322b1
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 26, 2021
f772413
Merge branch 'master' into feature/snapshots-only
odeimaiz Aug 26, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ qx.Class.define("osparc.component.form.renderer.PropForm", {
const paramsMenuBtn = this.__getParamsMenuButton(field.key).set({
visibility: "excluded"
});
osparc.data.model.Sweeper.isSweeperEnabled()
.then(isSweeperEnabled => {
osparc.utils.Utils.isDevelopmentPlatform()
.then(areParamsEnabled => {
field.bind("visibility", paramsMenuBtn, "visibility", {
converter: visibility => (visibility === "visible" && isSweeperEnabled) ? "visible" : "excluded"
converter: visibility => (visibility === "visible" && areParamsEnabled) ? "visible" : "excluded"
});
});
return paramsMenuBtn;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/* ************************************************************************

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.snapshots.Snapshots", {
extend: osparc.ui.table.Table,

construct: function(primaryStudy) {
this.__primaryStudy = primaryStudy;

const model = this.__initModel();

this.base(arguments, model, {
initiallyHiddenColumns: [
this.self().T_POS.STUDY_ID.col,
this.self().T_POS.SNAPSHOT_ID.col,
this.self().T_POS.PARENT_ID.col
],
statusBarVisible: false
});

this.setColumnWidth(this.self().T_POS.NAME.col, 220);
this.setColumnWidth(this.self().T_POS.DATE.col, 130);

this.__populateSnapshotsTable();
},

statics: {
T_POS: {
STUDY_ID: {
col: 0,
label: "StudyId"
},
NAME: {
col: 1,
label: qx.locale.Manager.tr("Snapshot Name")
},
DATE: {
col: 2,
label: qx.locale.Manager.tr("Created At")
},
SNAPSHOT_ID: {
col: 3,
label: "SnapshotId"
},
PARENT_ID: {
col: 4,
label: "ParentId"
}
}
},

members: {
__primaryStudy: null,

getRowData: function(rowIdx) {
return this.getTableModel().getRowDataAsMap(rowIdx);
},

__initModel: function() {
const model = new qx.ui.table.model.Simple();

const cols = [];
Object.keys(this.self().T_POS).forEach(colKey => {
const idx = this.self().T_POS[colKey].col;
const label = this.self().T_POS[colKey].label;
cols.splice(idx, 0, label);
});
model.setColumns(cols);

return model;
},

__populateSnapshotsTable: function() {
const columnModel = this.getTableColumnModel();
columnModel.setDataCellRenderer(this.self().T_POS.STUDY_ID.col, new qx.ui.table.cellrenderer.String());
columnModel.setDataCellRenderer(this.self().T_POS.NAME.col, new qx.ui.table.cellrenderer.String());
columnModel.setDataCellRenderer(this.self().T_POS.DATE.col, new qx.ui.table.cellrenderer.Date());
columnModel.setDataCellRenderer(this.self().T_POS.SNAPSHOT_ID.col, new qx.ui.table.cellrenderer.String());
columnModel.setDataCellRenderer(this.self().T_POS.PARENT_ID.col, new qx.ui.table.cellrenderer.String());

this.__primaryStudy.getSnapshots()
.then(snapshots => {
const rows = [];
snapshots.reverse().forEach(snapshot => {
const row = [];
row[this.self().T_POS.STUDY_ID.col] = snapshot["project_uuid"];
row[this.self().T_POS.NAME.col] = snapshot["label"];
const date = new Date(snapshot["created_at"]);
row[this.self().T_POS.DATE.col] = osparc.utils.Utils.formatDateAndTime(date);
row[this.self().T_POS.SNAPSHOT_ID.col] = snapshot["id"];
row[this.self().T_POS.PARENT_ID.col] = snapshot["parent_uuid"];
rows.push(row);
});
this.getTableModel().setData(rows, false);
});
}
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* ************************************************************************

osparc - the simcore frontend

https://osparc.io

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

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

Authors:
* Odei Maiz (odeimaiz)

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

qx.Class.define("osparc.component.snapshots.SnapshotsView", {
extend: qx.ui.core.Widget,

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

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

if (study.hasSnapshots()) {
this.__primaryStudy = study;
const snapshotsSection = this.__buildSnapshotsSection();
this._add(snapshotsSection, {
flex: 1
});
}
},

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

members: {
__snapshotsSection: null,
__snapshotsTable: null,
__selectedSnapshot: null,
__openSnapshotBtn: null,

__buildSnapshotsSection: function() {
const snapshotsSection = this.__snapshotsSection = new qx.ui.groupbox.GroupBox(this.tr("Snapshots")).set({
layout: new qx.ui.layout.VBox(5)
});

this.__rebuildSnapshotsTable();

const openSnapshotBtn = this.__openSnapshotBtn = this.__createOpenSnapshotBtn();
openSnapshotBtn.setEnabled(false);
snapshotsSection.addAt(openSnapshotBtn, 2);
openSnapshotBtn.addListener("execute", () => {
if (this.__selectedSnapshot) {
this.fireDataEvent("openSnapshot", this.__selectedSnapshot);
}
});

return snapshotsSection;
},

__rebuildSnapshotsTable: function() {
if (this.__snapshotsTable) {
this.__snapshotsSection.remove(this.__snapshotsTable);
}

const snapshotsTable = this.__snapshotsTable = new osparc.component.snapshots.Snapshots(this.__primaryStudy);
snapshotsTable.addListener("cellTap", e => {
if (this.__openSnapshotBtn) {
this.__openSnapshotBtn.setEnabled(true);
}
const selectedRow = e.getRow();
this.__selectedSnapshot = snapshotsTable.getRowData(selectedRow);
});

this.__snapshotsSection.addAt(snapshotsTable, 1, {
flex: 1
});

return snapshotsTable;
},

__createOpenSnapshotBtn: function() {
const openSnapshotBtn = new qx.ui.form.Button(this.tr("Open Snapshot")).set({
allowGrowX: false
});
return openSnapshotBtn;
}
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/* ************************************************************************

osparc - the simcore frontend

https://osparc.io

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

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

Authors:
* Odei Maiz (odeimaiz)

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

qx.Class.define("osparc.component.snapshots.TakeSnapshotView", {
extend: qx.ui.core.Widget,

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

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

this.set({
study
});

this.__buildForm();
},

events: {
"takeSnapshot": "qx.event.type.Event",
"cancel": "qx.event.type.Event"
},

properties: {
study: {
check: "osparc.data.model.Study",
init: null,
nullable: false
}
},

members: {
__form: null,

_createChildControlImpl: function(id) {
let control;
switch (id) {
case "label":
control = new qx.ui.form.TextField();
break;
case "save-data":
control = new qx.ui.form.CheckBox().set({
value: false,
enabled: false
});
break;
case "cancel-button": {
control = new qx.ui.form.Button(this.tr("Cancel")).set({
allowGrowX: false
});
const commandEsc = new qx.ui.command.Command("Enter");
control.setCommand(commandEsc);
control.addListener("execute", () => this.fireEvent("cancel"));
break;
}
case "ok-button": {
control = new qx.ui.form.Button(this.tr("OK")).set({
allowGrowX: false
});
const commandEnter = new qx.ui.command.Command("Enter");
control.setCommand(commandEnter);
control.addListener("execute", () => {
// releaseCapture to make sure all changes are applied
this.__renderer.releaseCapture();
this.fireEvent("takeSnapshot");
});
break;
}
}
return control || this.base(arguments, id);
},

__buildForm: function() {
const form = this.__form = new qx.ui.form.Form();
const renderer = this.__renderer = new qx.ui.form.renderer.Single(form);
this._add(renderer);

const study = this.getStudy();

const label = this.getChildControl("label");
form.add(label, "Label", null, "label");
label.setValue(study.getName());

// buttons
const cancelButton = this.getChildControl("cancel-button");
form.addButton(cancelButton);
const okButton = this.getChildControl("ok-button");
form.addButton(okButton);
},

getLabel: function() {
return this.__form.getItem("label").getValue();
},

getSaveData: function() {
return this.__form.getItem("save-data").getValue();
}
}
});
Loading