Bug 34945

Summary: Remove the use of event attributes from OPAC clubs tab
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: minor    
Priority: P5 - low CC: dcook, fridolin.somers, testopia, victor
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.05,22.11.11
Circulation function:
Bug Depends on:    
Bug Blocks: 34709    
Attachments: Bug 34945: Remove the use of event attributes from OPAC clubs tab
Bug 34945: Remove the use of event attributes from OPAC clubs tab
Bug 34945: Remove the use of event attributes from OPAC clubs tab
Bug 34945: Remove the use of event attributes from OPAC clubs tab
Bug 34945: Remove the use of event attributes from OPAC clubs tab

Description Owen Leonard 2023-09-28 11:43:20 UTC
There are some event attributes in the OPAC's clubs tab, shown on the user summary page. These should be removed in favor of defining events in JavaScript.
Comment 1 Owen Leonard 2023-09-28 11:56:54 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2023-09-28 12:11:04 UTC
Created attachment 156325 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.
Comment 3 Victor Grousset/tuxayo 2023-09-29 16:25:49 UTC
"Cancel enrollment" button doesn't work with width < 620 px.

Because the button is hidden and another one is created bellow. Which lacks the event handler.
Comment 4 Owen Leonard 2023-10-02 15:10:44 UTC
Created attachment 156456 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.
Comment 5 Victor Grousset/tuxayo 2023-10-02 18:29:41 UTC
Created attachment 156460 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2023-10-02 18:30:03 UTC
Thanks, it works :D
Comment 7 Katrin Fischer 2023-10-03 11:03:59 UTC
Created attachment 156494 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi (tcohen) 2023-10-04 13:45:01 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 9 Fridolin Somers 2023-10-05 20:29:14 UTC
Pushed to 23.05.x for 23.05.05
Comment 10 Matt Blenkinsop 2023-10-17 17:24:48 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x