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
b7faa902
Unverified
Commit
b7faa902
authored
Jan 30, 2020
by
Torkel Ödegaard
Committed by
GitHub
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DatasourceSettings: Fixed issue navigating away from data source settings page (#21841)
parent
050d902e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
public/app/features/plugins/plugin_component.ts
+12
-3
No files found.
public/app/features/plugins/plugin_component.ts
View file @
b7faa902
import
angular
from
'angular'
;
import
angular
,
{
ILocationService
}
from
'angular'
;
import
_
from
'lodash'
;
import
config
from
'app/core/config'
;
...
...
@@ -16,7 +16,8 @@ function pluginDirectiveLoader(
$rootScope
:
GrafanaRootScope
,
$http
:
any
,
$templateCache
:
any
,
$timeout
:
any
$timeout
:
any
,
$location
:
ILocationService
)
{
function
getTemplate
(
component
:
{
template
:
any
;
templateUrl
:
any
})
{
if
(
component
.
template
)
{
...
...
@@ -145,11 +146,19 @@ function pluginDirectiveLoader(
// Datasource ConfigCtrl
case
'datasource-config-ctrl'
:
{
const
dsMeta
=
scope
.
ctrl
.
datasourceMeta
;
const
angularUrl
=
$location
.
url
();
return
importDataSourcePlugin
(
dsMeta
).
then
(
dsPlugin
=>
{
scope
.
$watch
(
'ctrl.current'
,
()
=>
{
scope
.
onModelChanged
(
scope
.
ctrl
.
current
);
// This watcher can trigger when we navigate away due to late digests
// This check is to stop onModelChanged from being called when navigating away
// as it triggers a redux action which comes before the angular $routeChangeSucces and
// This makes the bridgeSrv think location changed from redux before detecting it was actually
// changed from angular.
if
(
angularUrl
===
$location
.
url
())
{
scope
.
onModelChanged
(
scope
.
ctrl
.
current
);
}
},
true
);
...
...
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