From 93072f75ee79ad0d88de19d0f30201cf6adc2605 Mon Sep 17 00:00:00 2001 From: AndreiaPena Date: Thu, 10 Oct 2024 10:12:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20api:=20create=20FT=5FPIX=5FCOMPANIO?= =?UTF-8?q?N=5FENABLED=20feature=20toggle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/sample.env | 7 +++++++ api/src/shared/config.js | 2 ++ .../infrastructure/validate-environment-variables.js | 1 + .../feature-toggles/feature-toggle-controller_test.js | 1 + 4 files changed, 11 insertions(+) diff --git a/api/sample.env b/api/sample.env index 5d6e1211df2..bfbafbf2fb8 100644 --- a/api/sample.env +++ b/api/sample.env @@ -802,6 +802,13 @@ TEST_REDIS_URL=redis://localhost:6379 # default: false #FT_ENABLE_V3_ELIGIBILITY_CHECK=false +# Consider the Pix Companion extension as active +# +# presence: optional +# type: boolean +# default: false +# FT_PIX_COMPANION_ENABLED=false + # ===== # CPF # ===== diff --git a/api/src/shared/config.js b/api/src/shared/config.js index e01dc92086d..00050e600c6 100644 --- a/api/src/shared/config.js +++ b/api/src/shared/config.js @@ -213,6 +213,7 @@ const configuration = (function () { isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON), showExperimentalMissions: toBoolean(process.env.FT_SHOW_EXPERIMENTAL_MISSIONS), showNewResultPage: toBoolean(process.env.FT_SHOW_NEW_RESULT_PAGE), + isPixCompanionEnabled: toBoolean(process.env.FT_PIX_COMPANION_ENABLED), }, hapi: { options: {}, @@ -414,6 +415,7 @@ const configuration = (function () { config.featureToggles.isNeedToAdjustCertificationAccessibilityEnabled = false; config.featureToggles.showNewResultPage = false; config.featureToggles.showExperimentalMissions = false; + config.featureToggles.isPixCompanionEnabled = false; config.mailing.enabled = false; config.mailing.provider = 'brevo'; diff --git a/api/src/shared/infrastructure/validate-environment-variables.js b/api/src/shared/infrastructure/validate-environment-variables.js index d3e612cdc1f..622d3d76e83 100644 --- a/api/src/shared/infrastructure/validate-environment-variables.js +++ b/api/src/shared/infrastructure/validate-environment-variables.js @@ -39,6 +39,7 @@ const schema = Joi.object({ FT_ENABLE_NEED_TO_ADJUST_CERTIFICATION_ACCESSIBILITY: Joi.string().optional().valid('true', 'false'), FT_ENABLE_PIX_PLUS_LOWER_LEVEL: Joi.string().optional().valid('true', 'false'), FT_ENABLE_TEXT_TO_SPEECH_BUTTON: Joi.string().optional().valid('true', 'false'), + FT_PIX_COMPANION_ENABLED: Joi.string().optional().valid('true', 'false'), KNEX_ASYNC_STACKTRACE_ENABLED: Joi.string().optional().valid('true', 'false'), LCMS_API_KEY: Joi.string().required(), LCMS_API_URL: Joi.string().uri().required(), diff --git a/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js b/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js index 81d2764d7ca..a4ab6a5ac1d 100644 --- a/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js +++ b/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js @@ -31,6 +31,7 @@ describe('Acceptance | Shared | Application | Controller | feature-toggle', func 'is-text-to-speech-button-enabled': false, 'show-new-result-page': false, 'show-experimental-missions': false, + 'is-pix-companion-enabled': false, }, }, };