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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-6 / +6 lines)
Lines 200-211 export default { Link Here
200
        },
200
        },
201
        table_url: function () {
201
        table_url: function () {
202
            let url = "/api/v1/erm/agreements"
202
            let url = "/api/v1/erm/agreements"
203
            if (this.filters.by_expired) {
204
                if (!this.filters.max_expiration_date)
205
                    this.filters.max_expiration_date = new Date()
206
                        .toISOString()
207
                        .substring(0, 10)
208
            }
209
            if (this.filters.by_expired)
203
            if (this.filters.by_expired)
210
                url +=
204
                url +=
211
                    "?max_expiration_date=" + this.filters.max_expiration_date
205
                    "?max_expiration_date=" + this.filters.max_expiration_date
Lines 216-221 export default { Link Here
216
            this.$emit("close")
210
            this.$emit("close")
217
        },
211
        },
218
        filter_table: async function () {
212
        filter_table: async function () {
213
            if (this.filters.by_expired) {
214
                if (!this.filters.max_expiration_date)
215
                    this.filters.max_expiration_date = new Date()
216
                        .toISOString()
217
                        .substring(0, 10)
218
            }
219
            if (this.before_route_entered) {
219
            if (this.before_route_entered) {
220
                let new_route = build_url(
220
                let new_route = build_url(
221
                    "/cgi-bin/koha/erm/agreements",
221
                    "/cgi-bin/koha/erm/agreements",
(-)a/t/cypress/integration/Agreements_spec.ts (-3 / +2 lines)
Lines 177-186 describe("Agreement CRUD operations", () => { Link Here
177
            .its('request.url')
177
            .its('request.url')
178
            .should('include', 'max_expiration_date='+dates["today_iso"]); // Defaults to today
178
            .should('include', 'max_expiration_date='+dates["today_iso"]); // Defaults to today
179
        cy.get("#max_expiration_date_filter").should("have.value", dates["today_iso"]); // Input box reflects default
179
        cy.get("#max_expiration_date_filter").should("have.value", dates["today_iso"]); // Input box reflects default
180
        cy.url().should('include', "/cgi-bin/koha/erm/agreements?by_expired=true"); // Browser url also updated
180
        cy.url().should('include', "/cgi-bin/koha/erm/agreements?by_expired=true&max_expiration_date="+dates["today_iso"]); // Browser url also updated
181
181
182
        // Now test that the url for this particular state works
182
        // Now test that the url for this particular state works
183
        cy.visit("/cgi-bin/koha/erm/agreements?by_expired=true");
183
        cy.visit("/cgi-bin/koha/erm/agreements?by_expired=true&max_expiration_date="+dates["today_iso"]);
184
        cy.wait('@getActiveAgreements').its('request.url').should('include', 'max_expiration_date='+dates["today_iso"]);
184
        cy.wait('@getActiveAgreements').its('request.url').should('include', 'max_expiration_date='+dates["today_iso"]);
185
185
186
        // Now test with a user entered date
186
        // Now test with a user entered date
187
- 

Return to bug 33490