From 1d5ac23683fb54162018c0ea371af8881622593f Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Fri, 17 May 2024 11:22:12 -0400 Subject: [PATCH] Add front-end routing #10598 --- .../plugins/controlled-list-manager.js | 13 +++ .../ControlledListEditor.vue | 18 ++++- .../ControlledListManager/constants.ts | 6 ++ .../tree/AddDeleteControls.vue | 2 - .../ControlledListManager/tree/ListTree.vue | 6 +- .../tree/ListTreeControls.vue | 80 ++++++++++++++++++- .../ControlledListManager/tree/MoveRow.vue | 14 ++-- .../ControlledListManager/tree/TreeRow.vue | 4 +- .../components/ControlledListManager/utils.ts | 20 +++-- .../app/src/plugins/ControlledListManager.vue | 3 + arches/urls.py | 4 +- 11 files changed, 146 insertions(+), 24 deletions(-) diff --git a/arches/app/media/js/views/components/plugins/controlled-list-manager.js b/arches/app/media/js/views/components/plugins/controlled-list-manager.js index 6e73a28a5b1..545c932875e 100644 --- a/arches/app/media/js/views/components/plugins/controlled-list-manager.js +++ b/arches/app/media/js/views/components/plugins/controlled-list-manager.js @@ -3,10 +3,23 @@ import ControlledListManager from '@/plugins/ControlledListManager.vue'; import createVueApp from 'utils/create-vue-application'; import ControlledListManagerTemplate from 'templates/views/components/plugins/controlled-list-manager.htm'; +import { createRouter, createWebHistory } from 'vue-router'; + +const routes = [ + { path: '/plugins/controlled-list-manager', name: 'splash', component: ControlledListManager }, + { path: '/plugins/controlled-list-manager/list/:id', name: 'list', component: ControlledListManager }, + { path: '/plugins/controlled-list-manager/item/:id', name: 'item', component: ControlledListManager }, +]; + +const router = createRouter({ + history: createWebHistory(), + routes, +}); ko.components.register('controlled-list-manager', { viewModel: function() { createVueApp(ControlledListManager).then((vueApp) => { + vueApp.use(router); vueApp.mount('#controlled-list-manager-mounting-point'); }) }, diff --git a/arches/app/src/components/ControlledListManager/ControlledListEditor.vue b/arches/app/src/components/ControlledListManager/ControlledListEditor.vue index 8bce1535cef..7bc01525ffe 100644 --- a/arches/app/src/components/ControlledListManager/ControlledListEditor.vue +++ b/arches/app/src/components/ControlledListManager/ControlledListEditor.vue @@ -1,6 +1,7 @@