-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only show sort buttons if there is more than 1 image in the album. #577
Conversation
By analyzing the blame information on this pull request, we identified @oparoz to be a potential reviewer |
It would be good if you could describe in more details the logic you've used. That way the principles can be validated before the code. Looking at the code, I see a couple of issues:
So it seems you need to write more tests in your test plan to try and cover more cases |
@oparoz First condition is pretty trivial to fix. But the second condition is for when 1 folder and 1 image is present. At that time should we show sort buttons or not? |
Yes. Even though it appears that no sorting would be necessary, because all elements can bee seen at once, I have no way of defining from which point it is. |
Ah and I read the 2nd condition wrong. So, the logic is correct there, but try to combine 1 & 2 if you can. If we have more than one element -> show buttons |
@oparoz Have a look at this one. |
That doesn't work if I have 10 images and 0 albums, no? (Add this case to the test plan if it doesn't) |
@oparoz My bad, I missed those conditions. Anyways the new one adds those conditions as well. |
OK, now try to combine these conditions into 1, if possible. |
@oparoz Have done. Please check. Thanks! |
I think I have a better idea. Add the number of images and albums and if the sum is greater than one, then show the buttons. What do you think? |
@oparoz 👍 Certainly a good idea, as it decreases the number of redundant comparisions and combines them. Have updated the file. |
OK about the idea, but have you tested your code? By looking at it, I'd say the way you wrote it doesn't work. |
@oparoz Sorry for the inconvenience. |
We all make mistakes :), but that's why I think the test plan is important. It makes it easy to quickly review all cases. Let me know when you've tested the solution and I'll review it. |
@oparoz I have tested it and as far as I can see there are no errors. I worked with 1 image, then 2 images, similarly for albums and then both of the together. |
invalid url fixed additional fix to infobox invalid URL fixed Delete public.js Update galleryalbum.js Update galleryinfobox.js invalid url Delete public.js Update gallery.js Update public.php Update gallery.js Update galleryview.js Update galleryview.js Update galleryview.js Update galleryview.js Update galleryview.js invalid url fixes Revert "invalid url fixed" This reverts commit 34738a0. Sort buttons fixed Revert "invalid url fixed" This reverts commit 34738a0. Made some minor changes Sort buttons issue Sort buttons issue 2 Sort buttons issue 3 Sort buttons issue 3
This reverts commit 5d8ef96.
OK, I'll let you summon some testers ;) |
Ok, @imjalpreet @tahaalibra Need your reviews about this. What do you think? |
i think @mbtamuli was working on this. please review... |
Everything is working properly. 👍
|
Thanks @mbtamuli |
Only show sort buttons if there is more than 1 image in the album.
Fixes: #573
Licence: AGPL
Description
Fixes the problem and shows sort button if more than 1 image in album.
Features
Works for images as well as folders.
Tested on
Reviewers
@oparoz