Bug 38020 - Fix 'delete list' button to have same formatting as 'edit list'
Summary: Fix 'delete list' button to have same formatting as 'edit list'
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Yanjun Li
QA Contact: Aleisha Amohia
URL:
Keywords: Academy
Depends on: 36246
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-26 19:13 UTC by Aleisha Amohia
Modified: 2024-10-31 10:04 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the items in the 'Edit' menu for lists in the staff interface so that the options (Edit list, Delete list) are correctly left aligned. Previously, 'Delete list' was indented.
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 38020: Change form to submit link (3.12 KB, patch)
2024-10-24 20:57 UTC, Yanjun Li
Details | Diff | Splinter Review
Bug 38020: Change form to submit link (2.88 KB, patch)
2024-10-25 04:48 UTC, David Nind
Details | Diff | Splinter Review
Bug 38020: Change form to submit link (2.88 KB, patch)
2024-10-30 16:29 UTC, Yanjun Li
Details | Diff | Splinter Review
Bug 38020: (follow-up) Remove unused delete confirmation code (1.07 KB, patch)
2024-10-30 16:29 UTC, Yanjun Li
Details | Diff | Splinter Review
Bug 38020: Change form to submit link (2.94 KB, patch)
2024-10-31 05:02 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 38020: (follow-up) Remove unused delete confirmation code (1.13 KB, patch)
2024-10-31 05:02 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 38020: (QA follow-up) Decapitilise 'list' (1.63 KB, patch)
2024-10-31 05:02 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2024-09-26 19:13:10 UTC
In the staff interface, the edit and delete list buttons in the 'edit' dropdown look different.

To recreate:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
Comment 1 Yanjun Li 2024-10-24 20:57:26 UTC
Created attachment 173307 [details] [review]
Bug 38020: Change form to submit link

To test:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
6. Apply patch
7. Try steps 1 through 4 again
8. The delete list button form looks right, and delete function works
Comment 2 David Nind 2024-10-25 04:48:53 UTC
Created attachment 173311 [details] [review]
Bug 38020: Change form to submit link

To test:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
6. Apply patch
7. Try steps 1 through 4 again
8. The delete list button form looks right, and delete function works

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Owen Leonard 2024-10-25 13:44:08 UTC
FYI for anyone trying to solve similar problems:

A control in a dropdown menu that looks like this:

<button type="submit" class="btn btn-default delete-list">Delete list</button>

...will look wrong because of the "btn btn-default" class. If you change it to "dropdown-item" it looks fine without making other markup changes.

<button type="submit" class="dropdown-item delete-list">Delete list</button>

There's no guideline saying one is better than the other so it makes no difference for this patch.
Comment 4 Pedro Amorim 2024-10-29 15:08:39 UTC
I don't think this is PQA ready but don't think the reasons below are enough to FQA either, so I'm only leaving comments here in case they make sense:

1) The following code:

  $(".delete-list").click(function(e){
    return confirm(_("Are you sure you want to delete this list?"));
  });

in virtualshelves/shelves.tt is no longer used after this patch, because the confirmation message is now part of the anchor link. If this is true, it should be removed.


2) Not related to this patch directly, but related to the previous point, virtualshelves/tables/shelves_results.tt has 'class="delete-list' for the delete button on the list view, but the JS code in 1) is only used on the 'view' op, not the 'list' op, thus deleting a list from the detail page has a confirmation dialog, but deleting a list from the list view does not have a confirmation dialog.
Comment 5 Katrin Fischer 2024-10-30 06:06:43 UTC
Don't be scared to set Failed QA for questions and clarification - it's not a bad thing and the status change helps to get attention as it will show on the personal dashboard for example, while an email is easy to miss. We need to make that less scary maybe :)
Comment 6 Pedro Amorim 2024-10-30 09:10:53 UTC
(In reply to Katrin Fischer from comment #5)
> Don't be scared to set Failed QA for questions and clarification - it's not
> a bad thing and the status change helps to get attention as it will show on
> the personal dashboard for example, while an email is easy to miss. We need
> to make that less scary maybe :)

Agreed. Thanks!
Comment 7 Yanjun Li 2024-10-30 16:29:30 UTC
Created attachment 173724 [details] [review]
Bug 38020: Change form to submit link

To test:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
6. Apply patch
7. Try steps 1 through 4 again
8. The delete list button form looks right, and delete function works

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Yanjun Li 2024-10-30 16:29:32 UTC
Created attachment 173725 [details] [review]
Bug 38020: (follow-up) Remove unused delete confirmation code

This follow-up patch removes the unused delete list confirmation dialog in virtualshelves/shelves.tt
Comment 9 Yanjun Li 2024-10-30 16:38:40 UTC
(In reply to Pedro Amorim from comment #4)
> 
> 1) The following code:
> 
>   $(".delete-list").click(function(e){
>     return confirm(_("Are you sure you want to delete this list?"));
>   });
> 
> in virtualshelves/shelves.tt is no longer used after this patch, because the
> confirmation message is now part of the anchor link. If this is true, it
> should be removed.
> 
> 
> 2) Not related to this patch directly, but related to the previous point,
> virtualshelves/tables/shelves_results.tt has 'class="delete-list' for the
> delete button on the list view, but the JS code in 1) is only used on the
> 'view' op, not the 'list' op, thus deleting a list from the detail page has
> a confirmation dialog, but deleting a list from the list view does not have
> a confirmation dialog.

Thank you for your comment! 
I added a follow-up for 1) also opened a ticket for 2) Bug 38302
Comment 10 Aleisha Amohia 2024-10-31 05:02:32 UTC
Created attachment 173747 [details] [review]
Bug 38020: Change form to submit link

To test:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
6. Apply patch
7. Try steps 1 through 4 again
8. The delete list button form looks right, and delete function works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 11 Aleisha Amohia 2024-10-31 05:02:35 UTC
Created attachment 173748 [details] [review]
Bug 38020: (follow-up) Remove unused delete confirmation code

This follow-up patch removes the unused delete list confirmation dialog in virtualshelves/shelves.tt

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 12 Aleisha Amohia 2024-10-31 05:02:38 UTC
Created attachment 173749 [details] [review]
Bug 38020: (QA follow-up) Decapitilise 'list'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 13 Katrin Fischer 2024-10-31 10:04:04 UTC
Pushed for 24.11!

Well done everyone, thank you!