Add dropdown button text component for vulnerability report
What does this MR do and why?
This MR adds a DropdownButtonText
component that's currently unused, but will be used by a future MR to set the text in the dropdown button on the vulnerability report filters:
GlDropdown
will automatically truncate text, but we need custom behavior:
-
We show
Item 1 +x more
, whereItem 1
is the name of the item and+x more
is how many items are selected past the first one. -
The
+x more
part should never be truncated; the first item's name should be truncated instead, e.g.Really long selected item name +2 more
should be truncated toReally long sel... +2 more
.
There's enough custom behavior to warrant creating a separate component to handle this, and each vulnerability filter will be using it.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #376324 (closed)