From c4524caea6fc2c8d56b3b153bf090b4619ad348a Mon Sep 17 00:00:00 2001 From: Kyrylo Klymenko Date: Thu, 14 Nov 2024 22:18:30 +0100 Subject: [PATCH] Remove feature flags gating and flags itself from .env for termed roles and whitelisting --- .env | 2 - src/components/Roles/RoleDetailsTabs.tsx | 5 +- src/components/Roles/forms/RoleFormInfo.tsx | 63 +++++++++---------- src/components/Roles/forms/RoleFormMember.tsx | 8 +-- .../SafeSettings/SettingsNavigation.tsx | 26 ++++---- src/router.tsx | 24 +++---- 6 files changed, 56 insertions(+), 72 deletions(-) diff --git a/.env b/.env index 6e0c6f78a7..f228f8356a 100644 --- a/.env +++ b/.env @@ -57,6 +57,4 @@ VITE_APP_WALLET_CONNECT_PROJECT_ID="" # FEATURE FLAGS (Must equal "ON") VITE_APP_FLAG_DEVELOPMENT_MODE="" -VITE_APP_FLAG_WHITELISTING="" -VITE_APP_FLAG_TERMED_ROLES="" VITE_APP_FLAG_DEMO_MODE="" diff --git a/src/components/Roles/RoleDetailsTabs.tsx b/src/components/Roles/RoleDetailsTabs.tsx index 41b1639fc1..0d17bc7f0c 100644 --- a/src/components/Roles/RoleDetailsTabs.tsx +++ b/src/components/Roles/RoleDetailsTabs.tsx @@ -2,7 +2,6 @@ import { Divider, Tab, TabList, TabPanel, TabPanels, Tabs, Text } from '@chakra- import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Address, Hex } from 'viem'; -import { isFeatureEnabled } from '../../constants/common'; import { paymentSorterByActiveStatus, paymentSorterByStartDate, @@ -115,11 +114,11 @@ export default function RoleDetailsTabs({ mt={4} > - {isFeatureEnabled('TERMED_ROLES') && isTermed && {t('terms')}} + {isTermed && {t('terms')}} {t('payments')} - {isFeatureEnabled('TERMED_ROLES') && isTermed && ( + {isTermed && ( {/* @dev - deploying whitelisting voting strategy is feasible from UI/UX standpoint only when Safe has Azorius module AND hatsTree been created already */} - {type !== GovernanceType.MULTISIG && - !!hatsTree && - !!hatsTreeId && - import.meta.env.VITE_APP_FLAG_WHITELISTING === 'ON' && ( - - - {() => ( - - {t('canCreateProposals')} - - setFieldValue( - 'roleEditing.canCreateProposals', - !values.roleEditing?.canCreateProposals, - ) - } - isChecked={values.roleEditing?.canCreateProposals} - isDisabled={!values.roleEditing} - /> - - )} - - - )} + {type !== GovernanceType.MULTISIG && !!hatsTree && !!hatsTreeId && ( + + + {() => ( + + {t('canCreateProposals')} + + setFieldValue( + 'roleEditing.canCreateProposals', + !values.roleEditing?.canCreateProposals, + ) + } + isChecked={values.roleEditing?.canCreateProposals} + isDisabled={!values.roleEditing} + /> + + )} + + + )} ); } diff --git a/src/components/Roles/forms/RoleFormMember.tsx b/src/components/Roles/forms/RoleFormMember.tsx index 6c8575b3af..b79dc571fc 100644 --- a/src/components/Roles/forms/RoleFormMember.tsx +++ b/src/components/Roles/forms/RoleFormMember.tsx @@ -21,7 +21,7 @@ import { Field, FieldInputProps, FieldMetaProps, FormikProps, useFormikContext } import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { DecentHourGlass } from '../../../assets/theme/custom/icons/DecentHourGlass'; -import { DETAILS_BOX_SHADOW, isFeatureEnabled } from '../../../constants/common'; +import { DETAILS_BOX_SHADOW } from '../../../constants/common'; import useAddress from '../../../hooks/utils/useAddress'; import { useGetAccountName } from '../../../hooks/utils/useGetAccountName'; import { RoleFormValues } from '../../../types/roles'; @@ -333,10 +333,6 @@ export function RoleFormMember() { const { values } = useFormikContext(); if (!!values.roleEditing?.isTermed) { - if (!isFeatureEnabled('TERMED_ROLES')) { - // @prevent any sheningans on different environments - return null; - } return ; } return ( @@ -356,7 +352,7 @@ export function RoleFormMember() { > - {isFeatureEnabled('TERMED_ROLES') && } + ); } diff --git a/src/components/SafeSettings/SettingsNavigation.tsx b/src/components/SafeSettings/SettingsNavigation.tsx index f75a3eea2c..d63593fd66 100644 --- a/src/components/SafeSettings/SettingsNavigation.tsx +++ b/src/components/SafeSettings/SettingsNavigation.tsx @@ -147,21 +147,19 @@ export default function SettingsNavigation() { {fractalModules.length + safe.guard ? 1 : 0} - {import.meta.env.VITE_APP_FLAG_WHITELISTING === 'ON' && ( - } - title={t('permissionsTitle')} - showDivider={false} + } + title={t('permissionsTitle')} + showDivider={false} + > + - - {azoriusGovernance.votingStrategy ? 1 : 0} - - - )} + {azoriusGovernance.votingStrategy ? 1 : 0} + + )} diff --git a/src/router.tsx b/src/router.tsx index fb7f5d1e9f..1ab3966fb4 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -214,20 +214,16 @@ export const router = (addressPrefix: string, daoAddress: string | undefined) => path: DAO_ROUTES.settingsModulesAndGuard.path, element: , }, - ...(import.meta.env.VITE_APP_FLAG_WHITELISTING === 'ON' - ? [ - { - path: DAO_ROUTES.settingsPermissions.path, - element: , - children: [ - { - path: DAO_ROUTES.settingsPermissionsCreateProposal.path, - element: , - }, - ], - }, - ] - : []), + { + path: DAO_ROUTES.settingsPermissions.path, + element: , + children: [ + { + path: DAO_ROUTES.settingsPermissionsCreateProposal.path, + element: , + }, + ], + }, ], }, {