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
60272d8a
Commit
60272d8a
authored
Feb 14, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple implementation for preserve tags, closes #11627
parent
2bc573c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
public/app/features/dashboard/components/SaveModals/SaveDashboardAsModalCtrl.ts
+10
-4
No files found.
public/app/features/dashboard/components/SaveModals/SaveDashboardAsModalCtrl.ts
View file @
60272d8a
...
...
@@ -16,19 +16,19 @@ const template = `
<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>
<label class="gf-form-label width-
8
">New name</label>
<input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" required>
</div>
<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
"
label-class="width-
8
"
dashboard-id="ctrl.clone.id">
</folder-picker>
</div>
<gf-form-switch class="gf-form" label="Preserve tags" label-class="width-8" checked="ctrl.preseveTags">
</gf-form-switch>
</div>
<div class="gf-form-button-row text-center">
...
...
@@ -44,6 +44,7 @@ export class SaveDashboardAsModalCtrl {
folderId
:
any
;
dismiss
:
()
=>
void
;
isValidFolderSelection
=
true
;
preseveTags
:
boolean
;
/** @ngInject */
constructor
(
private
dashboardSrv
)
{
...
...
@@ -55,6 +56,7 @@ export class SaveDashboardAsModalCtrl {
this
.
clone
.
editable
=
true
;
this
.
clone
.
hideControls
=
false
;
this
.
folderId
=
dashboard
.
meta
.
folderId
;
this
.
preseveTags
=
false
;
// remove alerts if source dashboard is already persisted
// do not want to create alert dupes
...
...
@@ -71,6 +73,10 @@ export class SaveDashboardAsModalCtrl {
}
save
()
{
if
(
!
this
.
preseveTags
)
{
this
.
clone
.
tags
=
[];
}
return
this
.
dashboardSrv
.
save
(
this
.
clone
,
{
folderId
:
this
.
folderId
}).
then
(
this
.
dismiss
);
}
...
...
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