Description
Joy Nelson
2019-04-26 15:13:00 UTC
*** Bug 1884 has been marked as a duplicate of this bug. *** The BULAC (http://www.bulac.fr/) is interested by the behaviours detailed on the first comment, and we’d like to sponsor this development. An important hope for us, not mentioned above, is to have better performance on the suggestions page loading, for it is now very slow because of the hundreds of suggestions we’ve already got. We hope archiving will settle this. 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>. Created attachment 95499 [details] [review] Bug 22784: DB Changes Sponsored-by: BULAC - http://www.bulac.fr/ Created attachment 95500 [details] [review] Bug 22784: DBIC Changes Sponsored-by: BULAC - http://www.bulac.fr/ Created attachment 95501 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Created attachment 95502 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ (In reply to Joy Nelson from comment #0) > Create a way to archive the 'completed' purchase suggestions on the staff > side. > 1. Add an 'archived' column to purchase suggestions Done! > 2. Add a script to automatically mark suggestions of a certain age and > status as archived Done! > 3. Add a button on the purchase suggestions page to archive specific > suggestions Were you suggesting 1 new action for the selected suggestions? This patchset only add 1 new action per suggestion. We could have another action at the bottom of the suggestion list but I am afraid it will become a bit packed and we are going to lose readability, dependent bug reports already add stuff there. I would suggest to deal with that on a separate bug report. > 4. Add a 'view archived suggestions' button to view archived suggestions. > Default view does not display archived suggestions Not sure it is needed as there is the filter. I am willing to add something after you have tested the patches and can tell me what you have exactly in mind ;) > 5. Add 'archived' option to the filters on the purchase suggestions page. Done! Created attachment 95510 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Created attachment 95511 [details] [review] Bug 22784: Bugfix - do not modify #description build Debian packages from a git repository Created attachment 95512 [details] [review] Bug 22784: Do not display an empty table This is terrible and highlight that the whole script must be rewrite. GetDistinctValues does not handle the "archived" flag (and we do not want to put our hands there), so let's hack that and plan to rewrite the whole script. Created attachment 95513 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ Hi Jonathan, This patch doesn't apply on master : Applying: Bug 22784: DB Changes Using index info to reconstruct a base tree... M Koha/Schema/Result/Suggestion.pm M installer/data/mysql/kohastructure.sql Falling back to patching base and 3-way merge... Auto-merging installer/data/mysql/kohastructure.sql Auto-merging Koha/Schema/Result/Suggestion.pm Applying: Bug 22784: DBIC Changes Using index info to reconstruct a base tree... M Koha/Schema/Result/Suggestion.pm Falling back to patching base and 3-way merge... Auto-merging Koha/Schema/Result/Suggestion.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Suggestion.pm Failed to merge in the changes. Patch failed at 0001 Bug 22784: DBIC Changes Sorry, wrong bug number in the dep list. Created attachment 95533 [details] [review] Bug 22784: DB Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 95534 [details] [review] Bug 22784: DBIC Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 95535 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 95536 [details] [review] Bug 22784: Bugfix - do not modify #description build Debian packages from a git repository Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 95537 [details] [review] Bug 22784: Do not display an empty table This is terrible and highlight that the whole script must be rewrite. GetDistinctValues does not handle the "archived" flag (and we do not want to put our hands there), so let's hack that and plan to rewrite the whole script. Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 95538 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> This still applies, QA? (In reply to Liz Rea from comment #20) > This still applies, QA? Please don't - only person from the QA team seeing this will probably be me and the people who can't QA because they are already on the bug report having worked on it :) (In reply to Liz Rea from comment #20) > This still applies, QA? I can take a look on Monday Created attachment 96900 [details] [review] Bug 22784: DB Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Created attachment 96901 [details] [review] Bug 22784: DBIC Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Created attachment 96902 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Created attachment 96903 [details] [review] Bug 22784: Bugfix - do not modify #description build Debian packages from a git repository Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Created attachment 96904 [details] [review] Bug 22784: Do not display an empty table This is terrible and highlight that the whole script must be rewrite. GetDistinctValues does not handle the "archived" flag (and we do not want to put our hands there), so let's hack that and plan to rewrite the whole script. Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Created attachment 96905 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Currently blocked by dependency bug 23950. Created attachment 100806 [details] [review] Bug 22784: DB Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100807 [details] [review] Bug 22784: DBIC Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100808 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100809 [details] [review] Bug 22784: Bugfix - do not modify #description build Debian packages from a git repository Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100810 [details] [review] Bug 22784: Do not display an empty table This is terrible and highlight that the whole script must be rewrite. GetDistinctValues does not handle the "archived" flag (and we do not want to put our hands there), so let's hack that and plan to rewrite the whole script. Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100811 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100854 [details] [review] Bug 22784: DB Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100855 [details] [review] Bug 22784: DBIC Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100856 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100857 [details] [review] Bug 22784: Bugfix - do not modify #description build Debian packages from a git repository Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100858 [details] [review] Bug 22784: Do not display an empty table This is terrible and highlight that the whole script must be rewrite. GetDistinctValues does not handle the "archived" flag (and we do not want to put our hands there), so let's hack that and plan to rewrite the whole script. Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 100859 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Hi Jonathan, can you please rebase? Created attachment 101948 [details] [review] Bug 22784: DBIC changes (In reply to Katrin Fischer from comment #42) > Hi Jonathan, can you please rebase? The patches applied ok. The one that does not it DBIC changes, it can be done this way: % git bz apply --skip % dbic That's it :) (In reply to Jonathan Druart from comment #44) > (In reply to Katrin Fischer from comment #42) > > Hi Jonathan, can you please rebase? > > The patches applied ok. The one that does not it DBIC changes, it can be > done this way: > % git bz apply --skip > % dbic > > That's it :) I did that on one of Nick's patches recenlty and then he had some thing dependent on it in the ohter patches - thought I'd play it safe here :) Created attachment 102779 [details] [review] Bug 22784: Fix small display issue with fa icon in suggestions table The <i> was not closed resulting in the "Archived" displaying in the wrong font. Might be a browser specific issue, but adding the closing </i> fixed it and follows the existing pattern. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102780 [details] [review] Bug 22784: DB Changes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102781 [details] [review] Bug 22784: Add the ability to archive/unarchive a purchase suggestions There are performance issues when searching suggestions if there are thousands of suggestions. To prevent that we are going to add the ability to archive purchase suggestions, in order to remove them from the search list (by default). Test plan: 0. Apply all the patches, execute the updatedatabase.pl script, restart all 1. Create some suggestions 2. Search for them 3. Use the "Archive" action button for one of them 4. Restart the search => The archived suggestion does no longer appear in the list 5. Use the filter "Included archived" in the "Suggestion information" filter box => The archived suggestion is now displayed 6. Use other filters => The "archived" filter is kept from one search to another 7. Use one of the action at the bottom of the suggestion list (change the status for instance) => The "archived" filter is still kept Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102782 [details] [review] Bug 22784: Bugfix - do not modify #description build Debian packages from a git repository Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102783 [details] [review] Bug 22784: Do not display an empty table This is terrible and highlight that the whole script must be rewrite. GetDistinctValues does not handle the "archived" flag (and we do not want to put our hands there), so let's hack that and plan to rewrite the whole script. Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102784 [details] [review] Bug 22784: Add a cronjob to archive suggestions given age or status criteria In order to deal automatically with suggestions that need to be archived, this cronjob will help to add the "archived" flag following their age or status. Test plan: - Execute the script with the --help parameter and read the documentation. - Does it make sense? - Use it without the --confirm flag and try several combination For instance you will want to archive suggestions that have been rejected for more than a week: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=rejecteddate --age=weeks:1 or even suggestion that have been suggested for more than a year and have a ORDERED status: perl misc/cronjobs/archive_purchase_suggestions.pl --age-date-field=suggesteddate --age=years:1 --status=ORDERED - Use it with the --confirm flag and make sure the suggestions have been archived. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102785 [details] [review] Bug 22784: DBIC changes Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 102786 [details] [review] Bug 22784: Fix small display issue with fa icon in suggestions table The <i> was not closed resulting in the "Archived" displaying in the wrong font. Might be a browser specific issue, but adding the closing </i> fixed it and follows the existing pattern. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> This worked really well in my testing and is a real nice addition to help carefully clean up suggestions without having to delete the data. The only thing is maybe the way we display archived entries in the suggestions table - I think the icon/message could be better placed somehow, but haven't come up with a good suggestion myself. Definitely not a blocker :) Nice work everyone! Pushed to master for 20.05 Created attachment 102944 [details] [review] Bug 22784: (QA follow-up) booleans should be TINYINT As per the coding guidelines, they should be TINYINT(1). Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> We should add that last patch I attached. Nice work everyone! Pushed to master for 20.05 Good catch, thanks Tomas. enhancement not backported to 19.11.x |