diff --git a/src/backend/core/models.py b/src/backend/core/models.py index 3b94c1323..547c2dd12 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -487,7 +487,7 @@ def get_abilities(self): ), }, "teams": { - "can_view": teams_can_view and settings.FEATURES["TEAMS"], + "can_view": teams_can_view and settings.FEATURES["TEAMS_DISPLAY"], "can_create": teams_can_view and settings.FEATURES["TEAMS_CREATE"], }, "mailboxes": { diff --git a/src/backend/core/tests/test_api_config.py b/src/backend/core/tests/test_api_config.py index ea3a65da6..d2132917a 100644 --- a/src/backend/core/tests/test_api_config.py +++ b/src/backend/core/tests/test_api_config.py @@ -24,7 +24,7 @@ def test_api_config_anonymous(): "CONTACTS_DISPLAY": True, "CONTACTS_CREATE": True, "MAILBOXES_CREATE": True, - "TEAMS": True, + "TEAMS_DISPLAY": True, "TEAMS_CREATE": True, }, "RELEASE": "NA", @@ -46,7 +46,7 @@ def test_api_config_authenticated(): "CONTACTS_DISPLAY": True, "CONTACTS_CREATE": True, "MAILBOXES_CREATE": True, - "TEAMS": True, + "TEAMS_DISPLAY": True, "TEAMS_CREATE": True, }, "RELEASE": "NA", diff --git a/src/backend/people/settings.py b/src/backend/people/settings.py index 9e00e7006..8c99afa6b 100755 --- a/src/backend/people/settings.py +++ b/src/backend/people/settings.py @@ -465,7 +465,7 @@ def FEATURES(self): "CONTACTS_CREATE", # Used in the users/me/ endpoint "CONTACTS_DISPLAY", # Used in the users/me/ endpoint "MAILBOXES_CREATE", # Used in the users/me/ endpoint - "TEAMS", + "TEAMS_DISPLAY", "TEAMS_CREATE", # Used in the users/me/ endpoint } diff --git a/src/frontend/apps/desk/src/__tests__/pages.test.tsx b/src/frontend/apps/desk/src/__tests__/pages.test.tsx index a6527c631..dbd847c9a 100644 --- a/src/frontend/apps/desk/src/__tests__/pages.test.tsx +++ b/src/frontend/apps/desk/src/__tests__/pages.test.tsx @@ -21,7 +21,11 @@ describe('Page', () => { it('checks Page rendering with team feature', () => { useConfigStore.setState({ - config: { RELEASE: '1.0.0', FEATURES: { TEAMS: true }, LANGUAGES: [] }, + config: { + RELEASE: '1.0.0', + FEATURES: { TEAMS_DISPLAY: true }, + LANGUAGES: [], + }, }); render(, { wrapper: AppWrapper }); @@ -31,7 +35,11 @@ describe('Page', () => { it('checks Page rendering without team feature', () => { useConfigStore.setState({ - config: { RELEASE: '1.0.0', FEATURES: { TEAMS: false }, LANGUAGES: [] }, + config: { + RELEASE: '1.0.0', + FEATURES: { TEAMS_DISPLAY: false }, + LANGUAGES: [], + }, }); render(, { wrapper: AppWrapper }); diff --git a/src/frontend/apps/desk/src/core/MainLayout.tsx b/src/frontend/apps/desk/src/core/MainLayout.tsx index 3b90e6411..9b9db7310 100644 --- a/src/frontend/apps/desk/src/core/MainLayout.tsx +++ b/src/frontend/apps/desk/src/core/MainLayout.tsx @@ -15,7 +15,7 @@ export function MainLayout({ children }: PropsWithChildren) {
- {config?.FEATURES.TEAMS && } + {config?.FEATURES.TEAMS_DISPLAY && } ({ describe('MainLayout', () => { it('checks menu rendering with team feature', () => { useConfigStore.setState({ - config: { RELEASE: '1.0.0', FEATURES: { TEAMS: true }, LANGUAGES: [] }, + config: { + RELEASE: '1.0.0', + FEATURES: { TEAMS_DISPLAY: true }, + LANGUAGES: [], + }, }); useAuthStore.setState({ authenticated: true, @@ -51,7 +55,11 @@ describe('MainLayout', () => { it('checks menu rendering with no abilities', () => { useConfigStore.setState({ - config: { RELEASE: '1.0.0', FEATURES: { TEAMS: true }, LANGUAGES: [] }, + config: { + RELEASE: '1.0.0', + FEATURES: { TEAMS_DISPLAY: true }, + LANGUAGES: [], + }, }); useAuthStore.setState({ authenticated: true, @@ -85,7 +93,11 @@ describe('MainLayout', () => { it('checks menu rendering without team feature', () => { useConfigStore.setState({ - config: { RELEASE: '1.0.0', FEATURES: { TEAMS: false }, LANGUAGES: [] }, + config: { + RELEASE: '1.0.0', + FEATURES: { TEAMS_DISPLAY: false }, + LANGUAGES: [], + }, }); useAuthStore.setState({ authenticated: true, diff --git a/src/frontend/apps/desk/src/core/config/types.ts b/src/frontend/apps/desk/src/core/config/types.ts index 3e5ab9399..ca2316646 100644 --- a/src/frontend/apps/desk/src/core/config/types.ts +++ b/src/frontend/apps/desk/src/core/config/types.ts @@ -2,6 +2,6 @@ export interface Config { LANGUAGES: [string, string][]; RELEASE: string; FEATURES: { - TEAMS: boolean; + TEAMS_DISPLAY: boolean; }; } diff --git a/src/frontend/apps/desk/src/features/mail-domains/domains/components/panel/Panel.tsx b/src/frontend/apps/desk/src/features/mail-domains/domains/components/panel/Panel.tsx index 2ce61f6ef..184502803 100644 --- a/src/frontend/apps/desk/src/features/mail-domains/domains/components/panel/Panel.tsx +++ b/src/frontend/apps/desk/src/features/mail-domains/domains/components/panel/Panel.tsx @@ -22,7 +22,7 @@ export const Panel = () => { $minWidth: '0', }; - const styleNoTeam = !config?.FEATURES.TEAMS && { + const styleNoTeam = !config?.FEATURES.TEAMS_DISPLAY && { $display: 'none', tabIndex: -1, }; diff --git a/src/frontend/apps/desk/src/pages/index.tsx b/src/frontend/apps/desk/src/pages/index.tsx index a7c574c26..38ec82e9c 100644 --- a/src/frontend/apps/desk/src/pages/index.tsx +++ b/src/frontend/apps/desk/src/pages/index.tsx @@ -9,8 +9,8 @@ const Page: NextPageWithLayout = () => { const router = useNavigate(); useEffect(() => { - router.push(config?.FEATURES.TEAMS ? '/teams/' : '/mail-domains/'); - }, [config?.FEATURES.TEAMS, router]); + router.push(config?.FEATURES.TEAMS_DISPLAY ? '/teams/' : '/mail-domains/'); + }, [config?.FEATURES.TEAMS_DISPLAY, router]); return null; }; diff --git a/src/frontend/apps/e2e/__tests__/app-desk/config.spec.ts b/src/frontend/apps/e2e/__tests__/app-desk/config.spec.ts index ded192485..83e08dce4 100644 --- a/src/frontend/apps/e2e/__tests__/app-desk/config.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-desk/config.spec.ts @@ -25,7 +25,7 @@ test.describe('Config', () => { CONTACTS_DISPLAY: true, MAILBOXES_CREATE: true, TEAMS_CREATE: true, - TEAMS: true, + TEAMS_DISPLAY: true, }, RELEASE: 'NA', }); @@ -48,7 +48,7 @@ test.describe('Config', () => { ['en-us', 'English'], ['fr-fr', 'French'], ], - FEATURES: { TEAMS: false }, + FEATURES: { TEAMS_DISPLAY: false }, }, }); } else { diff --git a/src/helm/env.d/preprod/values.desk.yaml.gotmpl b/src/helm/env.d/preprod/values.desk.yaml.gotmpl index 61494730d..c80b1d926 100644 --- a/src/helm/env.d/preprod/values.desk.yaml.gotmpl +++ b/src/helm/env.d/preprod/values.desk.yaml.gotmpl @@ -100,7 +100,7 @@ backend: secretKeyRef: name: backend key: MAIL_PROVISIONING_API_CREDENTIALS - FEATURE_TEAMS: False + FEATURE_TEAMS_DISPLAY: False FEATURE_CONTACTS_DISPLAY: False FEATURE_CONTACTS_CREATE: False FEATURE_TEAMS_CREATE: False diff --git a/src/helm/env.d/production/values.desk.yaml.gotmpl b/src/helm/env.d/production/values.desk.yaml.gotmpl index f7298da43..c8d1bd1f8 100644 --- a/src/helm/env.d/production/values.desk.yaml.gotmpl +++ b/src/helm/env.d/production/values.desk.yaml.gotmpl @@ -100,7 +100,7 @@ backend: secretKeyRef: name: backend key: MAIL_PROVISIONING_API_CREDENTIALS - FEATURE_TEAMS: False + FEATURE_TEAMS_DISPLAY: False FEATURE_CONTACTS_DISPLAY: False FEATURE_CONTACTS_CREATE: False FEATURE_TEAMS_CREATE: False