Skip to content

Commit fd29a2e

Browse files
committed
shared with propagated
1 parent aee04f7 commit fd29a2e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilterExtended.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
3535

3636
this.__buildLayout();
3737

38+
this.__searchMyProjectsSelected();
39+
3840
qx.core.Init.getApplication().getRoot().add(this);
3941

4042
this.__attachHideHandlers();
@@ -161,11 +163,15 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
161163
// Set initial state based on the provided initFilterData
162164
const activeFilters = this.getChildControl("search-bar-filter").getChildControl("active-filters");
163165
const textField = this.getChildControl("search-bar-filter").getChildControl("text-field");
164-
if ("sharedWith" in this.__initFilterData) {
165-
const chip = osparc.dashboard.SearchBarFilter.createChip("sharedWith", this.__initFilterData["sharedWith"], this.tr("Shared with"));
166-
activeFilters.add(chip);
166+
if ("sharedWith" in this.__initFilterData && this.__initFilterData["sharedWith"]) {
167+
const sharedWithOptions = osparc.dashboard.SearchBarFilter.getSharedWithOptions(this.__resourceType);
168+
const optionsFound = sharedWithOptions.find(option => option.id === this.__initFilterData["sharedWith"]);
169+
if (optionsFound) {
170+
const chip = osparc.dashboard.SearchBarFilter.createChip("sharedWith", optionsFound.id, optionsFound.label);
171+
activeFilters.add(chip);
172+
}
167173
}
168-
if ("tags" in this.__initFilterData) {
174+
if ("tags" in this.__initFilterData && this.__initFilterData["tags"]) {
169175
const tags = osparc.store.Tags.getInstance().getTags();
170176
this.__initFilterData["tags"].forEach(tagId => {
171177
const tagFound = tags.find(tag => tag.getTagId() === tagId);
@@ -175,7 +181,7 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
175181
}
176182
});
177183
}
178-
if ("text" in this.__initFilterData) {
184+
if ("text" in this.__initFilterData && this.__initFilterData["text"]) {
179185
textField.setValue(this.__initFilterData["text"]);
180186
}
181187

0 commit comments

Comments
 (0)