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
e683f6af
Commit
e683f6af
authored
Dec 20, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/10277_logout_route_full_page_reload'
parents
4acf6b0e
23cceaec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
public/app/core/services/global_event_srv.ts
+7
-1
public/app/core/specs/global_event_srv.jest.ts
+2
-2
No files found.
public/app/core/services/global_event_srv.ts
View file @
e683f6af
...
...
@@ -6,10 +6,12 @@ import appEvents from "app/core/app_events";
// Good for communication react > angular and vice verse
export
class
GlobalEventSrv
{
private
appSubUrl
;
private
fullPageReloadRoutes
;
/** @ngInject */
constructor
(
private
$location
,
private
$timeout
)
{
constructor
(
private
$location
,
private
$timeout
,
private
$window
)
{
this
.
appSubUrl
=
config
.
appSubUrl
;
this
.
fullPageReloadRoutes
=
[
"/logout"
];
}
// Angular's $location does not like <base href...> and absolute urls
...
...
@@ -27,6 +29,10 @@ export class GlobalEventSrv {
init
()
{
appEvents
.
on
(
"location-change"
,
payload
=>
{
const
urlWithoutBase
=
this
.
stripBaseFromUrl
(
payload
.
href
);
if
(
this
.
fullPageReloadRoutes
.
indexOf
(
urlWithoutBase
)
>
-
1
)
{
this
.
$window
.
location
.
href
=
payload
.
href
;
return
;
}
this
.
$timeout
(()
=>
{
// A hack to use timeout when we're changing things (in this case the url) from outside of Angular.
...
...
public/app/core/specs/global_event_srv.jest.ts
View file @
e683f6af
import
{
GlobalEventSrv
}
from
"app/core/services/global_event_srv"
;
import
{
GlobalEventSrv
}
from
"app/core/services/global_event_srv"
;
import
{
beforeEach
}
from
"test/lib/common"
;
jest
.
mock
(
"app/core/config"
,
()
=>
{
...
...
@@ -11,7 +11,7 @@ describe("GlobalEventSrv", () => {
let
searchSrv
;
beforeEach
(()
=>
{
searchSrv
=
new
GlobalEventSrv
(
null
,
null
);
searchSrv
=
new
GlobalEventSrv
(
null
,
null
,
null
);
});
describe
(
"With /subUrl as appSubUrl"
,
()
=>
{
...
...
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