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
906cc6d3
Unverified
Commit
906cc6d3
authored
Apr 23, 2020
by
Alex Khomenko
Committed by
GitHub
Apr 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search: Fix strict null errors (#23804)
parent
c0fe5654
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
16 deletions
+22
-16
public/app/core/components/Select/SortPicker.tsx
+1
-1
public/app/features/search/components/ActionRow.tsx
+4
-2
public/app/features/search/components/ManageDashboards.tsx
+2
-1
public/app/features/search/components/SearchResultsFilter.tsx
+10
-7
public/app/features/search/hooks/useSearchQuery.ts
+1
-1
public/app/features/search/loaders.ts
+4
-4
No files found.
public/app/core/components/Select/SortPicker.tsx
View file @
906cc6d3
...
...
@@ -8,7 +8,7 @@ const searchSrv = new SearchSrv();
export
interface
Props
{
onChange
:
(
sortValue
:
SelectableValue
)
=>
void
;
value
?:
SelectableValue
;
value
?:
SelectableValue
|
null
;
placeholder
?:
string
;
}
...
...
public/app/features/search/components/ActionRow.tsx
View file @
906cc6d3
...
...
@@ -25,17 +25,19 @@ interface Props {
query
:
DashboardQuery
;
showStarredFilter
?:
boolean
;
hideSelectedTags
?:
boolean
;
hideLayout
?:
boolean
;
}
export
const
ActionRow
:
FC
<
Props
>
=
({
layout
,
onLayoutChange
,
onSortChange
,
onStarredFilterChange
,
onStarredFilterChange
=
()
=>
{}
,
onTagFilterChange
,
query
,
showStarredFilter
,
hideSelectedTags
,
hideLayout
,
})
=>
{
const
theme
=
useTheme
();
const
styles
=
getStyles
(
theme
);
...
...
@@ -43,7 +45,7 @@ export const ActionRow: FC<Props> = ({
return
(
<
div
className=
{
styles
.
actionRow
}
>
<
HorizontalGroup
spacing=
"md"
width=
"100%"
>
{
l
ayout
?
<
RadioButtonGroup
options=
{
layoutOptions
}
onChange=
{
onLayoutChange
}
value=
{
layout
}
/>
:
null
}
{
!
hideL
ayout
?
<
RadioButtonGroup
options=
{
layoutOptions
}
onChange=
{
onLayoutChange
}
value=
{
layout
}
/>
:
null
}
<
SortPicker
onChange=
{
onSortChange
}
value=
{
query
.
sort
}
/>
</
HorizontalGroup
>
<
HorizontalGroup
spacing=
"md"
justify=
"space-between"
>
...
...
public/app/features/search/components/ManageDashboards.tsx
View file @
906cc6d3
...
...
@@ -154,7 +154,8 @@ export const ManageDashboards: FC<Props> = memo(({ folderId, folderUid }) => {
onSortChange=
{
onSortChange
}
onTagFilterChange=
{
onTagFilterChange
}
query=
{
query
}
layout=
{
!
folderUid
&&
layout
}
layout=
{
layout
}
hideLayout=
{
!!
folderUid
}
onLayoutChange=
{
onLayoutChange
}
/>
)
}
...
...
public/app/features/search/components/SearchResultsFilter.tsx
View file @
906cc6d3
...
...
@@ -12,14 +12,15 @@ export interface Props {
canDelete
?:
boolean
;
canMove
?:
boolean
;
deleteItem
:
()
=>
void
;
hideLayout
?:
boolean
;
layout
:
string
;
moveTo
:
()
=>
void
;
onLayoutChange
:
Dispatch
<
SetStateAction
<
string
>>
;
onSortChange
:
onSelectChange
;
onStarredFilterChange
:
onSelectChange
;
onTagFilterChange
:
onSelectChange
;
onToggleAllChecked
:
()
=>
void
;
query
:
DashboardQuery
;
onSortChange
:
onSelectChange
;
onLayoutChange
:
Dispatch
<
SetStateAction
<
string
>>
;
layout
:
string
;
}
export
const
SearchResultsFilter
:
FC
<
Props
>
=
({
...
...
@@ -27,14 +28,15 @@ export const SearchResultsFilter: FC<Props> = ({
canDelete
,
canMove
,
deleteItem
,
hideLayout
,
layout
,
moveTo
,
onToggleAllChecked
,
onLayoutChange
,
onSortChange
,
onStarredFilterChange
,
onTagFilterChange
,
onToggleAllChecked
,
query
,
onSortChange
,
layout
,
onLayoutChange
,
})
=>
{
const
showActions
=
canDelete
||
canMove
;
const
theme
=
useTheme
();
...
...
@@ -56,6 +58,7 @@ export const SearchResultsFilter: FC<Props> = ({
<
ActionRow
{
...
{
layout
,
hideLayout
,
onLayoutChange
,
onSortChange
,
onStarredFilterChange
,
...
...
public/app/features/search/hooks/useSearchQuery.ts
View file @
906cc6d3
...
...
@@ -46,7 +46,7 @@ export const useSearchQuery = (queryParams: Partial<DashboardQuery>) => {
dispatch
({
type
:
TOGGLE_STARRED
,
payload
:
filter
.
value
});
};
const
onSortChange
=
(
sort
:
SelectableValue
)
=>
{
const
onSortChange
=
(
sort
:
SelectableValue
|
null
)
=>
{
dispatch
({
type
:
TOGGLE_SORT
,
payload
:
sort
});
};
...
...
public/app/features/search/loaders.ts
View file @
906cc6d3
...
...
@@ -41,16 +41,16 @@ export const loadFolderPage = (uid: string, activeChildId: string) => {
navModel
.
main
.
text
=
folderTitle
;
const
dashTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-dashboards'
);
dashTab
.
url
=
folderUrl
;
dashTab
!
.
url
=
folderUrl
;
if
(
folder
.
canAdmin
)
{
const
permTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-permissions'
);
permTab
.
url
=
folderUrl
+
'/permissions'
;
permTab
!
.
url
=
folderUrl
+
'/permissions'
;
const
settingsTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-settings'
);
settingsTab
.
url
=
folderUrl
+
'/settings'
;
settingsTab
!
.
url
=
folderUrl
+
'/settings'
;
}
else
{
navModel
.
main
.
children
=
[
dashTab
];
navModel
.
main
.
children
=
[
dashTab
!
];
}
return
{
folder
,
model
:
navModel
};
...
...
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