|
17 | 17 | :data="data"
|
18 | 18 | style="height: calc(100vh - 355px);"
|
19 | 19 | >
|
| 20 | + <!-- Slot Table Header filter Button --> |
| 21 | + <template |
| 22 | + v-for="(column, index) in fields" |
| 23 | + #[`filter-${column.field}`] |
| 24 | + > |
| 25 | + <div |
| 26 | + v-if="column.sortable" |
| 27 | + :key="index" |
| 28 | + @click="handleEllipsisClick(column)" |
| 29 | + > |
| 30 | + <i |
| 31 | + :class="['fas', { |
| 32 | + 'fa-sort': column.direction === 'none', |
| 33 | + 'fa-sort-up': column.direction === 'asc', |
| 34 | + 'fa-sort-down': column.direction === 'desc', |
| 35 | + }]" |
| 36 | + /> |
| 37 | + </div> |
| 38 | + </template> |
20 | 39 | <!-- Slot Table Body -->
|
21 | 40 | <template
|
22 | 41 | v-for="(row, rowIndex) in data.data"
|
|
33 | 52 | v-html="sanitize(row[header.field])"
|
34 | 53 | />
|
35 | 54 | <template v-else>
|
36 |
| - <template v-if="isComponent(row[header.field])"> |
| 55 | + <template |
| 56 | + v-if="isComponent(row[header.field])" |
| 57 | + :data-cy="`process-table-component-${rowIndex}-${colIndex}`" |
| 58 | + > |
37 | 59 | <component
|
38 | 60 | :is="row[header.field].component"
|
39 |
| - :data-cy="`process-table-component-${rowIndex}-${colIndex}`" |
40 | 61 | v-bind="row[header.field].props"
|
41 | 62 | />
|
42 | 63 | </template>
|
43 |
| - <template v-else> |
44 |
| - <div |
45 |
| - v-if="header.field === 'name'" |
46 |
| - :data-cy="`process-table-field-${rowIndex}-${colIndex}`" |
47 |
| - > |
48 |
| - <i |
49 |
| - v-b-tooltip |
50 |
| - tabindex="0" |
51 |
| - :title="row.warningMessages.join(' ')" |
52 |
| - class="text-warning fa fa-exclamation-triangle" |
53 |
| - :class="{'invisible': row.warningMessages.length == 0}" |
54 |
| - /> |
55 |
| - <i |
56 |
| - v-if="row.status == 'ACTIVE' || row.status == 'INACTIVE'" |
57 |
| - v-b-tooltip |
58 |
| - tabindex="0" |
59 |
| - :title="row.status" |
60 |
| - class="mr-2" |
61 |
| - :class="{ 'fas fa-check-circle text-success': row.status == 'ACTIVE', 'far fa-circle': row.status == 'INACTIVE' }" |
62 |
| - /> |
63 |
| - <span |
64 |
| - v-uni-id="row.id.toString()" |
| 64 | + <template |
| 65 | + v-else |
| 66 | + :data-cy="`process-table-field-${rowIndex}-${colIndex}`" |
| 67 | + > |
| 68 | + <template v-if="header.field === 'name'"> |
| 69 | + <div |
| 70 | + :id="`element-archived-${row.id}`" |
| 71 | + :class="{ 'pm-table-truncate': header.truncate }" |
| 72 | + :style="{ maxWidth: header.width + 'px' }" |
| 73 | + > |
| 74 | + <i |
| 75 | + v-b-tooltip |
| 76 | + tabindex="0" |
| 77 | + :title="row.warningMessages.join(' ')" |
| 78 | + class="text-warning fa fa-exclamation-triangle" |
| 79 | + :class="{'invisible': row.warningMessages.length == 0}" |
| 80 | + /> |
| 81 | + <i |
| 82 | + v-if="row.status == 'ACTIVE' || row.status == 'INACTIVE'" |
| 83 | + v-b-tooltip |
| 84 | + tabindex="0" |
| 85 | + :title="row.status" |
| 86 | + class="mr-2" |
| 87 | + :class="{ 'fas fa-check-circle text-success': row.status == 'ACTIVE', 'far fa-circle': row.status == 'INACTIVE' }" |
| 88 | + /> |
| 89 | + <span> |
| 90 | + {{ row[header.field] }} |
| 91 | + </span> |
| 92 | + </div> |
| 93 | + <b-tooltip |
| 94 | + v-if="header.truncate" |
| 95 | + :target="`element-archived-${row.id}`" |
| 96 | + custom-class="pm-table-tooltip" |
65 | 97 | >
|
66 | 98 | {{ row[header.field] }}
|
67 |
| - </span> |
68 |
| - </div> |
| 99 | + </b-tooltip> |
| 100 | + </template> |
69 | 101 | <ellipsis-menu
|
70 | 102 | v-if="header.field === 'actions'"
|
71 | 103 | class="process-table"
|
@@ -177,32 +209,40 @@ export default {
|
177 | 209 | field: "name",
|
178 | 210 | width: 200,
|
179 | 211 | sortable: true,
|
| 212 | + truncate: true, |
| 213 | + direction: "none", |
180 | 214 | },
|
181 | 215 | {
|
182 | 216 | label: this.$t("Category"),
|
183 | 217 | field: "category_list",
|
184 | 218 | width: 160,
|
185 | 219 | sortable: true,
|
| 220 | + direction: "none", |
| 221 | + sortField: "category.name", |
186 | 222 | },
|
187 | 223 | {
|
188 | 224 | label: this.$t("Owner"),
|
189 | 225 | field: "owner",
|
190 | 226 | width: 160,
|
191 | 227 | sortable: true,
|
| 228 | + direction: "none", |
| 229 | + sortField: "user.username", |
192 | 230 | },
|
193 | 231 | {
|
194 | 232 | label: this.$t("Modified"),
|
195 | 233 | field: "updated_at",
|
196 | 234 | format: "datetime",
|
197 | 235 | width: 160,
|
198 | 236 | sortable: true,
|
| 237 | + direction: "none", |
199 | 238 | },
|
200 | 239 | {
|
201 | 240 | label: this.$t("Created"),
|
202 | 241 | field: "created_at",
|
203 | 242 | format: "datetime",
|
204 | 243 | width: 160,
|
205 | 244 | sortable: true,
|
| 245 | + direction: "none", |
206 | 246 | },
|
207 | 247 | {
|
208 | 248 | name: "__slot:actions",
|
|
0 commit comments