Skip to content

Commit 57a7c22

Browse files
committed
fix: easier scanning by aligning labels
1 parent 3182567 commit 57a7c22

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/components/ChecklistItemRow/ChecklistItemRow.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ vi.mock('@icons/Repeat.vue', () => createIconMock('RepeatIcon'))
99
vi.mock('@icons/Pencil.vue', () => createIconMock('PencilIcon'))
1010
vi.mock('@icons/Eye.vue', () => createIconMock('EyeIcon'))
1111
vi.mock('@icons/Delete.vue', () => createIconMock('DeleteIcon'))
12+
vi.mock('@icons/ArrowRight.vue', () => createIconMock('ArrowRightIcon'))
1213

1314
vi.mock('@nextcloud/vue/components/NcButton', () => ({
1415
default: {
@@ -195,6 +196,15 @@ describe('ChecklistItemRow', () => {
195196
expect(wrapper.emitted('edit')![0]).toEqual([item])
196197
})
197198

199+
it('emits move with item on move action click', async () => {
200+
const item = makeItem()
201+
const wrapper = mount(ChecklistItemRow, { props: { ...defaultProps, item } })
202+
const moveBtn = wrapper.findAll('.nc-action-button').find((b) => b.text() === 'Move to list')!
203+
await moveBtn.trigger('click')
204+
expect(wrapper.emitted('move')).toBeTruthy()
205+
expect(wrapper.emitted('move')![0]).toEqual([item])
206+
})
207+
198208
it('emits remove with item id on remove action click', async () => {
199209
const item = makeItem({ id: 9 })
200210
const wrapper = mount(ChecklistItemRow, { props: { ...defaultProps, item } })

src/components/ChecklistItemRow/ChecklistItemRow.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
</NcCheckboxRadioSwitch>
2525
<div class="checklist-row__meta">
2626
<span v-if="item.quantity" class="checklist-row__quantity">&times; {{ item.quantity }}</span>
27-
<span v-if="category" class="checklist-row__category" :style="{ color: category.color }">
28-
<component :is="categoryIconComponent(category.icon)" :size="14" />
29-
{{ category.name }}
30-
</span>
3127
<span v-if="item.rrule" class="checklist-row__recurrence" :title="item.rrule">
3228
<RepeatIcon :size="14" />
3329
{{ formatRrule(item.rrule) }}
3430
</span>
31+
<span v-if="category" class="checklist-row__category" :style="{ color: category.color }">
32+
<component :is="categoryIconComponent(category.icon)" :size="14" />
33+
{{ category.name }}
34+
</span>
3535
</div>
3636
<div class="checklist-row__actions">
3737
<NcButton variant="tertiary" :aria-label="strings.viewItem" @click="$emit('view', item)">

0 commit comments

Comments
 (0)