mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: Enable filtering dashboards in search by current folder (#16790)
* Added search-query-parser package * Migrate search input field to react and enable current folter filtering * Reveiw changes * FIx tags * Fix event handlers passed to html elements directly * noImplicitAny fix * Debounce search method in search controller * Search: have clear reset query as well
This commit is contained in:
committed by
Torkel Ödegaard
parent
2e326d1cb8
commit
7194c6d9bf
@@ -61,7 +61,16 @@ export class DashNav extends PureComponent<Props> {
|
||||
}
|
||||
|
||||
onOpenSearch = () => {
|
||||
appEvents.emit('show-dash-search');
|
||||
const { dashboard } = this.props;
|
||||
const haveFolder = dashboard.meta.folderId > 0;
|
||||
appEvents.emit(
|
||||
'show-dash-search',
|
||||
haveFolder
|
||||
? {
|
||||
query: 'folder:current',
|
||||
}
|
||||
: null
|
||||
);
|
||||
};
|
||||
|
||||
onClose = () => {
|
||||
@@ -142,8 +151,7 @@ export class DashNav extends PureComponent<Props> {
|
||||
<a className="navbar-page-btn" onClick={this.onOpenSearch}>
|
||||
{!this.isInFullscreenOrSettings && <i className="gicon gicon-dashboard" />}
|
||||
{haveFolder && <span className="navbar-page-btn--folder">{folderTitle} / </span>}
|
||||
{dashboard.title}
|
||||
<i className="fa fa-caret-down" />
|
||||
{dashboard.title} <i className="fa fa-caret-down" />
|
||||
</a>
|
||||
</div>
|
||||
{this.isSettings && <span className="navbar-settings-title"> / Settings</span>}
|
||||
|
||||
Reference in New Issue
Block a user