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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue (+4 lines)
Lines 342-347 export default { Link Here
342
342
343
        const { setConfirmationDialog, setMessage } = inject("mainStore")
343
        const { setConfirmationDialog, setMessage } = inject("mainStore")
344
344
345
        const navigationStore = inject("navigationStore")
346
345
        const AVStore = inject("AVStore")
347
        const AVStore = inject("AVStore")
346
        const { get_lib_from_av } = AVStore
348
        const { get_lib_from_av } = AVStore
347
349
Lines 351-356 export default { Link Here
351
            get_lib_from_av,
353
            get_lib_from_av,
352
            setConfirmationDialog,
354
            setConfirmationDialog,
353
            setMessage,
355
            setMessage,
356
            navigationStore,
354
        }
357
        }
355
    },
358
    },
356
    data() {
359
    data() {
Lines 387-392 export default { Link Here
387
            client.agreements.get(agreement_id).then(
390
            client.agreements.get(agreement_id).then(
388
                agreement => {
391
                agreement => {
389
                    this.agreement = agreement
392
                    this.agreement = agreement
393
                    this.navigationStore.setBreadcrumbParameter(agreement.name)
390
                    this.initialized = true
394
                    this.initialized = true
391
                },
395
                },
392
                error => {}
396
                error => {}
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesShow.vue (+4 lines)
Lines 155-160 export default { Link Here
155
155
156
        const { setConfirmationDialog, setMessage } = inject("mainStore")
156
        const { setConfirmationDialog, setMessage } = inject("mainStore")
157
157
158
        const navigationStore = inject("navigationStore")
159
158
        const AVStore = inject("AVStore")
160
        const AVStore = inject("AVStore")
159
        const { get_lib_from_av } = AVStore
161
        const { get_lib_from_av } = AVStore
160
162
Lines 164-169 export default { Link Here
164
            get_lib_from_av,
166
            get_lib_from_av,
165
            setConfirmationDialog,
167
            setConfirmationDialog,
166
            setMessage,
168
            setMessage,
169
            navigationStore,
167
        }
170
        }
168
    },
171
    },
169
    data() {
172
    data() {
Lines 194-199 export default { Link Here
194
            client.licenses.get(license_id).then(
197
            client.licenses.get(license_id).then(
195
                license => {
198
                license => {
196
                    this.license = license
199
                    this.license = license
200
                    this.navigationStore.setBreadcrumbParameter(license.name)
197
                    this.initialized = true
201
                    this.initialized = true
198
                },
202
                },
199
                error => {}
203
                error => {}
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/NavigationItem.vue (-4 / +5 lines)
Lines 9-15 Link Here
9
                <template v-if="item.icon">
9
                <template v-if="item.icon">
10
                    <i :class="`${item.icon}`"></i>&nbsp;
10
                    <i :class="`${item.icon}`"></i>&nbsp;
11
                </template>
11
                </template>
12
                <span v-if="item.title">{{ $__(item.title) }}</span>
12
                <span v-if="item.title.text">{{ $__(item.title.text) }}</span>
13
            </router-link>
13
            </router-link>
14
            <router-link
14
            <router-link
15
                v-else-if="item.path"
15
                v-else-if="item.path"
Lines 19-25 Link Here
19
                <template v-if="item.icon">
19
                <template v-if="item.icon">
20
                    <i :class="`${item.icon}`"></i>&nbsp;
20
                    <i :class="`${item.icon}`"></i>&nbsp;
21
                </template>
21
                </template>
22
                <span v-if="item.title">{{ $__(item.title) }}</span>
22
                <span v-if="item.title">{{ $__(item.title.text) }}</span>
23
            </router-link>
23
            </router-link>
24
            <a
24
            <a
25
                v-else-if="item.href"
25
                v-else-if="item.href"
Lines 29-42 Link Here
29
                <template v-if="item.icon">
29
                <template v-if="item.icon">
30
                    <i :class="`${item.icon}`"></i>&nbsp;
30
                    <i :class="`${item.icon}`"></i>&nbsp;
31
                </template>
31
                </template>
32
                <span v-if="item.title">{{ $__(item.title) }}</span>
32
                <span v-if="item.title">{{ $__(item.title.text) }}</span>
33
            </a>
33
            </a>
34
            <span v-else :class="{ disabled: item.disabled }">
34
            <span v-else :class="{ disabled: item.disabled }">
35
                <template v-if="item.icon">
35
                <template v-if="item.icon">
36
                    <i :class="`${item.icon}`"></i>&nbsp;
36
                    <i :class="`${item.icon}`"></i>&nbsp;
37
                </template>
37
                </template>
38
                <span class="item-last" v-if="item.title">{{
38
                <span class="item-last" v-if="item.title">{{
39
                    $__(item.title)
39
                    $__(item.title.text)
40
                }}</span>
40
                }}</span>
41
            </span>
41
            </span>
42
        </span>
42
        </span>
Lines 44-49 Link Here
44
            <NavigationItem
44
            <NavigationItem
45
                v-for="(item, key) in item.children"
45
                v-for="(item, key) in item.children"
46
                :item="item"
46
                :item="item"
47
                :key="key"
47
            ></NavigationItem>
48
            ></NavigationItem>
48
        </ul>
49
        </ul>
49
    </li>
50
    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js (-27 / +47 lines)
Lines 37-43 export const routes = [ Link Here
37
        path: "/cgi-bin/koha/erm/erm.pl",
37
        path: "/cgi-bin/koha/erm/erm.pl",
38
        is_default: true,
38
        is_default: true,
39
        is_base: true,
39
        is_base: true,
40
        title: $__("E-resource management"),
40
        title: { dynamic: false, text: $__("E-resource management")},
41
        children: [
41
        children: [
42
            {
42
            {
43
                path: "",
43
                path: "",
Lines 47-53 export const routes = [ Link Here
47
            },
47
            },
48
            {
48
            {
49
                path: "/cgi-bin/koha/erm/agreements",
49
                path: "/cgi-bin/koha/erm/agreements",
50
                title: $__("Agreements"),
50
                title: { dynamic: false, text: $__("Agreements")},
51
                icon: "fa fa-check-circle",
51
                icon: "fa fa-check-circle",
52
                is_end_node: true,
52
                is_end_node: true,
53
                children: [
53
                children: [
Lines 60-84 export const routes = [ Link Here
60
                        path: ":agreement_id",
60
                        path: ":agreement_id",
61
                        name: "AgreementsShow",
61
                        name: "AgreementsShow",
62
                        component: markRaw(AgreementsShow),
62
                        component: markRaw(AgreementsShow),
63
                        title: $__("Show agreement"),
63
                        title: { dynamic: true, text: $__("Show agreement")},
64
                        children: [
65
                            {
66
                                path: "items",
67
                                title: { dynamic: false, text: $__("")},
68
                                children: [
69
                                    {
70
                                        path: "add",
71
                                        name: "TestChildTwo",
72
                                        component: markRaw(EHoldingsLocalTitlesFormAdd),
73
                                        title: { dynamic: false, text: $__("Add item to train")},
74
                                    },
75
                                    {
76
                                        path: "add/:item_ids",
77
                                        name: "TestChildThree",
78
                                        component: markRaw(EHoldingsLocalPackagesFormAdd),
79
                                        title: { dynamic: false, text: $__("Add items to train")},
80
                                    },
81
                                ]
82
                            },
83
                        ]
64
                    },
84
                    },
65
                    {
85
                    {
66
                        path: "add",
86
                        path: "add",
67
                        name: "AgreementsFormAdd",
87
                        name: "AgreementsFormAdd",
68
                        component: markRaw(AgreementsFormAdd),
88
                        component: markRaw(AgreementsFormAdd),
69
                        title: $__("Add agreement"),
89
                        title: { dynamic: false, text: $__("Add agreement")},
70
                    },
90
                    },
71
                    {
91
                    {
72
                        path: "edit/:agreement_id",
92
                        path: "edit/:agreement_id",
73
                        name: "AgreementsFormAddEdit",
93
                        name: "AgreementsFormAddEdit",
74
                        component: markRaw(AgreementsFormAdd),
94
                        component: markRaw(AgreementsFormAdd),
75
                        title: $__("Edit agreement"),
95
                        title: { dynamic: true, text: $__("Edit agreement")},
76
                    },
96
                    },
77
                ],
97
                ],
78
            },
98
            },
79
            {
99
            {
80
                path: "/cgi-bin/koha/erm/licenses",
100
                path: "/cgi-bin/koha/erm/licenses",
81
                title: $__("Licenses"),
101
                title: { dynamic: false, text: $__("Licenses")},
82
                icon: "fa fa-gavel",
102
                icon: "fa fa-gavel",
83
                is_end_node: true,
103
                is_end_node: true,
84
                children: [
104
                children: [
Lines 91-127 export const routes = [ Link Here
91
                        path: ":license_id",
111
                        path: ":license_id",
92
                        name: "LicensesShow",
112
                        name: "LicensesShow",
93
                        component: markRaw(LicensesShow),
113
                        component: markRaw(LicensesShow),
94
                        title: $__("Show license"),
114
                        title: { dynamic: true, text: $__("Show license")}
95
                    },
115
                    },
96
                    {
116
                    {
97
                        path: "add",
117
                        path: "add",
98
                        name: "LicensesFormAdd",
118
                        name: "LicensesFormAdd",
99
                        component: markRaw(LicensesFormAdd),
119
                        component: markRaw(LicensesFormAdd),
100
                        title: $__("Add license"),
120
                        title: { dynamic: false, text: $__("Add license")}
101
                    },
121
                    },
102
                    {
122
                    {
103
                        path: "edit/:license_id",
123
                        path: "edit/:license_id",
104
                        name: "LicensesFormAddEdit",
124
                        name: "LicensesFormAddEdit",
105
                        component: markRaw(LicensesFormAdd),
125
                        component: markRaw(LicensesFormAdd),
106
                        title: $__("Edit license"),
126
                        title: { dynamic: true, text: $__("Edit license")}
107
                    },
127
                    },
108
                ],
128
                ],
109
            },
129
            },
110
            {
130
            {
111
                path: "/cgi-bin/koha/erm/eholdings",
131
                path: "/cgi-bin/koha/erm/eholdings",
112
                title: $__("eHoldings"),
132
                title: { dynamic: false, text: $__("eHoldings")},
113
                icon: "fa fa-crosshairs",
133
                icon: "fa fa-crosshairs",
114
                disabled: true,
134
                disabled: true,
115
                children: [
135
                children: [
116
                    {
136
                    {
117
                        path: "local",
137
                        path: "local",
118
                        title: $__("Local"),
138
                        title: { dynamic: false, text: $__("Local")},
119
                        icon: "fa-solid fa-location-dot",
139
                        icon: "fa-solid fa-location-dot",
120
                        disabled: true,
140
                        disabled: true,
121
                        children: [
141
                        children: [
122
                            {
142
                            {
123
                                path: "packages",
143
                                path: "packages",
124
                                title: $__("Packages"),
144
                                title: { dynamic: false, text: $__("Packages")},
125
                                icon: "fa fa-archive",
145
                                icon: "fa fa-archive",
126
                                is_end_node: true,
146
                                is_end_node: true,
127
                                children: [
147
                                children: [
Lines 138-144 export const routes = [ Link Here
138
                                        component: markRaw(
158
                                        component: markRaw(
139
                                            EHoldingsLocalPackagesShow
159
                                            EHoldingsLocalPackagesShow
140
                                        ),
160
                                        ),
141
                                        title: $__("Show package"),
161
                                        title: { dynamic: true, text: $__("Show package")}
142
                                    },
162
                                    },
143
                                    {
163
                                    {
144
                                        path: "add",
164
                                        path: "add",
Lines 146-152 export const routes = [ Link Here
146
                                        component: markRaw(
166
                                        component: markRaw(
147
                                            EHoldingsLocalPackagesFormAdd
167
                                            EHoldingsLocalPackagesFormAdd
148
                                        ),
168
                                        ),
149
                                        title: $__("Add package"),
169
                                        title: { dynamic: false, text: $__("Add package")}
150
                                    },
170
                                    },
151
                                    {
171
                                    {
152
                                        path: "edit/:package_id",
172
                                        path: "edit/:package_id",
Lines 154-166 export const routes = [ Link Here
154
                                        component: markRaw(
174
                                        component: markRaw(
155
                                            EHoldingsLocalPackagesFormAdd
175
                                            EHoldingsLocalPackagesFormAdd
156
                                        ),
176
                                        ),
157
                                        title: $__("Edit package"),
177
                                        title: { dynamic: true, text: $__("Edit package")}
158
                                    },
178
                                    },
159
                                ],
179
                                ],
160
                            },
180
                            },
161
                            {
181
                            {
162
                                path: "titles",
182
                                path: "titles",
163
                                title: $__("Titles"),
183
                                title: { dynamic: false, text: $__("Titles")},
164
                                icon: "fa-solid fa-arrow-down-a-z",
184
                                icon: "fa-solid fa-arrow-down-a-z",
165
                                is_end_node: true,
185
                                is_end_node: true,
166
                                children: [
186
                                children: [
Lines 177-183 export const routes = [ Link Here
177
                                        component: markRaw(
197
                                        component: markRaw(
178
                                            EHoldingsLocalTitlesShow
198
                                            EHoldingsLocalTitlesShow
179
                                        ),
199
                                        ),
180
                                        title: $__("Show title"),
200
                                        title: { dynamic: true, text: $__("Show title")}
181
                                    },
201
                                    },
182
                                    {
202
                                    {
183
                                        path: "add",
203
                                        path: "add",
Lines 185-191 export const routes = [ Link Here
185
                                        component: markRaw(
205
                                        component: markRaw(
186
                                            EHoldingsLocalTitlesFormAdd
206
                                            EHoldingsLocalTitlesFormAdd
187
                                        ),
207
                                        ),
188
                                        title: $__("Add title"),
208
                                        title: { dynamic: false, text: $__("Add title")}
189
                                    },
209
                                    },
190
                                    {
210
                                    {
191
                                        path: "edit/:title_id",
211
                                        path: "edit/:title_id",
Lines 193-199 export const routes = [ Link Here
193
                                        component: markRaw(
213
                                        component: markRaw(
194
                                            EHoldingsLocalTitlesFormAdd
214
                                            EHoldingsLocalTitlesFormAdd
195
                                        ),
215
                                        ),
196
                                        title: $__("Edit title"),
216
                                        title: { dynamic: true, text: $__("Edit title")}
197
                                    },
217
                                    },
198
                                    {
218
                                    {
199
                                        path: "import",
219
                                        path: "import",
Lines 201-207 export const routes = [ Link Here
201
                                        component: markRaw(
221
                                        component: markRaw(
202
                                            EHoldingsLocalTitlesFormImport
222
                                            EHoldingsLocalTitlesFormImport
203
                                        ),
223
                                        ),
204
                                        title: $__("Import from a list"),
224
                                        title: { dynamic: false, text: $__("Import from a list")}
205
                                    },
225
                                    },
206
                                    {
226
                                    {
207
                                        path: "/cgi-bin/koha/erm/eholdings/local/resources/:resource_id",
227
                                        path: "/cgi-bin/koha/erm/eholdings/local/resources/:resource_id",
Lines 209-215 export const routes = [ Link Here
209
                                        component: markRaw(
229
                                        component: markRaw(
210
                                            EHoldingsLocalResourcesShow
230
                                            EHoldingsLocalResourcesShow
211
                                        ),
231
                                        ),
212
                                        title: $__("Resource"),
232
                                        title: { dynamic: true, text: $__("Resource")}
213
                                    },
233
                                    },
214
                                ],
234
                                ],
215
                            },
235
                            },
Lines 217-229 export const routes = [ Link Here
217
                    },
237
                    },
218
                    {
238
                    {
219
                        path: "ebsco",
239
                        path: "ebsco",
220
                        title: $__("EBSCO"),
240
                        title: { dynamic: false, text: $__("EBSCO")},
221
                        icon: "fa fa-globe",
241
                        icon: "fa fa-globe",
222
                        disabled: true,
242
                        disabled: true,
223
                        children: [
243
                        children: [
224
                            {
244
                            {
225
                                path: "packages",
245
                                path: "packages",
226
                                title: $__("Packages"),
246
                                title: { dynamic: false, text: $__("Packages")},
227
                                icon: "fa fa-archive",
247
                                icon: "fa fa-archive",
228
                                is_end_node: true,
248
                                is_end_node: true,
229
                                children: [
249
                                children: [
Lines 240-252 export const routes = [ Link Here
240
                                        component: markRaw(
260
                                        component: markRaw(
241
                                            EHoldingsEBSCOPackagesShow
261
                                            EHoldingsEBSCOPackagesShow
242
                                        ),
262
                                        ),
243
                                        title: $__("Show package"),
263
                                        title: { dynamic: true, text: $__("Show package")}
244
                                    },
264
                                    },
245
                                ],
265
                                ],
246
                            },
266
                            },
247
                            {
267
                            {
248
                                path: "titles",
268
                                path: "titles",
249
                                title: $__("Titles"),
269
                                title: { dynamic: true, text: $__("Titles")},
250
                                icon: "fa-solid fa-arrow-down-a-z",
270
                                icon: "fa-solid fa-arrow-down-a-z",
251
                                is_end_node: true,
271
                                is_end_node: true,
252
                                children: [
272
                                children: [
Lines 263-269 export const routes = [ Link Here
263
                                        component: markRaw(
283
                                        component: markRaw(
264
                                            EHoldingsEBSCOTitlesShow
284
                                            EHoldingsEBSCOTitlesShow
265
                                        ),
285
                                        ),
266
                                        title: $__("Show title"),
286
                                        title: { dynamic: true, text: $__("Show title")}
267
                                    },
287
                                    },
268
                                    {
288
                                    {
269
                                        path: "/cgi-bin/koha/erm/eholdings/ebsco/resources/:resource_id",
289
                                        path: "/cgi-bin/koha/erm/eholdings/ebsco/resources/:resource_id",
Lines 271-277 export const routes = [ Link Here
271
                                        component: markRaw(
291
                                        component: markRaw(
272
                                            EHoldingsEBSCOResourcesShow
292
                                            EHoldingsEBSCOResourcesShow
273
                                        ),
293
                                        ),
274
                                        title: $__("Resource"),
294
                                        title: { dynamic: true, text: $__("Resource")},
275
                                        is_navigation_item: false,
295
                                        is_navigation_item: false,
276
                                    },
296
                                    },
277
                                ],
297
                                ],
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js (-6 / +16 lines)
Lines 11-16 export const useNavigationStore = defineStore("navigation", { Link Here
11
        },
11
        },
12
        current: null,
12
        current: null,
13
        params: {},
13
        params: {},
14
        breadcrumbParameter: null
14
    }),
15
    }),
15
    actions: {
16
    actions: {
16
        setRoutes(routesDef) {
17
        setRoutes(routesDef) {
Lines 68-78 export const useNavigationStore = defineStore("navigation", { Link Here
68
                child.meta.self = child;
69
                child.meta.self = child;
69
            }
70
            }
70
        },
71
        },
72
        setBreadcrumbParameter(param) {
73
            this.breadcrumbParameter = param
74
        }
71
    },
75
    },
72
    getters: {
76
    getters: {
73
        breadcrumbs() {
77
        breadcrumbs() {
74
            if (this.current)
78
            if (this.current)
75
                return _buildFromCurrentMatches(this.current, this.routeState);
79
                return _buildFromCurrentMatches(this.current, this.routeState, this.breadcrumbParameter);
76
80
77
            return _getBaseElements(this.routeState);
81
            return _getBaseElements(this.routeState);
78
82
Lines 100-113 export const useNavigationStore = defineStore("navigation", { Link Here
100
                );
104
                );
101
            }
105
            }
102
106
103
            function _buildFromCurrentMatches(currentMatches, routeState) {
107
            function _buildFromCurrentMatches(currentMatches, routeState, param) {
104
                return [
108
                return [
105
                    {
109
                    {
106
                        ...routeState,
110
                        ...routeState,
107
                        icon: null,
111
                        icon: null,
108
                        children: null,
112
                        children: null,
109
                    },
113
                    },
110
                    ..._mapMatches(currentMatches),
114
                    ..._mapMatches(currentMatches, param),
111
                ];
115
                ];
112
            }
116
            }
113
117
Lines 115-129 export const useNavigationStore = defineStore("navigation", { Link Here
115
                return child.is_base || (child.path && child.path !== "");
119
                return child.is_base || (child.path && child.path !== "");
116
            }
120
            }
117
121
118
            function _mapMatches(currentMatches) {
122
            function _mapMatches(currentMatches, param) {
119
                return currentMatches
123
                return currentMatches
120
                    .filter(match => _isBaseOrNotStub(match.meta.self))
124
                    .filter(match => _isBaseOrNotStub(match.meta.self))
121
                    .map(match => ({
125
                    .map(match => ({
122
                        ...match.meta.self,
126
                        ...match.meta.self,
127
                        title: _setTitle(match.meta.self, param),
123
                        icon: null,
128
                        icon: null,
124
                        path: match.path,
129
                        path: match.path,
125
                        children: null,
130
                        children: null,
126
                    }));
131
                    }))
132
                    .filter(match => match.title.text);
133
            }
134
135
            function _setTitle(self, param) {
136
                const title = self.title.dynamic ? param : self.title.text
137
                return { dynamic: self.title.dynamic, text: title }
127
            }
138
            }
128
        },
139
        },
129
        leftNavigation() {
140
        leftNavigation() {
130
- 

Return to bug 33169