Bugzilla – Attachment 149674 Details for
Bug 33490
Agreements - Filter by expired results in error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33490: Make url consistent
Bug-33490-Make-url-consistent.patch (text/plain), 3.06 KB, created by
Jonathan Druart
on 2023-04-14 12:32:38 UTC
(
hide
)
Description:
Bug 33490: Make url consistent
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-04-14 12:32:38 UTC
Size:
3.06 KB
patch
obsolete
>From bfb26b799c531eabe0bbddd8a62364a05f89c626 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 13 Apr 2023 18:12:13 +0100 >Subject: [PATCH] Bug 33490: Make url consistent > >This ensures we populate the max_expiration_date param on the browser >url for consistency with selected dates. >--- > .../prog/js/vue/components/ERM/AgreementsList.vue | 12 ++++++------ > t/cypress/integration/ERM/Agreements_spec.ts | 4 ++-- > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >index 4712cc5f3e8..d7c9f82a1ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >@@ -208,18 +208,18 @@ export default { > }, > table_url: function () { > let url = "/api/v1/erm/agreements" >- if (this.filters.by_expired) { >- if (!this.filters.max_expiration_date) >- this.filters.max_expiration_date = new Date() >- .toISOString() >- .substring(0, 10) >- } > if (this.filters.by_expired) > url += > "?max_expiration_date=" + this.filters.max_expiration_date > return url > }, > filter_table: async function () { >+ if (this.filters.by_expired) { >+ if (!this.filters.max_expiration_date) >+ this.filters.max_expiration_date = new Date() >+ .toISOString() >+ .substring(0, 10) >+ } > if (!this.embedded) { > let new_route = build_url( > "/cgi-bin/koha/erm/agreements", >diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts >index 3a3954f00d4..61db7af1460 100644 >--- a/t/cypress/integration/ERM/Agreements_spec.ts >+++ b/t/cypress/integration/ERM/Agreements_spec.ts >@@ -170,10 +170,10 @@ describe("Agreement CRUD operations", () => { > .its('request.url') > .should('include', 'max_expiration_date='+dates["today_iso"]); // Defaults to today > cy.get("#max_expiration_date_filter").should("have.value", dates["today_iso"]); // Input box reflects default >- cy.url().should('include', "/cgi-bin/koha/erm/agreements?by_expired=true"); // Browser url also updated >+ cy.url().should('include', "/cgi-bin/koha/erm/agreements?by_expired=true&max_expiration_date="+dates["today_iso"]); // Browser url also updated > > // Now test that the url for this particular state works >- cy.visit("/cgi-bin/koha/erm/agreements?by_expired=true"); >+ cy.visit("/cgi-bin/koha/erm/agreements?by_expired=true&max_expiration_date="+dates["today_iso"]); > cy.wait('@getActiveAgreements').its('request.url').should('include', 'max_expiration_date='+dates["today_iso"]); > > // Now test with a user entered date >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33490
:
149519
|
149521
|
149522
|
149523
|
149603
|
149604
|
149615
|
149643
|
149652
|
149661
|
149672
|
149673
|
149674
|
149675
|
149676
|
150038
|
150039
|
150040
|
150048
|
150194
|
150195
|
150196
|
150197
|
150198
|
150199
|
150200
|
150201