-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat: add CellNumberfield to StudioInputTable #14345
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14345 +/- ##
=======================================
Coverage 95.57% 95.57%
=======================================
Files 1864 1865 +1
Lines 24151 24177 +26
Branches 2786 2788 +2
=======================================
+ Hits 23082 23108 +26
Misses 812 812
Partials 257 257 ☔ View full report in Codecov by Sentry. |
onChange?: (value: number) => void; | ||
value?: number; | ||
validationErrorMessage: string; | ||
validationErrorMessage?: 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.
Why are these optional? 😊
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.
onChange
is made optional because I wanted to show it in the StudioInputTable
storybook without attaching a handler function. Another option is to leave it as required and supplying it with an empty function. What do you think?
validationErrorMessage
is made optional because it shows the error directly below the input field, which would look out of place in the table:
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.
Hm, in general I would think the code should be written with the components actual use and not be adapted to fit storybook or tests. So maybe an empty handler function in storybook would be preferable? 🤔
Also regarding the validationErrorMessage
, I guess it would be better passing a undefined value for the storybook, or something similar?
The best solution could be to achieve a similar design as for the StudioCodeListEditor
? But that would probably make more sense to implement in the PR that adopt the usage of CellNumberfield
in the editor.
However, it might be a thing to keep in mind when implementing the error-handling for this component?
(Sorry for all the question marks here - I am not too sure about these allegations 😅)
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.
Hm, in general I would think the code should be written with the components actual use and not be adapted to fit storybook or tests. So maybe an empty handler function in storybook would be preferable? 🤔
Agreed 😊
Also regarding the
validationErrorMessage
, I guess it would be better passing a undefined value for the storybook, or something similar?
But here it is not just for test or Storybook, but also how it is and will be implemented in StudioInputTable
and StudioCodeListEditor
. If there was a red validation message under each field, it would look out of place in the tables and would break the pattern we have in StudioCodeListEditor
where the validation message is shown at the bottom.
The best solution could be to achieve a similar design as for the
StudioCodeListEditor
? But that would probably make more sense to implement in the PR that adopt the usage ofCellNumberfield
in the editor. However, it might be a thing to keep in mind when implementing the error-handling for this component?
I agree with handling the validation message when implementing it in StudioCodeListEditor
😊
(Sorry for all the question marks here - I am not too sure about these allegations 😅)
It's OK 😄
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.
I understand! Lets stick with the validationErrorMessage
as optional 👏
Description
Adds
CellNumberfield
toStudioInputTable
. It will be used later byStudioCodeListEditor
for editing number values.Related Issue(s)
Verification