Bugzilla – Attachment 173776 Details for
Bug 37576
Add additional fields support to ERM agreements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37576: (QA follow-up) Tidy
Bug-37576-QA-follow-up-Tidy.patch (text/plain), 6.45 KB, created by
Nick Clemens (kidclamp)
on 2024-10-31 11:34:38 UTC
(
hide
)
Description:
Bug 37576: (QA follow-up) Tidy
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-10-31 11:34:38 UTC
Size:
6.45 KB
patch
obsolete
>From 73bc6d8b4f5adc9a11efc868e383c823d937e8c8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 31 Oct 2024 11:29:31 +0000 >Subject: [PATCH] Bug 37576: (QA follow-up) Tidy > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/REST/V1/ERM/Agreements.pm | 26 ++++++++++--------- > .../js/vue/components/ERM/AgreementsList.vue | 6 +++-- > .../integration/AdditionalFields_spec.ts | 7 ++--- > 3 files changed, 22 insertions(+), 17 deletions(-) > >diff --git a/Koha/REST/V1/ERM/Agreements.pm b/Koha/REST/V1/ERM/Agreements.pm >index 2ba2e0fedea..5a82b102f4a 100644 >--- a/Koha/REST/V1/ERM/Agreements.pm >+++ b/Koha/REST/V1/ERM/Agreements.pm >@@ -92,12 +92,12 @@ sub add { > > my $body = $c->req->json; > >- my $periods = delete $body->{periods} // []; >- my $user_roles = delete $body->{user_roles} // []; >- my $agreement_licenses = delete $body->{agreement_licenses} // []; >+ my $periods = delete $body->{periods} // []; >+ my $user_roles = delete $body->{user_roles} // []; >+ my $agreement_licenses = delete $body->{agreement_licenses} // []; > my $agreement_relationships = delete $body->{agreement_relationships} // []; >- my $documents = delete $body->{documents} // []; >- my $extended_attributes = delete $body->{extended_attributes} // []; >+ my $documents = delete $body->{documents} // []; >+ my $extended_attributes = delete $body->{extended_attributes} // []; > > my $agreement = Koha::ERM::Agreement->new_from_api($body)->store; > $agreement->periods($periods); >@@ -106,7 +106,8 @@ sub add { > $agreement->agreement_relationships($agreement_relationships); > $agreement->documents($documents); > >- my @extended_attributes = map { {'id' => $_->{field_id}, 'value' => $_->{value}} } @{$extended_attributes}; >+ my @extended_attributes = >+ map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes}; > $agreement->extended_attributes( \@extended_attributes ); > > $c->res->headers->location($c->req->url->to_string . '/' . $agreement->agreement_id); >@@ -180,12 +181,12 @@ sub update { > > my $body = $c->req->json; > >- my $periods = delete $body->{periods} // []; >- my $user_roles = delete $body->{user_roles} // []; >- my $agreement_licenses = delete $body->{agreement_licenses} // []; >+ my $periods = delete $body->{periods} // []; >+ my $user_roles = delete $body->{user_roles} // []; >+ my $agreement_licenses = delete $body->{agreement_licenses} // []; > my $agreement_relationships = delete $body->{agreement_relationships} // []; >- my $documents = delete $body->{documents} // []; >- my $extended_attributes = delete $body->{extended_attributes} // []; >+ my $documents = delete $body->{documents} // []; >+ my $extended_attributes = delete $body->{extended_attributes} // []; > > $agreement->set_from_api($body)->store; > $agreement->periods($periods); >@@ -194,7 +195,8 @@ sub update { > $agreement->agreement_relationships($agreement_relationships); > $agreement->documents($documents); > >- my @extended_attributes = map { {'id' => $_->{field_id}, 'value' => $_->{value}} } @{$extended_attributes}; >+ my @extended_attributes = >+ map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes}; > $agreement->extended_attributes( \@extended_attributes ); > > $c->res->headers->location($c->req->url->to_string . '/' . $agreement->agreement_id); >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 2f1fe6a7fb6..e57b7a00b9c 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 >@@ -115,7 +115,9 @@ export default { > searchable_av_options: [], > tableOptions: { > columns: this.getTableColumns(), >- options: { embed: "user_roles,vendor,extended_attributes,+strings" }, >+ options: { >+ embed: "user_roles,vendor,extended_attributes,+strings", >+ }, > url: () => this.table_url(), > table_settings: this.agreement_table_settings, > add_filters: true, >@@ -186,7 +188,7 @@ export default { > error => {} > ) > }, >- async getSearchableAdditionalFields() { >+ async getSearchableAdditionalFields() { > const client = APIClient.additional_fields > await client.additional_fields.getAll("agreement").then( > searchable_additional_fields => { >diff --git a/t/cypress/integration/AdditionalFields_spec.ts b/t/cypress/integration/AdditionalFields_spec.ts >index babea8a31a5..132680fe689 100644 >--- a/t/cypress/integration/AdditionalFields_spec.ts >+++ b/t/cypress/integration/AdditionalFields_spec.ts >@@ -113,7 +113,7 @@ function get_no_additional_fields_agreement() { > ], > extended_attributes: [], > _strings: { >- "additional_field_values": [] >+ additional_field_values: [], > }, > }; > } >@@ -1055,7 +1055,9 @@ describe("Additional Fields operations", () => { > ).as("avcategories"); > > cy.visit("/cgi-bin/koha/erm/agreements"); >- cy.get("#agreements_list table tbody tr:first").contains("Edit").click(); >+ cy.get("#agreements_list table tbody tr:first") >+ .contains("Edit") >+ .click(); > cy.wait("@get-agreement"); > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > >@@ -1122,5 +1124,4 @@ describe("Additional Fields operations", () => { > "#agreements_add form #additional_fields label[for='additional_field_3']" > ).should("have.length", 2); > }); >- > }); >-- >2.39.5
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 37576
:
171181
|
171268
|
171379
|
171397
|
173774
|
173775
| 173776 |
174530
|
174531
|
174532