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 38-44 describe("Vendor CRUD operations", () => { Link Here
38
        cy.get("h1").contains("Add vendor");
38
        cy.get("h1").contains("Add vendor");
39
39
40
        // Fill in the form for normal attributes
40
        // Fill in the form for normal attributes
41
        cy.get("#vendor_add").contains("Submit").click();
41
        cy.get("#vendors_add").contains("Save").click();
42
        cy.get("input:invalid,textarea:invalid,select:invalid").should(
42
        cy.get("input:invalid,textarea:invalid,select:invalid").should(
43
            "have.length",
43
            "have.length",
44
            1
44
            1
Lines 114-120 describe("Vendor CRUD operations", () => { Link Here
114
            statusCode: 201,
114
            statusCode: 201,
115
            body: vendor,
115
            body: vendor,
116
        });
116
        });
117
        cy.get("#vendor_add").contains("Submit").click();
117
        cy.get("#vendors_add").contains("Save").click();
118
        cy.get("main div[class='alert alert-info']").contains("Vendor created");
118
        cy.get("main div[class='alert alert-info']").contains("Vendor created");
119
    });
119
    });
120
120
Lines 153-159 describe("Vendor CRUD operations", () => { Link Here
153
            statusCode: 200,
153
            statusCode: 200,
154
            body: vendor,
154
            body: vendor,
155
        });
155
        });
156
        cy.get("#vendor_add").contains("Submit").click();
156
        cy.get("#vendors_add").contains("Save").click();
157
        cy.get("main div[class='alert alert-info']").contains("Vendor updated");
157
        cy.get("main div[class='alert alert-info']").contains("Vendor updated");
158
    });
158
    });
159
159
160
- 

Return to bug 38899