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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue (-20 / +16 lines)
Lines 1-10 Link Here
1
<template>
1
<template>
2
    <div v-if="_is_loading">
2
    <div>
3
        <Dialog />
4
    </div>
5
    <div v-else-if="ERMModule">
6
        <Breadcrumb />
3
        <Breadcrumb />
7
        <div class="main container-fluid">
4
        <div class="main container-fluid" v-if="ERMModule">
8
            <div class="row">
5
            <div class="row">
9
                <div class="col-sm-10 col-sm-push-2">
6
                <div class="col-sm-10 col-sm-push-2">
10
                    <main>
7
                    <main>
Lines 111-123 Link Here
111
                </div>
108
                </div>
112
            </div>
109
            </div>
113
        </div>
110
        </div>
114
    </div>
111
        <div class="main container-fluid" v-else>
115
    <div v-else>
112
            <Dialog />
116
        {{
113
        </div>
117
            $__(
118
                "The e-resource management module is disabled, turn on 'ERMModule' to use it"
119
            )
120
        }}
121
    </div>
114
    </div>
122
</template>
115
</template>
123
116
Lines 137-153 export default { Link Here
137
130
138
        const mainStore = inject("mainStore")
131
        const mainStore = inject("mainStore")
139
132
140
        // Note that we cannot use loading and loaded from messages
133
        const { loading, loaded, setError } = mainStore
141
        // Pinia is not initiated yet there
142
        const { _is_loading } = storeToRefs(mainStore)
143
134
144
        return {
135
        return {
145
            vendorStore,
136
            vendorStore,
146
            AVStore,
137
            AVStore,
147
            mainStore,
138
            setError,
148
            erm_providers,
139
            erm_providers,
149
            ERMModule,
140
            ERMModule,
150
            _is_loading,
141
            loading,
142
            loaded,
151
        }
143
        }
152
    },
144
    },
153
    data() {
145
    data() {
Lines 156-162 export default { Link Here
156
        }
148
        }
157
    },
149
    },
158
    beforeCreate() {
150
    beforeCreate() {
159
        this.mainStore._is_loading = true
151
        if(!this.ERMModule) {
152
            return this.setError(this.$__(
153
                'The e-resource management module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ERMModule">ERMModule</a> to use it'
154
            ), false);
155
        }
156
        this.loading()
160
157
161
        const acq_client = APIClient.acquisition
158
        const acq_client = APIClient.acquisition
162
        acq_client.vendors.getAll().then(
159
        acq_client.vendors.getAll().then(
Lines 200-206 export default { Link Here
200
                    }
197
                    }
201
                )
198
                )
202
            })
199
            })
203
            .then(() => (this.mainStore._is_loading = false))
200
        }).then(() => (this.loaded()));
204
    },
201
    },
205
    components: {
202
    components: {
206
        Breadcrumb,
203
        Breadcrumb,
207
- 

Return to bug 32991