Skip to content

Commit 2f4f745

Browse files
committed
init text
1 parent 3150815 commit 2f4f745

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", {
337337
// this widget pops up a larger widget with all filters visible
338338
// and lets users search between projects, templates, public projects and, eventually, files
339339
popUpSearchBarFilter: function() {
340-
const searchBarFilterExtended = new osparc.dashboard.SearchBarFilterExtended(this, this.__resourceType);
340+
const initFilterData = this.getFilterData();
341+
const searchBarFilterExtended = new osparc.dashboard.SearchBarFilterExtended(this, this.__resourceType, initFilterData);
341342
const bounds = osparc.utils.Utils.getBounds(this);
342343
searchBarFilterExtended.setLayoutProperties({
343344
left: bounds.left,

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
1919
extend: qx.ui.core.Widget,
2020

21-
construct: function(sourceSearchBarFilter, resourceType) {
22-
this.__sourceSearchBarFilter = sourceSearchBarFilter;
23-
this.__resourceType = resourceType;
24-
21+
construct: function(sourceSearchBarFilter, resourceType, initFilterData = {}) {
2522
this.base(arguments, "searchBarFilter-"+resourceType, "searchBarFilter");
2623

2724
this._setLayout(new qx.ui.layout.VBox(10));
@@ -32,6 +29,10 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
3229
decorator: "rounded",
3330
});
3431

32+
this.__sourceSearchBarFilter = sourceSearchBarFilter;
33+
this.__resourceType = resourceType;
34+
this.__initFilterData = initFilterData;
35+
3536
this.__buildLayout();
3637

3738
// defaults to "My Projects"
@@ -75,14 +76,19 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
7576
_createChildControlImpl: function(id) {
7677
let control;
7778
switch (id) {
78-
case "search-bar-filter":
79+
case "search-bar-filter": {
7980
control = new osparc.dashboard.SearchBarFilter(this.__resourceType);
80-
control.getChildControl("text-field").addListener("appear", () => {
81-
control.getChildControl("text-field").focus();
82-
control.getChildControl("text-field").activate();
81+
const textField = control.getChildControl("text-field");
82+
if ("text" in this.__initFilterData) {
83+
textField.setValue(this.__initFilterData["text"]);
84+
}
85+
textField.addListener("appear", () => {
86+
textField.focus();
87+
textField.activate();
8388
});
8489
this._add(control);
8590
break;
91+
}
8692
case "context-buttons":
8793
control = new qx.ui.toolbar.ToolBar().set({
8894
spacing: 0,

0 commit comments

Comments
 (0)