Bug 18743 - Filter suggestion lists correctly for IndependentBranches
Summary: Filter suggestion lists correctly for IndependentBranches
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Nick Clemens
URL:
Keywords:
: 10449 (view as bug list)
Depends on:
Blocks: 23594
  Show dependency treegraph
 
Reported: 2017-06-07 15:02 UTC by Séverine Queune
Modified: 2019-11-08 15:25 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.05


Attachments
bug 18743 - Partially working filter of suggestions by libraries (4.47 KB, patch)
2017-06-30 03:40 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18743 - Removed library filter in Acquisition suggestions when IndependentBranches enabled (11.04 KB, patch)
2017-07-01 03:50 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18743 - Removed library filter in Acquisition suggestions when IndependentBranches enabled (12.33 KB, patch)
2017-07-03 05:27 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account (1.96 KB, patch)
2017-10-19 18:06 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account (3.62 KB, patch)
2018-01-29 20:20 UTC, Maksim Sen
Details | Diff | Splinter Review
Bug 18743 - Removed library filter in Acquisition suggestions when IndependentBranches enabled (12.14 KB, patch)
2018-03-12 10:32 UTC, Nicolas Legrand
Details | Diff | Splinter Review
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account (2.79 KB, patch)
2018-03-12 13:02 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 18743: Fix suggestion listing when organized by library (4.25 KB, patch)
2019-10-16 15:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18743: Fix suggestion listing when organized by library (5.52 KB, patch)
2019-10-20 08:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18743: Correct number of pending suggestions (acq home page) (1001 bytes, patch)
2019-10-20 08:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18743: Fix suggestion listing when organized by library (5.65 KB, patch)
2019-10-22 08:50 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 18743: Correct number of pending suggestions (acq home page) (1.17 KB, patch)
2019-10-22 08:50 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 18743: Fix suggestion listing when organized by library (5.72 KB, patch)
2019-10-25 10:20 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18743: Correct number of pending suggestions (acq home page) (1.24 KB, patch)
2019-10-25 10:20 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18743: Fix suggestion listing when organized by library (5.76 KB, patch)
2019-10-25 10:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18743: Correct number of pending suggestions (acq home page) (1.28 KB, patch)
2019-10-25 10:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18743: Fix suggestion listing when organized by library (5.76 KB, patch)
2019-10-25 10:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18743: Correct number of pending suggestions (acq home page) (1.28 KB, patch)
2019-10-25 10:26 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Séverine Queune 2017-06-07 15:02:02 UTC
There should be an automatic filter on current site when working on the suggestion list ansd using the syspref IndependentBranches.
The filter in the last menu "Acquisition information" doesn't work, and the first option "Organize by" only sort them in the same tab.

It created a display bug when a librarian from the A library accepted/refused 2 suggestions for the B library and tried to change the site : these 2 suggestions now appear on the "OPAC Purchase suggestions" when there is no user logged.
Comment 1 Alex Buckley 2017-06-30 03:40:43 UTC Comment hidden (obsolete)
Comment 2 Alex Buckley 2017-06-30 21:20:32 UTC
Hi Severine 

I am working through making a patch for this bug report and just to clarify the issue I thought I would write this up:

When IndependentBranches is enabled then both the 'organise by', and 'Acquisition information' filters should not have a library option because only suggestions from the currently logged in library branch should be displayed. 

An additional bug I have found on the current master is:

When the IndependentBranches syspref is set to 'no' then only suggestions from the currently logged in branch are displayed.
For example if the staff member is logged into Fairfield branch then only suggestions submitted to Fairfield branch are displayed. 

This is incorrect because with IndependentBranches not enabled then the user should be able to see all suggestions from all library branches and this is when the 'Organise by' and 'Acquisition information' filters should have a library option.  

Whereas when IndependentBranches syspref is set to 'yes' then all suggestions from all library branches are displayed which is not correct. When IndependentBranches is set to true then only the suggestions from the currently logged in branch should be displayed. 

Regards 
Alex Buckley
Comment 3 Alex Buckley 2017-07-01 03:50:38 UTC Comment hidden (obsolete)
Comment 4 Alex Buckley 2017-07-03 05:27:01 UTC
Created attachment 64768 [details] [review]
Bug 18743 - Removed library filter in Acquisition suggestions when IndependentBranches enabled

Also ensured that when a superlibrarian is logged in then suggestions from
all branches are displayed with IndependentBranches being either on or off, as this
syspref does not affect what suggestions superlibrarians can see.

But when non-superlibrarian user with access to the acquisitions module
visits it when IndependentBranches is enabled then only suggestions of
the branch they are logged in with are displayed.

If non-superlibrarian users log in when IndependentBranches is not
enabled then suggestions from all branches are displayed.

Note: The library filter in the 'Organize by' area (which is displayed when multiple branches suggestions are displayed according to the aforementioned logic) successfully splits the suggestions into different tabs with the correct number of suggestions for each branch
displayed in each tab.

Test plan:
1. Relicate the bug described in description comment

2. Apply patch

3. Create 2 suggestions a library branch (which I will refer to in this
test plan as branch A)

4. Create 1 suggestion for a different branch (which I will refer to as
branch B)

5. Log into staff client as superlibrarian with either branch and ensure the
IndependentBranches syspref is set to 'yes'

6. Go to Acquisitions->Suggestions Management

7. Notice that suggestions from branch A and B are displayed

8. In the Organize by are click to filter by library and click go

9. Notice that one tab says <name of branch A> (2) whilst the other tab
says <name of branch B> (1) with each tab containing the relevant
suggestions to that branch

10. In the Acquisition information filter select branch A and then click
'Go' and notice that it successfully filters the results and shows 2
suggestions of branch A only

11. Now change the IndependentBranches syspref to 'no'

12. Repeat steps 6, 7, 8, 9, 10 noticing the same outcome in step 9 and
10

13. Log out and log back into staff client in branch A as a non-superlibrarian user
who has access to the Acquisitions module

14. Currently IndependentBranches is set to 'no' so go to
Acquisitions->Suggestions Management

15. Repeat steps 6, 7, 8, 9, 10 and notice the same outcome as step 9
and 10

16. Change IndependentBranches to 'yes'

17. Go to Acquisitions->Suggestions Management

18. Notice that only suggestions from branch A (the branch you are
logged in with) are displayed. This is because when IndependentBranches
is enabled non-superlibrarians do not need to see suggestions from other
branches

19. Also notice that there is no 'library' option in the 'Organized by'
area and there is no library filter in the acquisition information area. This is because only suggestions from the current branch are displayed and so organizing/filtering by library is redundant.

Sponsored-by: Catalyst IT
Comment 5 Katrin Fischer 2017-08-08 12:13:00 UTC
Hi Alex,

something seems not to be working quite right. What I have done:

1) Made 2 suggestions from the OPAC for Centerville and Fairfield. Centerville is my home library (turn on AllowPurchaseSuggestionBranchChoice)
2) Made 1 suggestion from the intranet for 'any' library
3) Checked that with independent branches off, I can see all 3 suggestions in "Pending"
4) Turned on IndependentBranches - no change in behaviour
5) Applied patch, restarted plack etc.
6) No matter how I 'organize by' I don't see any of the suggestions now, the page is always empty, no tabs shown.
Comment 6 David Bourgault 2017-10-19 18:06:39 UTC
Created attachment 68298 [details] [review]
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account

---
THIS IS AN ALTERNATE PATCH
I am submitting it here, because it covers less than Alex's patch, but does so in a simpler fashion.
APPLY ONLY THIS PATCH, OR THE OTHER, NOT BOTH.
---

Displays suggestions for all libraries when IndependantBranches is set to no, or user is Super librarian by adding a missing if statement.

TEST PLAN
[0] Apply patch
[1] Set IndependentBranches to 'Yes'.
[2] Create a suggestion with a user from branch A.
[3] As a superlibrarian, visit the suggestion page, you should see the suggestion.
[4] As staff from branch A, visit the sugg. page, you should see the suggestion.
[5] As staff from branch B, visit the sugg. pase, you should NOT see the suggestion.
[6] Set IndependentBranches to 'No'.
[7] Redo step 3-5. You should always see the suggestion.
[8] Sign-off.
[9] Have fun.
Comment 7 Katrin Fischer 2017-10-28 12:04:05 UTC
Hi David,

this does not seem to work really well yet. To test:
- Add a suggestion for A, B and any.
- Add a staff user with acq permissions from A.
- Activated independent branches.
- Verify that selecting the 'Any' option from the branches list you can still always see all suggestions.
Comment 8 Maksim Sen 2018-01-29 20:20:39 UTC
Created attachment 71030 [details] [review]
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account

---
THIS IS AN ALTERNATE PATCH
I am submitting it here, because it covers less than Alex's patch, but does so in a simpler fashion.
APPLY ONLY THIS PATCH, OR THE OTHER, NOT BOTH.
---

Displays suggestions for all libraries when IndependantBranches is set to no, or user is Super librarian by adding a missing if statement.

TEST PLAN
[0] Apply patch
[1] Set IndependentBranches to 'Yes'.
[2] Create a suggestion with a user from branch A.
[3] As a superlibrarian, visit the suggestion page, you should see the suggestion.
[4] As staff from branch A, visit the sugg. page, you should see the suggestion.
[5] As staff from branch B, visit the sugg. pase, you should NOT see the suggestion.
[6] As staff from branch A, make sure the amount of suggestions to the left of "Suggestions pending approval: "
        is the same as the amount of suggestions in the suggestions page.
[7] Set IndependentBranches to 'No'.
[8] Redo step 3-5. You should always see the suggestion.
[9] Sign-off.
[10] Have fun.
Comment 9 Nicolas Legrand 2018-03-12 10:32:14 UTC
Created attachment 72637 [details] [review]
Bug 18743 - Removed library filter in Acquisition suggestions when IndependentBranches enabled

Also ensured that when a superlibrarian is logged in then suggestions from
all branches are displayed with IndependentBranches being either on or off, as this
syspref does not affect what suggestions superlibrarians can see.

But when non-superlibrarian user with access to the acquisitions module
visits it when IndependentBranches is enabled then only suggestions of
the branch they are logged in with are displayed.

If non-superlibrarian users log in when IndependentBranches is not
enabled then suggestions from all branches are displayed.

Note: The library filter in the 'Organize by' area (which is displayed when multiple branches suggestions are displayed according to the aforementioned logic) successfully splits the suggestions into different tabs with the correct number of suggestions for each branch
displayed in each tab.

Test plan:
1. Relicate the bug described in description comment

2. Apply patch

3. Create 2 suggestions a library branch (which I will refer to in this
test plan as branch A)

4. Create 1 suggestion for a different branch (which I will refer to as
branch B)

5. Log into staff client as superlibrarian with either branch and ensure the
IndependentBranches syspref is set to 'yes'

6. Go to Acquisitions->Suggestions Management

7. Notice that suggestions from branch A and B are displayed

8. In the Organize by are click to filter by library and click go

9. Notice that one tab says <name of branch A> (2) whilst the other tab
says <name of branch B> (1) with each tab containing the relevant
suggestions to that branch

10. In the Acquisition information filter select branch A and then click
'Go' and notice that it successfully filters the results and shows 2
suggestions of branch A only

11. Now change the IndependentBranches syspref to 'no'

12. Repeat steps 6, 7, 8, 9, 10 noticing the same outcome in step 9 and
10

13. Log out and log back into staff client in branch A as a non-superlibrarian user
who has access to the Acquisitions module

14. Currently IndependentBranches is set to 'no' so go to
Acquisitions->Suggestions Management

15. Repeat steps 6, 7, 8, 9, 10 and notice the same outcome as step 9
and 10

16. Change IndependentBranches to 'yes'

17. Go to Acquisitions->Suggestions Management

18. Notice that only suggestions from branch A (the branch you are
logged in with) are displayed. This is because when IndependentBranches
is enabled non-superlibrarians do not need to see suggestions from other
branches

19. Also notice that there is no 'library' option in the 'Organized by'
area and there is no library filter in the acquisition information area. This is because only suggestions from the current branch are displayed and so organizing/filtering by library is redundant.

Sponsored-by: Catalyst IT
Comment 10 Nicolas Legrand 2018-03-12 10:33:03 UTC
just rebased the first one master.
Comment 11 Séverine Queune 2018-03-12 13:02:57 UTC
Created attachment 72679 [details] [review]
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 12 Séverine Queune 2018-03-12 13:05:55 UTC
The first patch didn't apply as expected : no suggestion was visible.
The alternative patch filters correctly suggestions on branches when logged as non-superlibrarian ; all sugegstions can be seen by a superlibrairian.
Comment 13 Séverine Queune 2018-03-15 11:37:12 UTC
Linked to Bug 10449, Frido is working on it.
Comment 14 Fridolin SOMERS 2018-03-15 11:40:20 UTC
*** Bug 10449 has been marked as a duplicate of this bug. ***
Comment 15 Fridolin SOMERS 2018-03-16 15:45:49 UTC
I think we must redefine the behavior we want before proposing patches.

I propose a general postulate n°1 :
"A suggestion without branch is considered like a suggestion of the current user branch."

This makes this case more easy for filtering and counting. We say that branch is not defined yet and you may set your branch (even if independant branches and no-superlibarian).

I have listed the current behavior and we will discuss what behavior is wanted.
Comment 16 Katrin Fischer 2018-03-30 14:14:32 UTC
(In reply to Fridolin SOMERS from comment #15)
> I think we must redefine the behavior we want before proposing patches.
> 
> I propose a general postulate n°1 :
> "A suggestion without branch is considered like a suggestion of the current
> user branch."
+1
Comment 17 Séverine Queune 2019-09-11 13:18:47 UTC
The BULAC (http://www.bulac.fr/) would LOVE to see this discussion reopened and is ready to sponsor the development chosen.

As long as “Change sponsored?” is set on “Seeking developer”, anyone wanting to quote us for the development of such a feature or just ask for more information is welcome to write to us: <sigb@bulac.fr>.
Comment 18 Fridolin SOMERS 2019-09-18 15:28:51 UTC
I propose a general postulate n°2 :

"Behavior/display is the same between : 
  - IndependantBranches off
  - IndependantBranches on + superlibrarian
"

This makes code really less complicated.
Comment 19 Jonathan Druart 2019-10-16 15:07:05 UTC
Created attachment 94300 [details] [review]
Bug 18743: Fix suggestion listing when organized by library

There are some weird behaviors happening when using the "Organize by:
library" dropdown along with the library filter (in the "Acquisition
information" box).

I am suggesting the following test plan:
0. Create several suggestion from different libraries

A. You are superlibrarian and IndependentBranches is not set
1. Hit /suggestion/suggestion.pl
=> Default view shows the suggestions from your library
2. Filter by another library
=> You see the suggestions from this library
3. Filter by "Any" libraries
=> You see all the suggestions
4. "Organize by library"
=> You see all the suggestions, organized by library
5. Filter by a specific library
=> You see the suggestion from your library, all in one tab

B. You are not superlibrarian and IndependentBranches
Same as A.

C. You are superlibrarian and IndependentBranches is set
Same as A.

D. You are not superlibrarian and IndependentBranches is not set
You will never see suggestions coming from outside your library

QA: To be clear: the whole script needs a rewrite, but here we are just
trying to fix weird behaviors.
Comment 20 Jonathan Druart 2019-10-16 15:08:09 UTC
I think I have tracked down the different weird behaviors. They have all been addressed in the last patch.

Please test :)
Comment 21 Séverine Queune 2019-10-17 22:23:35 UTC
I had a doubt concerning the settings of IndependentBranches, so for each test I precise which of the 'Yes/No' I used.

> A. You are superlibrarian and IndependentBranches is not set
> 1. Hit /suggestion/suggestion.pl
With IndependentBranches = 'Yes'

> => Default view shows the suggestions from your library
no : I can see all the pending suggestions whatever is the fitler I used for Library

> 2. Filter by another library
> => You see the suggestions from this library
no : same as 1.

> 3. Filter by "Any" libraries
> => You see all the suggestions
no : same as 1.

> 4. "Organize by library"
> => You see all the suggestions, organized by library
no : all the suggestions are displayed in only one tab which name is the library I'm logged in

> 5. Filter by a specific library
> => You see the suggestion from your library, all in one tab
None of the filter boxes open when I clic on them so I can't test.
Tested with 2 different superadmin accounts, located in 2 different sites, on 2 different computers.


> B. You are not superlibrarian and IndependentBranches
> Same as A.
With IndependentBranches = 'No'
1. ok
2. ok
3. ok
4. ok
5. ok

> C. You are superlibrarian and IndependentBranches is set
> Same as A.
With IndependentBranches = 'No'
1. ok
2. ok
3. ok
4. ok
5. ok

> D. You are not superlibrarian and IndependentBranches is not set
> You will never see suggestions coming from outside your library
With IndependentBranches = 'Yes'
1. ok
2. ok : option not available as expected
3. ok : only suggestions for my site are displayed
4+5. no : if I filter on my site and then "organize by library", the table is not displayed. I can only see it filtering on "Any". 

I wonder what is the behaviour we want to have concerning the count of "suggestions waiting" on /koha/mainpage.pl and /acqui/acqui-home.pl : for case D, only the pending suggestions on the site of the logged user are counted.
For the 3 other cases, all the suggestions are counted. I understand this logic as these users can modifiy all of them, but I think it might be a little disturbing for a user to see "x pending suggestions" and, on the suggestion page, having an empty page because all the suggestions are made for an other site.
Could we imagine to have something like : "Pending suggestions : my site = x / all = y" ?
Comment 22 Jonathan Druart 2019-10-20 08:18:50 UTC
Created attachment 94417 [details] [review]
Bug 18743: Fix suggestion listing when organized by library

There are some weird behaviors happening when using the "Organize by:
library" dropdown along with the library filter (in the "Acquisition
information" box).

I am suggesting the following test plan:
0. Create several suggestion from different libraries

A. You are superlibrarian and IndependentBranches is not set (=No)
1. Hit /suggestion/suggestion.pl
=> Default view shows the suggestions from your library
2. Filter by another library
=> You see the suggestions from this library
3. Filter by "Any" libraries
=> You see all the suggestions
4. "Organize by library"
=> You see all the suggestions, organized by library
5. Filter by a specific library
=> You see the suggestion from your library, all in one tab

B. You are not superlibrarian and IndependentBranches is set (=Yes)
Same as A.

C. You are superlibrarian and IndependentBranches is set
Same as A.

D. You are not superlibrarian and IndependentBranches is not set
You will never see suggestions coming from outside your library

QA: To be clear: the whole script needs a rewrite, but here we are just
trying to fix weird behaviors.
Comment 23 Jonathan Druart 2019-10-20 08:18:56 UTC
Created attachment 94418 [details] [review]
Bug 18743: Correct number of pending suggestions (acq home page)

This patch could be moved to its own bug report if we want to adjust
tests.
Comment 24 sandboxes@biblibre.com 2019-10-22 08:50:12 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 25 sandboxes@biblibre.com 2019-10-22 08:50:45 UTC
Created attachment 94515 [details] [review]
Bug 18743: Fix suggestion listing when organized by library

There are some weird behaviors happening when using the "Organize by:
library" dropdown along with the library filter (in the "Acquisition
information" box).

I am suggesting the following test plan:
0. Create several suggestion from different libraries

A. You are superlibrarian and IndependentBranches is not set (=No)
1. Hit /suggestion/suggestion.pl
=> Default view shows the suggestions from your library
2. Filter by another library
=> You see the suggestions from this library
3. Filter by "Any" libraries
=> You see all the suggestions
4. "Organize by library"
=> You see all the suggestions, organized by library
5. Filter by a specific library
=> You see the suggestion from your library, all in one tab

B. You are not superlibrarian and IndependentBranches is set (=Yes)
Same as A.

C. You are superlibrarian and IndependentBranches is set
Same as A.

D. You are not superlibrarian and IndependentBranches is not set
You will never see suggestions coming from outside your library

QA: To be clear: the whole script needs a rewrite, but here we are just
trying to fix weird behaviors.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 26 sandboxes@biblibre.com 2019-10-22 08:50:48 UTC
Created attachment 94516 [details] [review]
Bug 18743: Correct number of pending suggestions (acq home page)

This patch could be moved to its own bug report if we want to adjust
tests.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 27 Nick Clemens 2019-10-25 10:20:04 UTC
Created attachment 94737 [details] [review]
Bug 18743: Fix suggestion listing when organized by library

There are some weird behaviors happening when using the "Organize by:
library" dropdown along with the library filter (in the "Acquisition
information" box).

I am suggesting the following test plan:
0. Create several suggestion from different libraries

A. You are superlibrarian and IndependentBranches is not set (=No)
1. Hit /suggestion/suggestion.pl
=> Default view shows the suggestions from your library
2. Filter by another library
=> You see the suggestions from this library
3. Filter by "Any" libraries
=> You see all the suggestions
4. "Organize by library"
=> You see all the suggestions, organized by library
5. Filter by a specific library
=> You see the suggestion from your library, all in one tab

B. You are not superlibrarian and IndependentBranches is set (=Yes)
Same as A.

C. You are superlibrarian and IndependentBranches is set
Same as A.

D. You are not superlibrarian and IndependentBranches is not set
You will never see suggestions coming from outside your library

QA: To be clear: the whole script needs a rewrite, but here we are just
trying to fix weird behaviors.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 28 Nick Clemens 2019-10-25 10:20:08 UTC
Created attachment 94738 [details] [review]
Bug 18743: Correct number of pending suggestions (acq home page)

This patch could be moved to its own bug report if we want to adjust
tests.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 29 Nick Clemens 2019-10-25 10:22:48 UTC
This all works as I expect, I think the test plan descriptions are still incorrect, under the scenarios below all works as explained and is correct:

A super yes, ib no
B super no, ib no
C super yes, ib yes
D super no, ib yes
Comment 30 Jonathan Druart 2019-10-25 10:23:18 UTC
Created attachment 94739 [details] [review]
Bug 18743: Fix suggestion listing when organized by library

There are some weird behaviors happening when using the "Organize by:
library" dropdown along with the library filter (in the "Acquisition
information" box).

I am suggesting the following test plan:
0. Create several suggestion from different libraries

A. You are superlibrarian and IndependentBranches is not set (=No)
1. Hit /suggestion/suggestion.pl
=> Default view shows the suggestions from your library
2. Filter by another library
=> You see the suggestions from this library
3. Filter by "Any" libraries
=> You see all the suggestions
4. "Organize by library"
=> You see all the suggestions, organized by library
5. Filter by a specific library
=> You see the suggestion from your library, all in one tab

B. You are not superlibrarian and IndependentBranches is set (=Yes)
Same as A.

C. You are superlibrarian and IndependentBranches is set
Same as A.

D. You are not superlibrarian and IndependentBranches is not set
You will never see suggestions coming from outside your library

QA: To be clear: the whole script needs a rewrite, but here we are just
trying to fix weird behaviors.

Sponsored-by: BULAC - http://www.bulac.fr/

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 31 Jonathan Druart 2019-10-25 10:23:22 UTC
Created attachment 94740 [details] [review]
Bug 18743: Correct number of pending suggestions (acq home page)

This patch could be moved to its own bug report if we want to adjust
tests.

Sponsored-by: BULAC - http://www.bulac.fr/

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 32 Jonathan Druart 2019-10-25 10:26:30 UTC
Created attachment 94741 [details] [review]
Bug 18743: Fix suggestion listing when organized by library

There are some weird behaviors happening when using the "Organize by:
library" dropdown along with the library filter (in the "Acquisition
information" box).

I am suggesting the following test plan:
0. Create several suggestion from different libraries

A. You are superlibrarian and IndependentBranches is not set (=No)
1. Hit /suggestion/suggestion.pl
=> Default view shows the suggestions from your library
2. Filter by another library
=> You see the suggestions from this library
3. Filter by "Any" libraries
=> You see all the suggestions
4. "Organize by library"
=> You see all the suggestions, organized by library
5. Filter by a specific library
=> You see the suggestion from your library, all in one tab

B. You are not superlibrarian and IndependentBranches is not set (=No)
Same as A.

C. You are superlibrarian and IndependentBranches is set
Same as A.

D. You are not superlibrarian and IndependentBranches is set
You will never see suggestions coming from outside your library

QA: To be clear: the whole script needs a rewrite, but here we are just
trying to fix weird behaviors.

Sponsored-by: BULAC - http://www.bulac.fr/

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 33 Jonathan Druart 2019-10-25 10:26:35 UTC
Created attachment 94742 [details] [review]
Bug 18743: Correct number of pending suggestions (acq home page)

This patch could be moved to its own bug report if we want to adjust
tests.

Sponsored-by: BULAC - http://www.bulac.fr/

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 34 Jonathan Druart 2019-10-25 10:27:23 UTC
(In reply to Nick Clemens from comment #29)
> This all works as I expect, I think the test plan descriptions are still
> incorrect, under the scenarios below all works as explained and is correct:
> 
> A super yes, ib no
> B super no, ib no
> C super yes, ib yes
> D super no, ib yes

Indeed, not completely back to binary mode it seems ;)

I have amended the test plan and added the sponsored-by lines.

Thanks Nick!
Comment 35 Martin Renvoize 2019-10-25 12:21:09 UTC
Nice work!

Pushed to master for 19.11.00
Comment 36 Fridolin SOMERS 2019-11-08 15:25:35 UTC
Pushed to 19.05.x for 19.05.05

Great job everyone and thanks a lot BULAC ;)