From 9e2b9e64c2ef1fd142448e89542b0b0804e7a202 Mon Sep 17 00:00:00 2001 From: Emmanuelle Bonnemay Date: Mon, 4 Nov 2024 11:33:42 +0100 Subject: [PATCH 1/2] refactor(api): reorganize feature toggle declaration --- api/src/shared/config.js | 22 ++++++++++--------- .../feature-toggle-controller_test.js | 13 ++++++----- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/api/src/shared/config.js b/api/src/shared/config.js index 210ef8df83c..c8fb67a387d 100644 --- a/api/src/shared/config.js +++ b/api/src/shared/config.js @@ -198,23 +198,24 @@ const configuration = (function () { scoAccountRecoveryKeyLifetimeMinutes: process.env.SCO_ACCOUNT_RECOVERY_KEY_LIFETIME_MINUTES, }, featureToggles: { - isV3EligibilityCheckEnabled: toBoolean(process.env.FT_ENABLE_V3_ELIGIBILITY_CHECK), deprecatePoleEmploiPushNotification: toBoolean(process.env.DEPRECATE_PE_PUSH_NOTIFICATION), isAlwaysOkValidateNextChallengeEndpointEnabled: toBoolean( process.env.FT_ALWAYS_OK_VALIDATE_NEXT_CHALLENGE_ENDPOINT, ), + isAsyncQuestRewardingCalculationEnabled: toBoolean(process.env.FT_ENABLE_ASYNC_QUESTS_REWARDS_CALCULATION), isCertificationTokenScopeEnabled: toBoolean(process.env.FT_ENABLE_CERTIF_TOKEN_SCOPE), isNeedToAdjustCertificationAccessibilityEnabled: toBoolean( process.env.FT_ENABLE_NEED_TO_ADJUST_CERTIFICATION_ACCESSIBILITY, ), - isQuestEnabled: toBoolean(process.env.FT_ENABLE_QUESTS), - isAsyncQuestRewardingCalculationEnabled: toBoolean(process.env.FT_ENABLE_ASYNC_QUESTS_REWARDS_CALCULATION), isNewAuthenticationDesignEnabled: toBoolean(process.env.FT_NEW_AUTHENTICATION_DESIGN_ENABLED), isPix1dEnabled: toBoolean(process.env.FT_PIX_1D_ENABLED), + isPixCompanionEnabled: toBoolean(process.env.FT_PIX_COMPANION_ENABLED), + isQuestEnabled: toBoolean(process.env.FT_ENABLE_QUESTS), isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON), + isV3EligibilityCheckEnabled: toBoolean(process.env.FT_ENABLE_V3_ELIGIBILITY_CHECK), showExperimentalMissions: toBoolean(process.env.FT_SHOW_EXPERIMENTAL_MISSIONS), showNewCampaignPresentationPage: toBoolean(process.env.FT_SHOW_NEW_CAMPAIGN_PRESENTATION_PAGE), - isPixCompanionEnabled: toBoolean(process.env.FT_PIX_COMPANION_ENABLED), + showNewResultPage: toBoolean(process.env.FT_SHOW_NEW_RESULT_PAGE), }, hapi: { options: {}, @@ -406,16 +407,17 @@ const configuration = (function () { config.features.pixCertifScoBlockedAccessDateLycee = null; config.features.pixCertifScoBlockedAccessDateCollege = null; - config.featureToggles.isV3EligibilityCheckEnabled = false; + config.featureToggles.deprecatePoleEmploiPushNotification = false; config.featureToggles.isAlwaysOkValidateNextChallengeEndpointEnabled = false; - config.featureToggles.isPix1dEnabled = true; config.featureToggles.isCertificationTokenScopeEnabled = false; - config.featureToggles.isTextToSpeechButtonEnabled = false; - config.featureToggles.deprecatePoleEmploiPushNotification = false; config.featureToggles.isNeedToAdjustCertificationAccessibilityEnabled = false; - config.featureToggles.showNewCampaignPresentationPage = false; - config.featureToggles.showExperimentalMissions = false; + config.featureToggles.isPix1dEnabled = true; config.featureToggles.isPixCompanionEnabled = false; + config.featureToggles.isTextToSpeechButtonEnabled = false; + config.featureToggles.isV3EligibilityCheckEnabled = false; + config.featureToggles.showNewResultPage = false; + config.featureToggles.showExperimentalMissions = false; + config.mailing.enabled = false; config.mailing.provider = 'brevo'; 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 039ba7341c6..af9cce77d83 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 @@ -21,18 +21,19 @@ describe('Acceptance | Shared | Application | Controller | feature-toggle', func type: 'feature-toggles', attributes: { 'deprecate-pole-emploi-push-notification': false, - 'is-v3-eligibility-check-enabled': false, 'is-always-ok-validate-next-challenge-endpoint-enabled': false, + 'is-async-quest-rewarding-calculation-enabled': false, 'is-certification-token-scope-enabled': false, + 'is-need-to-adjust-certification-accessibility-enabled': false, 'is-new-authentication-design-enabled': false, 'is-pix1d-enabled': true, - 'is-need-to-adjust-certification-accessibility-enabled': false, - 'is-text-to-speech-button-enabled': false, - 'show-new-campaign-presentation-page': false, - 'show-experimental-missions': false, 'is-pix-companion-enabled': false, 'is-quest-enabled': false, - 'is-async-quest-rewarding-calculation-enabled': false, + 'is-text-to-speech-button-enabled': false, + 'is-v3-eligibility-check-enabled': false, + 'show-experimental-missions': false, + 'show-new-campaign-presentation-page': false, + 'show-new-result-page': false, }, }, }; From 26a35103efa1b9f32351bcfe06e62ffe7d5d4fd2 Mon Sep 17 00:00:00 2001 From: Emmanuelle Bonnemay Date: Mon, 4 Nov 2024 11:59:44 +0100 Subject: [PATCH 2/2] feat(api): add new self account deletion feature toggle --- api/sample.env | 5 +++++ api/src/shared/config.js | 3 ++- .../feature-toggles/feature-toggle-controller_test.js | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/api/sample.env b/api/sample.env index 8f46172f445..63e72275aba 100644 --- a/api/sample.env +++ b/api/sample.env @@ -818,6 +818,11 @@ TEST_REDIS_URL=redis://localhost:6379 # default: false # FT_ENABLE_ASYNC_QUESTS_REWARDS_CALCULATION=false +# Enable self account deletion +# type: boolean +# default: false +# FT_SELF_ACCOUNT_DELETION=false + # ===== # CPF # ===== diff --git a/api/src/shared/config.js b/api/src/shared/config.js index c8fb67a387d..ea920b76eba 100644 --- a/api/src/shared/config.js +++ b/api/src/shared/config.js @@ -210,6 +210,7 @@ const configuration = (function () { isNewAuthenticationDesignEnabled: toBoolean(process.env.FT_NEW_AUTHENTICATION_DESIGN_ENABLED), isPix1dEnabled: toBoolean(process.env.FT_PIX_1D_ENABLED), isPixCompanionEnabled: toBoolean(process.env.FT_PIX_COMPANION_ENABLED), + isSelfAccountDeletionEnabled: toBoolean(process.env.FT_SELF_ACCOUNT_DELETION), isQuestEnabled: toBoolean(process.env.FT_ENABLE_QUESTS), isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON), isV3EligibilityCheckEnabled: toBoolean(process.env.FT_ENABLE_V3_ELIGIBILITY_CHECK), @@ -413,12 +414,12 @@ const configuration = (function () { config.featureToggles.isNeedToAdjustCertificationAccessibilityEnabled = false; config.featureToggles.isPix1dEnabled = true; config.featureToggles.isPixCompanionEnabled = false; + config.featureToggles.isSelfAccountDeletionEnabled = false; config.featureToggles.isTextToSpeechButtonEnabled = false; config.featureToggles.isV3EligibilityCheckEnabled = false; config.featureToggles.showNewResultPage = false; config.featureToggles.showExperimentalMissions = false; - config.mailing.enabled = false; config.mailing.provider = 'brevo'; config.mailing.smtpUrl = 'smtp://username:password@localhost:1025/'; 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 af9cce77d83..c76f071564f 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 @@ -29,6 +29,7 @@ describe('Acceptance | Shared | Application | Controller | feature-toggle', func 'is-pix1d-enabled': true, 'is-pix-companion-enabled': false, 'is-quest-enabled': false, + 'is-self-account-deletion-enabled': false, 'is-text-to-speech-button-enabled': false, 'is-v3-eligibility-check-enabled': false, 'show-experimental-missions': false,