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

Per 9237 gift storage interface #248

Merged
merged 24 commits into from
Oct 29, 2023
Merged

Conversation

crisnicandrei
Copy link
Contributor

@crisnicandrei crisnicandrei commented Jun 13, 2023

This pr's purpose is the implementation of the gift storage interface.

I have added a new tab to the storage dialog accessed from the dropdown for the gift component. I have created a new component which in which the new form lies where the user must input the email, amount and the message. Upon confirmation a new modal pops up for confirmation.

@crisnicandrei crisnicandrei requested a review from meisekimiu June 13, 2023 08:23
@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch 2 times, most recently from a008365 to 4ee9a12 Compare June 13, 2023 08:26
@crisnicandrei crisnicandrei marked this pull request as draft June 13, 2023 08:28
@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from 08444a5 to bc94459 Compare June 13, 2023 08:30
@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch 2 times, most recently from be06693 to 3dfe053 Compare July 18, 2023 07:41
@crisnicandrei crisnicandrei marked this pull request as ready for review July 18, 2023 07:52
@crisnicandrei crisnicandrei changed the title WIP Per 9237 gift storage interface Per 9237 gift storage interface Jul 18, 2023
@meisekimiu
Copy link
Member

Can you rebase this on main and fix the conflicts?

@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from 52950c3 to b6dd618 Compare July 25, 2023 07:31
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may have been preexisting, but I can now reach https://ng.permanent.org:4200/app/(private//dialog:storage/done) and see an empty screen in the modal. I think we always want something to appear in the modal, likely the "add storage" page by default.

More concerning, I tried gifting 1.2 GB of storage, which is not allowed since we are limiting to whole numbers of gigabytes. I got a 500 error back from the server with the message SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: "-1288490188.8"CONTEXT: unnamed portal parameter $1 = '...'. but the user-facing message was "Success!" We should also remove the decimal point from the placeholder text and have it just read "0" or similar to make it clear that users need to send only whole numbers of gbs as gifts. Here is the slack conversation where Robert suggested sticking to whole gbs for gifting. Mind you, the server error should have been a validation issue, not a sql error, so I'm also looking into that.

@crisnicandrei
Copy link
Contributor Author

@cecilia-donnelly I have pushed some changes, could you please recheck? thanks

@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from 556df8e to acee8a0 Compare July 27, 2023 11:49
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for validating the storage amount is a whole number! However, just disabling the button is very confusing. Can you add a red box around the problematic entry or something like that? (cc @k8lyn6 since this is really a design question - is there language you'd like to use for the error if a person tries to give 1.5 GB and we're only allowing them to gift integer gbs of storage?)

@k8lyn6
Copy link

k8lyn6 commented Jul 28, 2023

@cecilia-donnelly How about: "Storage can only be gifted in 1GB increments."

@crisnicandrei
Copy link
Contributor Author

@cecilia-donnelly @k8lyn6 should there be a message for invalid email addresses as well?

@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from 8106702 to 57a5255 Compare July 31, 2023 14:09
@k8lyn6
Copy link

k8lyn6 commented Jul 31, 2023

@cecilia-donnelly users can gift storage to people who aren't Permanent members, correct? I don't think we normally have a message for invalid email addresses, so I don't think we need one here.

@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from 898b112 to f29b7ab Compare July 31, 2023 19:21
@crisnicandrei
Copy link
Contributor Author

@k8lyn6 i have added a message if the string is not a valid message (e.g andrei instead of [email protected])

@cecilia-donnelly
Copy link
Member

Note that @k8lyn6 and I talked about this earlier and we should hold off on merging/deploying this until we fix a couple backend bugs. Notably https://permanent.atlassian.net/browse/PER-9327.

@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch 2 times, most recently from d9e87eb to 92202e3 Compare October 4, 2023 17:16
@crisnicandrei
Copy link
Contributor Author

@k8lyn6 @cecilia-donnelly @meisekimiu I have tested this with the backend changes, and it looks good so I would say it can be reviewed

@cecilia-donnelly cecilia-donnelly self-requested a review October 10, 2023 15:22
@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from 5248e82 to 3cc3b3e Compare October 10, 2023 15:29
@crisnicandrei crisnicandrei requested a review from k8lyn6 October 27, 2023 13:56
@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from c67fc46 to 60040ee Compare October 27, 2023 16:51
This pr's purpose is the implementation of the gift storage interface.

I have added a new tab to the dropdown for the gift component. I have created a new component which in which the new form lies where the user must input the email, amount and the message. Upon confirmation a new modal pops up for confirmation.
Add red outline and error message if the amount is not an integer
Added a validator with debounce for the email address
Linting
Removed string
Removed duplicate imports
Wrote more tests.
Added tests
Update the account after succesfull API call.
Linting and moved the logic of the subscription.
Display a message when the amount is greater than the available space.
Added a test to check if the form is disabled if the amount exceeds the available account space.
Added more tests for coverage.
Reset the form after submitting.
Updated the gifting message
Fixed the remaining amount after gifting
@crisnicandrei crisnicandrei force-pushed the PER-9237-gift-storage-interface branch from d8acc73 to 5cd7b95 Compare October 29, 2023 18:40
@crisnicandrei crisnicandrei merged commit 047bd8c into main Oct 29, 2023
2 checks passed
@crisnicandrei crisnicandrei deleted the PER-9237-gift-storage-interface branch October 29, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants