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
46165a7f
Unverified
Commit
46165a7f
authored
Mar 16, 2020
by
Torkel Ödegaard
Committed by
GitHub
Mar 16, 2020
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SaveDashboard: Updated modal design/layout a bit (#22810)
parent
a3037e36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
packages/grafana-ui/src/components/Forms/index.ts
+2
-0
public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx
+19
-18
No files found.
packages/grafana-ui/src/components/Forms/index.ts
View file @
46165a7f
...
@@ -10,6 +10,7 @@ import { Field } from './Field';
...
@@ -10,6 +10,7 @@ import { Field } from './Field';
import
{
Button
,
LinkButton
}
from
'./Button'
;
import
{
Button
,
LinkButton
}
from
'./Button'
;
import
{
Switch
}
from
'./Switch'
;
import
{
Switch
}
from
'./Switch'
;
import
{
TextArea
}
from
'./TextArea/TextArea'
;
import
{
TextArea
}
from
'./TextArea/TextArea'
;
import
{
Checkbox
}
from
'./Checkbox'
;
const
Forms
=
{
const
Forms
=
{
RadioButtonGroup
,
RadioButtonGroup
,
...
@@ -26,6 +27,7 @@ const Forms = {
...
@@ -26,6 +27,7 @@ const Forms = {
InputControl
,
InputControl
,
AsyncSelect
,
AsyncSelect
,
TextArea
,
TextArea
,
Checkbox
,
};
};
export
{
ButtonVariant
}
from
'./Button'
;
export
{
ButtonVariant
}
from
'./Button'
;
...
...
public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx
View file @
46165a7f
import
React
,
{
useMemo
}
from
'react'
;
import
React
,
{
useMemo
}
from
'react'
;
import
{
Forms
,
Button
,
HorizontalGroup
}
from
'@grafana/ui'
;
import
{
Forms
,
Button
,
HorizontalGroup
}
from
'@grafana/ui'
;
import
{
e2e
}
from
'@grafana/e2e'
;
import
{
e2e
}
from
'@grafana/e2e'
;
import
{
SaveDashboardFormProps
}
from
'../types'
;
import
{
SaveDashboardFormProps
}
from
'../types'
;
...
@@ -30,32 +31,32 @@ export const SaveDashboardForm: React.FC<SaveDashboardFormProps> = ({ dashboard,
...
@@ -30,32 +31,32 @@ export const SaveDashboardForm: React.FC<SaveDashboardFormProps> = ({ dashboard,
>
>
{
({
register
,
errors
})
=>
(
{
({
register
,
errors
})
=>
(
<>
<>
<
Forms
.
Field
label=
"Changes description"
>
<
div
className=
"gf-form-group"
>
<
Forms
.
TextArea
{
hasTimeChanged
&&
(
name=
"message"
<
Forms
.
Checkbox
ref=
{
register
}
label=
"Save current time range as dashboard default"
placeholder=
"Add a note to describe your changes..."
autoFocus
/>
</
Forms
.
Field
>
{
hasTimeChanged
&&
(
<
Forms
.
Field
label=
"Save current time range"
description=
"Dashboard time range has changed"
>
<
Forms
.
Switch
name=
"saveTimerange"
name=
"saveTimerange"
ref=
{
register
}
ref=
{
register
}
aria
-
label=
{
e2e
.
pages
.
SaveDashboardModal
.
selectors
.
saveTimerange
}
aria
-
label=
{
e2e
.
pages
.
SaveDashboardModal
.
selectors
.
saveTimerange
}
/>
/>
</
Forms
.
Field
>
)
}
)
}
{
hasVariableChanged
&&
(
{
hasVariableChanged
&&
(
<
Forms
.
Checkbox
<
Forms
.
Field
label=
"Save current variables"
description=
"Dashboard variables have changed"
>
label=
"Save current variable values as dashboard default"
<
Forms
.
Switch
name=
"saveVariables"
name=
"saveVariables"
ref=
{
register
}
ref=
{
register
}
aria
-
label=
{
e2e
.
pages
.
SaveDashboardModal
.
selectors
.
saveVariables
}
aria
-
label=
{
e2e
.
pages
.
SaveDashboardModal
.
selectors
.
saveVariables
}
/>
/>
</
Forms
.
Field
>
)
}
)
}
{
(
hasVariableChanged
||
hasTimeChanged
)
&&
<
div
className=
"gf-form-group"
/>
}
<
Forms
.
TextArea
name=
"message"
ref=
{
register
}
placeholder=
"Add a note to describe your changes..."
autoFocus
/>
</
div
>
<
HorizontalGroup
>
<
HorizontalGroup
>
<
Button
type=
"submit"
aria
-
label=
{
e2e
.
pages
.
SaveDashboardModal
.
selectors
.
save
}
>
<
Button
type=
"submit"
aria
-
label=
{
e2e
.
pages
.
SaveDashboardModal
.
selectors
.
save
}
>
...
...
Kornkitt Poolsup
@Doratong24
mentioned in commit
4d235b97
Mar 05, 2021
mentioned in commit
4d235b97
mentioned in commit 4d235b978e24cc22e31be04635d68b3fc0b5c653
Toggle commit list
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