Description
Jonathan Druart
2024-03-22 09:13:52 UTC
Created attachment 163685 [details] [review] Bug 36396: DB changes Add the new DB column search_field.authorised_value_category Sponsored-by: The Research University in the Helmholtz Association (KIT) Created attachment 163686 [details] [review] Bug 36396: DBIC schema changes Sponsored-by: The Research University in the Helmholtz Association (KIT) Created attachment 163687 [details] [review] Bug 36396: Link facet with authorised value category - ES This new feature adds the ability to link an ES facet to an authorised value category, in order to display a description instead of the code. Test plan: 1. Go to the ES mapping admin page 2. Notice the new "Authorized value category" column in the facets config table 3. Create a new facet that is linked to a search field containing values from an authorised value category. Pick this category in the list 4. Save 5. Reindex 6. Notice that the descriptions are now displayed (staff and OPAC) in the search result page. QA: See the related bug report for possible improvements. It's not easy at all to deal with the "specials" here, a lot of changes must be done in how we fetch/cache the AVs. Sponsored-by: The Research University in the Helmholtz Association (KIT) Created attachment 163688 [details] [review] Bug 36396: Prevent link to av for 'specials' See previous commit message, 'QA' part. We do not support the "specials" categories. Sponsored-by: The Research University in the Helmholtz Association (KIT) Created attachment 163689 [details] [review] Bug 36396: UI - OPAC Sponsored-by: The Research University in the Helmholtz Association (KIT) Created attachment 163690 [details] [review] Bug 36396: Export/import the yaml config Test plan: Export the ES fields/mappings using misc/search_tools/export_elasticsearch_mappings.pl > mappings.yaml Copy this file to admin/searchengine/elasticsearch/mappings.yaml Reset the mapping from the UI Notice that the links to the AV categories have been preserved Sponsored-by: The Research University in the Helmholtz Association (KIT) Thanks Jonathan! Just a very small thing: When adding a new line to the facets config table 'Facet order' it is not possible to leave the authorised value category empty. You first have to add the line and save, afterwards you can change the authorised value category to be empty. Created attachment 163705 [details] [review] Bug 36396: (follow-up) Prevent link to av for 'specials' (In reply to Michaela Sieber from comment #7) > Thanks Jonathan! > > Just a very small thing: > When adding a new line to the facets config table 'Facet order' it is not > possible to leave the authorised value category empty. You first have to add > the line and save, afterwards you can change the authorised value category > to be empty. Indeed, thanks! Should be fixed now. Created attachment 163776 [details] [review] Bug 36396: DB changes Add the new DB column search_field.authorised_value_category Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Created attachment 163777 [details] [review] Bug 36396: DBIC schema changes Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Created attachment 163778 [details] [review] Bug 36396: Link facet with authorised value category - ES This new feature adds the ability to link an ES facet to an authorised value category, in order to display a description instead of the code. Test plan: 1. Go to the ES mapping admin page 2. Notice the new "Authorized value category" column in the facets config table 3. Create a new facet that is linked to a search field containing values from an authorised value category. Pick this category in the list 4. Save 5. Reindex 6. Notice that the descriptions are now displayed (staff and OPAC) in the search result page. QA: See the related bug report for possible improvements. It's not easy at all to deal with the "specials" here, a lot of changes must be done in how we fetch/cache the AVs. Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Created attachment 163779 [details] [review] Bug 36396: Prevent link to av for 'specials' See previous commit message, 'QA' part. We do not support the "specials" categories. Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Created attachment 163780 [details] [review] Bug 36396: UI - OPAC Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Created attachment 163781 [details] [review] Bug 36396: Export/import the yaml config Test plan: Export the ES fields/mappings using misc/search_tools/export_elasticsearch_mappings.pl > mappings.yaml Copy this file to admin/searchengine/elasticsearch/mappings.yaml Reset the mapping from the UI Notice that the links to the AV categories have been preserved Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Created attachment 163782 [details] [review] Bug 36396: (follow-up) Prevent link to av for 'specials' Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> With bug 35138 being pushed today, this would make a lot of sense to "round off" the feature for this release. Created attachment 166246 [details] [review] Bug 36396: DB changes Add the new DB column search_field.authorised_value_category Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 166247 [details] [review] Bug 36396: DBIC schema changes Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 166248 [details] [review] Bug 36396: Link facet with authorised value category - ES This new feature adds the ability to link an ES facet to an authorised value category, in order to display a description instead of the code. Test plan: 1. Go to the ES mapping admin page 2. Notice the new "Authorized value category" column in the facets config table 3. Create a new facet that is linked to a search field containing values from an authorised value category. Pick this category in the list 4. Save 5. Reindex 6. Notice that the descriptions are now displayed (staff and OPAC) in the search result page. QA: See the related bug report for possible improvements. It's not easy at all to deal with the "specials" here, a lot of changes must be done in how we fetch/cache the AVs. Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 166249 [details] [review] Bug 36396: Prevent link to av for 'specials' See previous commit message, 'QA' part. We do not support the "specials" categories. Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 166250 [details] [review] Bug 36396: UI - OPAC Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 166251 [details] [review] Bug 36396: Export/import the yaml config Test plan: Export the ES fields/mappings using misc/search_tools/export_elasticsearch_mappings.pl > mappings.yaml Copy this file to admin/searchengine/elasticsearch/mappings.yaml Reset the mapping from the UI Notice that the links to the AV categories have been preserved Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 166252 [details] [review] Bug 36396: (follow-up) Prevent link to av for 'specials' Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> This looks pretty good and works.. but we're missing unit tests for the additional functionality introduced into the Koha:: modules. Created attachment 166254 [details] [review] Bug 36396: Add tests Created attachment 166258 [details] [review] Bug 36396: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Nice one Jonathan, Passing QA Pushed for 24.05! Well done everyone, thank you! Depends on Bug 35138 not in 23.11.x |