Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesej committed Jan 12, 2024
2 parents fd499e9 + 88c5763 commit 90b26eb
Show file tree
Hide file tree
Showing 51 changed files with 1,049 additions and 153 deletions.
5 changes: 3 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ VITE_FEATURE_FLAG_CONNECT_ANY_DAPP=true
# Enable gasless plugin on DAO creation
VITE_FEATURE_FLAG_GASLESS_PLUGIN=false

VITE_VOCDONI_ENV='stg'
VITE_FEATURE_FLAG_DAO_MEMBERLIST=true

VITE_VOCDONI_ENV='stg'

VITE_BACKEND_URL=https://app-backend.aragon.org
VITE_BACKEND_URL=https://stg.app-backend.aragon.org
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ VITE_FEATURE_FLAG_OSX_UPDATES=true
# Enable gasless plugin on DAO creation
VITE_FEATURE_FLAG_GASLESS_PLUGIN=false

VITE_FEATURE_FLAG_DAO_MEMBERLIST=false

VITE_VOCDONI_ENV='stg'
VITE_BACKEND_URL=https://app-backend.aragon.org
5 changes: 3 additions & 2 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ VITE_FEATURE_FLAG_CONNECT_ANY_DAPP=true
# Enable gasless plugin on DAO creation
VITE_FEATURE_FLAG_GASLESS_PLUGIN=false

VITE_VOCDONI_ENV='stg'
VITE_FEATURE_FLAG_DAO_MEMBERLIST=true

VITE_VOCDONI_ENV='stg'

VITE_BACKEND_URL=https://app-backend.aragon.org
VITE_BACKEND_URL=https://stg.app-backend.aragon.org
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@apollo/client": "^3.5.8",
"@aragon/ods": "^1.0.4",
"@aragon/sdk-client": "^1.20.4",
"@aragon/sdk-client": "^1.21.1",
"@aragon/sdk-client-common": "^1.13.0",
"@elastic/apm-rum-react": "^2.0.0",
"@radix-ui/react-accordion": "^1.1.2",
Expand Down Expand Up @@ -123,4 +123,4 @@
"engines": {
"node": ">=18.0.0"
}
}
}
23 changes: 18 additions & 5 deletions src/components/accordionMethod/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ import {
ListItemProps,
} from '@aragon/ods-old';
import styled from 'styled-components';
import {shortenAddress} from 'utils/library';

export type AccordionType = 'action-builder' | 'execution-widget';

export type AccordionMethodType = {
type: AccordionType;
methodName: string;
smartContractName?: string;
smartContractAddress?: string;
blockExplorerLink?: string;
verified?: boolean;
alertLabel?: string;
methodDescription?: string | React.ReactNode;
Expand Down Expand Up @@ -58,6 +61,8 @@ export const AccordionItem: React.FC<AccordionMethodType & {name: string}> = ({
name,
methodName,
smartContractName,
smartContractAddress,
blockExplorerLink,
verified = false,
alertLabel,
methodDescription,
Expand All @@ -74,18 +79,26 @@ export const AccordionItem: React.FC<AccordionMethodType & {name: string}> = ({
<MethodName>{methodName}</MethodName>
{smartContractName && (
<div
className={`flex items-center space-x-2 ${
className={`flex items-center ${
verified ? 'text-primary-600' : 'text-warning-600'
}`}
>
<p
className={`font-semibold ${
{smartContractAddress && (
<p className="mr-4 text-neutral-600">
{shortenAddress(smartContractAddress)}
</p>
)}
{verified ? <IconSuccess /> : <IconWarning />}
<a
href={blockExplorerLink}
target="_blank"
rel="noreferrer"
className={`ml-2 font-semibold ${
verified ? 'text-primary-500' : 'text-warning-500'
}`}
>
{smartContractName}
</p>
{verified ? <IconSuccess /> : <IconWarning />}
</a>
</div>
)}
{alertLabel && <AlertInline label={alertLabel} />}
Expand Down
10 changes: 9 additions & 1 deletion src/components/executionWidget/actions/addAddressCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import {useProviders} from 'context/providers';
import {CHAIN_METADATA} from 'utils/constants';
import {Web3Address} from 'utils/library';
import {ActionAddAddress} from 'utils/types';
import {useDaoDetailsQuery} from 'hooks/useDaoDetails';

export const AddAddressCard: React.FC<{
action: ActionAddAddress;
}> = ({action: {inputs}}) => {
const {t} = useTranslation();
const {network} = useNetwork();
const {api: provider} = useProviders();
const {data: daoDetails} = useDaoDetailsQuery();

const [addresses, setAddresses] = useState<Web3Address[]>([]);

Expand Down Expand Up @@ -61,7 +63,13 @@ export const AddAddressCard: React.FC<{
<AccordionMethod
type="execution-widget"
methodName={t('labels.addWallets')}
smartContractName={t('labels.aragonOSx')}
smartContractName={`Multisig v${daoDetails?.plugins[0].release}.${daoDetails?.plugins[0].build}`}
smartContractAddress={daoDetails?.plugins[0].instanceAddress}
blockExplorerLink={
daoDetails?.plugins[0].instanceAddress
? `${CHAIN_METADATA[network].explorer}address/${daoDetails?.plugins[0].instanceAddress}`
: undefined
}
verified
methodDescription={t('labels.addWalletsDescription')}
>
Expand Down
12 changes: 11 additions & 1 deletion src/components/executionWidget/actions/mintTokenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {PluginTypes} from 'hooks/usePluginClient';
import {CHAIN_METADATA} from 'utils/constants';
import {Web3Address} from 'utils/library';
import {ActionMintToken} from 'utils/types';
import {useDaoToken} from 'hooks/useDaoToken';

export const MintTokenCard: React.FC<{
action: ActionMintToken;
Expand All @@ -21,6 +22,9 @@ export const MintTokenCard: React.FC<{
const {api: provider} = useProviders();

const {data: daoDetails} = useDaoDetailsQuery();
const {data: daoToken} = useDaoToken(
daoDetails?.plugins[0].instanceAddress as string
);

const {
data: {members, memberCount},
Expand Down Expand Up @@ -91,7 +95,13 @@ export const MintTokenCard: React.FC<{
<AccordionMethod
type="execution-widget"
methodName={t('labels.mintTokens')}
smartContractName={t('labels.aragonOSx')}
smartContractName="GovernanceERC20"
smartContractAddress={daoToken?.address}
blockExplorerLink={
daoToken?.address
? `${CHAIN_METADATA[network].explorer}token/${daoToken?.address}`
: undefined
}
verified
methodDescription={t('newProposal.mintTokens.methodDescription')}
additionalInfo={t('newProposal.mintTokens.additionalInfo')}
Expand Down
13 changes: 12 additions & 1 deletion src/components/executionWidget/actions/modifyMetadataCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import {AccordionMethod} from 'components/accordionMethod';
import {ActionCardDlContainer, Dd, Dl, Dt} from 'components/descriptionList';
import {ActionUpdateMetadata} from 'utils/types';
import {useResolveDaoAvatar} from 'hooks/useResolveDaoAvatar';
import {useDaoDetailsQuery} from 'hooks/useDaoDetails';
import {useNetwork} from 'context/network';
import {CHAIN_METADATA} from 'utils/constants';

export const ModifyMetadataCard: React.FC<{action: ActionUpdateMetadata}> = ({
action: {inputs},
}) => {
const {t} = useTranslation();
const {network} = useNetwork();
const {data: daoDetails} = useDaoDetailsQuery();

const displayedLinks = inputs.links.filter(
l => l.url !== '' && l.name !== ''
Expand All @@ -22,7 +27,13 @@ export const ModifyMetadataCard: React.FC<{action: ActionUpdateMetadata}> = ({
<AccordionMethod
type="execution-widget"
methodName={t('labels.updateMetadataAction')}
smartContractName={t('labels.aragonOSx')}
smartContractName={'DAO'}
smartContractAddress={daoDetails?.address}
blockExplorerLink={
daoDetails?.address
? `${CHAIN_METADATA[network].explorer}address/${daoDetails?.address}`
: undefined
}
methodDescription={t('labels.updateMetadataActionDescription')}
verified
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,28 @@ import {useTranslation} from 'react-i18next';
import {AccordionMethod} from 'components/accordionMethod';
import {ActionCardDlContainer, Dd, Dl, Dt} from 'components/descriptionList';
import {ActionUpdateMultisigPluginSettings} from 'utils/types';
import {useDaoDetailsQuery} from 'hooks/useDaoDetails';
import {useNetwork} from 'context/network';
import {CHAIN_METADATA} from 'utils/constants';

export const ModifyMultisigSettingsCard: React.FC<{
action: ActionUpdateMultisigPluginSettings;
}> = ({action: {inputs}}) => {
const {t} = useTranslation();
const {network} = useNetwork();
const {data: daoDetails} = useDaoDetailsQuery();

return (
<AccordionMethod
type="execution-widget"
methodName={t('labels.updateGovernanceAction')}
smartContractName={t('labels.aragonOSx')}
smartContractName={`Multisig v${daoDetails?.plugins[0].release}.${daoDetails?.plugins[0].build}`}
smartContractAddress={daoDetails?.plugins[0].instanceAddress}
blockExplorerLink={
daoDetails?.plugins[0].instanceAddress
? `${CHAIN_METADATA[network].explorer}address/${daoDetails?.plugins[0].instanceAddress}`
: undefined
}
methodDescription={t('labels.updateGovernanceActionDescription')}
verified
>
Expand Down
13 changes: 12 additions & 1 deletion src/components/executionWidget/actions/modifySettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ import {getDHMFromSeconds} from 'utils/date';
import {getErc20MinParticipation} from 'utils/proposals';
import {ActionUpdatePluginSettings} from 'utils/types';
import {formatUnits} from 'ethers/lib/utils';
import {useDaoDetailsQuery} from 'hooks/useDaoDetails';
import {useNetwork} from 'context/network';
import {CHAIN_METADATA} from 'utils/constants';

export const ModifyMvSettingsCard: React.FC<{
action: ActionUpdatePluginSettings;
}> = ({action: {inputs}}) => {
const {t} = useTranslation();
const {network} = useNetwork();
const {data: daoDetails} = useDaoDetailsQuery();
const {days, hours, minutes} = getDHMFromSeconds(inputs.minDuration);

const minParticipation = useMemo(
Expand Down Expand Up @@ -45,7 +50,13 @@ export const ModifyMvSettingsCard: React.FC<{
<AccordionMethod
type="execution-widget"
methodName={t('labels.updateGovernanceAction')}
smartContractName={t('labels.aragonOSx')}
smartContractName={`Token Voting v${daoDetails?.plugins[0].release}.${daoDetails?.plugins[0].build}`}
smartContractAddress={daoDetails?.plugins[0].instanceAddress}
blockExplorerLink={
daoDetails?.plugins[0].instanceAddress
? `${CHAIN_METADATA[network].explorer}address/${daoDetails?.plugins[0].instanceAddress}`
: undefined
}
methodDescription={t('labels.updateGovernanceActionDescription')}
verified
>
Expand Down
12 changes: 10 additions & 2 deletions src/components/executionWidget/actions/removeAddressCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import {useProviders} from 'context/providers';
import {CHAIN_METADATA} from 'utils/constants';
import {Web3Address} from 'utils/library';
import {ActionRemoveAddress} from 'utils/types';
import {useDaoDetailsQuery} from 'hooks/useDaoDetails';

export const RemoveAddressCard: React.FC<{
action: ActionRemoveAddress;
}> = ({action: {inputs}}) => {
const {t} = useTranslation();
const {network} = useNetwork();
const {data: daoDetails} = useDaoDetailsQuery();
const {api: provider} = useProviders();

const [addresses, setAddresses] = useState<Web3Address[]>([]);
Expand Down Expand Up @@ -60,10 +62,16 @@ export const RemoveAddressCard: React.FC<{
*************************************************/
return (
<AccordionMethod
verified
type="execution-widget"
methodName={t('labels.removeWallets')}
smartContractName={t('labels.aragonOSx')}
verified
smartContractName={`Multisig v${daoDetails?.plugins[0].release}.${daoDetails?.plugins[0].build}`}
smartContractAddress={daoDetails?.plugins[0].instanceAddress}
blockExplorerLink={
daoDetails?.plugins[0].instanceAddress
? `${CHAIN_METADATA[network].explorer}address/${daoDetails?.plugins[0].instanceAddress}`
: undefined
}
methodDescription={t('labels.removeWalletsDescription')}
>
<Container>
Expand Down
9 changes: 9 additions & 0 deletions src/components/executionWidget/actions/sccExecutionWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import {AccordionMethod} from 'components/accordionMethod';
import {ComponentForTypeWithFormProvider} from 'containers/smartContractComposer/components/inputForm';
import {useNetwork} from 'context/network';
import React from 'react';
import styled from 'styled-components';
import {CHAIN_METADATA} from 'utils/constants';
import {Input} from 'utils/types';

export const SCCExecutionCard: React.FC<{
action: any;
}> = ({action}) => {
const {network} = useNetwork();
return (
<AccordionMethod
type="execution-widget"
methodName={action.functionName}
smartContractName={action.contractName}
smartContractAddress={action.contractAddress}
blockExplorerLink={
action.contractAddress
? `${CHAIN_METADATA[network].explorer}address/${action.contractAddress}`
: undefined
}
verified
>
<Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {FormlessComponentForType} from 'containers/smartContractComposer/compone
import {POTENTIALLY_TIME_SENSITIVE_FIELDS} from 'utils/constants/misc';
import {capitalizeFirstLetter, shortenAddress} from 'utils/library';
import {ActionWC, ExecutionStatus, Input} from 'utils/types';
import {CHAIN_METADATA} from 'utils/constants';
import {useNetwork} from 'context/network';

type WCActionCardActionCardProps = Pick<AccordionMethodType, 'type'> & {
action: ActionWC;
Expand All @@ -25,6 +27,7 @@ export const WCActionCard: React.FC<WCActionCardActionCardProps> = ({
type,
}) => {
const {t} = useTranslation();
const {network} = useNetwork();

const showTimeSensitiveWarning = useMemo(() => {
// Note: need to check whether the inputs exist because the decoding
Expand Down Expand Up @@ -54,7 +57,13 @@ export const WCActionCard: React.FC<WCActionCardActionCardProps> = ({
type={type}
methodName={action.functionName}
dropdownItems={methodActions}
smartContractName={shortenAddress(action.contractName)}
smartContractName={action.contractName}
smartContractAddress={shortenAddress(action.contractAddress)}
blockExplorerLink={
action.contractAddress
? `${CHAIN_METADATA[network].explorer}address/${action.contractAddress}`
: undefined
}
verified={!!action.verified}
methodDescription={action.notice}
>
Expand Down
8 changes: 7 additions & 1 deletion src/components/executionWidget/actions/withdrawCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ export const WithdrawCard: React.FC<{
<AccordionMethod
type="execution-widget"
methodName={t('TransferModal.item2Title')}
smartContractName={t('labels.aragonOSx')}
smartContractName={action.tokenSymbol ? action.tokenSymbol : undefined}
smartContractAddress={action.tokenAddress}
blockExplorerLink={
action.tokenAddress
? `${CHAIN_METADATA[network].explorer}token/${action.tokenAddress}`
: undefined
}
verified
methodDescription={t('AddActionModal.withdrawAssetsActionSubtitle')}
>
Expand Down
Loading

0 comments on commit 90b26eb

Please sign in to comment.