View | Details | Raw Unified | Return to bug 34417
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 / +66 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
                    },
64
                    },
65
                    {
65
                    {
66
                        path: "add",
66
                        path: "add",
67
                        name: "AgreementsFormAdd",
67
                        name: "AgreementsFormAdd",
68
                        component: markRaw(AgreementsFormAdd),
68
                        component: markRaw(AgreementsFormAdd),
69
                        title: $__("Add agreement"),
69
                        title: { dynamic: false, text: $__("Add agreement") },
70
                    },
70
                    },
71
                    {
71
                    {
72
                        path: "edit/:agreement_id",
72
                        path: "edit/:agreement_id",
73
                        name: "AgreementsFormAddEdit",
73
                        name: "AgreementsFormAddEdit",
74
                        component: markRaw(AgreementsFormAdd),
74
                        component: markRaw(AgreementsFormAdd),
75
                        title: $__("Edit agreement"),
75
                        title: { dynamic: true, text: $__("Edit agreement") },
76
                    },
76
                    },
77
                ],
77
                ],
78
            },
78
            },
79
            {
79
            {
80
                path: "/cgi-bin/koha/erm/licenses",
80
                path: "/cgi-bin/koha/erm/licenses",
81
                title: $__("Licenses"),
81
                title: { dynamic: false, text: $__("Licenses") },
82
                icon: "fa fa-gavel",
82
                icon: "fa fa-gavel",
83
                is_end_node: true,
83
                is_end_node: true,
84
                children: [
84
                children: [
Lines 91-127 export const routes = [ Link Here
91
                        path: ":license_id",
91
                        path: ":license_id",
92
                        name: "LicensesShow",
92
                        name: "LicensesShow",
93
                        component: markRaw(LicensesShow),
93
                        component: markRaw(LicensesShow),
94
                        title: $__("Show license"),
94
                        title: { dynamic: true, text: $__("Show license") },
95
                    },
95
                    },
96
                    {
96
                    {
97
                        path: "add",
97
                        path: "add",
98
                        name: "LicensesFormAdd",
98
                        name: "LicensesFormAdd",
99
                        component: markRaw(LicensesFormAdd),
99
                        component: markRaw(LicensesFormAdd),
100
                        title: $__("Add license"),
100
                        title: { dynamic: false, text: $__("Add license") },
101
                    },
101
                    },
102
                    {
102
                    {
103
                        path: "edit/:license_id",
103
                        path: "edit/:license_id",
104
                        name: "LicensesFormAddEdit",
104
                        name: "LicensesFormAddEdit",
105
                        component: markRaw(LicensesFormAdd),
105
                        component: markRaw(LicensesFormAdd),
106
                        title: $__("Edit license"),
106
                        title: { dynamic: true, text: $__("Edit license") },
107
                    },
107
                    },
108
                ],
108
                ],
109
            },
109
            },
110
            {
110
            {
111
                path: "/cgi-bin/koha/erm/eholdings",
111
                path: "/cgi-bin/koha/erm/eholdings",
112
                title: $__("eHoldings"),
112
                title: { dynamic: false, text: $__("eHoldings") },
113
                icon: "fa fa-crosshairs",
113
                icon: "fa fa-crosshairs",
114
                disabled: true,
114
                disabled: true,
115
                children: [
115
                children: [
116
                    {
116
                    {
117
                        path: "local",
117
                        path: "local",
118
                        title: $__("Local"),
118
                        title: { dynamic: false, text: $__("Local") },
119
                        icon: "fa-solid fa-location-dot",
119
                        icon: "fa-solid fa-location-dot",
120
                        disabled: true,
120
                        disabled: true,
121
                        children: [
121
                        children: [
122
                            {
122
                            {
123
                                path: "packages",
123
                                path: "packages",
124
                                title: $__("Packages"),
124
                                title: {
125
                                    dynamic: false,
126
                                    text: $__("Packages"),
127
                                },
125
                                icon: "fa fa-archive",
128
                                icon: "fa fa-archive",
126
                                is_end_node: true,
129
                                is_end_node: true,
127
                                children: [
130
                                children: [
Lines 138-144 export const routes = [ Link Here
138
                                        component: markRaw(
141
                                        component: markRaw(
139
                                            EHoldingsLocalPackagesShow
142
                                            EHoldingsLocalPackagesShow
140
                                        ),
143
                                        ),
141
                                        title: $__("Show package"),
144
                                        title: {
145
                                            dynamic: true,
146
                                            text: $__("Show package"),
147
                                        },
142
                                    },
148
                                    },
143
                                    {
149
                                    {
144
                                        path: "add",
150
                                        path: "add",
Lines 146-152 export const routes = [ Link Here
146
                                        component: markRaw(
152
                                        component: markRaw(
147
                                            EHoldingsLocalPackagesFormAdd
153
                                            EHoldingsLocalPackagesFormAdd
148
                                        ),
154
                                        ),
149
                                        title: $__("Add package"),
155
                                        title: {
156
                                            dynamic: false,
157
                                            text: $__("Add package"),
158
                                        },
150
                                    },
159
                                    },
151
                                    {
160
                                    {
152
                                        path: "edit/:package_id",
161
                                        path: "edit/:package_id",
Lines 154-166 export const routes = [ Link Here
154
                                        component: markRaw(
163
                                        component: markRaw(
155
                                            EHoldingsLocalPackagesFormAdd
164
                                            EHoldingsLocalPackagesFormAdd
156
                                        ),
165
                                        ),
157
                                        title: $__("Edit package"),
166
                                        title: {
167
                                            dynamic: true,
168
                                            text: $__("Edit package"),
169
                                        },
158
                                    },
170
                                    },
159
                                ],
171
                                ],
160
                            },
172
                            },
161
                            {
173
                            {
162
                                path: "titles",
174
                                path: "titles",
163
                                title: $__("Titles"),
175
                                title: { dynamic: false, text: $__("Titles") },
164
                                icon: "fa-solid fa-arrow-down-a-z",
176
                                icon: "fa-solid fa-arrow-down-a-z",
165
                                is_end_node: true,
177
                                is_end_node: true,
166
                                children: [
178
                                children: [
Lines 177-183 export const routes = [ Link Here
177
                                        component: markRaw(
189
                                        component: markRaw(
178
                                            EHoldingsLocalTitlesShow
190
                                            EHoldingsLocalTitlesShow
179
                                        ),
191
                                        ),
180
                                        title: $__("Show title"),
192
                                        title: {
193
                                            dynamic: true,
194
                                            text: $__("Show title"),
195
                                        },
181
                                    },
196
                                    },
182
                                    {
197
                                    {
183
                                        path: "add",
198
                                        path: "add",
Lines 185-191 export const routes = [ Link Here
185
                                        component: markRaw(
200
                                        component: markRaw(
186
                                            EHoldingsLocalTitlesFormAdd
201
                                            EHoldingsLocalTitlesFormAdd
187
                                        ),
202
                                        ),
188
                                        title: $__("Add title"),
203
                                        title: {
204
                                            dynamic: false,
205
                                            text: $__("Add title"),
206
                                        },
189
                                    },
207
                                    },
190
                                    {
208
                                    {
191
                                        path: "edit/:title_id",
209
                                        path: "edit/:title_id",
Lines 193-199 export const routes = [ Link Here
193
                                        component: markRaw(
211
                                        component: markRaw(
194
                                            EHoldingsLocalTitlesFormAdd
212
                                            EHoldingsLocalTitlesFormAdd
195
                                        ),
213
                                        ),
196
                                        title: $__("Edit title"),
214
                                        title: {
215
                                            dynamic: true,
216
                                            text: $__("Edit title"),
217
                                        },
197
                                    },
218
                                    },
198
                                    {
219
                                    {
199
                                        path: "import",
220
                                        path: "import",
Lines 201-207 export const routes = [ Link Here
201
                                        component: markRaw(
222
                                        component: markRaw(
202
                                            EHoldingsLocalTitlesFormImport
223
                                            EHoldingsLocalTitlesFormImport
203
                                        ),
224
                                        ),
204
                                        title: $__("Import from a list"),
225
                                        title: {
226
                                            dynamic: false,
227
                                            text: $__("Import from a list"),
228
                                        },
205
                                    },
229
                                    },
206
                                    {
230
                                    {
207
                                        path: "/cgi-bin/koha/erm/eholdings/local/resources/:resource_id",
231
                                        path: "/cgi-bin/koha/erm/eholdings/local/resources/:resource_id",
Lines 209-215 export const routes = [ Link Here
209
                                        component: markRaw(
233
                                        component: markRaw(
210
                                            EHoldingsLocalResourcesShow
234
                                            EHoldingsLocalResourcesShow
211
                                        ),
235
                                        ),
212
                                        title: $__("Resource"),
236
                                        title: {
237
                                            dynamic: true,
238
                                            text: $__("Resource"),
239
                                        },
213
                                    },
240
                                    },
214
                                ],
241
                                ],
215
                            },
242
                            },
Lines 217-229 export const routes = [ Link Here
217
                    },
244
                    },
218
                    {
245
                    {
219
                        path: "ebsco",
246
                        path: "ebsco",
220
                        title: $__("EBSCO"),
247
                        title: { dynamic: false, text: $__("EBSCO") },
221
                        icon: "fa fa-globe",
248
                        icon: "fa fa-globe",
222
                        disabled: true,
249
                        disabled: true,
223
                        children: [
250
                        children: [
224
                            {
251
                            {
225
                                path: "packages",
252
                                path: "packages",
226
                                title: $__("Packages"),
253
                                title: {
254
                                    dynamic: false,
255
                                    text: $__("Packages"),
256
                                },
227
                                icon: "fa fa-archive",
257
                                icon: "fa fa-archive",
228
                                is_end_node: true,
258
                                is_end_node: true,
229
                                children: [
259
                                children: [
Lines 240-252 export const routes = [ Link Here
240
                                        component: markRaw(
270
                                        component: markRaw(
241
                                            EHoldingsEBSCOPackagesShow
271
                                            EHoldingsEBSCOPackagesShow
242
                                        ),
272
                                        ),
243
                                        title: $__("Show package"),
273
                                        title: {
274
                                            dynamic: true,
275
                                            text: $__("Show package"),
276
                                        },
244
                                    },
277
                                    },
245
                                ],
278
                                ],
246
                            },
279
                            },
247
                            {
280
                            {
248
                                path: "titles",
281
                                path: "titles",
249
                                title: $__("Titles"),
282
                                title: { dynamic: true, text: $__("Titles") },
250
                                icon: "fa-solid fa-arrow-down-a-z",
283
                                icon: "fa-solid fa-arrow-down-a-z",
251
                                is_end_node: true,
284
                                is_end_node: true,
252
                                children: [
285
                                children: [
Lines 263-269 export const routes = [ Link Here
263
                                        component: markRaw(
296
                                        component: markRaw(
264
                                            EHoldingsEBSCOTitlesShow
297
                                            EHoldingsEBSCOTitlesShow
265
                                        ),
298
                                        ),
266
                                        title: $__("Show title"),
299
                                        title: {
300
                                            dynamic: true,
301
                                            text: $__("Show title"),
302
                                        },
267
                                    },
303
                                    },
268
                                    {
304
                                    {
269
                                        path: "/cgi-bin/koha/erm/eholdings/ebsco/resources/:resource_id",
305
                                        path: "/cgi-bin/koha/erm/eholdings/ebsco/resources/:resource_id",
Lines 271-277 export const routes = [ Link Here
271
                                        component: markRaw(
307
                                        component: markRaw(
272
                                            EHoldingsEBSCOResourcesShow
308
                                            EHoldingsEBSCOResourcesShow
273
                                        ),
309
                                        ),
274
                                        title: $__("Resource"),
310
                                        title: {
311
                                            dynamic: true,
312
                                            text: $__("Resource"),
313
                                        },
275
                                        is_navigation_item: false,
314
                                        is_navigation_item: false,
276
                                    },
315
                                    },
277
                                ],
316
                                ],
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js (-5 / +22 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(
80
                    this.current,
81
                    this.routeState,
82
                    this.breadcrumbParameter
83
                );
76
84
77
            return _getBaseElements(this.routeState);
85
            return _getBaseElements(this.routeState);
78
86
Lines 100-113 export const useNavigationStore = defineStore("navigation", { Link Here
100
                );
108
                );
101
            }
109
            }
102
110
103
            function _buildFromCurrentMatches(currentMatches, routeState) {
111
            function _buildFromCurrentMatches(
112
                currentMatches,
113
                routeState,
114
                param
115
            ) {
104
                return [
116
                return [
105
                    {
117
                    {
106
                        ...routeState,
118
                        ...routeState,
107
                        icon: null,
119
                        icon: null,
108
                        children: null,
120
                        children: null,
109
                    },
121
                    },
110
                    ..._mapMatches(currentMatches),
122
                    ..._mapMatches(currentMatches, param),
111
                ];
123
                ];
112
            }
124
            }
113
125
Lines 115-130 export const useNavigationStore = defineStore("navigation", { Link Here
115
                return child.is_base || (child.path && child.path !== "");
127
                return child.is_base || (child.path && child.path !== "");
116
            }
128
            }
117
129
118
            function _mapMatches(currentMatches) {
130
            function _mapMatches(currentMatches, param) {
119
                return currentMatches
131
                return currentMatches
120
                    .filter(match => _isBaseOrNotStub(match.meta.self))
132
                    .filter(match => _isBaseOrNotStub(match.meta.self))
121
                    .map(match => ({
133
                    .map(match => ({
122
                        ...match.meta.self,
134
                        ...match.meta.self,
135
                        title: _setTitle(match.meta.self, param),
123
                        icon: null,
136
                        icon: null,
124
                        path: match.path,
137
                        path: match.path,
125
                        children: null,
138
                        children: null,
126
                    }));
139
                    }));
127
            }
140
            }
141
142
            function _setTitle(self, param) {
143
                const title = self.title.dynamic ? param : self.title.text;
144
                return { dynamic: self.title.dynamic, text: title };
145
            }
128
        },
146
        },
129
        leftNavigation() {
147
        leftNavigation() {
130
            return _getNavigationElements(this.routeState);
148
            return _getNavigationElements(this.routeState);
131
- 

Return to bug 34417