Skip to content

Commit

Permalink
Merge pull request #48 from velo-iledefrance/status_override
Browse files Browse the repository at this point in the history
Permettre de modifier manuellement le status d’avancement
  • Loading branch information
n-b authored Nov 20, 2023
2 parents 96af8a7 + eda49c0 commit 9a34f6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type OriginalProperties = {
Commentaire: string | null;
doublon: boolean | null;
ITINERAIRE_PROV_DEF: string | null;
"Niveau aménagement manuel": string | null;
};

export enum TronçonStatus {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/prepared_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ import departements from "../../data/departements-ile-de-france.geo.json";
import { featureEach } from "@turf/meta";

function status(
niveau_validation: string,
status_selon_idf: string,
apport_rerv: string,
phase: string,
mort: boolean,
status_override: string,
): TronçonStatus {
const niveau = status_override !== "" ? status_override : status_selon_idf
if (mort) {
return TronçonStatus.Blocked;
} else if (phase === "2 - 2030") {
Expand All @@ -48,7 +50,7 @@ function status(
"A l'étude": TronçonStatus.Planned,
"En travaux": TronçonStatus.Building,
"Mis en service": TronçonStatus.Built,
}[niveau_validation] || TronçonStatus.Unknown
}[niveau] || TronçonStatus.Unknown
);
}
}
Expand Down Expand Up @@ -138,6 +140,7 @@ export async function prepareData(): Promise<GlobalData> {
feature.properties.APPORT_RERV || "",
feature.properties.PHASE,
feature.properties["Bloqué"] || false,
feature.properties["Niveau aménagement manuel"] || "",
),
variant: ["Variante", "Variante initiale"].includes(
feature.properties.NIVEAU_VALID_SUPPORT_VIAIRE,
Expand Down

0 comments on commit 9a34f6b

Please sign in to comment.