View | Details | Raw Unified | Return to bug 34425
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue (-3 / +3 lines)
Lines 1-6 Link Here
1
<template>
1
<template>
2
    <div v-if="initialized && PreservationModule == 1">
2
    <div v-if="initialized && PreservationModule == 1">
3
        <Breadcrumb />
3
        <Breadcrumbs />
4
        <div class="main container-fluid">
4
        <div class="main container-fluid">
5
            <div class="row">
5
            <div class="row">
6
                <div class="col-sm-10 col-sm-push-2">
6
                <div class="col-sm-10 col-sm-push-2">
Lines 63-69 Link Here
63
63
64
<script>
64
<script>
65
import { inject } from "vue"
65
import { inject } from "vue"
66
import Breadcrumb from "../Breadcrumb.vue"
66
import Breadcrumbs from "../Breadcrumbs.vue"
67
import Dialog from "../Dialog.vue"
67
import Dialog from "../Dialog.vue"
68
import { APIClient } from "../../fetch/api-client.js"
68
import { APIClient } from "../../fetch/api-client.js"
69
import "vue-select/dist/vue-select.css"
69
import "vue-select/dist/vue-select.css"
Lines 149-155 export default { Link Here
149
    },
149
    },
150
150
151
    components: {
151
    components: {
152
        Breadcrumb,
152
        Breadcrumbs,
153
        Dialog,
153
        Dialog,
154
    },
154
    },
155
}
155
}
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts (-7 / +13 lines)
Lines 29-48 library.add( Link Here
29
29
30
import App from "../components/Preservation/Main.vue";
30
import App from "../components/Preservation/Main.vue";
31
31
32
import { routes } from "../routes/preservation";
32
import { routes as routesDef } from "../routes/preservation";
33
34
const router = createRouter({
35
    history: createWebHistory(),
36
    linkActiveClass: "current",
37
    routes,
38
});
39
33
40
import { useMainStore } from "../stores/main";
34
import { useMainStore } from "../stores/main";
41
import { useAVStore } from "../stores/authorised-values";
35
import { useAVStore } from "../stores/authorised-values";
42
import { usePreservationStore } from "../stores/preservation";
36
import { usePreservationStore } from "../stores/preservation";
37
import { useNavigationStore } from "../stores/navigation";
43
38
44
const pinia = createPinia();
39
const pinia = createPinia();
45
40
41
const navigationStore = useNavigationStore(pinia);
42
const routes = navigationStore.setRoutes(routesDef);
43
44
const router = createRouter({
45
    history: createWebHistory(),
46
    linkActiveClass: "current",
47
    routes,
48
});
49
46
const i18n = {
50
const i18n = {
47
    install: (app, options) => {
51
    install: (app, options) => {
48
        app.config.globalProperties.$__ = key => {
52
        app.config.globalProperties.$__ = key => {
Lines 65-74 const mainStore = useMainStore(pinia); Link Here
65
app.provide("mainStore", mainStore);
69
app.provide("mainStore", mainStore);
66
app.provide("AVStore", useAVStore(pinia));
70
app.provide("AVStore", useAVStore(pinia));
67
app.provide("PreservationStore", usePreservationStore(pinia));
71
app.provide("PreservationStore", usePreservationStore(pinia));
72
app.provide("navigationStore", navigationStore);
68
73
69
app.mount("#preservation");
74
app.mount("#preservation");
70
75
71
const { removeMessages } = mainStore;
76
const { removeMessages } = mainStore;
72
router.beforeEach((to, from) => {
77
router.beforeEach((to, from) => {
78
    navigationStore.$patch({ current: to.matched, params: to.params || {} });
73
    removeMessages(); // This will actually flag the messages as displayed already
79
    removeMessages(); // This will actually flag the messages as displayed already
74
});
80
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js (-130 / +67 lines)
Lines 67-229 function build_breadcrumb(parent_breadcrumb, current) { Link Here
67
}
67
}
68
68
69
export const routes = [
69
export const routes = [
70
    {
71
        path: "/cgi-bin/koha/mainpage.pl",
72
        beforeEnter(to, from, next) {
73
            window.location.href = "/cgi-bin/koha/mainpage.pl";
74
        },
75
    },
76
    {
70
    {
77
        path: "/cgi-bin/koha/preservation/home.pl",
71
        path: "/cgi-bin/koha/preservation/home.pl",
78
        component: Home,
72
        is_default: true,
79
        meta: {
73
        is_end_node: true,
80
            breadcrumb: () => [breadcrumbs.home, breadcrumbs.preservation_home],
74
        title: "Preservation",
81
        },
82
    },
83
    {
84
        path: "/cgi-bin/koha/preservation/trains",
85
        children: [
75
        children: [
86
            {
76
            {
87
                path: "",
77
                path: "",
88
                component: TrainsList,
78
                component: Home,
89
                meta: {
90
                    breadcrumb: () => breadcrumb_paths.trains,
91
                },
92
            },
79
            },
93
            {
80
            {
94
                path: ":train_id",
81
                path: "/cgi-bin/koha/preservation/trains",
82
                title: "Trains",
83
                is_end_node: true,
95
                children: [
84
                children: [
96
                    {
85
                    {
97
                        path: "",
86
                        path: "",
98
                        component: TrainsShow,
87
                        component: TrainsList,
99
                        meta: {
100
                            breadcrumb: () =>
101
                                build_breadcrumb(
102
                                    breadcrumb_paths.trains,
103
                                    "Show train" // $t("Show train")
104
                                ),
105
                        },
106
                    },
88
                    },
107
                    {
89
                    {
108
                        path: "items",
90
                        path: ":train_id",
91
                        title: "Show train",
92
                        is_end_node: true,
109
                        children: [
93
                        children: [
110
                            {
94
                            {
111
                                path: "add",
95
                                path: "",
112
                                component: TrainsFormAddItem,
96
                                component: TrainsShow,
113
                                meta: {
114
                                    breadcrumb: () =>
115
                                        build_breadcrumb(
116
                                            breadcrumb_paths.trains,
117
                                            "Add item to train" // $t("Add item to train")
118
                                        ),
119
                                },
120
                            },
121
                            {
122
                                path: "add/:item_ids",
123
                                component: TrainsFormAddItems,
124
                                meta: {
125
                                    breadcrumb: () =>
126
                                        build_breadcrumb(
127
                                            breadcrumb_paths.trains,
128
                                            "Add items to train" // $t("Add items to train")
129
                                        ),
130
                                },
131
                            },
97
                            },
132
                            {
98
                            {
133
                                path: "edit/:train_item_id",
99
                                path: "items",
134
                                component: TrainsFormAddItem,
100
                                children: [
135
                                meta: {
101
                                    {
136
                                    breadcrumb: () =>
102
                                        path: "add",
137
                                        build_breadcrumb(
103
                                        title: "Add item to train",
138
                                            breadcrumb_paths.trains,
104
                                        component: TrainsFormAddItem,
139
                                            "Edit item in train" // $t("Edit item in train")
105
                                    },
140
                                        ),
106
                                    {
141
                                },
107
                                        path: "add/:item_ids",
108
                                        title: "Add items to train",
109
                                        component: TrainsFormAddItems,
110
                                    },
111
                                    {
112
                                        path: "edit/:train_item_id",
113
                                        title: "Edit item in train",
114
                                        component: TrainsFormAddItem,
115
                                    },
116
                                ],
142
                            },
117
                            },
143
                        ],
118
                        ],
144
                    },
119
                    },
120
                    {
121
                        path: "add",
122
                        title: "Add train",
123
                        component: TrainsFormAdd,
124
                    },
125
                    {
126
                        path: "edit/:train_id",
127
                        title: "Edit train",
128
                        component: TrainsFormAdd,
129
                    },
145
                ],
130
                ],
146
            },
131
            },
147
            {
132
            {
148
                path: "add",
133
                path: "/cgi-bin/koha/preservation/waiting-list",
149
                component: TrainsFormAdd,
134
                component: WaitingList,
150
                meta: {
135
                title: "Waiting list",
151
                    breadcrumb: () =>
152
                        build_breadcrumb(
153
                            breadcrumb_paths.trains,
154
                            "Add train" // $t("Add train")
155
                        ),
156
                },
157
            },
158
            {
159
                path: "edit/:train_id",
160
                component: TrainsFormAdd,
161
                meta: {
162
                    breadcrumb: () =>
163
                        build_breadcrumb(
164
                            breadcrumb_paths.trains,
165
                            "Edit train" // $t("Edit train")
166
                        ),
167
                },
168
            },
169
        ],
170
    },
171
    {
172
        path: "/cgi-bin/koha/preservation/waiting-list",
173
        component: WaitingList,
174
        meta: {
175
            breadcrumb: () => [
176
                breadcrumbs.home,
177
                breadcrumbs.preservation_home,
178
                breadcrumbs.waiting_list,
179
            ],
180
        },
181
    },
182
    {
183
        path: "/cgi-bin/koha/preservation/settings",
184
        children: [
185
            {
186
                path: "",
187
                component: Settings,
188
                meta: {
189
                    breadcrumb: () => breadcrumb_paths.settings,
190
                },
191
            },
136
            },
192
            {
137
            {
193
                path: "processings",
138
                path: "/cgi-bin/koha/preservation/settings",
139
                is_end_node: true,
140
                title: "Settings",
194
                children: [
141
                children: [
195
                    {
142
                    {
196
                        path: ":processing_id",
143
                        path: "",
197
                        component: SettingsProcessingsShow,
144
                        component: Settings,
198
                        meta: {
199
                            breadcrumb: () =>
200
                                build_breadcrumb(
201
                                    breadcrumb_paths.settings_processings,
202
                                    "Show processing" // $t("Show processing")
203
                                ),
204
                        },
205
                    },
206
                    {
207
                        path: "add",
208
                        component: SettingsProcessingsFormAdd,
209
                        meta: {
210
                            breadcrumb: () =>
211
                                build_breadcrumb(
212
                                    breadcrumb_paths.settings_processings,
213
                                    "Add processing" // $t("Add processing")
214
                                ),
215
                        },
216
                    },
145
                    },
217
                    {
146
                    {
218
                        path: "edit/:processing_id",
147
                        path: "processings",
219
                        component: SettingsProcessingsFormAdd,
148
                        children: [
220
                        meta: {
149
                            {
221
                            breadcrumb: () =>
150
                                path: ":processing_id",
222
                                build_breadcrumb(
151
                                component: SettingsProcessingsShow,
223
                                    breadcrumb_paths.settings_processings,
152
                                title: "Show processing",
224
                                    "Edit processing" // $t("Edit processing")
153
                            },
225
                                ),
154
                            {
226
                        },
155
                                path: "add",
156
                                component: SettingsProcessingsFormAdd,
157
                                title: "Add processing",
158
                            },
159
                            {
160
                                path: "edit/:processing_id",
161
                                component: SettingsProcessingsFormAdd,
162
                                title: "Edit processing",
163
                            },
164
                        ],
227
                    },
165
                    },
228
                ],
166
                ],
229
            },
167
            },
230
- 

Return to bug 34425