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

Add new dashboard/assets #2607

Merged
merged 34 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
563e73d
Add new icons
kattylucy Feb 6, 2025
ded9a4e
Update hooks and components
kattylucy Feb 6, 2025
fb6940c
Add dashboard landing page and context
kattylucy Feb 6, 2025
657bf6a
Add new file upload button
kattylucy Feb 6, 2025
e41044b
Fix bug on tabs color
kattylucy Feb 6, 2025
cc36ee2
Update to fabric
kattylucy Feb 6, 2025
b62c2d9
Create utils functions for assets
kattylucy Feb 6, 2025
374f9b7
Add asset pages
kattylucy Feb 6, 2025
866a3d6
Update radio button in fabric
sophialittlejohn Feb 6, 2025
ed91c0e
assets page
kattylucy Feb 10, 2025
fa38e22
Add custom template fields
kattylucy Feb 10, 2025
a630887
Add image and description custom fields
kattylucy Feb 10, 2025
9f9bfa6
Cleanup
kattylucy Feb 11, 2025
7edf191
Fix bugs and filter dropdown to only borrowers
kattylucy Feb 11, 2025
df29bf6
Fix bugs around permissions
kattylucy Feb 11, 2025
0527e34
Add functionality to upload assets template
kattylucy Feb 11, 2025
d429a78
Add some UI improvements
kattylucy Feb 11, 2025
c99098c
Add pricing section
kattylucy Feb 11, 2025
bf6aa6d
Add create asset
kattylucy Feb 11, 2025
e39875a
Add submit to form
kattylucy Feb 11, 2025
ced0433
Cleanup
kattylucy Feb 11, 2025
3a8ef61
Fix total nav
kattylucy Feb 11, 2025
e9adfc6
Add review feedback
kattylucy Feb 13, 2025
0343956
Remove CTA from assets page
kattylucy Feb 13, 2025
cd15db6
Remove unused files
kattylucy Feb 13, 2025
f70c459
Fix linter warnings
kattylucy Feb 13, 2025
798c7bf
temp
kattylucy Feb 13, 2025
ce9d830
Fix import issue
kattylucy Feb 13, 2025
5b2d95a
Disable checkbox and fix maturity date html form validaitn
kattylucy Feb 14, 2025
f438bfc
fix tooltip positioner
kattylucy Feb 14, 2025
d2cedc4
Fix divider
kattylucy Feb 14, 2025
e4f21a7
Add context and selector new code
sophialittlejohn Feb 14, 2025
74f76c7
Use new selector
kattylucy Feb 14, 2025
b73c927
Merge branch 'main' into 2585_assets_page
kattylucy Feb 14, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function PoolPerformanceChart() {
const { poolStates } = useDailyPoolStates(poolId) || {}
const pool = usePool(poolId)
const poolAge = pool.createdAt ? daysBetween(pool.createdAt, new Date()) : 0
const { data: loans } = useLoans(poolId)
const { data: loans } = useLoans([poolId])

const firstOriginationDate = loans?.reduce((acc, cur) => {
if ('originationDate' in cur) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { CurrencyInput, DateInput, NumberInput, Select, TextAreaInput, TextInput } from '@centrifuge/fabric'
import { Field, FieldProps } from 'formik'
import { combine, max, min, positiveNumber, required } from '../../../utils/validation'
import { FieldWithErrorMessage } from '../../FieldWithErrorMessage'

export function AssetTemplateSection({ label, input, name }: { label: string; input: any; name: string }) {
switch (input.type) {
case 'single-select':
return (
<Field name={name} validate={required()} key={label}>
{({ field, form }: any) => (
<Select
placeholder="Select one"
label={`${label}*`}
options={input.options.map((o: any) => (typeof o === 'string' ? { label: o, value: o } : o))}
value={field.value ?? ''}
onChange={(event) => {
form.setFieldValue(name, event.target.value)
}}
/>
)}
</Field>
)
case 'currency': {
return (
<Field
name={name}
validate={combine(required(), positiveNumber(), min(input.min ?? -Infinity), max(input.max ?? Infinity))}
key={label}
>
{({ field, meta, form }: FieldProps) => {
return (
<CurrencyInput
{...field}
label={`${label}*`}
errorMessage={meta.touched ? meta.error : undefined}
currency={input.symbol}
placeholder="0.00"
onChange={(value) => form.setFieldValue(name, value)}
min={input.min}
max={input.max}
/>
)
}}
</Field>
)
}
case 'number':
return (
<FieldWithErrorMessage
name={name}
as={NumberInput}
label={`${label}*`}
placeholder={input.placeholder}
validate={combine(required(), min(input.min ?? -Infinity), max(input.max ?? Infinity))}
symbol={input.unit}
min={input.min}
max={input.max}
/>
)
case 'date':
return (
<FieldWithErrorMessage
name={name}
as={DateInput}
label={`${label}*`}
placeholder={input.placeholder}
validate={required()}
min={input.min}
max={input.max}
/>
)

default: {
const { type, ...rest } = input.type as any
return (
<FieldWithErrorMessage
name={name}
as={type === 'textarea' ? TextAreaInput : TextInput}
label={`${label}*`}
validate={required()}
{...rest}
/>
)
}
}
}
Loading
Loading