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 2-15 Link Here
2
    <aside>
2
    <aside>
3
        <div id="navmenu">
3
        <div id="navmenu">
4
            <div id="navmenulist">
4
            <div id="navmenulist">
5
                <h5>{{ $__(title) }}</h5>
5
                <VendorMenu v-if="leftNavigation === 'VendorMenu'" />
6
                <ul>
6
                <AcquisitionsMenu
7
                    <NavigationItem
7
                    v-else-if="leftNavigation === 'AcquisitionsMenu'"
8
                        v-for="(item, key) in navigationTree"
8
                />
9
                        v-bind:key="key"
9
                <template v-else>
10
                        :item="item"
10
                    <h5>{{ $__(title) }}</h5>
11
                    ></NavigationItem>
11
                    <ul>
12
                </ul>
12
                        <NavigationItem
13
                            v-for="(item, key) in leftNavigation"
14
                            v-bind:key="key"
15
                            :item="item"
16
                        ></NavigationItem>
17
                    </ul>
18
                </template>
13
            </div>
19
            </div>
14
        </div>
20
        </div>
15
    </aside>
21
    </aside>
Lines 18-40 Link Here
18
<script>
24
<script>
19
import { inject } from "vue"
25
import { inject } from "vue"
20
import NavigationItem from "./NavigationItem.vue"
26
import NavigationItem from "./NavigationItem.vue"
27
import VendorMenu from "./Islands/VendorMenu.vue"
28
import { storeToRefs } from "pinia"
29
import AcquisitionsMenu from "./Islands/AcquisitionsMenu.vue"
30
21
export default {
31
export default {
22
    name: "LeftMenu",
32
    name: "LeftMenu",
23
    data() {
24
        return {
25
            navigationTree: this.leftNavigation,
26
        }
27
    },
28
    setup: () => {
33
    setup: () => {
29
        const navigationStore = inject("navigationStore")
34
        const navigationStore = inject("navigationStore")
30
        const { leftNavigation } = navigationStore
35
        const { leftNavigation } = storeToRefs(navigationStore)
31
        return {
36
        return {
32
            leftNavigation,
37
            leftNavigation,
33
        }
38
        }
34
    },
39
    },
35
    async beforeMount() {
40
    async beforeMount() {
36
        if (this.condition)
41
        if (this.condition) this.condition(this.leftNavigation)
37
            this.navigationTree = await this.condition(this.navigationTree)
38
    },
42
    },
39
    props: {
43
    props: {
40
        title: String,
44
        title: String,
Lines 42-47 export default { Link Here
42
    },
46
    },
43
    components: {
47
    components: {
44
        NavigationItem,
48
        NavigationItem,
49
        VendorMenu,
50
        AcquisitionsMenu,
45
    },
51
    },
46
}
52
}
47
</script>
53
</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