Skip to content

🎨 [Frontend] Grouped list view #7845

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 30 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d0473bc
extend ui_config
odeimaiz Jun 6, 2025
13e7284
schema
odeimaiz Jun 6, 2025
4f21fd5
fetch hardcoded list
odeimaiz Jun 6, 2025
7368f65
remove groupBy from app browser
odeimaiz Jun 6, 2025
20e3047
helper
odeimaiz Jun 6, 2025
6e0dcbf
replace button by default value
odeimaiz Jun 6, 2025
523bf3a
fix
odeimaiz Jun 6, 2025
5b68c14
make it protected
odeimaiz Jun 6, 2025
8f0d7b0
logic in place
odeimaiz Jun 6, 2025
6bf0798
more progress
odeimaiz Jun 6, 2025
ede2ca2
fix
odeimaiz Jun 6, 2025
13451ef
working
odeimaiz Jun 6, 2025
eae72f2
and hide the button
odeimaiz Jun 6, 2025
e939b45
aesthetics
odeimaiz Jun 6, 2025
737f8cf
featured also in s4lacad
odeimaiz Jun 6, 2025
8738f60
tag icon
odeimaiz Jun 6, 2025
c9aac16
Merge branch 'master' into feature/group-s4l-services
odeimaiz Jun 6, 2025
3a63776
Merge branch 'feature/group-s4l-services' of github.com:odeimaiz/ospa…
odeimaiz Jun 6, 2025
6219bac
remove force grid
odeimaiz Jun 6, 2025
0064fa6
Merge branch 'master' into enh/grouped-list-view
odeimaiz Jun 6, 2025
8d15a04
minor
odeimaiz Jun 6, 2025
7f262c8
propagate signals and properties
odeimaiz Jun 6, 2025
2e148c2
Merge branch 'master' into enh/grouped-list-view
odeimaiz Jun 6, 2025
096c18f
refactor
odeimaiz Jun 6, 2025
da002bc
minor
odeimaiz Jun 6, 2025
4a86b9a
it now supports it
odeimaiz Jun 6, 2025
cae6b07
Merge branch 'master' into enh/grouped-list-view
odeimaiz Jun 6, 2025
5070ea7
refactor
odeimaiz Jun 6, 2025
a3de6b0
Merge branch 'enh/grouped-list-view' of github.com:odeimaiz/osparc-si…
odeimaiz Jun 6, 2025
e9a9426
Merge branch 'master' into enh/grouped-list-view
odeimaiz Jun 11, 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 @@ -66,7 +66,19 @@ qx.Class.define("osparc.dashboard.GroupedCardContainer", {
nullable: false,
event: "changeExpanded",
apply: "__applyExpanded"
}
},

mode: {
check: ["grid", "list"],
init: "grid",
nullable: false,
event: "changeMode"
},
},

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

members: {
Expand Down Expand Up @@ -113,12 +125,30 @@ qx.Class.define("osparc.dashboard.GroupedCardContainer", {
return control || this.base(arguments, id);
},

__modeChanged: function(container) {
osparc.dashboard.ResourceContainerManager.updateSpacing(this.getMode(), container);
if (this.getMode() === "list") {
this.set({
expanded: true,
});
}
},

__createContentContainer: function() {
let contentContainer = null;
const expanded = this.isExpanded();
const showAllBtn = this.__expandButton;
if (expanded) {
contentContainer = new osparc.dashboard.CardContainer();
this.__modeChanged(contentContainer);
this.addListener("changeMode", () => this.__modeChanged(contentContainer));
[
"changeSelection",
"changeVisibility"
].forEach(signalName => {
contentContainer.addListener(signalName, e => this.fireDataEvent(signalName, e.getData()), this);
});

showAllBtn.show();
} else {
const spacing = osparc.dashboard.GridButtonBase.SPACING;
Expand All @@ -136,7 +166,8 @@ qx.Class.define("osparc.dashboard.GroupedCardContainer", {
});
}
contentContainer.set({
padding: 5,
paddingTop: 5,
paddingBottom: 5,
allowGrowX: false
});
this._addAt(contentContainer, 1, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
},

_groupByChanged: function(groupBy) {
// if cards are grouped they need to be in grid mode
this._resourcesContainer.setMode("grid");
this.__viewModeLayout.setVisibility(groupBy ? "excluded" : "visible");
this._resourcesContainer.setGroupBy(groupBy);
this._reloadCards();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
}
}
return false;
}
},

updateSpacing: function(mode, container) {
const spacing = mode === "grid" ? osparc.dashboard.GridButtonBase.SPACING : osparc.dashboard.ListButtonBase.SPACING;
container.getLayout().set({
spacingX: spacing,
spacingY: spacing
});
},
},

members: {
Expand Down Expand Up @@ -171,18 +179,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
return this.__nonGroupedContainer;
},

__createGroupContainer: function(groupId, headerLabel, headerColor = "text") {
const groupContainer = new osparc.dashboard.GroupedCardContainer().set({
groupId: groupId.toString(),
headerLabel,
headerIcon: "",
headerColor,
visibility: "excluded"
});
this.__groupedContainersList.push(groupContainer);
return groupContainer;
},

areMoreResourcesRequired: function(loadingResourcesBtn) {
if (this.__nonGroupedContainer) {
return this.__nonGroupedContainer.areMoreResourcesRequired(loadingResourcesBtn);
Expand Down Expand Up @@ -325,15 +321,8 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

__createFlatList: function() {
const flatList = new osparc.dashboard.CardContainer();
const setContainerSpacing = () => {
const spacing = this.getMode() === "grid" ? osparc.dashboard.GridButtonBase.SPACING : osparc.dashboard.ListButtonBase.SPACING;
flatList.getLayout().set({
spacingX: spacing,
spacingY: spacing
});
};
setContainerSpacing();
this.addListener("changeMode", () => setContainerSpacing());
osparc.dashboard.ResourceContainerManager.updateSpacing(this.getMode(), flatList);
this.addListener("changeMode", () => osparc.dashboard.ResourceContainerManager.updateSpacing(this.getMode(), flatList));
[
"changeSelection",
"changeVisibility"
Expand All @@ -343,6 +332,27 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
return flatList;
},

__createGroupContainer: function(groupId, headerLabel, headerColor = "text") {
const groupContainer = new osparc.dashboard.GroupedCardContainer().set({
groupId: groupId.toString(),
headerLabel,
headerIcon: "",
headerColor,
visibility: "excluded"
});

this.bind("mode", groupContainer, "mode");
[
"changeSelection",
"changeVisibility"
].forEach(signalName => {
groupContainer.addListener(signalName, e => this.fireDataEvent(signalName, e.getData()), this);
});

this.__groupedContainersList.push(groupContainer);
return groupContainer;
},

reloadCards: function(resourceType) {
this.__rebuildLayout(resourceType);

Expand Down
Loading