impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 179 forks source link

feat(repository): lazy loading, range selection + fix(repository): fix endless force delete #838

Closed azanov closed 7 years ago

azanov commented 7 years ago

Lazy loading for thumbnails in repository (image browser)

On websites with a large amount of images (1000+) the image browser by default loads all thumbnails. This takes a lot of times and blocks further web requests until all images are loaded. To prevent this, I implemented lazy loading. Now only the thumbnails for currently visible images are loaded. Once the user resizes the window, scrolls it, uses the search function or uploads a new image, additional thumbnails are loaded on demand.

For reference see https://github.com/impresspages/ImpressPages/issues/800

Allow selecting of multiple images/files in repository (image browser) when holding the shift key

Sometimes you need to delete many images at once and selecting them one by one would take a lot of time. I added the possibility to select many images at once when holding the SHIFT key. A short demo is available here: http://recordit.co/UlMSj0cORr

Fix force-delete of images/files in repository (image browser)

The default delete function of the repository component supports deleting of multiple files and can handle the situation when one or multiple of the requested files could not be deleted for some reason. The user is then prompted to force delete the file, however, instead of requesting the deleting of only failed files, the repository component sends the whole list, including already deleted files to the server. This causes an endless loop as the server will always fail to delete some files as they have been removed in a previous request. I fixed this by filtering the file list sent to the server on force delete.

azanov commented 7 years ago

Added the possibility to select multiple images/files at once and also fixed a bug in the force delete logic.

jankus commented 7 years ago

You've mixed too many things here. You can already select multiple files at once. Why you need to hold a shift key if you can achieve the same thing without it?

azanov commented 7 years ago

Unfortunately no one reviewed the previous commit, so I pushed more changes.

Of course, currently it is possible to select multiple files. The point here is that at the moment you need to click on each individual file to select it. Try selecting 100+ files like this and you will wish to have the possibility to select ranges of files by holding the shift key. You can have a look at the video I recorded to demonstrate the change.

The change doesn't break the old logic. You still are able to select multiple files by clicking on each of them. The range selection is just an additional feature.

azanov commented 7 years ago

Any updates on reviewing my pull request?

maskas commented 7 years ago

Thanks, man, great addition. And sorry for me being slow.

maskas commented 7 years ago

It has been merged to the "dev", so will be included in next release.

azanov commented 7 years ago

Great! Thank you!

maskas commented 6 years ago

I've tested your improvements now. Everything seems to be working fine. Preparing ImpressPages 5.0.3

azanov commented 6 years ago

Thanks, sounds good!