Bugzilla – Attachment 153938 Details for
Bug 34425
Fix breadcrumbs vue component
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[DO NOT PUSH] Bug 34425: Implementation example for Preservation module
DO-NOT-PUSH-Bug-34425-Implementation-example-for-P.patch (text/plain), 12.62 KB, created by
Agustín Moyano
on 2023-07-26 20:41:59 UTC
(
hide
)
Description:
[DO NOT PUSH] Bug 34425: Implementation example for Preservation module
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2023-07-26 20:41:59 UTC
Size:
12.62 KB
patch
obsolete
>From f017f2dfc05fcbe465cf8690e0ca16a724370096 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Wed, 26 Jul 2023 17:41:22 -0300 >Subject: [PATCH] [DO NOT PUSH] Bug 34425: Implementation example for > Preservation module > >--- > .../js/vue/components/Preservation/Main.vue | 6 +- > .../prog/js/vue/modules/preservation.ts | 20 +- > .../prog/js/vue/routes/preservation.js | 196 ++++++------------ > 3 files changed, 83 insertions(+), 139 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue >index 07794196f2..7d50b5a701 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue >@@ -1,6 +1,6 @@ > <template> > <div v-if="initialized && PreservationModule == 1"> >- <Breadcrumb /> >+ <Breadcrumbs /> > <div class="main container-fluid"> > <div class="row"> > <div class="col-sm-10 col-sm-push-2"> >@@ -63,7 +63,7 @@ > > <script> > import { inject } from "vue" >-import Breadcrumb from "../Breadcrumb.vue" >+import Breadcrumbs from "../Breadcrumbs.vue" > import Dialog from "../Dialog.vue" > import { APIClient } from "../../fetch/api-client.js" > import "vue-select/dist/vue-select.css" >@@ -149,7 +149,7 @@ export default { > }, > > components: { >- Breadcrumb, >+ Breadcrumbs, > Dialog, > }, > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts >index 379e7f3d55..ed262a3d8a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts >@@ -29,20 +29,24 @@ library.add( > > import App from "../components/Preservation/Main.vue"; > >-import { routes } from "../routes/preservation"; >- >-const router = createRouter({ >- history: createWebHistory(), >- linkActiveClass: "current", >- routes, >-}); >+import { routes as routesDef } from "../routes/preservation"; > > import { useMainStore } from "../stores/main"; > import { useAVStore } from "../stores/authorised-values"; > import { usePreservationStore } from "../stores/preservation"; >+import { useNavigationStore } from "../stores/navigation"; > > const pinia = createPinia(); > >+const navigationStore = useNavigationStore(pinia); >+const routes = navigationStore.setRoutes(routesDef); >+ >+const router = createRouter({ >+ history: createWebHistory(), >+ linkActiveClass: "current", >+ routes, >+}); >+ > const i18n = { > install: (app, options) => { > app.config.globalProperties.$__ = key => { >@@ -65,10 +69,12 @@ const mainStore = useMainStore(pinia); > app.provide("mainStore", mainStore); > app.provide("AVStore", useAVStore(pinia)); > app.provide("PreservationStore", usePreservationStore(pinia)); >+app.provide("navigationStore", navigationStore); > > app.mount("#preservation"); > > const { removeMessages } = mainStore; > router.beforeEach((to, from) => { >+ navigationStore.$patch({ current: to.matched, params: to.params || {} }); > removeMessages(); // This will actually flag the messages as displayed already > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js >index f95d3705e1..47339bd6a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js >@@ -67,163 +67,101 @@ function build_breadcrumb(parent_breadcrumb, current) { > } > > export const routes = [ >- { >- path: "/cgi-bin/koha/mainpage.pl", >- beforeEnter(to, from, next) { >- window.location.href = "/cgi-bin/koha/mainpage.pl"; >- }, >- }, > { > path: "/cgi-bin/koha/preservation/home.pl", >- component: Home, >- meta: { >- breadcrumb: () => [breadcrumbs.home, breadcrumbs.preservation_home], >- }, >- }, >- { >- path: "/cgi-bin/koha/preservation/trains", >+ is_default: true, >+ is_end_node: true, >+ title: "Preservation", > children: [ > { > path: "", >- component: TrainsList, >- meta: { >- breadcrumb: () => breadcrumb_paths.trains, >- }, >+ component: Home, > }, > { >- path: ":train_id", >+ path: "/cgi-bin/koha/preservation/trains", >+ title: "Trains", >+ is_end_node: true, > children: [ > { > path: "", >- component: TrainsShow, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.trains, >- "Show train" // $t("Show train") >- ), >- }, >+ component: TrainsList, > }, > { >- path: "items", >+ path: ":train_id", >+ title: "Show train", >+ is_end_node: true, > children: [ > { >- path: "add", >- component: TrainsFormAddItem, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.trains, >- "Add item to train" // $t("Add item to train") >- ), >- }, >- }, >- { >- path: "add/:item_ids", >- component: TrainsFormAddItems, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.trains, >- "Add items to train" // $t("Add items to train") >- ), >- }, >+ path: "", >+ component: TrainsShow, > }, > { >- path: "edit/:train_item_id", >- component: TrainsFormAddItem, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.trains, >- "Edit item in train" // $t("Edit item in train") >- ), >- }, >+ path: "items", >+ children: [ >+ { >+ path: "add", >+ title: "Add item to train", >+ component: TrainsFormAddItem, >+ }, >+ { >+ path: "add/:item_ids", >+ title: "Add items to train", >+ component: TrainsFormAddItems, >+ }, >+ { >+ path: "edit/:train_item_id", >+ title: "Edit item in train", >+ component: TrainsFormAddItem, >+ }, >+ ], > }, > ], > }, >+ { >+ path: "add", >+ title: "Add train", >+ component: TrainsFormAdd, >+ }, >+ { >+ path: "edit/:train_id", >+ title: "Edit train", >+ component: TrainsFormAdd, >+ }, > ], > }, > { >- path: "add", >- component: TrainsFormAdd, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.trains, >- "Add train" // $t("Add train") >- ), >- }, >- }, >- { >- path: "edit/:train_id", >- component: TrainsFormAdd, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.trains, >- "Edit train" // $t("Edit train") >- ), >- }, >- }, >- ], >- }, >- { >- path: "/cgi-bin/koha/preservation/waiting-list", >- component: WaitingList, >- meta: { >- breadcrumb: () => [ >- breadcrumbs.home, >- breadcrumbs.preservation_home, >- breadcrumbs.waiting_list, >- ], >- }, >- }, >- { >- path: "/cgi-bin/koha/preservation/settings", >- children: [ >- { >- path: "", >- component: Settings, >- meta: { >- breadcrumb: () => breadcrumb_paths.settings, >- }, >+ path: "/cgi-bin/koha/preservation/waiting-list", >+ component: WaitingList, >+ title: "Waiting list", > }, > { >- path: "processings", >+ path: "/cgi-bin/koha/preservation/settings", >+ is_end_node: true, >+ title: "Settings", > children: [ > { >- path: ":processing_id", >- component: SettingsProcessingsShow, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.settings_processings, >- "Show processing" // $t("Show processing") >- ), >- }, >- }, >- { >- path: "add", >- component: SettingsProcessingsFormAdd, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.settings_processings, >- "Add processing" // $t("Add processing") >- ), >- }, >+ path: "", >+ component: Settings, > }, > { >- path: "edit/:processing_id", >- component: SettingsProcessingsFormAdd, >- meta: { >- breadcrumb: () => >- build_breadcrumb( >- breadcrumb_paths.settings_processings, >- "Edit processing" // $t("Edit processing") >- ), >- }, >+ path: "processings", >+ children: [ >+ { >+ path: ":processing_id", >+ component: SettingsProcessingsShow, >+ title: "Show processing", >+ }, >+ { >+ path: "add", >+ component: SettingsProcessingsFormAdd, >+ title: "Add processing", >+ }, >+ { >+ path: "edit/:processing_id", >+ component: SettingsProcessingsFormAdd, >+ title: "Edit processing", >+ }, >+ ], > }, > ], > }, >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34425
:
153937
| 153938