Skip to content

✨ [Frontend] Templates and Public Projects in Study Browser #7676

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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d7fe9ac
two more sections
odeimaiz May 14, 2025
f3e55da
Merge branch 'master' into feature/templates-in-project-browser
odeimaiz May 14, 2025
f4c0b1a
contexts
odeimaiz May 14, 2025
6e99f07
make them radio button
odeimaiz May 14, 2025
f82d620
Headers
odeimaiz May 14, 2025
67dd452
fetchTemplatesPaginated
odeimaiz May 14, 2025
f7696c5
minor
odeimaiz May 14, 2025
d96b267
minor
odeimaiz May 14, 2025
1e7df57
load resources
odeimaiz May 14, 2025
cd3e76b
list templates
odeimaiz May 14, 2025
b8a34cf
minor
odeimaiz May 14, 2025
92c99bf
paginated templates
odeimaiz May 14, 2025
25a5e7d
minor
odeimaiz May 14, 2025
9b6ab50
Confirmation
odeimaiz May 14, 2025
f1af430
workspacesContainer visibility
odeimaiz May 14, 2025
35ee7cd
foldersContainer visibility
odeimaiz May 14, 2025
36a7f2c
more compact header
odeimaiz May 14, 2025
e47e57e
Merge branch 'master' into feature/templates-in-project-browser
odeimaiz May 15, 2025
e054f73
minor
odeimaiz May 15, 2025
147fe50
TemplateBrowser -> TutorialBrowser
odeimaiz May 15, 2025
33957a0
rewording
odeimaiz May 15, 2025
e4089ac
minor
odeimaiz May 15, 2025
a51a1c3
Status mapping
odeimaiz May 15, 2025
7c02420
minor
odeimaiz May 15, 2025
3189e64
make sure maxs are not larger than the mins
odeimaiz May 15, 2025
c0f35e8
minor
odeimaiz May 15, 2025
ea19a5a
minor fix
odeimaiz May 15, 2025
21de32e
Update services/static-webserver/client/source/class/osparc/jobs/Runs…
odeimaiz May 15, 2025
3c726a9
Update services/static-webserver/client/source/class/osparc/info/Serv…
odeimaiz May 15, 2025
dfe65a9
Study -> Project
odeimaiz May 15, 2025
156feea
Merge branch 'feature/templates-in-project-browser' of github.com:ode…
odeimaiz May 15, 2025
75ba2e3
Merge branch 'master' into feature/templates-in-project-browser
odeimaiz May 15, 2025
3d065cb
fix playwright
odeimaiz May 15, 2025
940f4bd
Merge branch 'feature/templates-in-project-browser' of github.com:ode…
odeimaiz May 15, 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 @@ -18,7 +18,7 @@
/**
* Widget containing a TabView including:
* - StudyBrowser
* - TemplateBrowser
* - TutorialBrowser
* - AppBrowser
* - DataBrowser
*
Expand Down Expand Up @@ -82,16 +82,16 @@ qx.Class.define("osparc.dashboard.Dashboard", {

members: {
__studyBrowser: null,
__templateBrowser: null,
__tutorialBrowser: null,
__appBrowser: null,
__dataBrowser: null,

getStudyBrowser: function() {
return this.__studyBrowser;
},

getTemplateBrowser: function() {
return this.__templateBrowser;
getTutorialBrowser: function() {
return this.__tutorialBrowser;
},

getAppBrowser: function() {
Expand All @@ -104,23 +104,17 @@ qx.Class.define("osparc.dashboard.Dashboard", {
const tabs = [{
id: "studiesTab",
buttonId: "studiesTabBtn",
label: osparc.product.Utils.getStudyAlias({
plural: true,
allUpperCase: true
}),
label: this.tr("PROJECTS"),
icon: "@FontAwesome5Solid/file/"+tabIconSize,
buildLayout: this.__createStudyBrowser
}];
if (permissions.canDo("dashboard.templates.read")) {
tabs.push({
id: "templatesTab",
buttonId: "templatesTabBtn",
label: osparc.product.Utils.getTemplateAlias({
plural: true,
allUpperCase: true
}),
label: this.tr("TUTORIALS"),
icon: "@FontAwesome5Solid/copy/"+tabIconSize,
buildLayout: this.__createTemplateBrowser
buildLayout: this.__createTutorialBrowser
});
}
if (permissions.canDo("dashboard.services.read")) {
Expand Down Expand Up @@ -228,8 +222,8 @@ qx.Class.define("osparc.dashboard.Dashboard", {
return studiesView;
},

__createTemplateBrowser: function() {
const templatesView = this.__templateBrowser = new osparc.dashboard.TemplateBrowser();
__createTutorialBrowser: function() {
const templatesView = this.__tutorialBrowser = new osparc.dashboard.TutorialBrowser();
return templatesView;
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
}

if (permissions.canDo("dashboard.services.read")) {
const servicesButton = this.self().createMenuButton("@FontAwesome5Solid/cog/16", this.tr("Services..."));
const servicesButton = this.self().createMenuButton("@FontAwesome5Solid/cog/16", this.tr("Apps..."));
servicesButton.addListener("execute", () => this.fireDataEvent("changeTab", "appsTab"), this);
moreMenu.add(servicesButton);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
this.__tagButtons = [];
this.__appTypeButtons = [];

this._setLayout(new qx.ui.layout.VBox(15));
this._setLayout(new qx.ui.layout.VBox(10));
this.__buildLayout();
},

events: {
"templatesContext": "qx.event.type.Event",
"publicContext": "qx.event.type.Event",
"trashContext": "qx.event.type.Event",
"changeTab": "qx.event.type.Data",
"trashStudyRequested": "qx.event.type.Data",
Expand All @@ -46,6 +48,8 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
members: {
__resourceType: null,
__workspacesAndFoldersTree: null,
__templatesButton: null,
__publicProjectsButton: null,
__trashButton: null,
__sharedWithButtons: null,
__tagButtons: null,
Expand All @@ -56,6 +60,8 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
switch (this.__resourceType) {
case "study": {
this._add(this.__createWorkspacesAndFoldersTree());
this._add(this.__createTemplates());
this._add(this.__createPublicProjects());
this._add(this.__createTrashBin());
this._add(filtersSpacer);
const scrollView = new qx.ui.container.Scroll();
Expand Down Expand Up @@ -90,6 +96,8 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
});
this.__workspacesAndFoldersTree.contextChanged(context);

this.__templatesButton.setValue(context === "templates");
this.__publicProjectsButton.setValue(context === "public");
this.__trashButton.setValue(context === "trash");
},

Expand All @@ -116,6 +124,40 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
},
/* /WORKSPACES AND FOLDERS */

__createTemplates: function() {
const templatesButton = this.__templatesButton = new qx.ui.toolbar.RadioButton().set({
value: false,
appearance: "filter-toggle-button",
label: this.tr("Templates"),
icon: "@FontAwesome5Solid/copy/16",
paddingLeft: 10, // align it with the context
});
templatesButton.addListener("changeValue", e => {
const templatesEnabled = e.getData();
if (templatesEnabled) {
this.fireEvent("templatesContext");
}
});
return templatesButton;
},

__createPublicProjects: function() {
const publicProjectsButton = this.__publicProjectsButton = new qx.ui.toolbar.RadioButton().set({
value: false,
appearance: "filter-toggle-button",
label: this.tr("Public Projects"),
icon: "@FontAwesome5Solid/globe/16",
paddingLeft: 10, // align it with the context
});
publicProjectsButton.addListener("changeValue", e => {
const templatesEnabled = e.getData();
if (templatesEnabled) {
this.fireEvent("publicContext");
}
});
return publicProjectsButton;
},

/* TRASH BIN */
__createTrashBin: function() {
const trashButton = this.__trashButton = new qx.ui.toolbar.RadioButton().set({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

if (resourceType === "study") {
const workspacesContainer = this.__workspacesContainer = new osparc.dashboard.CardContainer();
this.__workspacesContainer.exclude();
this._add(workspacesContainer);

const foldersContainer = this.__foldersContainer = new osparc.dashboard.CardContainer();
this.__foldersContainer.exclude();
this._add(foldersContainer);
}

Expand Down Expand Up @@ -294,26 +296,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
this.__groupedContainersList = [];
},

__addFoldersContainer: function() {
// add foldersContainer dynamically
[
"addChildWidget",
"removeChildWidget"
].forEach(ev => {
this.__foldersContainer.addListener(ev, () => {
const children = this.__foldersContainer.getChildren();
if (children.length && !children.includes(this.__foldersContainer)) {
this._addAt(this.__foldersContainer, 0);
return;
}
if (children.length === 0 && children.includes(this.__foldersContainer)) {
this._remove(this.__foldersContainer);
return;
}
})
});
},

__rebuildLayout: function(resourceType) {
this.__cleanAll();
if (this.getGroupBy()) {
Expand Down Expand Up @@ -386,6 +368,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
reloadWorkspaces: function() {
if (this.__workspacesContainer) {
this.__workspacesContainer.removeAll();
this.__workspacesContainer.exclude();
}
let workspacesCards = [];
this.__workspacesList.forEach(workspaceData => workspacesCards.push(this.__workspaceToCard(workspaceData)));
Expand All @@ -394,11 +377,13 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

addNewWorkspaceCard: function(newWorkspaceCard) {
this.__workspacesContainer.addAt(newWorkspaceCard, 0);
this.__workspacesContainer.show();
},

__workspaceToCard: function(workspaceData) {
const card = this.__createWorkspaceCard(workspaceData);
this.__workspacesContainer.add(card);
this.__workspacesContainer.show();
return card;
},

Expand All @@ -423,6 +408,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
reloadFolders: function() {
if (this.__foldersContainer) {
this.__foldersContainer.removeAll();
this.__foldersContainer.exclude();
}
let folderCards = [];
this.__foldersList.forEach(folderData => folderCards.push(this.__folderToCard(folderData)));
Expand All @@ -431,11 +417,13 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

addNewFolderCard: function(newFolderCard) {
this.__foldersContainer.addAt(newFolderCard, 0);
this.__foldersContainer.show();
},

__folderToCard: function(folderData) {
const card = this.__createFolderCard(folderData);
this.__foldersContainer.add(card);
this.__foldersContainer.show();
return card;
},

Expand Down
Loading
Loading