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

🎨 [Frontend] Search across all Workspaces and Folders #6470

Merged
merged 56 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
98f26de
listen to filterChanged
odeimaiz Sep 30, 2024
d80040c
pass text
odeimaiz Sep 30, 2024
69ee9c5
minor
odeimaiz Sep 30, 2024
6aeb887
unused
odeimaiz Sep 30, 2024
f1e2f6d
minor
odeimaiz Sep 30, 2024
dd657ff
unused
odeimaiz Sep 30, 2024
c012252
minor
odeimaiz Sep 30, 2024
a2e9003
[skip ci] minor
odeimaiz Sep 30, 2024
53b29df
unused
odeimaiz Sep 30, 2024
849c5d5
workspaceId === -2
odeimaiz Sep 30, 2024
9a2cd86
Merge branch 'master' into feature/search-full
odeimaiz Sep 30, 2024
fcd7a7f
preselect view mode
odeimaiz Sep 30, 2024
9b29842
minor
odeimaiz Sep 30, 2024
b5db797
refactor
odeimaiz Sep 30, 2024
e8280b2
comment
odeimaiz Sep 30, 2024
34727a3
simplify reload studies
odeimaiz Sep 30, 2024
5bd52fd
workspaceId === -2
odeimaiz Sep 30, 2024
11f129e
minor
odeimaiz Sep 30, 2024
e958a1a
minor
odeimaiz Sep 30, 2024
db9fb1b
minor
odeimaiz Sep 30, 2024
07a636a
unused
odeimaiz Sep 30, 2024
eb4b938
minor
odeimaiz Sep 30, 2024
3a01065
more progress
odeimaiz Sep 30, 2024
1a7c45d
new endpoint
odeimaiz Sep 30, 2024
5c50c4e
move up
odeimaiz Sep 30, 2024
457d32d
sync tree
odeimaiz Sep 30, 2024
502edd2
patching
odeimaiz Sep 30, 2024
68ab2f4
minor
odeimaiz Sep 30, 2024
ebb6619
folderId in study model
odeimaiz Sep 30, 2024
64ec5fd
Merge branch 'master' into feature/search-full
odeimaiz Oct 1, 2024
154eae6
fix
odeimaiz Oct 1, 2024
a6ae63e
show errors
odeimaiz Oct 1, 2024
bb06716
[skip ci] stop fetching
odeimaiz Oct 1, 2024
51e49b0
addFoldersContainer
odeimaiz Oct 1, 2024
03edc7a
Merge branch 'master' into feature/search-full
odeimaiz Oct 2, 2024
f36bf4d
move down
odeimaiz Oct 2, 2024
bd80411
[skip ci] fix from Matus
odeimaiz Oct 2, 2024
aea34f6
fix hasParamFromURL
odeimaiz Oct 2, 2024
ed0568b
reload studies for a new search
odeimaiz Oct 2, 2024
ef5ba3e
minor checks
odeimaiz Oct 2, 2024
a8344cc
check progress
odeimaiz Oct 2, 2024
5c31f93
refactor
odeimaiz Oct 2, 2024
9d95f66
minor
odeimaiz Oct 2, 2024
504c66b
minor
odeimaiz Oct 2, 2024
afd6890
Check with Matus
odeimaiz Oct 2, 2024
8ef9b16
Merge branch 'master' into feature/search-full
odeimaiz Oct 14, 2024
13b32bd
comments
odeimaiz Oct 14, 2024
60edcc0
resetFilters
odeimaiz Oct 14, 2024
2d071ce
undo
odeimaiz Oct 14, 2024
ac7b64a
show error message
odeimaiz Oct 14, 2024
97554f4
not needed
odeimaiz Oct 14, 2024
c0b2fb3
minor
odeimaiz Oct 14, 2024
5a53b19
check context
odeimaiz Oct 14, 2024
efa824c
minor
odeimaiz Oct 14, 2024
0051c06
Merge branch 'master' into feature/search-full
odeimaiz Oct 14, 2024
4a5fdf4
Merge branch 'master' into feature/search-full
odeimaiz Oct 15, 2024
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 @@ -52,6 +52,10 @@ qx.Class.define("osparc.dashboard.ContextBreadcrumbs", {
__rebuild: function() {
this._removeAll();

if (this.getCurrentWorkspaceId() === -2) {
return;
}

if (this.getCurrentFolderId()) {
const currentFolder = osparc.store.Folders.getInstance().getFolder(this.getCurrentFolderId());
this.__createUpstreamButtons(currentFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,10 @@ qx.Class.define("osparc.dashboard.FolderButtonBase", {
},

_shouldApplyFilter: function(data) {
console.log("_shouldApplyFilter", data);
return false;
},

_shouldReactToFilter: function(data) {
console.log("_shouldReactToFilter", data);
return false;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
const mainLayoutWithSideSpacers = new qx.ui.container.Composite(new qx.ui.layout.HBox(spacing))
this._addToMainLayout(mainLayoutWithSideSpacers);

this.__leftFilters = new qx.ui.container.Composite(new qx.ui.layout.VBox(10)).set({
this.__leftFilters = new qx.ui.container.Composite(new qx.ui.layout.VBox(15)).set({
width: leftColumnWidth
});
mainLayoutWithSideSpacers.add(this.__leftFilters);

this.__centerLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
this.__centerLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(15));
mainLayoutWithSideSpacers.add(this.__centerLayout);

const rightColum = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
const rightColum = new qx.ui.container.Composite(new qx.ui.layout.VBox());
mainLayoutWithSideSpacers.add(rightColum, {
flex: 1
});
Expand Down Expand Up @@ -236,6 +236,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
});
const textField = searchBarFilter.getChildControl("text-field");
osparc.utils.Utils.setIdToWidget(textField, "searchBarFilter-textField-"+this._resourceType);

this._addToLayout(searchBarFilter);
},

Expand Down Expand Up @@ -356,6 +357,15 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
radioGroup.add(btn);
});

if (this._resourceType === "study") {
const viewMode = osparc.utils.Utils.localCache.getLocalStorageItem("studiesViewMode");
if (viewMode) {
if (viewMode === "list") {
radioGroup.setSelection([listBtn]);
}
}
}

this._toolbar.add(viewModeLayout);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
this.__resourcesList = [];
this.__groupedContainersList = [];

const containerHeader = this.__containerHeader = new osparc.dashboard.ContextBreadcrumbs();
this._add(containerHeader);
containerHeader.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");


const workspacesContainer = this.__workspacesContainer = new osparc.dashboard.ToggleButtonContainer();
workspacesContainer.setVisibility(osparc.utils.DisabledPlugins.isFoldersEnabled() ? "visible" : "excluded");
Expand Down Expand Up @@ -64,7 +60,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
init: "grid",
nullable: false,
event: "changeMode",
apply: "reloadCards"
apply: "__reloadCards"
},

groupBy: {
Expand Down Expand Up @@ -117,8 +113,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
__workspacesList: null,
__resourcesList: null,
__groupedContainersList: null,
__foldersLayout: null,
__containerHeader: null,
__foldersContainer: null,
__workspacesContainer: null,
__nonGroupedContainer: null,
Expand Down Expand Up @@ -163,10 +157,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
}
},

getContainerHeader: function() {
return this.__containerHeader;
},

getFlatList: function() {
return this.__nonGroupedContainer;
},
Expand Down Expand Up @@ -233,7 +223,10 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
position: "bottom-right"
});
card.setMenu(menu);
card.subscribeToFilterGroup("searchBarFilter");
if (resourceData.type !== "study") {
// the backend will do the projects:search
card.subscribeToFilterGroup("searchBarFilter");
}

[
"updateStudy",
Expand Down Expand Up @@ -284,6 +277,10 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
this._removeAll();
},

__reloadCards: function(mode) {
this.reloadCards();
},

__addFoldersContainer: function() {
// add foldersContainer dynamically
[
Expand Down Expand Up @@ -356,7 +353,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

reloadWorkspaces: function() {
this.__cleanAll();
this._add(this.__containerHeader);
this._add(this.__workspacesContainer);
let workspacesCards = [];
this.__workspacesList.forEach(workspaceData => workspacesCards.push(this.__workspaceToCard(workspaceData)));
Expand All @@ -375,7 +371,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

__createWorkspaceCard: function(workspace) {
const card = new osparc.dashboard.WorkspaceButtonItem(workspace);
card.subscribeToFilterGroup("searchBarFilter");
[
"workspaceSelected",
"workspaceUpdated",
Expand Down Expand Up @@ -411,7 +406,6 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {

__createFolderCard: function(folder) {
const card = new osparc.dashboard.FolderButtonItem(folder);
card.subscribeToFilterGroup("searchBarFilter");
[
"folderSelected",
"folderUpdated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
this.__openResource();
}
})
.catch(() => this.__openButton.setFetching(false));
.catch(err => {
console.error(err);
osparc.FlashMessenger.logAs(err.message, "ERROR");
this.__openButton.setFetching(false);
});
},

__confirmUpdate: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {
});
},

resetSharedWithActiveFilter: function() {
this.__removeChips("shared-with");
this.__filter();
},

setSharedWithActiveFilter: function(optionId, optionLabel) {
this.__removeChips("shared-with");
Expand Down Expand Up @@ -353,9 +349,13 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {
}
},

__resetFilters: function() {
resetFilters: function() {
this.__removeChips();
this.getChildControl("text-field").resetValue();
},

__resetFilters: function() {
this.resetFilters();
this.__filter();
},

Expand Down
Loading
Loading