-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add "Crop image previews" setting to files #25055
Add "Crop image previews" setting to files #25055
Conversation
It's funny that the "Node / build" check is failing because I did check in the compiled files and running Also, please note that I added a test on the backend for the new setting but I haven't found a way to add a working test for the frontend code. If I add a test in var image = new FileInfo({
id: 123,
name: 'a-photo.jpeg',
mimetype: 'image/jpeg',
size: 1234,
etag: 'a01234c',
mtime: 123456
});
var $tr = fileList.add(image);
console.log($tr.find('.thumbnail').css('background-image')); ...the output I get back is: url("http://localhost/core/img/filetypes/image.svg") ...which is not very helfpul if I want to test changes to preview image URLs. On closer look I see that the |
Hi @kesselb, could I try running that |
I can't explain that build diff tbh but could it be related to the node env? Right now some of a newer node/npm and others have the slightly older one. It could be a mismatch there. IIRC there is also an issue with the latest npm due to missing or incompatible peer deps in our dependency tree.
^ that is what the Github action builds with. |
Thank you @ChristophWurst, I thought that might be the case. I have Node 14 installed locally, and my npm version is just a couple of minor updates newer than what the bot is using (6.14.10). I have successfully checked in compiled assets before (#24970), but that was a much smaller chunk of work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! Great work!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading jquery code makes me cringe but it's a solid PR until we have a Vue rewrite 😜
Thank you @skjnldsv! @ChristophWurst, I haven't written any jQuery code for quite a while so it was a bit of time travel for me :). Looking forward to getting into Vue! |
/compile amend / |
Added a new user setting that toggles cropping on image previews in grid view. True (default value): crops each image to a square. False: keep original aspect ratio. Signed-off-by: Nina Pypchenko <[email protected]> Closes #18439. Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice 👍
Added a new user setting that toggles cropping on image previews in grid view.
True (default value): crops each image to a square. False: keep original aspect ratio.
Signed-off-by: Nina Pypchenko [email protected]
Closes #18439.