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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ButtonSubmit.vue (-1 / +8 lines)
Lines 1-5 Link Here
1
<template>
1
<template>
2
    <button type="submit" class="btn btn-primary">
2
    <button v-if="form" @click="form.requestSubmit()" class="btn btn-primary">
3
        <font-awesome-icon v-if="icon" :icon="icon" />
4
        {{ text }}
5
    </button>
6
    <button v-else type="submit" class="btn btn-primary">
3
        <font-awesome-icon v-if="icon" :icon="icon" />
7
        <font-awesome-icon v-if="icon" :icon="icon" />
4
        {{ text }}
8
        {{ text }}
5
    </button>
9
    </button>
Lines 18-23 export default { Link Here
18
            type: String,
22
            type: String,
19
            required: false,
23
            required: false,
20
        },
24
        },
25
        form: {
26
            type: Object,
27
        },
21
    },
28
    },
22
};
29
};
23
</script>
30
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue (-4 / +11 lines)
Lines 1-12 Link Here
1
<template>
1
<template>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <template v-else>
3
    <main id="vendors_add" v-else>
4
        <h1 v-if="vendor.id">
4
        <h1 v-if="vendor.id">
5
            {{ $__("Edit vendor #%s").format(vendor.id) }}
5
            {{ $__("Edit vendor #%s").format(vendor.id) }}
6
        </h1>
6
        </h1>
7
        <h1 v-else>{{ $__("Add vendor") }}</h1>
7
        <h1 v-else>{{ $__("Add vendor") }}</h1>
8
        <Toolbar :sticky="true">
8
        <Toolbar :sticky="true">
9
            <ButtonSubmit :text="$__('Save')" icon="save" />
9
            <ButtonSubmit :text="$__('Save')" icon="save" :form="vendorForm" />
10
            <ToolbarButton
10
            <ToolbarButton
11
                :to="{ name: 'VendorList' }"
11
                :to="{ name: 'VendorList' }"
12
                :title="$__('Cancel')"
12
                :title="$__('Cancel')"
Lines 15-21 Link Here
15
            >
15
            >
16
            </ToolbarButton>
16
            </ToolbarButton>
17
        </Toolbar>
17
        </Toolbar>
18
        <form @submit="onSubmit($event)" id="add_vendor">
18
        <form @submit="onSubmit($event)" ref="vendorForm">
19
            <VendorDetails :vendor="vendor" />
19
            <VendorDetails :vendor="vendor" />
20
            <VendorContacts :vendor="vendor" />
20
            <VendorContacts :vendor="vendor" />
21
            <VendorInterfaces :vendor="vendor" />
21
            <VendorInterfaces :vendor="vendor" />
Lines 25-31 Link Here
25
                :discountValid="discountValid"
25
                :discountValid="discountValid"
26
            />
26
            />
27
        </form>
27
        </form>
28
    </template>
28
    </main>
29
</template>
29
</template>
30
30
31
<script>
31
<script>
Lines 38-45 import VendorOrderingInformation from "./VendorOrderingInformation.vue"; Link Here
38
import VendorInterfaces from "./VendorInterfaces.vue";
38
import VendorInterfaces from "./VendorInterfaces.vue";
39
import Toolbar from "../Toolbar.vue";
39
import Toolbar from "../Toolbar.vue";
40
import ToolbarButton from "../ToolbarButton.vue";
40
import ToolbarButton from "../ToolbarButton.vue";
41
import { ref } from "vue";
41
42
42
export default {
43
export default {
44
    setup() {
45
        const vendorForm = ref();
46
        return {
47
            vendorForm,
48
        };
49
    },
43
    data() {
50
    data() {
44
        return {
51
        return {
45
            vendor: {
52
            vendor: {
(-)a/t/cypress/integration/Acquisitions/Vendors_spec.ts (-4 / +3 lines)
Lines 99-105 describe("Vendor CRUD operations", () => { Link Here
99
        cy.get("h1").contains("Add vendor");
99
        cy.get("h1").contains("Add vendor");
100
100
101
        // Fill in the form for normal attributes
101
        // Fill in the form for normal attributes
102
        cy.get("#add_vendor").contains("Submit").click();
102
        cy.get("#vendors_add").contains("Save").click();
103
        cy.get("input:invalid,textarea:invalid,select:invalid").should(
103
        cy.get("input:invalid,textarea:invalid,select:invalid").should(
104
            "have.length",
104
            "have.length",
105
            1
105
            1
Lines 175-181 describe("Vendor CRUD operations", () => { Link Here
175
            statusCode: 201,
175
            statusCode: 201,
176
            body: vendor,
176
            body: vendor,
177
        });
177
        });
178
        cy.get("#add_vendor").contains("Submit").click();
178
        cy.get("#vendors_add").contains("Save").click();
179
        cy.get("main div[class='alert alert-info']").contains("Vendor created");
179
        cy.get("main div[class='alert alert-info']").contains("Vendor created");
180
    });
180
    });
181
181
Lines 206-212 describe("Vendor CRUD operations", () => { Link Here
206
            statusCode: 200,
206
            statusCode: 200,
207
            body: vendor,
207
            body: vendor,
208
        });
208
        });
209
        cy.get("#add_vendor").contains("Submit").click();
209
        cy.get("#vendors_add").contains("Save").click();
210
        cy.get("main div[class='alert alert-info']").contains("Vendor updated");
210
        cy.get("main div[class='alert alert-info']").contains("Vendor updated");
211
    });
211
    });
212
212
213
- 

Return to bug 38899