-
-
Notifications
You must be signed in to change notification settings - Fork 323
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 Money cell and Money type options UI #1336
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
@seancolsen @silentninja I am not able to save a Money type column here.
- When trying to convert a column to money type with empty values for decimal places and max digits, server throws error: the fields cannot be null.
- When values are entered for both, server throws error: Unknown type_option passed.
@pavish Yeah that's an issue that I brought up with @silentninja back when I was first working on this PR a couple months ago. My memory is hazy, but I vaguely recall there being an open ticket or open PR for that somewhere. I just went looking and couldn't find it though. @silentninja does this jog your memory? Do you know of a ticket or PR for this bug? If we don't have a ticket for that yet, then I'm happy to create one. But I don't think it needs to hold up this PR. @pavish you can continue your review by manually submitting the columns PATCH request without the |
@pavish @seancolsen I think the issue is #1359 |
Thanks @silentninja I'll make fixes in this PR. @pavish I'll ping you when it's ready for review. |
@pavish this is ready for re-review now. |
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.
@seancolsen Looks good to me.
Fixes: #259
Before
After
Notes
Many of the requirements have changed since the ticket was written, and it's difficult to summarize all of them here. @pavish I'm hoping that you'll have enough of an idea of the requirements to review this PR, and we can address subsequent issues as we discover them.
This PR only handles the case where the user is creating a new column with the
MATHESAR_TYPES
schema installed. We use the typeMATHESAR_TYPES.MATHESAR_MONEY
. I haven't yet tested this functionality with the built in PostgresMONEY
type, but I suspect more work will be needed to handle existing data of that type. I created Allow the user to work with Postgres MONEY values with our Money UI type #1403 for that work.While setting the default Money column value and while setting a filter condition for a Money column, the input does not display the currency symbol. This behavior is not ideal, but it still works, in my opinion. I'm not sure of the best design to employ to improve this situation. If we want to improve it, we'll need to give the UX some more thought.
The ticket says "shown in a monospace font". That's not implemented here. I'd argue it's not necessary. We can create another ticket for it if needed.
There's quite a bit of code duplication between Number functionality and Money functionality. I'm open to cleaning some of it up, but I'd like the dust to settle a bit first.
Checklist
Update index.md
).master
branch of the repositoryDeveloper Certificate of Origin
Developer Certificate of Origin