Skip to content

✨ [Frontend] Enh: Adapt to paginated navigation and to new model #7280

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 77 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
7c29e13
minor
odeimaiz Feb 26, 2025
992c605
refactor
odeimaiz Feb 26, 2025
fc72276
[skip ci] more items
odeimaiz Feb 26, 2025
735a954
bring back the cache
odeimaiz Feb 26, 2025
86b4870
more caching
odeimaiz Feb 26, 2025
038c850
simplify resp
odeimaiz Feb 26, 2025
517e4cb
getPaths
odeimaiz Feb 26, 2025
906ea00
do not cache files
odeimaiz Feb 26, 2025
21fece7
[skip ci] minor
odeimaiz Feb 26, 2025
d2bb386
renaming
odeimaiz Feb 26, 2025
2b253f8
renaming
odeimaiz Feb 26, 2025
27a690e
[skip ci] minor
odeimaiz Feb 26, 2025
cacf6fd
getItemsByLocationAndPath
odeimaiz Feb 26, 2025
87e6abc
remove isDataset
odeimaiz Feb 26, 2025
8723ba5
minor
odeimaiz Feb 26, 2025
57a4b7d
fixes
odeimaiz Feb 26, 2025
f7add5c
[skip ci] displayPaths
odeimaiz Feb 26, 2025
8f10d09
addLoadingChild
odeimaiz Feb 26, 2025
24248f2
__pathModels
odeimaiz Feb 26, 2025
d300491
more progress
odeimaiz Feb 26, 2025
d0d8262
__itemsToTree
odeimaiz Feb 26, 2025
2b5c4a7
rename function
odeimaiz Feb 26, 2025
49234f5
more itemsToTree
odeimaiz Feb 26, 2025
7b68666
faster
odeimaiz Feb 26, 2025
4168b88
unused
odeimaiz Feb 26, 2025
a2daad8
StudyDataManager
odeimaiz Feb 26, 2025
326b50c
[skip ci] finally deprecated
odeimaiz Feb 26, 2025
db79c13
isFile
odeimaiz Feb 26, 2025
ec7642c
[skip ci] clean up and comments
odeimaiz Feb 26, 2025
17349ed
Merge branch 'master' into feature/storage-paginated
odeimaiz Feb 27, 2025
c32c569
refactor
odeimaiz Feb 27, 2025
03e5e41
Merge branch 'master' into feature/storage-paginated
odeimaiz Feb 27, 2025
7b673e7
displayPathToLabel
odeimaiz Feb 27, 2025
83c6fd9
fix conversion
odeimaiz Feb 27, 2025
cb2e553
minor
odeimaiz Feb 27, 2025
c1c48ea
[skip ci] minor fix
odeimaiz Feb 27, 2025
3a98205
PlanListItem remove hardcoded widths
odeimaiz Feb 27, 2025
73c0033
setLoaded deeper
odeimaiz Feb 27, 2025
06aa232
minor
odeimaiz Feb 27, 2025
aab934a
disable dbltap on treeitems
odeimaiz Feb 27, 2025
0101bdc
minor
odeimaiz Feb 27, 2025
3f350e1
type
odeimaiz Feb 27, 2025
16681ff
minor, navigation finished
odeimaiz Feb 27, 2025
f95473d
FileTreeItem
odeimaiz Feb 27, 2025
4b4d717
[skip ci] requestPathItems
odeimaiz Feb 27, 2025
7298952
minor
odeimaiz Feb 27, 2025
1426f16
pathToDatasetId
odeimaiz Feb 27, 2025
2818d8f
minor
odeimaiz Feb 27, 2025
cdf26d3
one left
odeimaiz Feb 27, 2025
36c7fa0
all good
odeimaiz Feb 27, 2025
fbe46dd
Merge branch 'master' into feature/storage-paginated
odeimaiz Feb 27, 2025
d2f1781
minor
odeimaiz Feb 27, 2025
d00fdb9
Merge branch 'feature/storage-paginated' of github.com:odeimaiz/ospar…
odeimaiz Feb 27, 2025
78ae894
update test
odeimaiz Feb 27, 2025
dc7f2bc
update test paths
odeimaiz Feb 28, 2025
ff6e887
update test paths
odeimaiz Feb 28, 2025
27daf14
question mark
odeimaiz Feb 28, 2025
f0c9851
Merge branch 'master' into feature/storage-paginated
odeimaiz Mar 3, 2025
6b8cb30
Merge branch 'master' into feature/storage-paginated
odeimaiz Mar 3, 2025
55bb04b
Merge branch 'master' into feature/storage-paginated
odeimaiz Mar 4, 2025
4cfe5a4
minor
odeimaiz Mar 4, 2025
49219c1
refactor and aesthetics
odeimaiz Mar 4, 2025
5aca368
?size=100
odeimaiz Mar 4, 2025
9aab778
Merge branch 'master' into feature/storage-paginated
odeimaiz Mar 5, 2025
c7d0e91
size 1000
odeimaiz Mar 5, 2025
873de8d
optimize folder population
odeimaiz Mar 5, 2025
05dccef
minor
odeimaiz Mar 5, 2025
5dc664d
[skip ci] minor
odeimaiz Mar 5, 2025
3375126
minor
odeimaiz Mar 5, 2025
8ed0218
getParent
odeimaiz Mar 5, 2025
3b51124
setFolder
odeimaiz Mar 5, 2025
1074a06
file picker file
odeimaiz Mar 5, 2025
d5e999b
add iseg to plus button
odeimaiz Mar 5, 2025
c07c6b0
simplify navigation
odeimaiz Mar 5, 2025
be749c4
minor
odeimaiz Mar 5, 2025
0629e55
sync tree and folder
odeimaiz Mar 5, 2025
1f13b5f
Merge branch 'master' into feature/storage-paginated
odeimaiz Mar 5, 2025
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 @@ -530,22 +530,20 @@ qx.Class.define("osparc.dashboard.CardBase", {

__evalSelectedButton: function() {
if (
this.hasChildControl("menu-selection-stack") &&
this.hasChildControl("menu-button") &&
this.hasChildControl("tick-selected") &&
this.hasChildControl("tick-unselected")
) {
const menuButton = this.getChildControl("menu-button");
const tick = this.getChildControl("tick-selected");
const untick = this.getChildControl("tick-unselected");
const menuButtonStack = this.getChildControl("menu-selection-stack");
if (this.isResourceType("study") && this.isMultiSelectionMode()) {
const tick = this.getChildControl("tick-selected");
const untick = this.getChildControl("tick-unselected");
const selected = this.getSelected();
menuButton.setVisibility("excluded");
tick.setVisibility(selected ? "visible" : "excluded");
untick.setVisibility(selected ? "excluded" : "visible");
menuButtonStack.setSelection(selected ? [tick] : [untick]);
} else {
menuButton.setVisibility("visible");
tick.setVisibility("excluded");
untick.setVisibility("excluded");
const menuButton = this.getChildControl("menu-button");
menuButtonStack.setSelection([menuButton]);
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ qx.Class.define("osparc.dashboard.DataBrowser", {

this.addListener("appear", () => {
const treeFolderView = this.getChildControl("tree-folder-view");
treeFolderView.getChildControl("folder-tree").populateTree();
treeFolderView.getChildControl("folder-tree").populateLocations();
treeFolderView.getChildControl("folder-viewer").setFolder(treeFolderView.getChildControl("folder-tree").getModel());
}, this);
},
Expand All @@ -84,7 +84,7 @@ qx.Class.define("osparc.dashboard.DataBrowser", {

const foldersTree = treeFolderView.getChildControl("folder-tree");
foldersTree.resetCache();
foldersTree.populateTree();
foldersTree.populateLocations();

const folderViewer = treeFolderView.getChildControl("folder-viewer");
folderViewer.resetFolder();
Expand All @@ -94,26 +94,26 @@ qx.Class.define("osparc.dashboard.DataBrowser", {
// After deleting a file, try to keep the user in the same folder.
// If the folder doesn't longer exist, open the closest available parent

const path = fileMetadata["fileUuid"].split("/");
const pathParts = fileMetadata["fileUuid"].split("/");

const treeFolderView = this.getChildControl("tree-folder-view");
const foldersTree = treeFolderView.getChildControl("folder-tree");
const folderViewer = treeFolderView.getChildControl("folder-viewer");

const openSameFolder = () => {
// drop last, which is the file
path.pop();
treeFolderView.openPath(path);
pathParts.pop();
treeFolderView.openPath(pathParts);
};

folderViewer.resetFolder();
const locationId = fileMetadata["locationId"];
const datasetId = path[0];
const path = pathParts[0];
foldersTree.resetCache();
foldersTree.populateTree()
foldersTree.populateLocations()
.then(datasetPromises => {
Promise.all(datasetPromises)
.then(() => foldersTree.requestDatasetFiles(locationId, datasetId))
.then(() => foldersTree.requestPathItems(locationId, path))
.then(() => openSameFolder());
})
.catch(err => console.error(err));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,16 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
}
case "header": {
const hGrid = new qx.ui.layout.Grid().set({
spacing: 0, // the sub-elements will take care of the padding
spacing: 6,
});
hGrid.setColumnFlex(1, 1);
hGrid.setRowAlign(0, "left", "middle");
hGrid.setColumnAlign(0, "right", "middle");
hGrid.setColumnAlign(1, "left", "middle");
hGrid.setColumnAlign(2, "center", "middle");
control = new qx.ui.container.Composite().set({
backgroundColor: "background-card-overlay",
padding: 0,
paddingBottom: 6,
paddingRight: 4,
maxWidth: this.self().ITEM_WIDTH,
maxHeight: this.self().ITEM_HEIGHT
});
Expand Down Expand Up @@ -189,37 +192,23 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
control = new qx.ui.basic.Label().set({
textColor: "contrasted-text-light",
font: "text-14",
padding: this.self().TITLE_PADDING,
maxWidth: this.self().ITEM_WIDTH,
});
layout = this.getChildControl("header");
layout.addAt(control, 0, {
layout.add(control, {
column: 1,
row: 0,
});
break;
case "subtitle":
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(6)).set({
anonymous: true,
height: 20,
padding: 6,
paddingLeft: 20, // align with icon
case "subtitle-icon": {
control = new qx.ui.basic.Image().set({
allowGrowX: false,
allowShrinkX: false,
});
layout = this.getChildControl("header");
layout.addAt(control, 0, {
layout.add(control, {
column: 0,
row: 1,
colSpan: 2,
});
break;
case "subtitle-icon": {
control = new qx.ui.basic.Image().set({
alignY: "middle",
allowGrowX: false,
allowShrinkX: false
});
const subtitleLayout = this.getChildControl("subtitle");
subtitleLayout.addAt(control, 0);
break;
}
case "subtitle-text": {
Expand All @@ -233,9 +222,10 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
font: "text-12",
allowGrowY: false
});
const subtitleLayout = this.getChildControl("subtitle");
subtitleLayout.addAt(control, 1, {
flex: 1
layout = this.getChildControl("header");
layout.add(control, {
column: 1,
row: 1,
});
break;
}
Expand Down Expand Up @@ -269,9 +259,10 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
width: 13,
margin: [0, 1]
});
layout = this.getChildControl("subtitle");
layout.set({
visibility: "visible"
layout = this.getChildControl("header");
layout.add(control, {
column: 2,
row: 1,
});
layout.addAt(control, 2);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,18 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
layout = this.getChildControl("main-layout");
layout.add(control, osparc.dashboard.GridButtonBase.POS.TAGS);
break;
case "menu-button":
case "menu-selection-stack":
control = new qx.ui.container.Stack();
control.set({
alignX: "center",
alignY: "middle"
});
this.getChildControl("header").add(control, {
column: 2,
row: 0,
});
break;
case "menu-button": {
this.getChildControl("title").set({
maxWidth: osparc.dashboard.GridButtonBase.ITEM_WIDTH - osparc.dashboard.CardBase.ICON_SIZE - this.self().MENU_BTN_DIMENSIONS - 2,
});
Expand All @@ -110,12 +121,11 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
osparc.utils.Utils.setIdToWidget(control, "studyItemMenuButton");
this._add(control, {
top: 6,
right: 6,
});
const menuSelectionStack = this.getChildControl("menu-selection-stack");
menuSelectionStack.addAt(control, 0);
break;
case "tick-unselected":
}
case "tick-unselected": {
control = new qx.ui.basic.Atom().set({
appearance: "form-button-outlined",
width: this.self().MENU_BTN_DIMENSIONS,
Expand All @@ -126,12 +136,11 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
control.getContentElement().setStyles({
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
this._add(control, {
top: 8,
right: 8
});
const menuSelectionStack = this.getChildControl("menu-selection-stack");
menuSelectionStack.addAt(control, 1);
break;
case "tick-selected":
}
case "tick-selected": {
control = new qx.ui.basic.Image().set({
appearance: "form-button",
width: this.self().MENU_BTN_DIMENSIONS,
Expand All @@ -146,11 +155,10 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
control.getContentElement().setStyles({
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
this._add(control, {
top: 8,
right: 8
});
const menuSelectionStack = this.getChildControl("menu-selection-stack");
menuSelectionStack.addAt(control, 2);
break;
}
case "lock-status":
control = new osparc.ui.basic.Thumbnail();
this._add(control, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,25 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
column: osparc.dashboard.ListButtonBase.POS.OPTIONS
});
break;
case "tick-unselected": {
case "menu-button": {
control = new qx.ui.form.MenuButton().set({
appearance: "form-button-outlined",
padding: [0, 8],
maxWidth: this.self().MENU_BTN_DIMENSIONS,
maxHeight: this.self().MENU_BTN_DIMENSIONS,
icon: "@FontAwesome5Solid/ellipsis-v/14",
focusable: false
});
// make it circular
control.getContentElement().setStyles({
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
osparc.utils.Utils.setIdToWidget(control, "studyItemMenuButton");
const menuSelectionStack = this.getChildControl("menu-selection-stack");
menuSelectionStack.addAt(control, 0);
break;
}
case "tick-unselected": {
control = new qx.ui.basic.Atom().set({
appearance: "form-button-outlined",
width: this.self().MENU_BTN_DIMENSIONS,
Expand All @@ -143,11 +160,11 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
control.getContentElement().setStyles({
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
const menuSelectionStack = this.getChildControl("menu-selection-stack");
menuSelectionStack.addAt(control, 1);
break;
}
case "tick-selected": {
const menuSelectionStack = this.getChildControl("menu-selection-stack");
control = new qx.ui.basic.Image("@FontAwesome5Solid/check/12").set({
appearance: "form-button-outlined",
width: this.self().MENU_BTN_DIMENSIONS,
Expand All @@ -158,25 +175,8 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
control.getContentElement().setStyles({
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
menuSelectionStack.addAt(control, 2);
break;
}
case "menu-button": {
const menuSelectionStack = this.getChildControl("menu-selection-stack");
control = new qx.ui.form.MenuButton().set({
appearance: "form-button-outlined",
padding: [0, 8],
maxWidth: this.self().MENU_BTN_DIMENSIONS,
maxHeight: this.self().MENU_BTN_DIMENSIONS,
icon: "@FontAwesome5Solid/ellipsis-v/14",
focusable: false
});
// make it circular
control.getContentElement().setStyles({
"border-radius": `${this.self().MENU_BTN_DIMENSIONS / 2}px`
});
osparc.utils.Utils.setIdToWidget(control, "studyItemMenuButton");
menuSelectionStack.addAt(control, 0);
menuSelectionStack.addAt(control, 2);
break;
}
}
Expand Down
Loading
Loading