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

Usage treshold & severity levels #358

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

Conversation

pixelbrackets
Copy link
Contributor

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.

Bildschirmfoto vom 2024-09-09 12-09-56

*/
private function formatNumber(int $number): string
{
return number_format($number, 0, ',', '.');
Copy link
Contributor

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.

Copy link
Contributor Author

@pixelbrackets pixelbrackets Sep 26, 2024

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.
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.

2 participants