From 60e83836260084ef4c44462d56f4e48174bf712b Mon Sep 17 00:00:00 2001 From: katty barroso Date: Fri, 13 Dec 2024 12:35:50 +0100 Subject: [PATCH] Add jay's feedback and cleanup --- .../IssuerCreatePool/PoolDetailsSection.tsx | 2 +- .../pages/IssuerCreatePool/PoolSetupSection.tsx | 6 +++--- .../src/pages/IssuerCreatePool/TrancheInput.tsx | 2 +- .../src/pages/IssuerCreatePool/types.ts | 3 +-- .../src/pages/IssuerCreatePool/validate.ts | 16 ---------------- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx b/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx index 8e74ccc505..8060ff1053 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx @@ -179,7 +179,7 @@ export const PoolDetailsSection = () => { {({ field, meta, form }: FieldProps) => ( form.setFieldValue('issuerShortDescription', event.target.value)} onBlur={field.onBlur} errorMessage={meta.touched && meta.error ? meta.error : undefined} diff --git a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx index 3fb98ff53d..5cd4b716f2 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx @@ -67,7 +67,7 @@ export const PoolSetupSection = () => { useEffect(() => { form.setFieldValue('adminMultisig.signers[0]', selectedAccount?.address) }, []) - + console.log(values) return ( @@ -209,10 +209,10 @@ export const PoolSetupSection = () => { Add or remove addresses that can: - Originate assets and invest in the pool* + Originate assets and invest in the pool {values.assetOriginators?.map((_: string, index: number) => ( - + {() => ( } placeholder="0.00" - currency={values.currency} + currency={values.assetDenomination} errorMessage={meta.touched ? meta.error : undefined} onChange={(value) => form.setFieldValue(field.name, value)} onBlur={() => form.setFieldTouched(field.name, true)} diff --git a/centrifuge-app/src/pages/IssuerCreatePool/types.ts b/centrifuge-app/src/pages/IssuerCreatePool/types.ts index 075ccd3c3b..cacc80029e 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/types.ts +++ b/centrifuge-app/src/pages/IssuerCreatePool/types.ts @@ -1,5 +1,4 @@ import { FeeTypes, PoolMetadataInput } from '@centrifuge/centrifuge-js' -import { isTestEnv } from '../../config' export interface Tranche { tokenName: string @@ -91,7 +90,7 @@ export const initialValues: CreatePoolValues = { // pool structure poolStructure: 'revolving', assetClass: 'Private credit', - assetDenomination: isTestEnv ? 'USDC' : 'Native USDC', + assetDenomination: 'USDC', subAssetClass: '', tranches: [createEmptyTranche('Junior')], diff --git a/centrifuge-app/src/pages/IssuerCreatePool/validate.ts b/centrifuge-app/src/pages/IssuerCreatePool/validate.ts index 5a21cf63fa..f8beaa492e 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/validate.ts +++ b/centrifuge-app/src/pages/IssuerCreatePool/validate.ts @@ -102,7 +102,6 @@ export const validateValues = (values: CreatePoolValues) => { if (values.issuerCategories.length > 1) { values.issuerCategories.forEach((category, i) => { - console.log(category) if (category.type === '') { errors = setIn(errors, `issuerCategories.${i}.type`, 'Type is required') } @@ -117,7 +116,6 @@ export const validateValues = (values: CreatePoolValues) => { if (values.poolRatings.length > 1) { values.poolRatings.forEach((rating, i) => { - console.log(rating) if (rating.agency === '') { errors = setIn(errors, `poolRatings.${i}.agency`, 'Field is required') } @@ -133,14 +131,6 @@ export const validateValues = (values: CreatePoolValues) => { }) } - if (values.adminMultisigEnabled) { - values.adminMultisig.signers.forEach((signer, i) => { - if (!isSubstrateAddress(signer) && signer !== '') { - errors = setIn(errors, `adminMultisig.signers.${i}`, 'Invalid address') - } - }) - } - values.poolFees.forEach((fee, i) => { if (fee.name === '' && i !== 0) { errors = setIn(errors, `poolFees.${i}.name`, 'Name is required') @@ -156,12 +146,6 @@ export const validateValues = (values: CreatePoolValues) => { } }) - values.assetOriginators.forEach((asset, i) => { - if (!isSubstrateAddress(asset) && asset !== '') { - errors = setIn(errors, `assetOriginators.${i}`, 'Invalid address') - } - }) - values.tranches.forEach((t, i) => { if (tokenNames.has(t.tokenName)) { errors = setIn(errors, `tranches.${i}.tokenName`, 'Tranche names must be unique')