Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAO-77 #450

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/govern-console/src/components/Field/IPFSInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactNode } from 'react';
import { useFormContext, Controller } from 'react-hook-form';
import { useLayout, TextInput, SPACING, ContentSwitcher, FileInput } from '@aragon/ui';
import { toUtf8String } from 'ethers/lib/utils';
Expand All @@ -18,7 +18,7 @@ export interface IPFSInputProps {
/**
* Sub Title of the field
*/
subtitle?: string;
subtitle?: ReactNode | string;
/**
* Placeholder
*/
Expand Down Expand Up @@ -53,6 +53,10 @@ export interface IPFSInputProps {
* IPFS gateway url of the file.
*/
ipfsMetadata?: ipfsMetadata;
/**
* Optional number of rows/lines for textarea if free text is chosen for component
*/
rows?: number;
}

export const IPFSInput: React.FC<IPFSInputProps> = ({
Expand All @@ -64,6 +68,7 @@ export const IPFSInput: React.FC<IPFSInputProps> = ({
shouldUnregister = true,
ipfsMetadata,
placeholder,
rows,
}) => {
const { control, watch, setValue } = useFormContext();
const { layoutName } = useLayout();
Expand Down Expand Up @@ -138,6 +143,7 @@ export const IPFSInput: React.FC<IPFSInputProps> = ({
<TextInput.Multiline
wide
placeholder={placeholder}
rows={rows ? rows : 2}
value={
typeof value !== 'string' && !(value instanceof FileList)
? toUtf8String(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,24 @@ const CreateDaoConfig: React.FC<{
<FormProvider {...methods}>
<IPFSInput
title="Rules / Agreement"
subtitle="Your DAO have optimistic capabilities, meaning that actions can happen without voting,
but should follow pre defined rules. Please provide the main agreement for your DAO (In
text, or upload a file)."
subtitle={
<StyledText name={'title4'} style={{ color: theme.disabledContent }}>
Your DAO has optimistic capabilities, meaning that transactions can happen without
voting, but should follow pre defined rules. Please provide the main agreement for
your DAO (In text, or upload a file). You can use and edit the following text as
required, or use{' '}
<Link href="https://docs.google.com/document/d/1HkSiJtjqiTCMbCagn2ev5iv_fG_PpfJcI-NqebmQzng/">
this template
</Link>{' '}
for a more complete agreement.
</StyledText>
}
shouldUnregister={false}
placeholder="Please insert the reason why you want to execute this"
placeholder="Please insert your DAO agreement"
isFile="isRuleFile"
textInputName="ruleText"
fileInputName="ruleFile"
rows={6}
/>
</FormProvider>

Expand Down
15 changes: 13 additions & 2 deletions packages/govern-console/src/containers/DAOSettings/DAOSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,24 @@ const DaoSettings: React.FC<DaoSettingFormProps> = () => {
) : (
<IPFSInput
title={'Rules / Agreement'}
subtitle="Your DAO have optimistic capabilities, meaning that actions can happen without voting, but should follow pre defined rules. Please provide the main agreement for your DAO (In text, or upload a file)."
placeholder="DAO rules and agreement.."
subtitle={
<StyledText name={'title4'} style={{ color: theme.disabledContent }}>
Your DAO has optimistic capabilities, meaning that transactions can happen
without voting, but should follow pre defined rules. Please provide the main
agreement for your DAO (In text, or upload a file). You can use{' '}
<Link href="https://docs.google.com/document/d/1HkSiJtjqiTCMbCagn2ev5iv_fG_PpfJcI-NqebmQzng/">
this template
</Link>{' '}
to create your agreement.
</StyledText>
}
placeholder="Please insert your DAO agreement"
ipfsMetadata={ipfsMetadata}
shouldUnregister={false}
textInputName="daoConfig.rules"
fileInputName="rulesFile"
isFile="isRuleFile"
rows={6}
/>
)}

Expand Down
9 changes: 6 additions & 3 deletions packages/govern-console/src/environment/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const networks = new Map<EnvironmentName, EnvironmentConfig>([
amount: '10000000000000000000',
},
resolver: '0xC464EB732A1D2f5BbD705727576065C91B2E9f18',
rules: 'No main agreement has been defined', // we use Bytes (ArrayLike<number>) instead of string hex
rules:
'Any transaction created in this DAO must have first been proposed in an Aragon Voice vote on https://voice.aragon.org/ and with the following approval criteria:\n\n67% support of the participating tokens in the vote proposal duration of at least 3 days.\n\nTransactions created that do not meet the above criteria should not be permitted.', // we use Bytes (ArrayLike<number>) instead of string hex
maxCalldataSize: 100000, // initial maxCalldatasize
},
curatedTokens: {
Expand Down Expand Up @@ -55,7 +56,8 @@ const networks = new Map<EnvironmentName, EnvironmentConfig>([
amount: '10000000000000000000',
},
resolver: '0xC464EB732A1D2f5BbD705727576065C91B2E9f18',
rules: 'No main agreement has been defined',
rules:
'Any transaction created in this DAO must have first been proposed in an Aragon Voice vote on https://voice.aragon.org/ and with the following approval criteria:\n\n67% support of the participating tokens in the vote proposal duration of at least 3 days.\n\nTransactions created that do not meet the above criteria should not be permitted.', // we use Bytes (ArrayLike<number>) instead of string hex
maxCalldataSize: 100000,
},
curatedTokens: {
Expand Down Expand Up @@ -87,7 +89,8 @@ const networks = new Map<EnvironmentName, EnvironmentConfig>([
amount: '10000000000000000000',
},
resolver: '0x9c003eC97676c30a041f128D671b3Db2f790c3E7',
rules: 'No main agreement has been defined',
rules:
'Any transaction created in this DAO must have first been proposed in an Aragon Voice vote on https://voice.aragon.org/ and with the following approval criteria:\n\n67% support of the participating tokens in the vote proposal duration of at least 3 days.\n\nTransactions created that do not meet the above criteria should not be permitted.', // we use Bytes (ArrayLike<number>) instead of string hex
maxCalldataSize: 100000,
},
curatedTokens: {
Expand Down