Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
pnm-public
camino
Commits
2ca5e031
Commit
2ca5e031
authored
6 years ago
by
Adrien Risser
Committed by
François Romain
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(tasks): calcule la date de fin d'une phase si la démarche est annulée
parent
a0cbfcfa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/_utils/titre-phases-find.js
+8
-10
8 additions, 10 deletions
tasks/_utils/titre-phases-find.js
with
8 additions
and
10 deletions
tasks/_utils/titre-phases-find.js
+
8
−
10
View file @
2ca5e031
...
@@ -16,7 +16,7 @@ const titrePhasesFind = (titreDemarchesByTitre, titreIsAxm) => {
...
@@ -16,7 +16,7 @@ const titrePhasesFind = (titreDemarchesByTitre, titreIsAxm) => {
const
dateFin
=
titrePhaseDateFinFind
(
const
dateFin
=
titrePhaseDateFinFind
(
titreDemarchesByTitre
,
titreDemarchesByTitre
,
titreDemarchesByTitreFiltered
,
titreDemarchesByTitreFiltered
,
titreDemarche
.
ordre
titreDemarche
)
)
const
dateDebut
=
titrePhaseDateDebutFind
(
const
dateDebut
=
titrePhaseDateDebutFind
(
...
@@ -95,17 +95,17 @@ const titrePhaseDateDebutFind = (
...
@@ -95,17 +95,17 @@ const titrePhaseDateDebutFind = (
// utile pour trouver la date de fin en cas d'annulation
// utile pour trouver la date de fin en cas d'annulation
// - titreDemarchesByTitreFiltered: uniquement les démarches
// - titreDemarchesByTitreFiltered: uniquement les démarches
// d'un titre qui donnent lieu à des phases
// d'un titre qui donnent lieu à des phases
// -
ordre: le numéro d'ordre de
la démarche dont on cherche la date de fin
// -
titreDemarche:
la démarche dont on cherche la date de fin
const
titrePhaseDateFinFind
=
(
const
titrePhaseDateFinFind
=
(
titreDemarchesByTitre
,
titreDemarchesByTitre
,
titreDemarchesByTitreFiltered
,
titreDemarchesByTitreFiltered
,
ordr
e
titreDemarch
e
)
=>
{
)
=>
{
// trouve une démarche d'annulation si elle existe
// trouve une démarche d'annulation si elle existe
const
titreDemarcheAnnulation
=
demarcheAnnulationFind
(
const
titreDemarcheAnnulation
=
demarcheAnnulationFind
(
titreDemarchesByTitre
,
titreDemarchesByTitre
,
ordre
titreDemarche
.
annulationDemarcheId
)
)
// si il y a une démarche d'annulation
// si il y a une démarche d'annulation
...
@@ -119,16 +119,14 @@ const titrePhaseDateFinFind = (
...
@@ -119,16 +119,14 @@ const titrePhaseDateFinFind = (
return
titreDemarcheDateFinAndDureeFind
(
return
titreDemarcheDateFinAndDureeFind
(
titreDemarchesByTitreFiltered
.
slice
().
reverse
(),
titreDemarchesByTitreFiltered
.
slice
().
reverse
(),
ordre
titreDemarche
.
ordre
).
dateFin
).
dateFin
}
}
const
demarcheAnnulationFind
=
(
titreDemarchesByTitre
,
ordre
)
=>
{
const
demarcheAnnulationFind
=
(
titreDemarchesByTitre
,
annulationDemarcheId
)
=>
{
// 2 solutions:
if
(
!
annulationDemarcheId
)
return
null
// - soit on parcourt toutes les démarches et on identifie la démarche d'annulation relative
// - soit l'id de la démarche d'annulation est renseignée en base
return
null
return
titreDemarchesByTitre
.
find
(
t
=>
t
.
id
===
annulationDemarcheId
);
}
}
module
.
exports
=
titrePhasesFind
module
.
exports
=
titrePhasesFind
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