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

Add notification when storage is running low #2148

Merged
merged 6 commits into from
May 26, 2022
Merged

Conversation

Tbaut
Copy link
Collaborator

@Tbaut Tbaut commented May 23, 2022

closes #2146

I added the ability to close "turn off" a notification on click, until the next refresh at least :)

@render
Copy link

render bot commented May 23, 2022

@render
Copy link

render bot commented May 23, 2022

@render
Copy link

render bot commented May 23, 2022

@github-actions github-actions bot added the Type: Feature Added to PRs to identify that the change is a new feature. label May 23, 2022
const [unpaidInvoiceNotification, setUnpaidInvoiceNotification] = useState<string | undefined>()
const [cardExpiringNotification, setCardExpiringNotification] = useState<string | undefined>()
const [isBillingEnabled, setIsBillingEnabled] = useState(false)
const shouldProposeUpgrade = useMemo(() => storageSummary
? storageSummary.used_storage > storageSummary.total_storage * 0.75
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@asnaith or @juans-chainsafe if you want to test, just change this line to whatever percentage you want, to see the notification appear.

Copy link
Contributor

@juans-chainsafe juans-chainsafe left a comment

Choose a reason for hiding this comment

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

Nicely done! and yep I tested locally because I needed to change the percentage, is working correctly! based on Andrew ticket.

PS: I will do the translations with Weblate to see how it works

Copy link
Contributor

@tanmoyAtb tanmoyAtb left a comment

Choose a reason for hiding this comment

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

Looks good, leaving a comment to check isBillingEnable before showing notification.

@asnaith
Copy link
Member

asnaith commented May 25, 2022

Thanks for the tips on how to test!

This is working well for most parts, just noticed the same thing as Tanmoy - users not whitelisted for billing can still click the notification but as they don't have access to billing it takes them to an empty settings page.

I think we should just tell the user their storage is low and remove the "upgrade here" text / click through if they're not whitelisted.

Screen Shot 2022-05-24 at 11 24 50 PM

@Tbaut
Copy link
Collaborator Author

Tbaut commented May 25, 2022

I added a proper redirection to our form, and as a side note, I asked the design team to change the copy a bit to give more context.

@Tbaut Tbaut requested a review from tanmoyAtb May 25, 2022 12:54
Copy link
Contributor

@tanmoyAtb tanmoyAtb left a comment

Choose a reason for hiding this comment

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

Looks good to go !

@asnaith
Copy link
Member

asnaith commented May 25, 2022

I added a proper redirection to our form, and as a side note, I asked the design team to change the copy a bit to give more context.

Nice change, looks good to go now :)

@Tbaut Tbaut merged commit 47db353 into dev May 26, 2022
@Tbaut Tbaut deleted the feat/tbaut-upgrade-button-2146 branch May 26, 2022 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Added to PRs to identify that the change is a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notify users when they reach 75% of their storage quota
5 participants