Bugzilla – Attachment 149643 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.09 KB, created by
Martin Renvoize
on 2023-04-14 07:25:37 UTC
(
hide
)
Description:
Bug 33490: Make url consistent
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-04-14 07:25:37 UTC
Size:
3.09 KB
patch
obsolete
>From ab61530287dd8583da43c7fcf88937e7191434b9 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/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 a20d406fc2..fba8c7fa5a 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 >@@ -200,12 +200,6 @@ 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 >@@ -216,6 +210,12 @@ export default { > this.$emit("close") > }, > 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.before_route_entered) { > let new_route = build_url( > "/cgi-bin/koha/erm/agreements", >diff --git a/t/cypress/integration/Agreements_spec.ts b/t/cypress/integration/Agreements_spec.ts >index 5bfd27fae3..7183e41331 100644 >--- a/t/cypress/integration/Agreements_spec.ts >+++ b/t/cypress/integration/Agreements_spec.ts >@@ -177,10 +177,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.40.0
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