Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
cjreimer committed Nov 20, 2024
1 parent 9c4d477 commit 52352fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import humanize from 'humanize-string'

const MAX_STRING_LENGTH = 150

export const bigIntDisplay = (value: bigint) => {
return value.toString()
}

export const formatEnum = (values: string | string[] | null | undefined) => {
let output = ''

Expand Down
4 changes: 4 additions & 0 deletions __fixtures__/test-project/web/src/lib/formatters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import humanize from 'humanize-string'

const MAX_STRING_LENGTH = 150

export const bigIntDisplay = (value: bigint) => {
return value.toString()
}

export const formatEnum = (values: string | string[] | null | undefined) => {
let output = ''

Expand Down
5 changes: 5 additions & 0 deletions packages/cli/src/commands/generate/scaffold/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ const modelRelatedVariables = (model) => {
listDisplayFunction: 'formatEnum',
displayFunction: 'formatEnum',
},
BigInt: {
componentName: 'TextField',
displayFunction: 'bigIntDisplay',
listDisplayFunction: 'truncate',
},
Boolean: {
componentName: 'CheckboxField',
defaultProp: 'defaultChecked',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import humanize from 'humanize-string'

const MAX_STRING_LENGTH = 150

export const bigIntDisplay = (value: bigint) => {
return value.toString()
}

export const formatEnum = (values: string | string[] | null | undefined) => {
let output = ''

Expand Down

0 comments on commit 52352fc

Please sign in to comment.