feat(license/ui): Display available license count
- [x] I have read the CONTRIBUTING document.
- [x] I have performed a self-review of my code.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [ ] This change requires a documentation update.
Description
- It fixes !36843
- Adds a license counter that tells the user how many licenses are left and how many have been allocated.
Screenshots (if appropriate):
Afftected Items Search Option:
Unlimited
Valid
Full
Overflow
Tab:
Unlimited
Valid
Full
Overflow
Form
Unlimited
Valid
Full
Overflow
for elements with background color cna you use boostrap badge ?
https://getbootstrap.com/docs/4.0/components/badge/
Quick design done IRL
- Use progress bars
- If overconsumption -> make the progress bar to 100% and use iconography, colors to alert the user*
- re-use the same design in both form and searchoption
- don't forget the csv export case, where we make a simple text "used/total"
for elements with background color cna you use boostrap badge ?
https://getbootstrap.com/docs/4.0/components/badge/
The current badges don't look good and would fail an accessibility check for color contrast. Using the regular info/success and danger badges would be better.
On this subject, I was already OK with the UI changes But I remember there was still the CSS export to do. Is it possible, or is there any technical issue blocking the thing?
I think that it is not possible because the data from the export in CSV and the display in the search options is the result of the giveItem function. However, there is no way to know if the action that the user wants to do is a CSV export or just a display of the Search options
As far as I see,
getSpecificValueToDisplay()implementations are never adapting the output to the context. Also, thehtmloption is always set totrue, see
There are things that need fixed/improved, but the default handling for HTML content in a non-HTML output is handled in the various Glpi\Search\Output\* classes. The NameListSearchOutput uses html_entity_decode and strip_tags to remove everything except the item link text. Outputs extending Spreadsheet output (PDF, ODS, CSV, XLSX) all use the DataExport class to normalize the content which uses RichText::getTextFromHtml.
In this specific case, there isn't really a textual representation that can be found by stripping the HTML tags. I am not sure this is a widespread issue though.