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
42d73080
Commit
42d73080
authored
Jan 16, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: save as enter key now works and folder selection also works, fixes #10464
parent
5eb36e65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
30 deletions
+11
-30
public/app/features/dashboard/dashboard_srv.ts
+1
-1
public/app/features/dashboard/folder_picker/folder_picker.html
+5
-13
public/app/features/dashboard/save_as_modal.ts
+5
-16
No files found.
public/app/features/dashboard/dashboard_srv.ts
View file @
42d73080
...
...
@@ -86,7 +86,7 @@ export class DashboardSrv {
save
(
clone
,
options
)
{
options
=
options
||
{};
options
.
folderId
=
this
.
dash
.
meta
.
folderId
;
options
.
folderId
=
options
.
folderId
||
this
.
dash
.
meta
.
folderId
;
return
this
.
backendSrv
.
saveDashboard
(
clone
,
options
)
...
...
public/app/features/dashboard/folder_picker/folder_picker.html
View file @
42d73080
...
...
@@ -9,29 +9,21 @@
</div>
<input
type=
"text"
class=
"gf-form-input max-width-10"
ng-
show
=
"ctrl.createNewFolder"
ng-
if
=
"ctrl.createNewFolder"
give-focus=
"ctrl.createNewFolder"
ng-model=
"ctrl.newFolderName"
ng-model-options=
"{ debounce: 400 }"
ng-class=
"{'validation-error': !ctrl.isNewFolderNameValid()}"
ng-change=
"ctrl.newFolderNameChanged()"
/>
</div>
<div
class=
"gf-form"
ng-show=
"ctrl.createNewFolder"
>
<label
class=
"gf-form-label text-success"
ng-show=
"ctrl.newFolderNameTouched && !ctrl.hasValidationError"
>
<i
class=
"fa fa-check"
></i>
</label>
</div>
<div
class=
"gf-form"
ng-show=
"ctrl.createNewFolder"
>
<button
class=
"gf-form-label"
<div
class=
"gf-form"
ng-if=
"ctrl.createNewFolder"
>
<button
class=
"btn btn-inverse"
ng-click=
"ctrl.createFolder($event)"
ng-disabled=
"!ctrl.newFolderNameTouched || ctrl.hasValidationError"
>
<i
class=
"fa fa-fw fa-save"
></i>
Create
</button>
</div>
<div
class=
"gf-form"
ng-show=
"ctrl.createNewFolder"
>
<button
class=
"gf-form-label"
ng-click=
"ctrl.cancelCreateFolder($event)"
>
<div
class=
"gf-form"
ng-if=
"ctrl.createNewFolder"
>
<button
class=
"btn btn-inverse"
ng-click=
"ctrl.cancelCreateFolder($event)"
>
Cancel
</button>
</div>
...
...
public/app/features/dashboard/save_as_modal.ts
View file @
42d73080
...
...
@@ -13,7 +13,7 @@ const template = `
</a>
</div>
<form name="ctrl.saveForm"
ng-submit="ctrl.save()"
class="modal-content" novalidate>
<form name="ctrl.saveForm" class="modal-content" novalidate>
<div class="p-t-2">
<div class="gf-form">
<label class="gf-form-label width-7">New name</label>
...
...
@@ -22,8 +22,6 @@ const template = `
<div class="gf-form">
<folder-picker initial-folder-id="ctrl.folderId"
on-change="ctrl.onFolderChange($folder)"
enter-folder-creation="ctrl.onEnterFolderCreation()"
exit-folder-creation="ctrl.onExitFolderCreation()"
enable-create-new="true"
label-class="width-7">
</folder-picker>
...
...
@@ -31,7 +29,7 @@ const template = `
</div>
<div class="gf-form-button-row text-center">
<button type="submit" class="btn btn-success" ng-
disabled="ctrl.saveForm.$invalid || !ctrl.isValidFolderSelection
">Save</button>
<button type="submit" class="btn btn-success" ng-
click="ctrl.save()
">Save</button>
<a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a>
</div>
</form>
...
...
@@ -41,7 +39,6 @@ const template = `
export
class
SaveDashboardAsModalCtrl
{
clone
:
any
;
folderId
:
any
;
isValidFolderSelection
=
true
;
dismiss
:
()
=>
void
;
/** @ngInject */
...
...
@@ -69,25 +66,17 @@ export class SaveDashboardAsModalCtrl {
}
save
()
{
return
this
.
dashboardSrv
.
save
(
this
.
clone
).
then
(
this
.
dismiss
);
}
onEnterFolderCreation
()
{
this
.
isValidFolderSelection
=
false
;
}
onExitFolderCreation
()
{
this
.
isValidFolderSelection
=
true
;
return
this
.
dashboardSrv
.
save
(
this
.
clone
,
{
folderId
:
this
.
folderId
}).
then
(
this
.
dismiss
);
}
keyDown
(
evt
)
{
if
(
this
.
isValidFolderSelection
&&
evt
.
keyCode
===
13
)
{
if
(
evt
.
keyCode
===
13
)
{
this
.
save
();
}
}
onFolderChange
(
folder
)
{
this
.
clone
.
folderId
=
folder
.
id
;
this
.
folderId
=
folder
.
id
;
}
}
...
...
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