From 4ca89a85b176888cf055b472c2a1d8a26dc425c0 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Thu, 29 Aug 2024 14:23:59 -0400 Subject: [PATCH 1/3] Revert "Merge pull request #2324 from decentdao/no-roles" This reverts commit 7c2f9fbb483dbde3756cf5dc15304168833aa4ca, reversing changes made to 47f64f62cb81ac008b83898d5063687e9150b167. --- .../ui/page/Navigation/NavigationLinks.tsx | 6 +- src/router.tsx | 56 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/components/ui/page/Navigation/NavigationLinks.tsx b/src/components/ui/page/Navigation/NavigationLinks.tsx index 9ebfccd7b0..21e651bb3a 100644 --- a/src/components/ui/page/Navigation/NavigationLinks.tsx +++ b/src/components/ui/page/Navigation/NavigationLinks.tsx @@ -7,7 +7,7 @@ import { Question, Scroll, SquaresFour, - // UsersThree, + UsersThree, } from '@phosphor-icons/react'; import { DAO_ROUTES } from '../../../../constants/routes'; import { URL_CHAT, URL_DOCS, URL_FAQ } from '../../../../constants/url'; @@ -97,14 +97,14 @@ function InternalLinks({ closeDrawer }: { closeDrawer?: () => void }) { scope="internal" closeDrawer={closeDrawer} /> - {/* */} + /> path: DAO_ROUTES.hierarchy.path, element: , }, - // { - // path: DAO_ROUTES.roles.path, - // element: , - // children: [ - // { - // path: 'details', - // element: , - // }, - // ], - // }, - // { - // path: DAO_ROUTES.rolesEdit.path, - // element: , - // children: [ - // { - // path: 'details', - // element: , - // }, - // { - // path: 'summary', - // element: , - // }, - // ], - // }, + { + path: DAO_ROUTES.roles.path, + element: , + children: [ + { + path: 'details', + element: , + }, + ], + }, + { + path: DAO_ROUTES.rolesEdit.path, + element: , + children: [ + { + path: 'details', + element: , + }, + { + path: 'summary', + element: , + }, + ], + }, { path: 'new/*', element: , From cd49a010a784472c381ac49d5b9ebc3b5f2ac096 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:31:24 -0400 Subject: [PATCH 2/3] add feature flag for streams --- .env | 3 ++ src/components/pages/Roles/RoleCard.tsx | 6 ++- .../pages/Roles/RolesDetailsDrawer.tsx | 3 +- .../pages/Roles/RolesDetailsDrawerMobile.tsx | 3 +- src/components/pages/Roles/RolesTable.tsx | 25 +++++++---- .../pages/Roles/forms/RoleFormTabs.tsx | 42 ++++++++++--------- src/constants/common.ts | 9 ++++ 7 files changed, 58 insertions(+), 33 deletions(-) diff --git a/.env b/.env index 8ae7441dca..853666f44c 100644 --- a/.env +++ b/.env @@ -54,3 +54,6 @@ VITE_APP_SITE_URL="https://app.dev.decentdao.org" # WalletConnect Cloud Project ID VITE_APP_WALLET_CONNECT_PROJECT_ID="" + +# FEATURE FLAGS (Must equal "ON") +VITE_APP_FLAG_STREAMS="" diff --git a/src/components/pages/Roles/RoleCard.tsx b/src/components/pages/Roles/RoleCard.tsx index 94c3aef0d1..c97a243ab2 100644 --- a/src/components/pages/Roles/RoleCard.tsx +++ b/src/components/pages/Roles/RoleCard.tsx @@ -3,6 +3,7 @@ import { CaretCircleRight, CaretRight } from '@phosphor-icons/react'; import { formatDuration, intervalToDuration } from 'date-fns'; import { useTranslation } from 'react-i18next'; import { getAddress, zeroAddress } from 'viem'; +import { isFeatureEnabled } from '../../../constants/common'; import { useGetDAOName } from '../../../hooks/DAO/useGetDAOName'; import useAvatar from '../../../hooks/utils/useAvatar'; import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider'; @@ -61,7 +62,7 @@ export function AvatarAndRoleName({ > {wearerAddress ? accountDisplayName : t('unassigned')} - {paymentsCount !== undefined && ( + {isFeatureEnabled('STREAMS') && paymentsCount !== undefined && ( - {payments && + {isFeatureEnabled('STREAMS') && + payments && payments.map((payment, index) => ( - {roleHat.payments && ( + {isFeatureEnabled('STREAMS') && roleHat.payments && ( <> - {roleHat.payments && ( + {isFeatureEnabled('STREAMS') && roleHat.payments && ( <> {t('member')} - - {t('activePayments')} - + {isFeatureEnabled('STREAMS') && ( + + {t('activePayments')} + + )} ); @@ -191,7 +194,7 @@ export function RolesRow({ {name} - + {isFeatureEnabled('STREAMS') && } ); } @@ -221,7 +224,11 @@ export function RolesRowEdit({ editStatus={editStatus} /> - p.isStreaming()).length || undefined} /> + {isFeatureEnabled('STREAMS') && ( + p.isStreaming()).length || undefined} + /> + )} ); } diff --git a/src/components/pages/Roles/forms/RoleFormTabs.tsx b/src/components/pages/Roles/forms/RoleFormTabs.tsx index d037cbfddb..d5ebfbfdd5 100644 --- a/src/components/pages/Roles/forms/RoleFormTabs.tsx +++ b/src/components/pages/Roles/forms/RoleFormTabs.tsx @@ -4,7 +4,7 @@ import { useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { Hex } from 'viem'; -import { TOOLTIP_MAXW } from '../../../../constants/common'; +import { isFeatureEnabled, TOOLTIP_MAXW } from '../../../../constants/common'; import { DAO_ROUTES } from '../../../../constants/routes'; import { useFractal } from '../../../../providers/App/AppProvider'; import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider'; @@ -67,30 +67,32 @@ export default function RoleFormTabs({ {t('roleInfo')} - - {!hatsTree ? ( - - {t('payments')} - - ) : ( - t('payments') - )} - + {isFeatureEnabled('STREAMS') && ( + + {!hatsTree ? ( + + {t('payments')} + + ) : ( + t('payments') + )} + + )} - {!!hatsTree && ( + {isFeatureEnabled('STREAMS') && !!hatsTree && ( diff --git a/src/constants/common.ts b/src/constants/common.ts index a98cd92ff5..7b530a1e25 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -46,3 +46,12 @@ export const ADDRESS_MULTISIG_METADATA = '0xdA0000000000000000000000000000000000 export const SIDEBAR_WIDTH = '4.25rem'; export const MAX_CONTENT_WIDTH = '80rem'; + +export const isFeatureEnabled = (feature: string) => { + const featureStatus = import.meta.env[`VITE_APP_FLAG_${feature}`]; + if (featureStatus === 'ON') { + return true; + } else { + return false; + } +}; From 5c4c76d63b83e8819c97e2bd251afdd60028a6f5 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Thu, 29 Aug 2024 16:54:15 -0400 Subject: [PATCH 3/3] Bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f1be8d843e..b3c33a9845 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "decent-interface", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "decent-interface", - "version": "0.3.0", + "version": "0.3.1", "hasInstallScript": true, "dependencies": { "@amplitude/analytics-browser": "^2.11.1", diff --git a/package.json b/package.json index b11b59fce0..681b6e9bed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decent-interface", - "version": "0.3.0", + "version": "0.3.1", "private": true, "dependencies": { "@amplitude/analytics-browser": "^2.11.1",