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
b62ab25c
Commit
b62ab25c
authored
Aug 03, 2019
by
Tobias Skarhed
Committed by
Torkel Ödegaard
Aug 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SignIn: Update redirect on reroute (#18360)
* Connect SignIn with redux and get url * Update test snapshot
parent
09e79384
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
public/app/core/components/sidemenu/SignIn.test.tsx
+2
-2
public/app/core/components/sidemenu/SignIn.tsx
+9
-3
public/app/core/components/sidemenu/__snapshots__/BottomSection.test.tsx.snap
+1
-1
No files found.
public/app/core/components/sidemenu/SignIn.test.tsx
View file @
b62ab25c
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
SignIn
from
'./SignIn'
;
import
{
SignIn
}
from
'./SignIn'
;
describe
(
'Render'
,
()
=>
{
it
(
'should render component'
,
()
=>
{
const
wrapper
=
shallow
(<
SignIn
/>);
const
wrapper
=
shallow
(<
SignIn
url=
"/"
/>);
expect
(
wrapper
).
toMatchSnapshot
();
});
...
...
public/app/core/components/sidemenu/SignIn.tsx
View file @
b62ab25c
import
React
,
{
FC
}
from
'react'
;
import
{
connectWithStore
}
from
'app/core/utils/connectWithReduxStore'
;
import
{
StoreState
}
from
'app/types'
;
const
SignIn
:
FC
<
any
>
=
(
)
=>
{
const
loginUrl
=
`login?redirect=
${
encodeURIComponent
(
window
.
location
.
pathname
)}
`
;
export
const
SignIn
:
FC
<
any
>
=
({
url
}
)
=>
{
const
loginUrl
=
`login?redirect=
${
encodeURIComponent
(
url
)}
`
;
return
(
<
div
className=
"sidemenu-item"
>
<
a
href=
{
loginUrl
}
className=
"sidemenu-link"
target=
"_self"
>
...
...
@@ -20,4 +22,8 @@ const SignIn: FC<any> = () => {
);
};
export
default
SignIn
;
const
mapStateToProps
=
(
state
:
StoreState
)
=>
({
url
:
state
.
location
.
url
,
});
export
default
connectWithStore
(
SignIn
,
mapStateToProps
);
public/app/core/components/sidemenu/__snapshots__/BottomSection.test.tsx.snap
View file @
b62ab25c
...
...
@@ -4,7 +4,7 @@ exports[`Render should render component 1`] = `
<div
className="sidemenu__bottom"
>
<
SignIn
/>
<
Component
/>
<BottomNavLinks
key="undefined-0"
link={
...
...
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