]> git.koha-community.org Git - koha.git/commit
Bug 37577: Add additional fields for ERM packages
authorJake Deery <jake.deery@ptfs-europe.com>
Thu, 31 Oct 2024 11:49:09 +0000 (11:49 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 8 Nov 2024 15:09:19 +0000 (16:09 +0100)
commit6ece1371236222532707485fc01031514a114106
treeb3fc4bc0ff0c8686449f8d2b4c80b8f7ad4ed07d
parenta87d525ffb6c3298289996a05d001399f55a346d
Bug 37577: Add additional fields for ERM packages

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

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_packages'
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_packages
    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 local package
    1)  Go to /cgi-bin/koha/erm/eholdings/local/packages/add, notice the new
        additional fields section
    2)  Complete all mandatory fields for a new package
    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 package, then view it
    1)  To view the package, click its name in the table list on
        /cgi-bin/koha/erm/eholdings/local/packages
    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 package, then view it again
    1)  Go to /cgi-bin/koha/erm/eholdings/local/packages/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_packages
    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/eholdings/local/packages
    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/EHoldings/Package.pm
Koha/ERM/EHoldings/Packages.pm
Koha/REST/V1/ERM/EHoldings/Packages/Local.pm
Koha/REST/V1/ExtendedAttributeTypes.pm
Koha/Schema/Result/ErmEholdingsPackage.pm
api/v1/swagger/definitions/erm_eholdings_package.yaml
api/v1/swagger/paths/erm_eholdings_packages.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/EHoldingsLocalPackagesFormAdd.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesShow.vue
koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js
t/cypress/integration/AdditionalFields_spec.ts