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
0d2a88e1
Commit
0d2a88e1
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
send feature to update succesively
parent
1b6805f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!295
Version 3.0.0
,
!288
REDMINE_ISSUE-12996
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/feature/Feature_list.vue
+22
-30
22 additions, 30 deletions
src/views/feature/Feature_list.vue
with
22 additions
and
30 deletions
src/views/feature/Feature_list.vue
+
22
−
30
View file @
0d2a88e1
...
...
@@ -491,45 +491,37 @@ export default {
},
async
modifyStatus
(
newStatus
)
{
let
errorCount
=
0
;
const
promises
=
this
.
checkedFeatures
.
map
((
feature_id
)
=>
{
if
(
this
.
checkedFeatures
.
length
>
0
)
{
const
feature_id
=
this
.
checkedFeatures
[
0
];
let
feature
=
this
.
clickedFeatures
.
find
((
el
)
=>
el
.
feature_id
===
feature_id
);
if
(
feature
)
{
return
featureAPI
.
updateFeature
({
featureAPI
.
updateFeature
({
feature_id
,
feature_type__slug
:
feature
.
feature_type
,
project__slug
:
this
.
$route
.
params
.
slug
,
newStatus
project__slug
:
this
.
$route
.
params
.
slug
,
newStatus
}).
then
((
response
)
=>
{
if
(
response
&&
response
.
data
&&
response
.
status
===
200
)
{
this
.
checkedFeatures
.
splice
(
this
.
checkedFeatures
.
indexOf
(
response
.
data
.
id
),
1
);
this
.
modifyStatus
(
newStatus
);
}
else
{
this
.
$store
.
commit
(
'
DISPLAY_MESSAGE
'
,
{
comment
:
`Le signalement
${
feature
.
title
}
n'a pas pu être modifié`
,
level
:
'
negative
'
});
this
.
fetchPagedFeatures
();
}
});
}
else
{
errorCount
+=
1
;
}
});
const
promisesResult
=
await
Promise
.
all
(
promises
);
promisesResult
.
forEach
((
response
)
=>
{
if
(
response
&&
response
.
data
&&
response
.
status
===
200
)
{
this
.
checkedFeatures
.
splice
(
this
.
checkedFeatures
.
indexOf
(
response
.
data
.
id
),
2
);
}
else
{
errorCount
+=
1
;
}
});
let
message
=
{
comment
:
'
Tous les signalements ont été modifié avec succès.
'
,
level
:
'
positive
'
};
if
(
errorCount
)
{
//* display error message
if
(
errorCount
===
1
)
{
message
.
comment
=
"
Un signalement n'a pas pu être modifié. (Il reste sélectionné)
"
;
}
else
{
message
.
comment
=
`
${
errorCount
}
signalements n'ont pas pu être modifiés. (Ils restent sélectionnés)`
;
}
message
.
level
=
'
negative
'
;
}
else
{
this
.
fetchPagedFeatures
();
this
.
$store
.
commit
(
'
DISPLAY_MESSAGE
'
,
{
comment
:
'
Tous les signalements ont été modifié avec succès.
'
,
level
:
'
positive
'
});
}
this
.
fetchPagedFeatures
();
this
.
$store
.
commit
(
'
DISPLAY_MESSAGE
'
,
message
);
},
deleteFeature
(
feature_id
)
{
const
url
=
`
${
this
.
API_BASE_URL
}
features/
${
feature_id
}
/?project__slug=
${
this
.
project
.
slug
}
`
;
axios
//TODO: REFACTO -> Delete function already exist in store
...
...
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