Abstract work item attributes to a single list/board component
Problem
Currently, each attribute (e.g. milestone, weight, iteration) uses its own component, which can result in inconsistency and require duplication of effort when making changes. There are then different components used between contexts, e.g. date attribute used in boards, and a date attribute used in lists.
In practice, each attribute should look and work the same, with the only differences typically being what information is shown for the icon, value, and tooltip (or popover).
Proposal
Single attribute component
Create a single abstraction as WorkItemCardAttribute
(or similar) for all standard attributes. Non-standard attributes — specifically labels, health status and assignee — should remain separate.
WorkItemCardAttribute
should by default support props for icon, value, tooltipTitle, tooltipDescription. Icon and value should then be used to present the attribute, along with a default tooltip using tooltipTitle and tooltipDescription. The tooltip should be templated so it can be replaced in limited cases where a different approach is needed, such as when using a popover.
Using the component
When presenting attributes in an aggregation view rather than loading each attribute component, loop through the work item attributes and use WorkItemCardAttribute
for each attribute that is present and which should be shown.
Testing
TBD