Skip to content

Commit 75d5e98

Browse files
committed
feat: update lifecycles table component with improved title and refactor click handling for identity links
1 parent 3b82aec commit 75d5e98

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/pages/lifecycles/table.vue

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
//- pre(v-html="JSON.stringify(expanded)")
44
q-table(
55
flat bordered dense
6-
ref="tableRef"
7-
title="Derniers cycles de vie"
6+
title="Derniers cycles déclenchés"
87
:rows="rows"
98
:columns="columns"
109
row-key="_id"
@@ -31,8 +30,9 @@
3130
)
3231
template(v-if="col.name === 'identity'")
3332
q-chip(
33+
href='javascript:void(0)'
3434
v-if="props.row?.refId?.inetOrgPerson?.cn"
35-
@click="push(`/identities?read=${props.row.refId._id}&filters[^inetOrgPerson.cn]=/${props.row?.refId?.inetOrgPerson?.cn}/i&skip=0&limit=16&sort[metadata.lastUpdatedAt]=desc`)"
35+
@click="open(`/identities?read=${props.row.refId._id}&filters[^inetOrgPerson.cn]=/${props.row?.refId?.inetOrgPerson?.cn}/i&skip=0&limit=16&sort[metadata.lastUpdatedAt]=desc`)"
3636
icon="mdi-account" clickable dense
3737
) {{ props.row?.refId?.inetOrgPerson?.cn }}
3838
span(v-else) Inconnu
@@ -49,7 +49,6 @@
4949
q-tr(v-if="props.expand" :props="props")
5050
q-td(colspan="100%" style="padding: 0;")
5151
MonacoEditor(
52-
v-if="isMounted"
5352
:model-value="JSON.stringify(props.row, null, 2)"
5453
lang="json"
5554
:options="monacoOptions"
@@ -84,8 +83,6 @@ export default {
8483
name: 'LifecyclesTablePage',
8584
data() {
8685
return {
87-
isMounted: false,
88-
tableRef: ref(),
8986
filter: ref(''),
9087
expanded: ref<any[]>([]),
9188
columns: [
@@ -103,7 +100,7 @@ export default {
103100
align: 'left',
104101
field: (row) => row.lifecycle,
105102
format: (lifecycle) => cycleToText(lifecycle),
106-
sortable: true,
103+
sortable: false,
107104
},
108105
{
109106
name: 'date',
@@ -185,14 +182,8 @@ export default {
185182
}
186183
},
187184
},
188-
mounted() {
189-
this.isMounted = true
190-
},
191-
beforeUnmount() {
192-
this.isMounted = false
193-
},
194185
methods: {
195-
onRequest(props) {
186+
async onRequest(props) {
196187
const { page, rowsPerPage: limit, sortBy, descending } = props.pagination
197188
const filter = props.filter
198189
@@ -202,9 +193,10 @@ export default {
202193
sortBy,
203194
descending,
204195
filter,
196+
props,
205197
})
206198
207-
this.router.push({
199+
await this.router.replace({
208200
query: {
209201
...this.router.currentRoute.value.query,
210202
page,
@@ -218,7 +210,7 @@ export default {
218210
this.expanded = this.expanded.includes(props.row._id) ? [] : [props.row._id]
219211
// props.expand = !props.expand
220212
},
221-
push(path) {
213+
open(path) {
222214
window.open(path, '_blank')
223215
},
224216
},

0 commit comments

Comments
 (0)