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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue (-4 / +34 lines)
Lines 1-7 Link Here
1
<template>
1
<template>
2
    <div class="alert alert-info" v-if="message" v-html="message"></div>
2
    <div class="alert alert-info" v-if="message" v-html="message"></div>
3
    <div class="alert alert-warning" v-if="error" v-html="error"></div>
3
    <div class="alert alert-warning" v-if="error" v-html="error"></div>
4
    <div class="modal" role="dialog" v-if="warning">
4
    <div class="modal" role="dialog" v-if="warning" id="warning">
5
        <div class="modal-dialog">
5
        <div class="modal-dialog">
6
            <div class="modal-content modal-lg">
6
            <div class="modal-content modal-lg">
7
                <div class="modal-header">
7
                <div class="modal-header">
Lines 22-28 Link Here
22
            </div>
22
            </div>
23
        </div>
23
        </div>
24
    </div>
24
    </div>
25
    <div class="confirmation modal" role="dialog" v-if="confirmation">
25
    <div
26
        class="confirmation modal"
27
        role="dialog"
28
        v-if="confirmation"
29
        id="confirmation"
30
    >
26
        <div class="modal-dialog">
31
        <div class="modal-dialog">
27
            <div class="modal-content modal-lg">
32
            <div class="modal-content modal-lg">
28
                <div class="modal-header alert-warning confirmation">
33
                <div class="modal-header alert-warning confirmation">
Lines 111-117 Link Here
111
</template>
116
</template>
112
117
113
<script>
118
<script>
114
import { inject } from "vue"
119
import { inject, watch, nextTick } from "vue"
115
import { storeToRefs } from "pinia"
120
import { storeToRefs } from "pinia"
116
import flatPickr from "vue-flatpickr-component"
121
import flatPickr from "vue-flatpickr-component"
117
export default {
122
export default {
Lines 132-138 export default { Link Here
132
            ) {
137
            ) {
133
                this.$refs.confirmationform.reportValidity()
138
                this.$refs.confirmationform.reportValidity()
134
            } else {
139
            } else {
135
                this.accept_callback()
140
                this.accept_callback().then(() => {
141
                    nextTick(() => {
142
                        $("#confirmation.modal").modal("hide")
143
                    })
144
                })
136
            }
145
            }
137
        },
146
        },
138
    },
147
    },
Lines 148-153 export default { Link Here
148
            is_loading,
157
            is_loading,
149
        } = storeToRefs(mainStore)
158
        } = storeToRefs(mainStore)
150
        const { removeMessages, removeConfirmationMessages } = mainStore
159
        const { removeMessages, removeConfirmationMessages } = mainStore
160
161
        watch(warning, newWarning => {
162
            if (!newWarning) {
163
                $("#warning.modal").modal("hide")
164
                return
165
            }
166
            nextTick(() => {
167
                $("#warning.modal").modal("show")
168
            })
169
        })
170
171
        watch(confirmation, newConfirmation => {
172
            if (!newConfirmation) {
173
                $("#confirmation.modal").modal("hide")
174
                return
175
            }
176
            nextTick(() => {
177
                $("#confirmation.modal").modal("show")
178
            })
179
        })
180
151
        return {
181
        return {
152
            message,
182
            message,
153
            error,
183
            error,
(-)a/t/cypress/integration/Preservation/Trains.ts (-2 / +2 lines)
Lines 532-538 describe("Trains", () => { Link Here
532
        cy.get("#barcode").type("bc_1");
532
        cy.get("#barcode").type("bc_1");
533
        cy.intercept("GET", "/api/v1/preservation/waiting-list/items*", []);
533
        cy.intercept("GET", "/api/v1/preservation/waiting-list/items*", []);
534
        cy.contains("Submit").click();
534
        cy.contains("Submit").click();
535
        cy.get("div[class='modal']").contains(
535
        cy.get("#warning.modal").contains(
536
            "Cannot find item with this barcode. It must be in the waiting list."
536
            "Cannot find item with this barcode. It must be in the waiting list."
537
        );
537
        );
538
        cy.get("#close_modal").click();
538
        cy.get("#close_modal").click();
Lines 642-648 describe("Trains", () => { Link Here
642
        cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3");
642
        cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3");
643
        cy.contains("Save").click();
643
        cy.contains("Save").click();
644
        cy.wait("@get-items");
644
        cy.wait("@get-items");
645
        cy.get("main div[class='modal']").contains(
645
        cy.get("#warning.modal").contains(
646
            "2 new items added. 1 items not found."
646
            "2 new items added. 1 items not found."
647
        );
647
        );
648
        cy.get("#close_modal").click();
648
        cy.get("#close_modal").click();
(-)a/t/cypress/integration/Preservation/WaitingList.ts (-2 / +1 lines)
Lines 97-103 describe("WaitingList", () => { Link Here
97
        cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3");
97
        cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3");
98
        cy.get("#add_to_waiting_list .approve").click();
98
        cy.get("#add_to_waiting_list .approve").click();
99
        cy.wait("@get-items");
99
        cy.wait("@get-items");
100
        cy.get("main div[class='modal']").contains(
100
        cy.get("#warning.modal").contains(
101
            "2 new items added. 1 items not found."
101
            "2 new items added. 1 items not found."
102
        );
102
        );
103
    });
103
    });
104
- 

Return to bug 37812