Description
Owen Leonard
2022-02-01 17:09:27 UTC
Created attachment 130053 [details] [review] Bug 29999: Replace the use of jQueryUI tabs on authorized values administration page This patch updates the authorized values edit interface so that it uses Bootstrap tabs instead of jQueryUI tabs for displaying icon sets. Normally Bootstrap tabs don't have to be initiated via JavaScript, but this page requires some JS to select the first tab as active if no other tabs are active. Because of the way the template works it's not simple to do it via template logic, so in this case some JS helps. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> Authorized values in the staff interface. - Select a category and then add or edit an authorized value in that category. - On the edit page you should see tabs under "Choose an icon." - Confirm that the tabs look correct and work correctly. - If you did not previously have any icon selected, the "None" tab should be active. - If you had an icon selected, that icon set's tab should be active. - Confirm that changing icons works correctly and that the selected icon's tab is always active when you return to the edit page. Created attachment 130055 [details] [review] Bug 29999: Replace the use of jQueryUI tabs on authorized values administration page This patch updates the authorized values edit interface so that it uses Bootstrap tabs instead of jQueryUI tabs for displaying icon sets. Normally Bootstrap tabs don't have to be initiated via JavaScript, but this page requires some JS to select the first tab as active if no other tabs are active. Because of the way the template works it's not simple to do it via template logic, so in this case some JS helps. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> Authorized values in the staff interface. - Select a category and then add or edit an authorized value in that category. - On the edit page you should see tabs under "Choose an icon." - Confirm that the tabs look correct and work correctly. - If you did not previously have any icon selected, the "None" tab should be active. - If you had an icon selected, that icon set's tab should be active. - Confirm that changing icons works correctly and that the selected icon's tab is always active when you return to the edit page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Note: To get this to look right it was necessary for me clear my cache after running 'yarn build'. Once I did it looks and feels exactly the same as when using jQueryUI tabs. CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt Created attachment 131068 [details] [review] Bug 29999: Replace the use of jQueryUI tabs on authorized values administration page This patch updates the authorized values edit interface so that it uses Bootstrap tabs instead of jQueryUI tabs for displaying icon sets. Normally Bootstrap tabs don't have to be initiated via JavaScript, but this page requires some JS to select the first tab as active if no other tabs are active. Because of the way the template works it's not simple to do it via template logic, so in this case some JS helps. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> Authorized values in the staff interface. - Select a category and then add or edit an authorized value in that category. - On the edit page you should see tabs under "Choose an icon." - Confirm that the tabs look correct and work correctly. - If you did not previously have any icon selected, the "None" tab should be active. - If you had an icon selected, that icon set's tab should be active. - Confirm that changing icons works correctly and that the selected icon's tab is always active when you return to the edit page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 131849 [details] [review] Bug 29999: (follow-up) Show the remote image tab if selected This follow-up corrects the markup so that if a value is entered in the "Remote image" field, the correct tab will be selected upon page load. The patch also corrrects the input name on the "No image" field so that the option works correctly. To test, apply the patch and edit an authorized value. - Select an icon from an icon set. Save, and then re-edit. - The correct icon set tab should be activated. - Select "No image," save, and re-edit. - The "No image" tab should be selected. - On the "Remote image" tab, enter a remote image url, e.g. https://via.placeholder.com/50/FF0000/FFFFFF.png. Save and re-edit. - The "Remote image" should be selected. Created attachment 131851 [details] [review] Bug 29999: Replace the use of jQueryUI tabs on authorized values administration page This patch updates the authorized values edit interface so that it uses Bootstrap tabs instead of jQueryUI tabs for displaying icon sets. Normally Bootstrap tabs don't have to be initiated via JavaScript, but this page requires some JS to select the first tab as active if no other tabs are active. Because of the way the template works it's not simple to do it via template logic, so in this case some JS helps. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> Authorized values in the staff interface. - Select a category and then add or edit an authorized value in that category. - On the edit page you should see tabs under "Choose an icon." - Confirm that the tabs look correct and work correctly. - If you did not previously have any icon selected, the "None" tab should be active. - If you had an icon selected, that icon set's tab should be active. - Confirm that changing icons works correctly and that the selected icon's tab is always active when you return to the edit page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Created attachment 131852 [details] [review] Bug 29999: (follow-up) Show the remote image tab if selected This follow-up corrects the markup so that if a value is entered in the "Remote image" field, the correct tab will be selected upon page load. The patch also corrrects the input name on the "No image" field so that the option works correctly. To test, apply the patch and edit an authorized value. - Select an icon from an icon set. Save, and then re-edit. - The correct icon set tab should be activated. - Select "No image," save, and re-edit. - The "No image" tab should be selected. - On the "Remote image" tab, enter a remote image url, e.g. https://via.placeholder.com/50/FF0000/FFFFFF.png. Save and re-edit. - The "Remote image" should be selected. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> "No image" is not selected when imageurl is null, but it's not a regression. Created attachment 131979 [details] [review] Bug 29999: Replace the use of jQueryUI tabs on authorized values administration page This patch updates the authorized values edit interface so that it uses Bootstrap tabs instead of jQueryUI tabs for displaying icon sets. Normally Bootstrap tabs don't have to be initiated via JavaScript, but this page requires some JS to select the first tab as active if no other tabs are active. Because of the way the template works it's not simple to do it via template logic, so in this case some JS helps. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> Authorized values in the staff interface. - Select a category and then add or edit an authorized value in that category. - On the edit page you should see tabs under "Choose an icon." - Confirm that the tabs look correct and work correctly. - If you did not previously have any icon selected, the "None" tab should be active. - If you had an icon selected, that icon set's tab should be active. - Confirm that changing icons works correctly and that the selected icon's tab is always active when you return to the edit page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 131980 [details] [review] Bug 29999: (follow-up) Show the remote image tab if selected This follow-up corrects the markup so that if a value is entered in the "Remote image" field, the correct tab will be selected upon page load. The patch also corrrects the input name on the "No image" field so that the option works correctly. To test, apply the patch and edit an authorized value. - Select an icon from an icon set. Save, and then re-edit. - The correct icon set tab should be activated. - Select "No image," save, and re-edit. - The "No image" tab should be selected. - On the "Remote image" tab, enter a remote image url, e.g. https://via.placeholder.com/50/FF0000/FFFFFF.png. Save and re-edit. - The "Remote image" should be selected. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 22.05, thanks to everybody involved [U+1F984] |