Skip to content

Commit

Permalink
[TSVB] query bar shows randomly in editor page (elastic#35081)
Browse files Browse the repository at this point in the history
* [TSVB] query bar shows randomly in editor page

Fix: elastic#31267

* Fix PR comments
  • Loading branch information
alexwizp authored Apr 22, 2019
1 parent 849e1f5 commit c1e5948
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
is-refresh-paused="model.refreshInterval.pause"
refresh-interval="model.refreshInterval.value"
on-refresh-change="onRefreshChange"
watch-depth="reference"
></search-bar>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/legacy/core_plugins/kibana/public/discover/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ <h1 tabindex="0" id="kui_local_breadcrumb" class="kuiLocalBreadcrumb" ng-if="opt
is-refresh-paused="refreshInterval.pause"
refresh-interval="refreshInterval.value"
on-refresh-change="onRefreshChange"
watch-depth="reference"
></search-bar>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
refresh-interval="refreshInterval.value"
show-auto-refresh-only="showAutoRefreshOnlyInQueryBar"
on-refresh-change="onRefreshChange"
watch-depth="reference"
></search-bar>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/legacy/ui/public/search_bar/components/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ interface DateRange {
to: string;
}

/**
* NgReact lib requires that changes to the props need to be made in the directive config as well
* See [search_bar\directive\index.js] file
*/
interface Props {
query: {
query: string;
Expand Down
27 changes: 25 additions & 2 deletions src/legacy/ui/public/search_bar/directive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,33 @@ const app = uiModules.get('app/kibana', ['react']);
app.directive('searchBar', (reactDirective, localStorage) => {
return reactDirective(
wrapInI18nContext(SearchBar),
undefined,
[
['query', { watchDepth: 'reference' }],
['store', { watchDepth: 'reference' }],
['intl', { watchDepth: 'reference' }],

['onQuerySubmit', { watchDepth: 'reference' }],
['onFiltersUpdated', { watchDepth: 'reference' }],
['onRefreshChange', { watchDepth: 'reference' }],

['indexPatterns', { watchDepth: 'collection' }],
['filters', { watchDepth: 'collection' }],

'appName',
'screenTitle',
'showFilterBar',
'showQueryBar',
'showDatePicker',
'dateRangeFrom',
'dateRangeTo',
'isRefreshPaused',
'refreshInterval',
'disableAutoFocus',
'showAutoRefreshOnly',
],
{},
{
store: localStorage,
}
},
);
});

0 comments on commit c1e5948

Please sign in to comment.