Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
177ab409
Commit
177ab409
authored
3 years ago
by
Sébastien DA ROCHA
Browse files
Options
Downloads
Plain Diff
Merge branch 'redmine-issues/13086' into 'develop'
REDMINE_ISSSUE-13086
See merge request
!293
parents
13b4780c
1680906d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!295
Version 3.0.0
,
!293
REDMINE_ISSSUE-13086
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/router/index.js
+6
-6
6 additions, 6 deletions
src/router/index.js
src/store/index.js
+7
-1
7 additions, 1 deletion
src/store/index.js
with
13 additions
and
7 deletions
src/router/index.js
+
6
−
6
View file @
177ab409
...
...
@@ -4,6 +4,10 @@ import Projects from '../views/Projects.vue';
Vue
.
use
(
VueRouter
);
//* store initial route before redirect to login page
//* in order to turn back to shared project afterwards (not memorized in router history at page load)
window
.
initialRoute
=
window
.
location
.
href
;
let
projectBase
=
'
projet
'
;
if
(
window
.
location
.
pathname
.
includes
(
'
projet-partage
'
))
{
projectBase
=
'
projet-partage
'
;
...
...
@@ -18,10 +22,7 @@ const routes = [
{
path
:
'
/connexion/
'
,
name
:
'
login
'
,
// route level code-splitting
// this generates a separate chunk (login.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component
:
()
=>
import
(
/* webpackChunkName: "login" */
'
../views/registration/Login.vue
'
)
component
:
()
=>
import
(
'
../views/registration/Login.vue
'
)
},
{
path
:
`
${
projectBase
===
'
projet
'
?
''
:
'
/
'
+
projectBase
+
'
/:slug
'
}
/my_account/`
,
...
...
@@ -137,14 +138,13 @@ const routes = [
{
path
:
'
/:pathMatch(.*)*
'
,
name
:
'
NotFound
'
,
component
:
()
=>
import
(
'
../views/NotFound.vue
'
)
},
];
//let routerHistory = [];
const
router
=
new
VueRouter
({
mode
:
'
history
'
,
base
:
'
/geocontrib/
'
,
routes
,
routerHistory
:
[],
scrollBehavior
(
to
,
from
,
savedPosition
)
{
//* record each route change to
turn back to origin after redirect
scrollBehavior
(
to
,
from
,
savedPosition
)
{
//* record each route change to
keep scroll position
const
fromHistory
=
Boolean
(
savedPosition
);
if
(
fromHistory
&&
this
.
options
.
routerHistory
.
length
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
src/store/index.js
+
7
−
1
View file @
177ab409
...
...
@@ -146,7 +146,13 @@ export default new Vuex.Store({
routerHistory
=
'
/
'
;
}
commit
(
'
SET_USER
'
,
response
.
data
.
user
);
router
.
push
(
routerHistory
[
routerHistory
.
length
-
1
]
||
'
/
'
);
if
(
routerHistory
===
'
/
'
&&
window
.
initialRoute
.
includes
(
'
projet-partage
'
))
{
window
.
location
.
replace
(
window
.
initialRoute
);
}
else
{
// ToDo : not working at page load, routerHistory filled afterwards, could try history.back()
router
.
push
(
routerHistory
[
routerHistory
.
length
-
1
]
||
'
/
'
);
}
dispatch
(
'
GET_USER_LEVEL_PROJECTS
'
);
dispatch
(
'
GET_USER_LEVEL_PERMISSIONS
'
);
return
response
.
status
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment