Skip to content

Commit

Permalink
refactor: put v-else on template
Browse files Browse the repository at this point in the history
  • Loading branch information
ozyx committed Mar 6, 2024
1 parent a05163f commit d0cefc7
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions src/plugins/timelist/TimelistComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,40 @@
>
</expanded-view-item>
</template>
<div v-else class="c-table c-table--sortable c-list-view c-list-view--sticky-header sticky">
<table class="c-table__body js-table__body">
<thead class="c-table__header">
<tr>
<list-header
v-for="headerItem in headerItems"
:key="headerItem.property"
:direction="
defaultSort.property === headerItem.property
? defaultSort.defaultDirection
: headerItem.defaultDirection
"
:is-sortable="headerItem.isSortable"
:aria-label="headerItem.name"
:title="headerItem.name"
:property="headerItem.property"
:current-sort="defaultSort.property"
@sort="sort"
<template v-else>
<div class="c-table c-table--sortable c-list-view c-list-view--sticky-header sticky">
<table class="c-table__body js-table__body">
<thead class="c-table__header">
<tr>

Check warning on line 45 in src/plugins/timelist/TimelistComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/timelist/TimelistComponent.vue#L45

Added line #L45 was not covered by tests
<list-header
v-for="headerItem in headerItems"
:key="headerItem.property"
:direction="
defaultSort.property === headerItem.property
? defaultSort.defaultDirection
: headerItem.defaultDirection
"
:is-sortable="headerItem.isSortable"
:aria-label="headerItem.name"
:title="headerItem.name"
:property="headerItem.property"
:current-sort="defaultSort.property"
@sort="sort"

Check warning on line 59 in src/plugins/timelist/TimelistComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/timelist/TimelistComponent.vue#L59

Added line #L59 was not covered by tests
/>
</tr>
</thead>
<tbody>
<list-item
v-for="item in sortedItems"
:key="item.key"
:item="item"
:item-properties="itemProperties"
@click.stop="setSelectionForActivity(item, $event.currentTarget)"
/>
</tr>
</thead>
<tbody>
<list-item
v-for="item in sortedItems"
:key="item.key"
:item="item"
:item-properties="itemProperties"
@click.stop="setSelectionForActivity(item, $event.currentTarget)"
/>
</tbody>
</table>
</div>
</tbody>
</table>
</div>
</template>
</div>
</template>

Expand Down

0 comments on commit d0cefc7

Please sign in to comment.