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

feat(organizations): update usage limits modals and banners TASK-996 #5249

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

pauloamorimbr
Copy link
Contributor

@pauloamorimbr pauloamorimbr commented Nov 8, 2024

🗒️ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

📣 Summary

Usage limits modal and banner descriptions were changed to reflect the individual, organization or team subscription.

📖 Description

Information for usage limits modal and banner was changed:

  • The subject changes between "you", "your organization" and "your team" depending on the user subscription
  • Texts were updated to fix translation problems, isolated in longer sentences (even if it makes the code look a bit redundant)
  • A Bug was fixed where the warning limits would be displayed repeated times. (Was already fixed for non-warning messages)
  • The react-markdown library was added to format markdown-like strings

👀 Preview steps

  1. ℹ️ have an account and a project
  2. have Stripe setup
  3. Reach the usage limit or get close to the usage limit. Easiest way is to override values in useUsage.hook.ts
  4. Open projects view.
  5. 🟢 Banner should show up informing about the usage limit. The message will vary depending on the is_mmo flag from the organization and on the shouldUseTeamLabel from environment.
  6. 🟢 For exceeded submissions limits a modal will show up having the same variants as the previous step.

💭 Notes

  • The full idea behind some of the changes is to improve translation process, converting broken down texts to longer sentences with context and formatting where needed.
  • At first a simpler markdown parser was implemented, but after some discussion in its PR we've decided to use react-markdown instead.
  • We could now consider updating the places in Kobo where we're using HTML and it could be dangerous, so @magicznyleszek created a task for that refactor: TASK-1257 🙇🏻

Copy link

@pauloamorimbr pauloamorimbr self-assigned this Nov 12, 2024
@pauloamorimbr pauloamorimbr changed the title feat(organizations): Update usage limits modals and banners [TASK-996] feat(organizations): Update usage limits modals and banners TASK-996 Nov 12, 2024
@pauloamorimbr pauloamorimbr marked this pull request as ready for review November 12, 2024 14:54
@jamesrkiger
Copy link
Contributor

@pauloamorimbr I think this would probably benefit from being two PRs: One for the new tooling and one for the actual changes to the limit banners.

Also, how would you feel about putting together some unit tests for this? I see we've got a story in there (thanks for that), but this feels like the kind of thing it would be good to have actual tests for to make sure we catch edge cases.

@pauloamorimbr pauloamorimbr changed the title feat(organizations): Update usage limits modals and banners TASK-996 feat(organizations): update usage limits modals and banners TASK-996 Nov 13, 2024
@pauloamorimbr pauloamorimbr marked this pull request as draft November 14, 2024 19:24
@pauloamorimbr pauloamorimbr force-pushed the task-996-update-usage-limits-modals-and-banners branch 3 times, most recently from 26496ab to 9b5e0e9 Compare November 19, 2024 15:43
@pauloamorimbr pauloamorimbr force-pushed the task-996-update-usage-limits-modals-and-banners branch from 9b5e0e9 to 451cdd3 Compare December 3, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants