Bug 33483: Restore 'select'

We are not supposed to see edit and delete buttons, but select instead,
to pick an agreement.

Regression introduced by
  commit 809f90d394
  Bug 33066: Remove build_datatable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-04-11 21:14:25 +02:00 committed by Tomas Cohen Arazi
parent 9d1fe4591c
commit d4204cb9c6
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -39,6 +39,7 @@
@show="doShow"
@edit="doEdit"
@delete="doDelete"
@select="doSelect"
></KohaTable>
</div>
<div v-else class="dialog message">
@ -127,7 +128,16 @@ export default {
},
actions: {
0: ["show"],
"-1": ["edit", "delete"],
"-1": this.embedded
? [
{
select: {
text: this.$__("Select"),
icon: "fa fa-check",
},
},
]
: ["edit", "delete"],
},
default_filters: {
"user_roles.user_id": function () {
@ -192,6 +202,10 @@ export default {
}
)
},
doSelect: function (agreement, dt, event) {
this.$emit("select-agreement", agreement.agreement_id)
this.$emit("close")
},
table_url: function () {
let url = "/api/v1/erm/agreements"
if (this.filters.by_expired)
@ -199,10 +213,6 @@ export default {
"?max_expiration_date=" + this.filters.max_expiration_date
return url
},
select_agreement: function (agreement_id) {
this.$emit("select-agreement", agreement_id)
this.$emit("close")
},
filter_table: async function () {
if (!embedded) {
let new_route = build_url(