Skip to content

Commit

Permalink
🐛 Fix bug w/ process env undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
HubM committed Apr 2, 2024
1 parent 59bc9f0 commit 99defc9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions packages/applications/legacy/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,3 @@ SENTRY_DSN=

# UMAMI
TRACKER_WEBSITE_ID=

# FEATURE FLAGS
FEATURE_FLAG_SHOW_GARANTIES_FINANCIERES=
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ v1Router.get(
let garantiesFinancières: ProjectDataForProjectPage['garantiesFinancières'] | undefined =
undefined;

if (projet.appelOffre.isSoumisAuxGF) {
if (projet.appelOffre.isSoumisAuxGF && process.env.FEATURE_FLAG_SHOW_GARANTIES_FINANCIERES) {
garantiesFinancières = await getGarantiesFinancières(identifiantProjetValueType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { afficherDate } from '../../../helpers';

import { GarantiesFinancières } from '@potentiel-domain/laureat';

const { FEATURE_FLAG_SHOW_GARANTIES_FINANCIERES } = process.env;

type InfoGeneralesProps = {
project: ProjectDataForProjectPage;
role: UserRole;
Expand Down Expand Up @@ -43,7 +41,6 @@ export const InfoGenerales = ({
puissance < appelOffre.periode.noteThreshold.volumeReserve.puissanceMax;

const shouldDisplayGf =
FEATURE_FLAG_SHOW_GARANTIES_FINANCIERES &&
isClasse &&
!isAbandoned &&
[
Expand All @@ -60,7 +57,7 @@ export const InfoGenerales = ({

return (
<Section title="Informations générales" icon={<BuildingIcon />} className="flex gap-5 flex-col">
{shouldDisplayGf && garantiesFinancières && (
{garantiesFinancières && shouldDisplayGf && (
<GarantiesFinancièresProjet
garantiesFinancières={garantiesFinancières}
project={{
Expand Down

0 comments on commit 99defc9

Please sign in to comment.