Skip to content

Commit

Permalink
Develop into master (#577)
Browse files Browse the repository at this point in the history
* Feature/form builder (#553)

* Publish new lib versions. (#412)

* fix/fix-table-types (#354)

* removed the any types from hub

* renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard

* removed commented out DaoData type

* one more comment -- thought i got both before

* Fix/355 summon params mixup (#356)

* more ignore

* fixes bad init params order in summon tx

* Feature/tag component (#349)

* Created basic tag component

* Added dynamic color selections for tags

* Bumped versions fixed filer

* Added icon support to tag component

Co-authored-by: Jord <[email protected]>
Co-authored-by: Jonathan Prozzi <[email protected]>

* Feature/delegate play (#357)

* more ignore

* fixes bad init params order in summon tx

* delegate testing and subgraph field updates

* finishes mapping

* update dao-data query and transformer

* adds delegate tag to list view and hooks up delegate filtering

* refactors filter into query helper

* Spencer's Summon tooltip suggestions (#370)

* Spencer's Summon tooltip suggestions

- Summon portion of #365 

* Delimiter references

#368

For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well.

* Address Jord's comments

Co-authored-by: Sam Kuhlmann <[email protected]>

* Fix/summon poll (#375)

* more ignore

* fixes bad init params order in summon tx

* delegate testing and subgraph field updates

* finishes mapping

* update dao-data query and transformer

* adds delegate tag to list view and hooks up delegate filtering

* adds schema field to tx entity

* updates poll for tx entity made before dao entity

* Feature/alpha baal update (#376)

* new abis

* updates summoner tx logic and contract addresses

* fixes transaction entity creation location;

* fixes some test

* Feature/unit utils (#380)

* create custom d.ts for human-format

* type and convert unit fn from V2

* readableNumber util accepts number strings, throws error if string but number string

* fix 0 to 1 utils, extend MaxDecimals to shorten decimal places

* refine spacer and unit symbol placement

* update new card to handle new params

* update table

* corrections

* alter d.ts file

* potential solutions to ts bug

* implement keating's d.ts fix

* fix comment

* Fix/network switcher (#381)

* better error handling

* fix bug

* remove log

* get react-table TS to stop yelling (#382)

Co-authored-by: Sam Kuhlmann <[email protected]>

* Feature/hub sort (#383)

* wip

* gets query working on dao entity after lots of subgraph updates

* updates front end for sort

* fixes type issue

* fixes build issue

* reviewing v3 monorepo and saw some networks missing (#399)

* Feature/public profile (#384)

* Add some stuff

* Add public profile

* Add ens

* Get build to pass

* Update apps/hub-app/src/pages/PublicProfilePage.tsx

Co-authored-by: Rowdy <[email protected]>

Co-authored-by: Sam Kuhlmann <[email protected]>
Co-authored-by: Rowdy <[email protected]>

* fixing doc display name from <[object Object]> to displayName (#402)

Co-authored-by: Sam Kuhlmann <[email protected]>

* adds search (#401)

* adds search wip

* correctly types the onChange for the input

* cleans up unsed imports

* naming

* Feature/public profile (#384)

* Add some stuff

* Add public profile

* Add ens

* Get build to pass

* Update apps/hub-app/src/pages/PublicProfilePage.tsx

Co-authored-by: Rowdy <[email protected]>

Co-authored-by: Sam Kuhlmann <[email protected]>
Co-authored-by: Rowdy <[email protected]>

* fixing doc display name from <[object Object]> to displayName (#402)

Co-authored-by: Sam Kuhlmann <[email protected]>

* conflicts

* correctly types the onChange for the input

* cleans up unsed imports

* naming

* fix build error

Co-authored-by: Alexander Keating <[email protected]>
Co-authored-by: Rowdy <[email protected]>
Co-authored-by: Brian Rossetti <[email protected]>

* Release/12072022 (#411)

* adds search wip

* correctly types the onChange for the input

* cleans up unsed imports

* naming

* conflicts

* correctly types the onChange for the input

* cleans up unsed imports

* naming

* fix build error

* feature bump

Co-authored-by: Jonathan Prozzi <[email protected]>
Co-authored-by: Rowdy <[email protected]>
Co-authored-by: Jord <[email protected]>
Co-authored-by: Spencer Graham <[email protected]>
Co-authored-by: Brian Rossetti <[email protected]>
Co-authored-by: Alexander Keating <[email protected]>

* Revert "Publish new lib versions. (#412)"

This reverts commit bab7077.

* build formLayout Component

* type correction

* build formLayout story

* rough in bicolumn layout

* handle bicolumn mobile switch, finish bicolumn

* fix mainlayout naming

* build story for bi-column layout

* scaffold formBuilder library

* rough in formBuilder

* restructure types

* refactor component structure

* test render inputs

* add core fields to builder enum

* add row layout to builder

* built logger, fix logger bug

* add disable all functionality

* handle asynchronous callback as props to form builder

* remove some comments

* put submit button in form footer

* fix code based on review

* build validation pipeline

* clean form and field types

* revise types again, simplify rules API

* commit after refactor carnage

* roll back to react-hook-form v6, finally get some traction

* found source of bug, trying new rhf version

* ...and the bug was slain, returned to that cold, miserable shit heap from whence it came.

* reintroduce devtool and logger

* build metadata form, form segment subForm component

* clean, add custom submit btn text

* clean

* build string validations

* derive validation type from function obj

* wrestled types into validation system

* rebuild form builder as context

* build formBuilder hook, use it in the factory

* create sample test

* update form placement

* more post merge corrections

* write validation updaters and add to pipeline, test required updaters, test validation, test pipeline

* try jest testing

* ensure field state updates on formState change

* more cleaning

* reorg files

* build metadata form

* tweak button styles, add defaultValues to formBuilder

* good place to stop

* remove comments

* fix Jest errors

* fix field wrapper stories, update lock

* may have fixed jest errors

Co-authored-by: Jonathan Prozzi <[email protected]>
Co-authored-by: Alexander Keating <[email protected]>
Co-authored-by: Sam Kuhlmann <[email protected]>
Co-authored-by: Rowdy <[email protected]>
Co-authored-by: Spencer Graham <[email protected]>
Co-authored-by: Brian Rossetti <[email protected]>

* Fix build (#563)

* Fix build

* Almost

* More changes

Co-authored-by: Jord <[email protected]>
Co-authored-by: Jonathan Prozzi <[email protected]>
Co-authored-by: Sam Kuhlmann <[email protected]>
Co-authored-by: Rowdy <[email protected]>
Co-authored-by: Spencer Graham <[email protected]>
Co-authored-by: Brian Rossetti <[email protected]>
  • Loading branch information
7 people authored Aug 1, 2022
1 parent 9c852ba commit b8644d3
Show file tree
Hide file tree
Showing 50 changed files with 2,038 additions and 2,203 deletions.
15 changes: 14 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
module.exports = {
stories: [],
addons: ['@storybook/addon-essentials'],
core: {
disableTelemetry: true, // 👈 Disables telemetry
},
// https://github.com/storybookjs/storybook/issues/17996
addons: [
{
name: '@storybook/addon-essentials',
options: {
actions: false,
},
},
],

// addons: ['@storybook/addon-essentials'],
// uncomment the property below if you want to apply some webpack config globally
// webpackFinal: async (config, { configType }) => {
// // Make whatever fine-grained changes you need that should apply to all storybook configs
Expand Down
129 changes: 129 additions & 0 deletions apps/core-app/src/data/formLegos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import { FormLego } from '@daohaus/haus-form-builder';

export const GovernanceProposal: FormLego = {
id: 'GovernanceProposal',
title: 'Update Governance Settings',
subtitle: 'Settings',
description: 'Learn more about governance settings.',
submitButtonText: 'Submit Proposal',
devtool: true,
requiredFields: {
proposalTitle: true,
},
fields: [
{
type: 'input',
id: 'proposalTitle',
label: 'Proposal Title',
placeholder: 'Proposal Name',
expectType: 'number',
rules: {
min: 42,
},
},
{
type: 'textarea',
id: 'proposalDescription',
label: 'Proposal Description',
placeholder: 'Proposal Description',
},
{
type: 'formSegment',
id: 'segment',
title: 'Stake Tokens',
description: 'Update token transferability',
fields: [
{
id: 'split',
type: 'splitColumn',
rows: [
{
rowId: 'default',
left: {
type: 'switch',
id: 'stakeEnabled',
switches: [{ id: 'stakeEnabled', fieldLabel: 'Voting' }],
},
right: {
type: 'switch',
id: 'stakeEnabled',
switches: [{ id: 'stakeypoo', fieldLabel: 'Voting' }],
},
},
],
},
],
},
],
};

export const MetadataConfig: FormLego = {
id: 'MetaDataConfig',
title: 'Update Metadata Settings',
subtitle: 'Settings',
fields: [
{
type: 'input',
id: 'daoContract',
label: 'DAO Contract',
address: true,
placeholder: '0x0000000000000000000000000000000000000000',
},
{
type: 'input',
id: 'daoName',
label: 'DAO Name',
placeholder: 'DAO Name',
},
{
type: 'textarea',
id: 'description',
label: 'Description',
placeholder: "Your DAO's description",
},
{
type: 'formSegment',
title: 'Social',
description: 'Update social media links',
id: 'socialsSegment',
fields: [
{
type: 'input',
id: 'website',
label: 'Website',
placeholder: 'https://example.com',
},
{
type: 'input',
id: 'twitter',
label: 'Twitter',
placeholder: 'https://twitter.com/daoName',
},
{
type: 'input',
id: 'discord',
label: 'Discord',
placeholder: 'https://discord.gg/daoName',
},
{
type: 'input',
id: 'telegram',
label: 'Telegram',
placeholder: 'https://t.me/daoName',
},
{
type: 'input',
id: 'github',
label: 'Github',
placeholder: 'https://github.com/daoName',
},
],
},
{
type: 'input',
id: 'tags',
label: 'Tags',
placeholder: 'Tags',
},
],
};
29 changes: 12 additions & 17 deletions apps/core-app/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import styled from 'styled-components';

import { Card, FormLayout } from '@daohaus/ui';
import { HausLayout } from '@daohaus/daohaus-connect-feature';
import { FormBuilder } from '@daohaus/haus-form-builder';
import { MetadataConfig } from '../data/formLegos';

const Spacer = styled.div`
width: 100%;
height: 50rem;
`;
const sampleDefaultData = {
daoContract: '0x756ee8B8E898D497043c2320d9909f1DD5a7077F',
daoName: 'DAO Name here',
};

export function Home() {
return (
<HausLayout>
<FormLayout
title="No DAO"
description="you need a better url"
subtitle="Something nicer"
>
<Card>
<Spacer />
</Card>
</FormLayout>
<HausLayout navLinks={[{ label: 'NavLink', href: '/' }]}>
<FormBuilder
form={MetadataConfig}
onSubmit={() => console.log('test')}
defaultValues={sampleDefaultData}
/>
</HausLayout>
);
}
Expand Down
11 changes: 5 additions & 6 deletions apps/summon-app/src/components/TimePicker/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useMemo } from 'react';
import { useFormContext } from 'react-hook-form';
import { hoursToSeconds, minutesToSeconds } from 'date-fns/esm';

import { Field, OptionType, WrappedInputSelect } from '@daohaus/ui';
import { Buildable, Field, OptionType, WrappedInputSelect } from '@daohaus/ui';
import { isNumberString } from '@daohaus/common-utilities';

// REFACTOR TO MOLECULES AFTER SUMMONER REVIEW
Expand Down Expand Up @@ -34,9 +34,9 @@ export const TimePicker = ({
id,
options = defaultOptions,
selectId,
required,
rules,
...props
}: TimePickerProps) => {
}: Buildable<TimePickerProps>) => {
const { setValue, watch } = useFormContext();
const unitId = useMemo(() => selectId || `${id}Units`, [selectId, id]);
const [amt, units] = watch([id, unitId]);
Expand All @@ -52,9 +52,8 @@ export const TimePicker = ({
id={id}
selectId={unitId}
options={options}
required={required}
registerOptions={{
required: required ? 'Time value is required' : false,
rules={{
...rules,
validate: {
isNumber: (value) =>
value === '' || isNumberString(value) ? true : 'Must be a number',
Expand Down
12 changes: 4 additions & 8 deletions apps/summon-app/src/layouts/AdvancedSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ export const AdvancedSegment = ({
<WrappedInput
id={FORM_KEYS.QUORUM}
label="Quorum %"
required
full
info={INFO_COPY.QUORUM}
defaultValue="0"
disabled={formDisabled}
registerOptions={{ required: 'This value is required' }}
rules={{ required: 'This value is required' }}
/>
),
right: (
Expand All @@ -35,10 +34,9 @@ export const AdvancedSegment = ({
label="Min Retention %"
defaultValue="66"
info={INFO_COPY.MIN_RETENTION}
required
full
disabled={formDisabled}
registerOptions={{ required: 'This value is required' }}
rules={{ required: 'This value is required' }}
/>
),
},
Expand All @@ -49,23 +47,21 @@ export const AdvancedSegment = ({
id={FORM_KEYS.SPONSOR_THRESHOLD}
label="Sponsor Threshold"
defaultValue="0"
required
full
info={INFO_COPY.SPONSOR_THRESHOLD}
disabled={formDisabled}
registerOptions={{ required: 'This value is required' }}
rules={{ required: 'This value is required' }}
/>
),
right: (
<WrappedInput
id={FORM_KEYS.OFFERING}
label="New Offering (ETH)"
defaultValue="0"
required
full
info={INFO_COPY.NEW_OFFERING}
disabled={formDisabled}
registerOptions={{ required: 'This value is required' }}
rules={{ required: 'This value is required' }}
/>
),
},
Expand Down
3 changes: 1 addition & 2 deletions apps/summon-app/src/layouts/MemberSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ export const MembersSegment = ({ formDisabled }: { formDisabled: boolean }) => {
info={INFO_COPY.MEMBERS}
full
number
required
disabled={formDisabled}
helperText={helperText}
registerOptions={{
rules={{
setValueAs: transformMemberData,
validate: validateMemberData,
required: 'Members is a required field',
Expand Down
2 changes: 1 addition & 1 deletion apps/summon-app/src/layouts/ShamanSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ShamanSegment = ({ formDisabled }: { formDisabled: boolean }) => {
number
disabled={formDisabled}
helperText={helperText}
registerOptions={{
rules={{
setValueAs: transformShamans,
validate: validateShamanData,
}}
Expand Down
8 changes: 4 additions & 4 deletions apps/summon-app/src/layouts/StakeTokenSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ export const StakeTokensSegment = ({
label="Name"
placeholder="Voting Stake"
info={INFO_COPY.VOTING_STK}
required
full
disabled={formDisabled}
registerOptions={{
rules={{
required: 'Token name is required',
maxLength: {
value: 50,
Expand All @@ -59,9 +58,8 @@ export const StakeTokensSegment = ({
placeholder="vSTK"
info={INFO_COPY.TOKEN_SYMBOL}
full
required
disabled={formDisabled}
registerOptions={{
rules={{
required: 'Token name is required',
maxLength: {
value: 5,
Expand All @@ -82,6 +80,7 @@ export const StakeTokensSegment = ({
disabled={formDisabled}
switches={[
{
id: FORM_KEYS.VOTE_TOKEN_TRANSFER,
fieldLabel: votingTransferableLabel,
defaultChecked: false,
},
Expand All @@ -96,6 +95,7 @@ export const StakeTokensSegment = ({
info={INFO_COPY.NV_STAKE_TRANSFER}
switches={[
{
id: FORM_KEYS.NV_TOKEN_TRANSFER,
fieldLabel: nvTransferableLabel,
defaultChecked: false,
},
Expand Down
2 changes: 1 addition & 1 deletion apps/summon-app/src/layouts/SummonerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const SummonerForm = ({
placeholder="Braid Guild"
full
disabled={formDisabled}
registerOptions={{ required: 'DAO name is required' }}
rules={{ required: 'DAO name is required' }}
/>
<Divider className="top-divider" />
</div>
Expand Down
8 changes: 6 additions & 2 deletions apps/summon-app/src/layouts/TimingSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const TimingSegment = ({ formDisabled }: { formDisabled: boolean }) => {
info={INFO_COPY.VOTING_PERIOD}
disabled={formDisabled}
placeholder="0"
required
rules={{
required: 'Time value is required',
}}
/>
),
right: (
Expand All @@ -31,7 +33,9 @@ export const TimingSegment = ({ formDisabled }: { formDisabled: boolean }) => {
full
disabled={formDisabled}
placeholder="0"
required
rules={{
required: 'Time value is required',
}}
/>
),
}}
Expand Down
1 change: 0 additions & 1 deletion libs/common-utilities/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"deploy": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"tag": "alpha",
"access": "public"
}
}
Expand Down
1 change: 0 additions & 1 deletion libs/dao-data/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"deploy": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"tag": "alpha",
"access": "public"
}
},
Expand Down
3 changes: 2 additions & 1 deletion libs/daohaus-connect-feature/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/daohaus-connect-feature",
"command": "tsc --project libs/daohaus-connect-feature/tsconfig.lib.json --emitDeclarationOnly --skipLibCheck",
"color": true
},
Expand Down Expand Up @@ -48,7 +50,6 @@
"deploy": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"tag": "alpha",
"access": "public"
}
}
Expand Down
Loading

0 comments on commit b8644d3

Please sign in to comment.