]> git.koha-community.org Git - koha.git/commit
Bug 37576: Add additional fields for ERM agreements
authorJake Deery <jake.deery@ptfs-europe.com>
Wed, 4 Sep 2024 14:52:58 +0000 (14:52 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 8 Nov 2024 15:09:17 +0000 (16:09 +0100)
commitf348afbae882f989f341c32c4b3a8ae2bd406156
tree92cd59a2c5b1de670eeffa0b4dd8b6356d0fbaa3
parentaf6b0510d7f00fae32f001afb2aaccd9064a9092
Bug 37576: Add additional fields for ERM agreements

This bug adds support for additional fields in the ERM module's
agreements, similar to how Bug 35287 added support for additional fields
in the ERM module's licences.

To test (k.t.d):
a)  APPLY PATCH
b)  Run cypress --spec t/cypress/integration/AdditionalFields_spec.ts
    1)  Note how the tests pass
c)  Add new additional fields for 'erm_agreements'
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_agreements
    2)  Create field one called 'text non-repeatable'
    3)  Create field two called 'text repeatable', check 'repeatable'
    4)  Create field three called 'av non-repeatable', pick LANG authorised
        value
    5)  Create field four called 'av repeatable', pick LOC authorised value,
        check repeatable
d)  Create new agreement
    1)  Go to /cgi-bin/koha/erm/agreements/add, notice the new additional
        fields section
    2)  Complete all mandatory fields for a new licence
    3)  Experiment with the four different additional field types – it
        may be useful to watch the Cypress-generated test video for
        guidance
    4)  Select some AV options from the AV fields, deselect them, notice
        the repeatable one allows for multiple selection, the non-repeatable
        one does not
e)  Save the agreement, then view it
    1)  To view the licence, click its name in the table list on
        /cgi-bin/koha/erm/agreements
    2)  notice the additional fields on display
    3)  also notice that the authorised values are in their human-readable
        form, and not their coded form
f)  Edit the agreement, then view it again
    1)  Go to /cgi-bin/koha/erm/agreements/edit/1
    2)  Play around again with the fields. Save.
    3)  Repeat step e, have the edits shown up?
g)  Test searchability
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_agreements
    2)  Edit one of the fields and make sure searchable is checked (ensure
        you choose a field that has some data in it)
    3)  Go to /cgi-bin/koha/erm/agreements
    4)  Notice that the searchable field(s) are now columns in the table
    5)  Notice that searchable AV fields contain a drop-down
    6)  Notice that searchable text fields have an input field
    7)  Perform a search on the additional field
    8)  Notice that the searching is working as expected
h) SIGN OFF

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
15 files changed:
Koha/AdditionalField.pm
Koha/ERM/Agreement.pm
Koha/ERM/Agreements.pm
Koha/REST/V1/ERM/Agreements.pm
Koha/REST/V1/ExtendedAttributeTypes.pm
Koha/Schema/Result/ErmAgreement.pm
api/v1/swagger/definitions/erm_agreement.yaml
api/v1/swagger/paths/erm_agreements.yaml
api/v1/swagger/paths/extended_attribute_types.yaml
koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue
koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js
t/cypress/integration/AdditionalFields_spec.ts