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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/LeftMenu.vue (-16 / +22 lines)
Lines 1-14 Link Here
1
<template>
1
<template>
2
    <aside>
2
    <aside>
3
        <div class="sidebar_menu">
3
        <div class="sidebar_menu">
4
            <h5>{{ $__(title) }}</h5>
4
            <VendorMenu v-if="leftNavigation === 'VendorMenu'" />
5
            <ul>
5
            <AcquisitionsMenu
6
                <NavigationItem
6
                v-else-if="leftNavigation === 'AcquisitionsMenu'"
7
                    v-for="(item, key) in navigationTree"
7
            />
8
                    v-bind:key="key"
8
            <template v-else>
9
                    :item="item"
9
                <h5>{{ $__(title) }}</h5>
10
                ></NavigationItem>
10
                <ul>
11
            </ul>
11
                    <NavigationItem
12
                        v-for="(item, key) in leftNavigation"
13
                        v-bind:key="key"
14
                        :item="item"
15
                    ></NavigationItem>
16
                </ul>
17
            </template>
12
        </div>
18
        </div>
13
        <!-- /.sidebar_menu -->
19
        <!-- /.sidebar_menu -->
14
    </aside>
20
    </aside>
Lines 17-39 Link Here
17
<script>
23
<script>
18
import { inject } from "vue";
24
import { inject } from "vue";
19
import NavigationItem from "./NavigationItem.vue";
25
import NavigationItem from "./NavigationItem.vue";
26
import VendorMenu from "./Islands/VendorMenu.vue";
27
import { storeToRefs } from "pinia";
28
import AcquisitionsMenu from "./Islands/AcquisitionsMenu.vue";
29
20
export default {
30
export default {
21
    name: "LeftMenu",
31
    name: "LeftMenu",
22
    data() {
23
        return {
24
            navigationTree: this.leftNavigation,
25
        };
26
    },
27
    setup: () => {
32
    setup: () => {
28
        const navigationStore = inject("navigationStore");
33
        const navigationStore = inject("navigationStore");
29
        const { leftNavigation } = navigationStore;
34
        const { leftNavigation } = storeToRefs(navigationStore);
30
        return {
35
        return {
31
            leftNavigation,
36
            leftNavigation,
32
        };
37
        };
33
    },
38
    },
34
    async beforeMount() {
39
    async beforeMount() {
35
        if (this.condition)
40
        if (this.condition) this.condition(this.leftNavigation);
36
            this.navigationTree = await this.condition(this.navigationTree);
37
    },
41
    },
38
    props: {
42
    props: {
39
        title: String,
43
        title: String,
Lines 41-46 export default { Link Here
41
    },
45
    },
42
    components: {
46
    components: {
43
        NavigationItem,
47
        NavigationItem,
48
        VendorMenu,
49
        AcquisitionsMenu,
44
    },
50
    },
45
};
51
};
46
</script>
52
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue (-1 / +2 lines)
Lines 14-20 Link Here
14
                </div>
14
                </div>
15
15
16
                <div class="col-md-2 order-sm-2 order-md-1">
16
                <div class="col-md-2 order-sm-2 order-md-1">
17
                    <LeftMenu :title="$__('Vendor management')"></LeftMenu>
17
                    <LeftMenu :title="$__('Acquisitions')"></LeftMenu>
18
                </div>
18
                </div>
19
            </div>
19
            </div>
20
        </div>
20
        </div>
Lines 53-58 export default { Link Here
53
            loaded,
53
            loaded,
54
            userPermissions,
54
            userPermissions,
55
            AVStore,
55
            AVStore,
56
            config,
56
        };
57
        };
57
    },
58
    },
58
    beforeCreate() {
59
    beforeCreate() {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/acquisitions.js (-1 / +3 lines)
Lines 31-42 export const routes = [ Link Here
31
                        path: "",
31
                        path: "",
32
                        name: "VendorList",
32
                        name: "VendorList",
33
                        component: markRaw(VendorList),
33
                        component: markRaw(VendorList),
34
                        alternateLeftMenu: "AcquisitionsMenu",
34
                    },
35
                    },
35
                    {
36
                    {
36
                        path: ":vendor_id",
37
                        path: ":vendor_id",
37
                        name: "VendorShow",
38
                        name: "VendorShow",
38
                        component: markRaw(VendorShow),
39
                        component: markRaw(VendorShow),
39
                        title: $__("Show vendor"),
40
                        title: $__("Show vendor"),
41
                        alternateLeftMenu: "VendorMenu",
40
                    },
42
                    },
41
                    {
43
                    {
42
                        path: "add",
44
                        path: "add",
Lines 55-60 export const routes = [ Link Here
55
                        name: "VendorShowBaskets",
57
                        name: "VendorShowBaskets",
56
                        component: markRaw(VendorShow),
58
                        component: markRaw(VendorShow),
57
                        title: $__("Baskets"),
59
                        title: $__("Baskets"),
60
                        alternateLeftMenu: "VendorMenu",
58
                    },
61
                    },
59
                ],
62
                ],
60
            },
63
            },
61
- 

Return to bug 38010