Skip to content

Commit b60fc04

Browse files
committed
Table formatting fix
1 parent b0bf8f5 commit b60fc04

File tree

1 file changed

+54
-28
lines changed

1 file changed

+54
-28
lines changed

src/pages/ErrataFeed.vue

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,7 @@
4343
@keydown.enter.prevent="searchErrata()"
4444
/>
4545
</div>
46-
<div class="q-pb-md group row justify-between">
47-
<q-btn
48-
v-if="userAuthenticated()"
49-
@click="
50-
selectionHasSkippedPackages()
51-
? (confirm = true)
52-
: bulkReleaseErratas()
53-
"
54-
no-caps
55-
color="primary"
56-
:disable="!selectedAdvisories.length"
57-
:loading="loadingRelease"
58-
>
59-
Release selection
60-
</q-btn>
46+
<div class="q-pb-md group row justify-end">
6147
<q-btn
6248
@click="searchErrata()"
6349
no-caps
@@ -75,7 +61,7 @@
7561
color="primary"
7662
:loading="loadingTable"
7763
:rows-per-page-options="[10]"
78-
row-key="id"
64+
row-key="complexId"
7965
hide-pagination
8066
binary-state-sort
8167
wrap-cells
@@ -84,6 +70,23 @@
8470
>
8571
<template v-slot:top-right v-if="userAuthenticated()">
8672
<div class="q-gutter-md">
73+
<q-btn
74+
size="80%"
75+
square
76+
v-if="selectedAdvisories.length"
77+
@click="
78+
selectionHasSkippedPackages()
79+
? (confirm = true)
80+
: bulkReleaseErratas()
81+
"
82+
no-caps
83+
icon="backup"
84+
color="primary"
85+
:loading="loadingRelease"
86+
>
87+
<q-tooltip> Release selected Advisories </q-tooltip>
88+
</q-btn>
89+
8790
<q-btn
8891
size="80%"
8992
square
@@ -106,15 +109,36 @@
106109
</q-btn>
107110
</div>
108111
</template>
112+
<template v-slot:header="props">
113+
<q-tr :props="props">
114+
<q-th v-for="col in props.cols" :key="col.name" :props="props">
115+
<q-checkbox
116+
v-if="col.name === 'id' && userAuthenticated()"
117+
v-model="props.selected"
118+
:disable="loadingTable"
119+
size="xs"
120+
/>
121+
{{ col.label }}
122+
</q-th>
123+
</q-tr>
124+
</template>
109125
<template v-slot:body="props">
110126
<q-tr
111127
:props="props"
112128
class="cursor-pointer"
113129
:class="markAdvisory(props.row.id)"
114130
@click="loadAdvisory(props.row.id, props.row.platform_id)"
115131
>
116-
<q-td v-if="userAuthenticated()" auto-width>
117-
<q-checkbox v-model="props.selected" />
132+
<q-td key="id" :props="props">
133+
<div class="row">
134+
<q-checkbox
135+
v-if="userAuthenticated()"
136+
size="xs"
137+
v-model="props.selected"
138+
class="col"
139+
/>
140+
<span class="col">{{ props.row.id }} </span>
141+
</div>
118142
</q-td>
119143
<q-td key="release_status" :props="props">
120144
<q-chip
@@ -140,14 +164,12 @@
140164
<q-td key="updated_date" :props="props">{{
141165
formatDate(props.row.updated_date)
142166
}}</q-td>
143-
<q-td key="id" :props="props">{{ props.row.id }}</q-td>
144167
<q-td key="platform" :props="props">{{
145168
platformName(props.row.platform_id)
146169
}}</q-td>
147170
<q-td key="original_title" :props="props">{{
148171
title(props.row)
149172
}}</q-td>
150-
<q-td key="id" :props="props">{{ props.row.id }}</q-td>
151173
</q-tr>
152174
</template>
153175
</q-table>
@@ -234,6 +256,13 @@
234256
selectedAdvisory: null,
235257
showDialogAdvisories: false,
236258
columns: [
259+
{
260+
name: 'id',
261+
required: true,
262+
align: 'left',
263+
label: 'ID',
264+
field: 'id',
265+
},
237266
{
238267
name: 'release_status',
239268
required: true,
@@ -249,13 +278,7 @@
249278
field: 'updated_date',
250279
headerStyle: 'width: 120px',
251280
},
252-
{
253-
name: 'id',
254-
required: true,
255-
align: 'left',
256-
label: 'ID',
257-
field: 'id',
258-
},
281+
259282
{
260283
name: 'platform',
261284
required: true,
@@ -401,7 +424,10 @@
401424
.then((response) => {
402425
this.loading = false
403426
this.loadingTable = false
404-
this.advisors = response.data.records
427+
this.advisors = response.data.records.map((advisory) => ({
428+
...advisory,
429+
complexId: `${advisory.platform_id}-${advisory.id}`,
430+
}))
405431
this.totalPages = Math.ceil(response.data['total_records'] / 10)
406432
})
407433
.catch((error) => {

0 commit comments

Comments
 (0)