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
Usage limits for KoboToolbox-hosted servers #4578
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add manage usage route to user menu
Usage limits 2fa fixes
# Conflicts: # kpi/tests/api/test_api_environment.py # kpi/views/environment.py
* add button color option for dark blue * Added props to style koboModal header and footer * Modal for any limits exceeding and calculating those limits. * Add translation function * Add css padding and aria labels * Linting and formating * update kobo-common version * Updated lock file with version kobo-compose * Updated color and kobo common version to older version * Bug fix for initial load not rendering update to limits * ran install to fix build error * Fixed package lock from merge conflict * initial style for limit banner * Add dark red button styles * updated to use bytes not GB * Linting and formatting fixes * Updated banner to only show when dismissed is true and cleaned up some code * Clean up and PR updates * added initial check for constant free_tier_thresholds * removed console logs * added line for data being set to submission limits for free tier thresholds * PR updates to refactor and fix small style bugs
…o-projects-page Add Modal and Banner for when user goes over limits to my projects page
* add usage limits to usage page * add recurring property to price * add highlights for usage over limits with very basic styling * add warning icon * prevent subscriptionStore from sending multiple simultaneous fetches * install prettybytes * add amber to icon color options * update usage page structure to match figma * fix ts error in subscriptionStore * allow service_usage to accept POST requests * refactor getUsage to optionally send organization_id * update usage page * show monthly/annual usage data based on plan type, add loading state * fix some ts/linting errors * remove unused file dataUsageStore.ts * extract UsageContainer component * extract some logic to *.api.* files * remove unused imports * add missing usageContainer tsx and scss files * finalize styling * get usage by organization in overlimits banners/modal * extract USAGE_WARNING_RATIO to a constant * run prettier/eslint * remove unused imports from subscriptionStore * try/catch call to getOrganization * refactor date formatting utils * use refactored formatDate instead of recreating it * fix misleading type * refactor isLoaded to isInitialised * try/catch in getUsageForOrganization * extract usage.loaded to separate booleans * handle null return from getUsageForOrganization * remove duplicate visuallyhidden class * refactor RecurringInterval to type instead of enum * extract AriaText component to common components library * change dates to use time tags * add story for AriaText * use base kobo colors instead of modifying opacity in usageContainer * remove mobx observables from react dep arrays * pull truncate into a utility function * remove some unnecessary brackets around JSX string args
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Description
Add usage limits on submissions, data, and NLP for users on KoboToolbox-hosted servers.
Notes
Changes:
/#/account/usage
) has been updated to reflect total usage for a user's organization./api/v2/service_usage
now calculates usage based on a subscriber's plan start dateFREE_TIER_THRESHOLDS
constance configDepends on kobocat#889; without the code changes and migrations from that PR, usage will be calculated incorrectly.