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
151b838f
Commit
151b838f
authored
Jan 22, 2019
by
Hugo Häggmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes:#14282 - Do not change folder for persisted dashboards
parent
9c8dea06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
public/app/features/dashboard/folder_picker/folder_picker.ts
+10
-1
public/app/features/dashboard/save_as_modal.ts
+2
-1
public/app/features/dashboard/settings/settings.html
+2
-1
No files found.
public/app/features/dashboard/folder_picker/folder_picker.ts
View file @
151b838f
...
...
@@ -21,6 +21,7 @@ export class FolderPickerCtrl {
hasValidationError
:
boolean
;
validationError
:
any
;
isEditor
:
boolean
;
dashboardId
?:
number
;
/** @ngInject */
constructor
(
private
backendSrv
,
private
validationSrv
,
private
contextSrv
)
{
...
...
@@ -131,6 +132,7 @@ export class FolderPickerCtrl {
private
loadInitialValue
()
{
const
resetFolder
=
{
text
:
this
.
initialTitle
,
value
:
null
};
const
rootFolder
=
{
text
:
this
.
rootName
,
value
:
0
};
const
emptyFolder
=
{
text
:
''
,
value
:
null
};
this
.
getOptions
(
''
).
then
(
result
=>
{
let
folder
;
...
...
@@ -144,7 +146,13 @@ export class FolderPickerCtrl {
if
(
this
.
isEditor
)
{
folder
=
rootFolder
;
}
else
{
folder
=
result
.
length
>
0
?
result
[
0
]
:
resetFolder
;
// We shouldn't assign a random folder without the user actively choosing it on a persisted dashboard
const
isPersistedDashBoard
=
this
.
dashboardId
?
true
:
false
;
if
(
isPersistedDashBoard
)
{
folder
=
emptyFolder
;
}
else
{
folder
=
result
.
length
>
0
?
result
[
0
]
:
resetFolder
;
}
}
}
...
...
@@ -176,6 +184,7 @@ export function folderPicker() {
exitFolderCreation
:
'&'
,
enableCreateNew
:
'@'
,
enableReset
:
'@'
,
dashboardId
:
'<?'
,
},
};
}
...
...
public/app/features/dashboard/save_as_modal.ts
View file @
151b838f
...
...
@@ -25,7 +25,8 @@ const template = `
enter-folder-creation="ctrl.onEnterFolderCreation()"
exit-folder-creation="ctrl.onExitFolderCreation()"
enable-create-new="true"
label-class="width-7">
label-class="width-7"
dashboard-id="ctrl.clone.id">
</folder-picker>
</div>
</div>
...
...
public/app/features/dashboard/settings/settings.html
View file @
151b838f
...
...
@@ -51,7 +51,8 @@
on-change=
"ctrl.onFolderChange($folder)"
enable-create-new=
"true"
is-valid-selection=
"true"
label-class=
"width-7"
>
label-class=
"width-7"
dashboard-id=
"ctrl.dashboard.id"
>
</folder-picker>
<gf-form-switch
class=
"gf-form"
label=
"Editable"
tooltip=
"Uncheck, then save and reload to disable all dashboard editing"
checked=
"ctrl.dashboard.editable"
label-class=
"width-7"
>
</gf-form-switch>
...
...
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