-
Notifications
You must be signed in to change notification settings - Fork 41
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 treshold & severity levels #358
base: main
Are you sure you want to change the base?
Usage treshold & severity levels #358
Conversation
*/ | ||
private function formatNumber(int $number): string | ||
{ | ||
return number_format($number, 0, ',', '.'); |
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.
Using the NumberFormatter
would be nicer, however that requires php intl
which is only hard required by the TYPO3 core since v12.
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.
Yes indeed, since this would take local language settings into account. But as you said, the requirement does not exist in TYPO3 11 and adding this to the package only for this one number format seems to be a disproportionate burden for integrators. Suggestion: Merge this format for now, keep a migration to NumberFormatter:: on a short list for your next version?
Action icons dont have a fixed color set, in order to let TYPO3 set the desired color - black in list actions, white in toolbar infos. Change the DeepL SVG to not use black in all places.
Calculate the message severity based on the API quota usage rate. Matching popular quota warning levels if will notify above 90% usage, and shown an error when the limit is exceeded. Hide the flashmessage after a translation if the severity is low. Refs web-vision#343
Use severity levels in widget as well and reduce the height to prevent unused whitespace.
e537b55
to
86ac206
Compare
Based on formating styles in PR #357 and the desire for a threshold in issue #343 I have
tweaked the severity level determination in all usage bars (flashmessage, system infobox, widget).
Based on warning levels in other software (90%, 98%, 100%) each info box will use a different
severity color according to the currently used quota.
The widget is a bit more compact now, since it used a lot of whitespace before,
which makes the dashboard unnecessary large.