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();
...
@@ -8,7 +8,7 @@ const searchSrv = new SearchSrv();
export
interface
Props
{
export
interface
Props
{
onChange
:
(
sortValue
:
SelectableValue
)
=>
void
;
onChange
:
(
sortValue
:
SelectableValue
)
=>
void
;
value
?:
SelectableValue
;
value
?:
SelectableValue
|
null
;
placeholder
?:
string
;
placeholder
?:
string
;
}
}
...
...
public/app/features/search/components/ActionRow.tsx
View file @
906cc6d3
...
@@ -25,17 +25,19 @@ interface Props {
...
@@ -25,17 +25,19 @@ interface Props {
query
:
DashboardQuery
;
query
:
DashboardQuery
;
showStarredFilter
?:
boolean
;
showStarredFilter
?:
boolean
;
hideSelectedTags
?:
boolean
;
hideSelectedTags
?:
boolean
;
hideLayout
?:
boolean
;
}
}
export
const
ActionRow
:
FC
<
Props
>
=
({
export
const
ActionRow
:
FC
<
Props
>
=
({
layout
,
layout
,
onLayoutChange
,
onLayoutChange
,
onSortChange
,
onSortChange
,
onStarredFilterChange
,
onStarredFilterChange
=
()
=>
{}
,
onTagFilterChange
,
onTagFilterChange
,
query
,
query
,
showStarredFilter
,
showStarredFilter
,
hideSelectedTags
,
hideSelectedTags
,
hideLayout
,
})
=>
{
})
=>
{
const
theme
=
useTheme
();
const
theme
=
useTheme
();
const
styles
=
getStyles
(
theme
);
const
styles
=
getStyles
(
theme
);
...
@@ -43,7 +45,7 @@ export const ActionRow: FC<Props> = ({
...
@@ -43,7 +45,7 @@ export const ActionRow: FC<Props> = ({
return
(
return
(
<
div
className=
{
styles
.
actionRow
}
>
<
div
className=
{
styles
.
actionRow
}
>
<
HorizontalGroup
spacing=
"md"
width=
"100%"
>
<
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
}
/>
<
SortPicker
onChange=
{
onSortChange
}
value=
{
query
.
sort
}
/>
</
HorizontalGroup
>
</
HorizontalGroup
>
<
HorizontalGroup
spacing=
"md"
justify=
"space-between"
>
<
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 }) => {
...
@@ -154,7 +154,8 @@ export const ManageDashboards: FC<Props> = memo(({ folderId, folderUid }) => {
onSortChange=
{
onSortChange
}
onSortChange=
{
onSortChange
}
onTagFilterChange=
{
onTagFilterChange
}
onTagFilterChange=
{
onTagFilterChange
}
query=
{
query
}
query=
{
query
}
layout=
{
!
folderUid
&&
layout
}
layout=
{
layout
}
hideLayout=
{
!!
folderUid
}
onLayoutChange=
{
onLayoutChange
}
onLayoutChange=
{
onLayoutChange
}
/>
/>
)
}
)
}
...
...
public/app/features/search/components/SearchResultsFilter.tsx
View file @
906cc6d3
...
@@ -12,14 +12,15 @@ export interface Props {
...
@@ -12,14 +12,15 @@ export interface Props {
canDelete
?:
boolean
;
canDelete
?:
boolean
;
canMove
?:
boolean
;
canMove
?:
boolean
;
deleteItem
:
()
=>
void
;
deleteItem
:
()
=>
void
;
hideLayout
?:
boolean
;
layout
:
string
;
moveTo
:
()
=>
void
;
moveTo
:
()
=>
void
;
onLayoutChange
:
Dispatch
<
SetStateAction
<
string
>>
;
onSortChange
:
onSelectChange
;
onStarredFilterChange
:
onSelectChange
;
onStarredFilterChange
:
onSelectChange
;
onTagFilterChange
:
onSelectChange
;
onTagFilterChange
:
onSelectChange
;
onToggleAllChecked
:
()
=>
void
;
onToggleAllChecked
:
()
=>
void
;
query
:
DashboardQuery
;
query
:
DashboardQuery
;
onSortChange
:
onSelectChange
;
onLayoutChange
:
Dispatch
<
SetStateAction
<
string
>>
;
layout
:
string
;
}
}
export
const
SearchResultsFilter
:
FC
<
Props
>
=
({
export
const
SearchResultsFilter
:
FC
<
Props
>
=
({
...
@@ -27,14 +28,15 @@ export const SearchResultsFilter: FC<Props> = ({
...
@@ -27,14 +28,15 @@ export const SearchResultsFilter: FC<Props> = ({
canDelete
,
canDelete
,
canMove
,
canMove
,
deleteItem
,
deleteItem
,
hideLayout
,
layout
,
moveTo
,
moveTo
,
onToggleAllChecked
,
onLayoutChange
,
onSortChange
,
onStarredFilterChange
,
onStarredFilterChange
,
onTagFilterChange
,
onTagFilterChange
,
onToggleAllChecked
,
query
,
query
,
onSortChange
,
layout
,
onLayoutChange
,
})
=>
{
})
=>
{
const
showActions
=
canDelete
||
canMove
;
const
showActions
=
canDelete
||
canMove
;
const
theme
=
useTheme
();
const
theme
=
useTheme
();
...
@@ -56,6 +58,7 @@ export const SearchResultsFilter: FC<Props> = ({
...
@@ -56,6 +58,7 @@ export const SearchResultsFilter: FC<Props> = ({
<
ActionRow
<
ActionRow
{
...
{
{
...
{
layout
,
layout
,
hideLayout
,
onLayoutChange
,
onLayoutChange
,
onSortChange
,
onSortChange
,
onStarredFilterChange
,
onStarredFilterChange
,
...
...
public/app/features/search/hooks/useSearchQuery.ts
View file @
906cc6d3
...
@@ -46,7 +46,7 @@ export const useSearchQuery = (queryParams: Partial<DashboardQuery>) => {
...
@@ -46,7 +46,7 @@ export const useSearchQuery = (queryParams: Partial<DashboardQuery>) => {
dispatch
({
type
:
TOGGLE_STARRED
,
payload
:
filter
.
value
});
dispatch
({
type
:
TOGGLE_STARRED
,
payload
:
filter
.
value
});
};
};
const
onSortChange
=
(
sort
:
SelectableValue
)
=>
{
const
onSortChange
=
(
sort
:
SelectableValue
|
null
)
=>
{
dispatch
({
type
:
TOGGLE_SORT
,
payload
:
sort
});
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) => {
...
@@ -41,16 +41,16 @@ export const loadFolderPage = (uid: string, activeChildId: string) => {
navModel
.
main
.
text
=
folderTitle
;
navModel
.
main
.
text
=
folderTitle
;
const
dashTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-dashboards'
);
const
dashTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-dashboards'
);
dashTab
.
url
=
folderUrl
;
dashTab
!
.
url
=
folderUrl
;
if
(
folder
.
canAdmin
)
{
if
(
folder
.
canAdmin
)
{
const
permTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-permissions'
);
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'
);
const
settingsTab
=
navModel
.
main
.
children
.
find
((
child
:
any
)
=>
child
.
id
===
'manage-folder-settings'
);
settingsTab
.
url
=
folderUrl
+
'/settings'
;
settingsTab
!
.
url
=
folderUrl
+
'/settings'
;
}
else
{
}
else
{
navModel
.
main
.
children
=
[
dashTab
];
navModel
.
main
.
children
=
[
dashTab
!
];
}
}
return
{
folder
,
model
:
navModel
};
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