tech: mobx tests
This commit is contained in:
@@ -15,6 +15,8 @@ export class SearchResult extends React.Component<SearchResultProps, any> {
|
|||||||
this.state = {
|
this.state = {
|
||||||
search: store.search
|
search: store.search
|
||||||
};
|
};
|
||||||
|
|
||||||
|
store.search.query();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -22,12 +22,11 @@
|
|||||||
<div class="search-dropdown__col_1">
|
<div class="search-dropdown__col_1">
|
||||||
<div class="search-results-container" grafana-scrollbar>
|
<div class="search-results-container" grafana-scrollbar>
|
||||||
<h6 ng-show="!ctrl.isLoading && ctrl.results.length === 0">No dashboards matching your query were found.</h6>
|
<h6 ng-show="!ctrl.isLoading && ctrl.results.length === 0">No dashboards matching your query were found.</h6>
|
||||||
<search-result />
|
<dashboard-search-results
|
||||||
<!-- <dashboard-search-results -->
|
results="ctrl.results"
|
||||||
<!-- results="ctrl.results" -->
|
on-tag-selected="ctrl.filterByTag($tag)"
|
||||||
<!-- on-tag-selected="ctrl.filterByTag($tag)" -->
|
on-folder-expanding="ctrl.folderExpanding()"
|
||||||
<!-- on-folder-expanding="ctrl.folderExpanding()" -->
|
on-folder-expanded="ctrl.folderExpanded($folder)" />
|
||||||
<!-- on-folder-expanded="ctrl.folderExpanded($folder)" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,17 @@ export const SearchResultSection = types
|
|||||||
.actions(self => ({
|
.actions(self => ({
|
||||||
toggle() {
|
toggle() {
|
||||||
self.expanded = !self.expanded;
|
self.expanded = !self.expanded;
|
||||||
|
|
||||||
|
for (let i = 0; i < 100; i++) {
|
||||||
|
self.items.push(
|
||||||
|
ResultItem.create({
|
||||||
|
id: i,
|
||||||
|
title: "Dashboard " + self.items.length,
|
||||||
|
icon: "gicon gicon-dashboard",
|
||||||
|
url: "asd"
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user