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
c3796104
Commit
c3796104
authored
2 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
fix redirection after feature edition
parent
713be6a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!534
REDMINE_ISSUE-15889|Edition d'un signalement - Redirection vers la page de détail ne fonctionne plus
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/store/modules/feature.store.js
+8
-6
8 additions, 6 deletions
src/store/modules/feature.store.js
with
8 additions
and
6 deletions
src/store/modules/feature.store.js
+
8
−
6
View file @
c3796104
...
...
@@ -181,7 +181,7 @@ const feature = {
},
SEND_FEATURE
({
state
,
rootState
,
commit
,
dispatch
},
{
routeName
,
query
,
extraForms
})
{
function
redirect
(
featureId
,
featureName
,
response
)
{
function
redirect
(
featureName
,
response
)
{
// when modifying more than 2 features, exit this function (to avoid conflict with next feature call to GET_PROJECT_FEATURE)
if
(
routeName
===
'
editer-attribut-signalement
'
)
return
response
;
let
newQuery
=
{
...
query
};
// create a copy of query from the route to avoid redundant navigation error since the router object would be modified
...
...
@@ -197,9 +197,8 @@ const feature = {
);
const
slug_type_signal
=
rootState
[
'
feature-type
'
].
current_feature_type_slug
;
const
project
=
rootState
.
projects
.
project
;
if
(
routeName
===
'
ajouter-signalement
'
&&
!
query
.
ordering
)
{
const
project
=
rootState
.
projects
.
project
;
newQuery
=
{
ordering
:
project
.
feature_browsing_default_sort
,
offset
:
0
,
// if feature was just created, in both ordering it would be the first in project features list
...
...
@@ -211,7 +210,10 @@ const feature = {
if
(
query
&&
query
.
ordering
===
'
-updated_on
'
)
{
// if the list is ordered by update time
newQuery
.
offset
=
0
;
// it would be in first position (else, if ordered by creation, the position won't change anyway)
}
if
(
parseInt
(
query
.
offset
)
===
parseInt
(
newQuery
.
offset
))
return
'
reloadPage
'
;
// in fast edition avoid redundant navigation if query didn't change
// in fast edition avoid redundant navigation if query didn't change
if
(
routeName
===
'
details-signalement-filtre
'
&&
parseInt
(
query
.
offset
)
===
parseInt
(
newQuery
.
offset
))
{
return
'
reloadPage
'
;
}
router
.
push
({
name
:
'
details-signalement-filtre
'
,
params
:
{
slug_type_signal
},
...
...
@@ -223,7 +225,7 @@ const feature = {
async
function
handleOtherForms
(
featureId
,
featureName
,
response
)
{
await
dispatch
(
'
SEND_ATTACHMENTS
'
,
featureId
);
await
dispatch
(
'
PUT_LINKED_FEATURES
'
,
featureId
);
return
redirect
(
featureId
,
featureName
,
response
);
return
redirect
(
featureName
,
response
);
}
function
createGeojson
()
{
//* prepare feature data to send
...
...
@@ -271,7 +273,7 @@ const feature = {
state
.
attachmentsToDelete
.
length
>
0
)
{
return
handleOtherForms
(
featureId
,
featureName
,
response
);
}
else
{
return
redirect
(
featureId
,
featureName
,
response
);
return
redirect
(
featureName
,
response
);
}
}
})
...
...
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