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
Merge requests
!106
REDMINE_ISSUE-11915
Code
Examiner les modifications
Extraire la branche
Télécharger
Correctifs
Diff brut
Merged
REDMINE_ISSUE-11915
redmine-issues/11915
into
develop
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Timothee P
requested to merge
redmine-issues/11915
into
develop
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
d8a2553f
2 commits,
3 years ago
1 file
+
11
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/store/modules/feature.js
+
11
−
3
Options
@@ -103,9 +103,12 @@ const feature = {
});
},
SEND_FEATURE
({
state
,
rootState
,
dispatch
},
routeName
)
{
SEND_FEATURE
({
state
,
rootState
,
commit
,
dispatch
},
routeName
)
{
commit
(
"
DISPLAY_LOADER
"
,
"
Le signalement est en cours de création
"
,
{
root
:
true
})
const
message
=
routeName
===
"
editer-signalement
"
?
"
Le signalement a été mis à jour
"
:
"
Le signalement a été crée
"
;
function
redirect
(
featureId
)
{
commit
(
"
DISCARD_LOADER
"
,
null
,
{
root
:
true
})
router
.
push
({
name
:
"
details-signalement
"
,
params
:
{
@@ -115,12 +118,14 @@ const feature = {
},
});
}
async
function
handleOtherForms
(
featureId
)
{
await
dispatch
(
"
SEND_ATTACHMENTS
"
,
featureId
)
await
dispatch
(
"
PUT_LINKED_FEATURES
"
,
featureId
)
redirect
(
featureId
);
}
//* prepare feature data to send
let
extraFormObject
=
{};
//* prepare an object to be flatten in properties of geojson
for
(
const
field
of
state
.
extra_form
)
{
extraFormObject
[
field
.
name
]
=
field
.
value
;
@@ -138,8 +143,9 @@ const feature = {
...
extraFormObject
}
}
if
(
routeName
===
"
editer-signalement
"
)
{
axios
return
axios
.
put
(
`
${
rootState
.
configuration
.
VUE_APP_DJANGO_API_BASE
}
features/
${
state
.
form
.
feature_id
}
/?`
+
`feature_type__slug=
${
rootState
.
feature_type
.
current_feature_type_slug
}
`
+
`&project__slug=
${
rootState
.
project_slug
}
`
@@ -154,10 +160,11 @@ const feature = {
}
})
.
catch
((
error
)
=>
{
commit
(
"
DISCARD_LOADER
"
,
null
,
{
root
:
true
})
throw
error
;
});
}
else
{
axios
return
axios
.
post
(
`
${
rootState
.
configuration
.
VUE_APP_DJANGO_API_BASE
}
features/`
,
geojson
)
.
then
((
response
)
=>
{
if
(
response
.
status
===
201
&&
response
.
data
)
{
@@ -169,6 +176,7 @@ const feature = {
}
})
.
catch
((
error
)
=>
{
commit
(
"
DISCARD_LOADER
"
,
null
,
{
root
:
true
})
throw
error
;
});
}
Loading