From a87d525ffb6c3298289996a05d001399f55a346d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 31 Oct 2024 11:29:31 +0000 Subject: [PATCH] Bug 37576: (QA follow-up) Tidy Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- 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 2ba2e0fede..5a82b102f4 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 2f1fe6a7fb..e57b7a00b9 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 babea8a31a..132680fe68 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