From 95de17d1bc60ce3c43bc6978cfcbb921b444af24 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 27 Sep 2024 19:10:18 +0200 Subject: [PATCH] Add ability to customise generated edit page link in data table, use it for collections --- webapp/src/components/CollectionTable.vue | 1 + webapp/src/components/DynamicDataTable.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/src/components/CollectionTable.vue b/webapp/src/components/CollectionTable.vue index aa588e2d..5f55625c 100644 --- a/webapp/src/components/CollectionTable.vue +++ b/webapp/src/components/CollectionTable.vue @@ -4,6 +4,7 @@ :data="collections" :data-type="'collections'" :global-filter-fields="['collection_id', 'title', 'creatorsList']" + :edit-page-route-prefix="collections" /> diff --git a/webapp/src/components/DynamicDataTable.vue b/webapp/src/components/DynamicDataTable.vue index 92ab31be..70d99147 100644 --- a/webapp/src/components/DynamicDataTable.vue +++ b/webapp/src/components/DynamicDataTable.vue @@ -228,9 +228,9 @@ export default { event.originalEvent.metaKey || event.originalEvent.altKey ) { - window.open(`/edit/${row.item_id}`, "_blank"); + window.open(`/${this.editPageRoutePrefix}/${row.item_id}`, "_blank"); } else { - this.$router.push(`/edit/${row.item_id}`); + this.$router.push(`/${this.editPageRoutePrefix}/${row.item_id}`); } }, getComponentProps(componentName, data) {