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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc (-1 / +1 lines)
Lines 6-12 Link Here
6
6
7
        [% WRAPPER tab_panels %]
7
        [% WRAPPER tab_panels %]
8
            [% WRAPPER tab_panel tabname="supplier_search" bt_active= 1 %]
8
            [% WRAPPER tab_panel tabname="supplier_search" bt_active= 1 %]
9
                <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="get">
9
                <form name="findsupplier" action="/cgi-bin/koha/vendors" method="get">
10
                    <div class="form-title">
10
                    <div class="form-title">
11
                        <label class="control-label" for="supplier"><span class="control-text">Vendor search</span> <i class="fa fa-fw fa-upload" aria-hidden="true"></i></label>
11
                        <label class="control-label" for="supplier"><span class="control-text">Vendor search</span> <i class="fa fa-fw fa-upload" aria-hidden="true"></i></label>
12
                    </div>
12
                    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-2 / +6 lines)
Lines 49-56 Link Here
49
    <div class="col">
49
    <div class="col">
50
<div id="acqui_acqui_home_order">
50
<div id="acqui_acqui_home_order">
51
    <fieldset>
51
    <fieldset>
52
        <legend>View vendors</legend>
52
        <legend>Search vendors</legend>
53
        <a href="/cgi-bin/koha/vendors" class="btn btn-default">Vendor list</a>
53
        <form name="findsupplier" action="/cgi-bin/koha/vendors" method="get">
54
            <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
55
            <input type="submit" class="btn btn-primary" value="Search" />
56
            </p>
57
        </form>
54
    </fieldset>
58
    </fieldset>
55
</div>
59
</div>
56
</div>
60
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue (+7 lines)
Lines 59-64 export default { Link Here
59
            fp_config: flatpickr_defaults,
59
            fp_config: flatpickr_defaults,
60
            vendor_count: 0,
60
            vendor_count: 0,
61
            initialized: false,
61
            initialized: false,
62
            searchTerm: null,
62
            tableOptions: {
63
            tableOptions: {
63
                columns: this.getTableColumns(),
64
                columns: this.getTableColumns(),
64
                options: { embed: "aliases,baskets,subscriptions" },
65
                options: { embed: "aliases,baskets,subscriptions" },
Lines 97-102 export default { Link Here
97
    beforeRouteEnter(to, from, next) {
98
    beforeRouteEnter(to, from, next) {
98
        next(vm => {
99
        next(vm => {
99
            vm.getVendorCount().then(() => (vm.initialized = true))
100
            vm.getVendorCount().then(() => (vm.initialized = true))
101
            if (to.query.supplier) {
102
                vm.searchTerm = to.query.supplier
103
            }
100
        })
104
        })
101
    },
105
    },
102
    methods: {
106
    methods: {
Lines 155-160 export default { Link Here
155
        },
159
        },
156
        tableURL() {
160
        tableURL() {
157
            let url = "/api/v1/acquisitions/vendors"
161
            let url = "/api/v1/acquisitions/vendors"
162
            if (this.searchTerm) {
163
                url += "?name=" + this.searchTerm
164
            }
158
            return url
165
            return url
159
        },
166
        },
160
        getTableColumns() {
167
        getTableColumns() {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js (+6 lines)
Lines 152-157 export const useNavigationStore = defineStore("navigation", { Link Here
152
            }
152
            }
153
        },
153
        },
154
        leftNavigation() {
154
        leftNavigation() {
155
            const currentRoute = this.current[this.current.length - 1];
156
            if (currentRoute) {
157
                const alternateMenuRequired =
158
                    currentRoute.meta.self.alternateLeftMenu;
159
                if (alternateMenuRequired) return alternateMenuRequired;
160
            }
155
            return _getNavigationElements(this.routeState);
161
            return _getNavigationElements(this.routeState);
156
162
157
            // Function declarations
163
            // Function declarations
(-)a/t/cypress/integration/Acquisitions/Vendors_spec.ts (-4 / +3 lines)
Lines 64-70 describe("Vendor CRUD operations", () => { Link Here
64
64
65
    it("should list vendors", () => {
65
    it("should list vendors", () => {
66
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
66
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
67
        cy.get("#acqui_acqui_home_order").contains("Vendor list").click();
68
67
69
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", []);
68
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", []);
70
        cy.visit("/cgi-bin/koha/vendors");
69
        cy.visit("/cgi-bin/koha/vendors");
Lines 282-290 describe("External URLs", () => { Link Here
282
281
283
    it("should navigate to the receive shipments page", () => {
282
    it("should navigate to the receive shipments page", () => {
284
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
283
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
285
        cy.get("#acqui_acqui_home_order").contains("Vendor list").click();
286
284
287
        const vendor = getVendor();
285
        const vendor = getVendor();
286
288
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", {
287
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", {
289
            statusCode: 200,
288
            statusCode: 200,
290
            body: [vendor],
289
            body: [vendor],
Lines 293-305 describe("External URLs", () => { Link Here
293
                "X-Total-Count": "1",
292
                "X-Total-Count": "1",
294
            },
293
            },
295
        });
294
        });
296
        cy.intercept("GET", "/api/v1/acquisitions/vendors/*", vendor);
297
        cy.visit("/cgi-bin/koha/vendors");
295
        cy.visit("/cgi-bin/koha/vendors");
298
        const name_link = cy.get(
296
        const name_link = cy.get(
299
            "#vendors_list table tbody tr:first td:first a"
297
            "#vendors_list table tbody tr:first td:first a"
300
        );
298
        );
301
        name_link.should("have.text", vendor.name + " (#" + vendor.id + ")");
299
        name_link.should("have.text", vendor.name + " (#" + vendor.id + ")");
302
        name_link.click();
300
        name_link.click();
301
        cy.wait(500);
302
        cy.get("#vendors_show h1").contains(vendor.name);
303
303
304
        cy.get("#vendors_show").contains("Receive shipments").click();
304
        cy.get("#vendors_show").contains("Receive shipments").click();
305
        cy.get("h1").contains("Receive shipment from vendor " + vendor.name);
305
        cy.get("h1").contains("Receive shipment from vendor " + vendor.name);
306
- 

Return to bug 38010