-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: default value fixes #1166
fix: default value fixes #1166
Conversation
@@ -81,7 +81,7 @@ function prepareRowTableSchema(data: TTableDescription = {}): SchemaData[] { | |||
type: Type, | |||
notNull: NotNull, | |||
autoIncrement: Boolean(DefaultFromSequence), | |||
defaultValue: DefaultFromLiteral?.value?.text_value, | |||
defaultValue: Object.values(DefaultFromLiteral?.value || {})[0] || '-', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you decide to use such a logic? It seems less obvious than prev version.
Why not just DefaultFromLiteral?.value?.text_value || '-'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because field with value has different naming depends on it's type. i.e. bool_value
for bool, text_value
for string...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now i see... but lets also fix it in types DefaultFromLiteral
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -102,7 +102,7 @@ const defaultValueColumn: SchemaColumn = { | |||
return i18n('column-title.defaultValue'); | |||
}, | |||
width: 100, | |||
render: ({row}) => row.defaultValue, | |||
render: ({row}) => String(row.defaultValue), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need in explicit transformation, typescript should catch that defaultValue
is always string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't work for bool such way
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Bundle Size: ✅
Current: 78.90 MB | Main: 78.90 MB
Diff: 0.03 KB (-0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information