Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
46540f31
Unverified
Commit
46540f31
authored
Jun 30, 2020
by
Ivana Huckova
Committed by
GitHub
Jun 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix strict null errors that resulted from search (#25950)
parent
4bb3f665
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
public/app/core/utils/richHistory.ts
+2
-2
public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx
+3
-3
public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx
+3
-3
No files found.
public/app/core/utils/richHistory.ts
View file @
46540f31
...
...
@@ -346,7 +346,7 @@ export function filterQueriesBySearchFilter(queries: RichHistoryQuery[], searchF
const
listOfMatchingQueries
=
query
.
queries
.
filter
(
query
=>
// Remove fields in which we don't want to be searching
Object
.
values
(
_
.
omit
(
query
,
[
'datasource'
,
'key'
,
'refId'
,
'hide'
,
'queryType'
])).
some
(
value
=>
Object
.
values
(
_
.
omit
(
query
,
[
'datasource'
,
'key'
,
'refId'
,
'hide'
,
'queryType'
])).
some
(
(
value
:
any
)
=>
value
.
toString
().
includes
(
searchFilter
)
)
);
...
...
@@ -356,7 +356,7 @@ export function filterQueriesBySearchFilter(queries: RichHistoryQuery[], searchF
}
export
function
filterQueriesByDataSource
(
queries
:
RichHistoryQuery
[],
listOfDatasourceFilters
:
string
[]
|
null
)
{
return
listOfDatasourceFilters
?
.
length
>
0
return
listOfDatasourceFilters
&&
listOfDatasourceFilters
.
length
>
0
?
queries
.
filter
(
q
=>
listOfDatasourceFilters
.
includes
(
q
.
datasourceName
))
:
queries
;
}
...
...
public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx
View file @
46540f31
...
...
@@ -138,7 +138,7 @@ export function RichHistoryQueriesTab(props: Props) {
}
=
props
;
const
[
timeFilter
,
setTimeFilter
]
=
useState
<
[
number
,
number
]
>
([
0
,
retentionPeriod
]);
const
[
filteredQueries
,
setFilteredQueries
]
=
useState
([]);
const
[
filteredQueries
,
setFilteredQueries
]
=
useState
<
RichHistoryQuery
[]
>
([]);
const
[
searchInput
,
setSearchInput
]
=
useState
(
''
);
const
theme
=
useTheme
();
...
...
@@ -153,7 +153,7 @@ export function RichHistoryQueriesTab(props: Props) {
filterAndSortQueries
(
queries
,
sortOrder
,
datasourceFilters
?.
map
(
d
=>
d
.
value
),
datasourceFilters
?.
map
(
d
=>
d
.
value
)
as
string
[]
|
null
,
searchValue
,
timeFilter
)
...
...
@@ -167,7 +167,7 @@ export function RichHistoryQueriesTab(props: Props) {
filterAndSortQueries
(
queries
,
sortOrder
,
datasourceFilters
?.
map
(
d
=>
d
.
value
),
datasourceFilters
?.
map
(
d
=>
d
.
value
)
as
string
[]
|
null
,
searchInput
,
timeFilter
)
...
...
public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx
View file @
46540f31
...
...
@@ -83,7 +83,7 @@ export function RichHistoryStarredTab(props: Props) {
exploreId
,
}
=
props
;
const
[
filteredQueries
,
setFilteredQueries
]
=
useState
([]);
const
[
filteredQueries
,
setFilteredQueries
]
=
useState
<
RichHistoryQuery
[]
>
([]);
const
[
searchInput
,
setSearchInput
]
=
useState
(
''
);
const
theme
=
useTheme
();
...
...
@@ -99,7 +99,7 @@ export function RichHistoryStarredTab(props: Props) {
filterAndSortQueries
(
starredQueries
,
sortOrder
,
datasourceFilters
?.
map
(
d
=>
d
.
value
),
datasourceFilters
?.
map
(
d
=>
d
.
value
)
as
string
[]
|
null
,
searchValue
)
);
...
...
@@ -112,7 +112,7 @@ export function RichHistoryStarredTab(props: Props) {
filterAndSortQueries
(
starredQueries
,
sortOrder
,
datasourceFilters
?.
map
(
d
=>
d
.
value
),
datasourceFilters
?.
map
(
d
=>
d
.
value
)
as
string
[]
|
null
,
searchInput
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment