diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ef1c9..6c267dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- Added compatibility with PrimeVue 4 [#16](https://github.com/archesproject/arches-references/pull/16) +- Add compatibility with PrimeVue 4 [#9](https://github.com/archesproject/arches-references/issues/9) +- Add front-end routing [#19](https://github.com/archesproject/arches-references/pull/19) ### Changed -- Generate URIs when not supplied [#17](https://github.com/archesproject/arches-references/pull/17) +- Generate URIs when not supplied [#17](https://github.com/archesproject/arches-references/pull/17) ### Fixed diff --git a/arches_references/media/js/views/components/plugins/controlled-list-manager.js b/arches_references/media/js/views/components/plugins/controlled-list-manager.js index 6ed3916..f6b5c16 100644 --- a/arches_references/media/js/views/components/plugins/controlled-list-manager.js +++ b/arches_references/media/js/views/components/plugins/controlled-list-manager.js @@ -1,12 +1,27 @@ import ko from 'knockout'; import ControlledListManager from '@/arches_references/plugins/ControlledListManager.vue'; +import ControlledListsMain from '@/arches_references/components/ControlledListsMain.vue'; import createVueApplication 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: ControlledListsMain }, + { path: '/plugins/controlled-list-manager/list/:id', name: 'list', component: ControlledListsMain }, + { path: '/plugins/controlled-list-manager/item/:id', name: 'item', component: ControlledListsMain }, +]; + +const router = createRouter({ + history: createWebHistory(), + routes, +}); + ko.components.register('controlled-list-manager', { viewModel: function() { createVueApplication(ControlledListManager).then((vueApp) => { + vueApp.use(router); vueApp.mount('#controlled-list-manager-mounting-point'); }); }, diff --git a/arches_references/src/arches_references/components/ControlledListsMain.vue b/arches_references/src/arches_references/components/ControlledListsMain.vue index 65cc993..01f9721 100644 --- a/arches_references/src/arches_references/components/ControlledListsMain.vue +++ b/arches_references/src/arches_references/components/ControlledListsMain.vue @@ -1,13 +1,17 @@