feat: adding count label on multiselect component#865
Conversation
Codecov Report
@@ Coverage Diff @@
## main #865 +/- ##
==========================================
- Coverage 85.36% 85.36% -0.01%
==========================================
Files 799 799
Lines 16435 16433 -2
Branches 2064 2064
==========================================
- Hits 14030 14028 -2
Misses 2373 2373
Partials 32 32
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| padding: 0 6px; | ||
| background-color: $gray-2; | ||
| border-radius: 4px; | ||
| margin-left: 5px; |
There was a problem hiding this comment.
I guess, we use margin/padding as multiple of 4. You may check that.
Otherwise looks good to me!!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| expect(spectator.query(LabelComponent)?.label).toEqual('first and 5 more'); | ||
| expect(spectator.query(LabelComponent)?.label).toEqual('first'); | ||
|
|
||
| expect(spectator.component.selectedItemsCount).toBe(6); |
There was a problem hiding this comment.
We should test this from Dom. Example:
expect(spectator.query('.trigger-more-items')).toHaveText('6')
This comment has been minimized.
This comment has been minimized.
| ); | ||
| if (selectedItems === undefined || selectedItems.length === 0) { | ||
| this.triggerLabel = this.placeholder; | ||
| this.selectedItemsCount = 0; |
There was a problem hiding this comment.
nit: can move this assignment out of the condition then collapse the conditional
this.selectedItemsCount = selectedItems?.length ?? 0;
this.triggerLabel = this.selectedItemsCount === 0 ? this.placeholder : selectedItems[0].label;| margin-left: 8px; | ||
| max-width: 38px; | ||
| font-size: 12px; | ||
| font-weight: 600; |
There was a problem hiding this comment.
can we pull this font from our shared font styles? We generally want all fonts to be defined in font.scss so we're not defining them adhoc in every style sheet.
Description
Current behaviour of Multiselect component label is and more.
This PR contains changes which will Instead of showing "and " will show "+" tag with a grey background and border radius.
Testing
Unit tests to verify the existence of the tag and its value.
Checklist: