Bug 27607

Summary: Add the ability to compare patron records during merge process
Product: Koha Reporter: Owen Leonard <oleonard>
Component: PatronsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: barbara.johnson, caroline.cyr-la-rose, fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall
Version: MainKeywords: Manual-updated
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
When merging two patron records, the user now has the option to compare the two records to see the differences between them.
Version(s) released in:
21.05.00
Circulation function:
Attachments: Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code
Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code
Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code
Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code
Bug 27607: Add the ability to compare patron records during merge process
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code

Description Owen Leonard 2021-02-03 16:32:53 UTC
We can use the jsdiff library to compare a subset of patron fields during the patron merge process.
Comment 1 Owen Leonard 2021-02-03 16:47:18 UTC Comment hidden (obsolete)
Comment 2 PTFS Europe Sandboxes 2021-02-09 00:27:50 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2021-02-15 21:14:09 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2021-02-15 21:14:13 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2021-02-15 21:15:07 UTC
I really like this new use case for the diff view :)

I am not sure if people would like to see more patron fields included, like the the other addresses, but think we could wait and see in this case.
Comment 6 Jonathan Druart 2021-02-16 10:57:32 UTC
I don't think this is correct. You must take into account the "Select patron to keep" information. Here we assume that the first one will always be replaced by the second one.
Comment 7 Owen Leonard 2021-02-19 18:13:51 UTC
Created attachment 117090 [details] [review]
Bug 27607: Add the ability to compare patron records during merge process

This patch adds an option to compare two patron records during the
patron merge process. It can't work with more than two patrons, so the
option only appears if one has selected only two patrons to merge.

This patch also adds links to the patron names for opening the patron
record in a new tab.

To test, apply the patch and perform a search for patrons in the staff
client Patrons module.

 - Select two patrons in the list of search results and click "Merge
   selected patrons."
 - On the merge patron records page, confirm that the two patron names
   are links which, when clicked, open the patron details in another
   tab.
 - Click a radio button to select the patron whose record will be
   the basis of the merge. The "Compare patrons" button and "Merge
   patrons" should go from disabled to enabled.
 - Click the "Compare patrons" button. A modal window should display
   highlighting the differences in some selected values in the patron
   record. The patron you selected as the basis for the merge should
   appear on the left.
 - Close the modal and select the other patron as the basis of the
   merge. "Compare patrons" again. The other patron should now appear in
   the left pane of the comparison.
 - Repeat the same process above but select more than two patrons for
   merging. The "Compare patrons" button should not appear.
Comment 8 Owen Leonard 2021-02-19 18:13:54 UTC
Created attachment 117091 [details] [review]
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code
Comment 9 Barbara Johnson 2021-02-19 21:52:13 UTC
I re-tested this and found two issues.

In the address section Country is listed twice.  I think the first one should not be there.

Address line 1:
Address line 2:
City:
Country:
State:
ZIP/Postal code:
Country:

Everything worked fine in regards to comparing the patrons.  But when I tried to merge them the button did not work.

Also, I wonder if the modal that allows you to compare the two patrons should have a merge button on it so that you don't have to close it and then select the merge button from the main screen.  I believe when you merge two bib records there is a merge button on the comparison display.
Comment 10 Owen Leonard 2021-02-21 15:51:21 UTC
Created attachment 117124 [details] [review]
Bug 27607: Add the ability to compare patron records during merge process

This patch adds an option to compare two patron records during the
patron merge process. It can't work with more than two patrons, so the
option only appears if one has selected only two patrons to merge.

This patch also adds links to the patron names for opening the patron
record in a new tab.

To test, apply the patch and perform a search for patrons in the staff
client Patrons module.

 - Select two patrons in the list of search results and click "Merge
   selected patrons."
 - On the merge patron records page, confirm that the two patron names
   are links which, when clicked, open the patron details in another
   tab.
 - Click a radio button to select the patron whose record will be
   the basis of the merge. The "Compare patrons" button and "Merge
   patrons" should go from disabled to enabled.
 - Click the "Compare patrons" button. A modal window should display
   highlighting the differences in some selected values in the patron
   record. The patron you selected as the basis for the merge should
   appear on the left.
 - Close the modal and select the other patron as the basis of the
   merge. "Compare patrons" again. The other patron should now appear in
   the left pane of the comparison.
 - Test that the "Merge patrons" button in the modal window works
   correctly to submit the merge form and that the correct patron is
   used as the basis for merging.
 - Repeat the same process above but select more than two patrons for
   merging. The "Compare patrons" button should not appear.
Comment 11 Owen Leonard 2021-02-21 15:51:24 UTC
Created attachment 117125 [details] [review]
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code
Comment 12 Séverine Queune 2021-04-01 08:44:55 UTC
Created attachment 119064 [details] [review]
Bug 27607: Add the ability to compare patron records during merge process

This patch adds an option to compare two patron records during the
patron merge process. It can't work with more than two patrons, so the
option only appears if one has selected only two patrons to merge.

This patch also adds links to the patron names for opening the patron
record in a new tab.

To test, apply the patch and perform a search for patrons in the staff
client Patrons module.

 - Select two patrons in the list of search results and click "Merge
   selected patrons."
 - On the merge patron records page, confirm that the two patron names
   are links which, when clicked, open the patron details in another
   tab.
 - Click a radio button to select the patron whose record will be
   the basis of the merge. The "Compare patrons" button and "Merge
   patrons" should go from disabled to enabled.
 - Click the "Compare patrons" button. A modal window should display
   highlighting the differences in some selected values in the patron
   record. The patron you selected as the basis for the merge should
   appear on the left.
 - Close the modal and select the other patron as the basis of the
   merge. "Compare patrons" again. The other patron should now appear in
   the left pane of the comparison.
 - Test that the "Merge patrons" button in the modal window works
   correctly to submit the merge form and that the correct patron is
   used as the basis for merging.
 - Repeat the same process above but select more than two patrons for
   merging. The "Compare patrons" button should not appear.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 13 Séverine Queune 2021-04-01 08:44:58 UTC
Created attachment 119065 [details] [review]
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 14 Katrin Fischer 2021-04-03 13:14:51 UTC
Created attachment 119149 [details] [review]
Bug 27607: Add the ability to compare patron records during merge process

This patch adds an option to compare two patron records during the
patron merge process. It can't work with more than two patrons, so the
option only appears if one has selected only two patrons to merge.

This patch also adds links to the patron names for opening the patron
record in a new tab.

To test, apply the patch and perform a search for patrons in the staff
client Patrons module.

 - Select two patrons in the list of search results and click "Merge
   selected patrons."
 - On the merge patron records page, confirm that the two patron names
   are links which, when clicked, open the patron details in another
   tab.
 - Click a radio button to select the patron whose record will be
   the basis of the merge. The "Compare patrons" button and "Merge
   patrons" should go from disabled to enabled.
 - Click the "Compare patrons" button. A modal window should display
   highlighting the differences in some selected values in the patron
   record. The patron you selected as the basis for the merge should
   appear on the left.
 - Close the modal and select the other patron as the basis of the
   merge. "Compare patrons" again. The other patron should now appear in
   the left pane of the comparison.
 - Test that the "Merge patrons" button in the modal window works
   correctly to submit the merge form and that the correct patron is
   used as the basis for merging.
 - Repeat the same process above but select more than two patrons for
   merging. The "Compare patrons" button should not appear.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2021-04-03 13:14:55 UTC
Created attachment 119150 [details] [review]
Bug 27607: (QA follow-up) Make label match patron form: ZIP/Postal code

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Jonathan Druart 2021-04-06 13:57:40 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 17 Fridolin Somers 2021-04-15 11:20:09 UTC
Enhancement not pushed to 20.11.x