Skip to content

Commit 236a507

Browse files
author
Hrvoje Vucic
committed
Integrate v-lazy with data table in workflow overview
1 parent c980bbd commit 236a507

File tree

3 files changed

+50
-27
lines changed

3 files changed

+50
-27
lines changed

client/components/repository/Workflow/Overview/Assignee.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<v-tooltip open-delay="800" bottom>
33
<template #activator="{ on }">
4-
<div v-on="on" class="column-assignee d-flex align-center">
4+
<div v-on="on" class="column-assignee">
55
<assignee-avatar
66
:label="label"
77
:img-url="imgUrl"

client/components/repository/Workflow/Overview/Priority.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="d-flex align-center">
2+
<div>
33
<v-icon class="priority-icon mr-2">
44
{{ `$vuetify.icons.${icon}` }}
55
</v-icon>

client/components/repository/Workflow/Overview/index.vue

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
11
<template>
22
<v-data-table
3-
@click:row="selectActivity($event.id)"
43
:headers="headers"
54
:items="items"
65
height="100%"
76
item-class="class"
87
disable-pagination hide-default-footer fixed-header
98
class="overview primary lighten-5">
10-
<template #item.name="{ item, value }">
11-
<div class="d-flex">
12-
<overview-name :value="value" />
13-
<publishing-badge v-if="isAdmin || isRepositoryAdmin" :activity="item" />
14-
</div>
15-
</template>
16-
<template #item.status="{ value }">
17-
<overview-status v-bind="value" />
18-
</template>
19-
<template #item.assignee="{ value }">
20-
<overview-assignee v-bind="value" />
21-
</template>
22-
<template #item.priority="{ value }">
23-
<overview-priority v-bind="value" />
24-
</template>
25-
<template #item.dueDate="{ value }">
26-
<overview-due-date v-if="value" :value="value" />
9+
<template v-slot:item="{ item }">
10+
<v-lazy
11+
v-model="itemVisibility[item.id]"
12+
@click="selectActivity(item.id)"
13+
:class="{ selected: isActivitySelected(item.id) }"
14+
tag="tr"
15+
style="height: 48px;">
16+
<div style="display: contents;">
17+
<td class="text-left">
18+
<v-col class="d-flex text-left">
19+
<overview-name :value="item.name" />
20+
<publishing-badge v-if="isAdmin || isRepositoryAdmin" :activity="item" />
21+
</v-col>
22+
</td>
23+
<td class="text-left">
24+
<overview-status v-bind="item.status" />
25+
</td>
26+
<td class="text-left">
27+
<overview-assignee v-bind="item.assignee" />
28+
</td>
29+
<td class="text-left">
30+
<overview-priority v-bind="item.priority" />
31+
</td>
32+
<td class="text-left">
33+
<overview-due-date v-if="item.dueDate" :value="item.dueDate" />
34+
</td>
35+
</div>
36+
</v-lazy>
2737
</template>
2838
</v-data-table>
2939
</template>
@@ -45,6 +55,9 @@ export default {
4555
props: {
4656
activities: { type: Array, default: () => [] }
4757
},
58+
data: () => ({
59+
itemVisibility: {}
60+
}),
4861
computed: {
4962
...mapGetters(['isAdmin']),
5063
...mapGetters('repository', ['isRepositoryAdmin', 'workflow']),
@@ -116,12 +129,13 @@ export default {
116129
</script>
117130

118131
<style lang="scss" scoped>
119-
$row-background: var(--v-primary-lighten4);
132+
$row-background: var(--v-primary-lighten5);
133+
$row-hover-background: var(--v-primary-lighten4);
120134
121135
.overview ::v-deep {
122136
thead.v-data-table-header {
123137
tr th {
124-
background: #eceff1;
138+
background: $row-hover-background;
125139
}
126140
}
127141
@@ -133,16 +147,25 @@ $row-background: var(--v-primary-lighten4);
133147
max-width: 11.5rem;
134148
}
135149
136-
tr:hover {
137-
background: $row-background !important;
150+
.v-lazy {
151+
background-color: $row-background;
152+
border-bottom: thin solid rgba(0, 0, 0, 0.12);
153+
154+
&:hover {
155+
background-color: $row-hover-background !important;
156+
}
157+
158+
&.selected {
159+
background: $row-hover-background !important;
160+
}
138161
139162
&:not(.selected) {
140163
cursor: pointer;
141164
}
142-
}
143165
144-
.selected {
145-
background: $row-background;
166+
td {
167+
height: 48px;
168+
}
146169
}
147170
}
148171
</style>

0 commit comments

Comments
 (0)