Skip to content
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

(feat) implements image thumbnails for the File type #4509

Merged
merged 2 commits into from
Feb 27, 2018

Conversation

cadriel
Copy link
Contributor

@cadriel cadriel commented Nov 13, 2017

Implements an image thumbnail for type File. Depends on a new schema property called showThumb. This improves upon the existing PR's in place that have stalled.

CSS has been implemented to ensure larger format images don't break layout.

Intent is to keep this simple for now until more complex solutions re: image middleware are sorted.

Master currently has e2e and unit tests failing from a prior merge. Can these be resolved so I can rebase?

@JedWatson

@cadriel
Copy link
Contributor Author

cadriel commented Nov 15, 2017

@wmertens

@wmertens
Copy link
Contributor

👍 looks very clean, maybe @jossmac can merge?

@cadriel
Copy link
Contributor Author

cadriel commented Nov 16, 2017

Upon merge, probably best to close the following;
keystonejs/keystone#4198
https://github.com/keystonejs/keystone/pull/3865

There might be other related issues and PR's too.

@cadriel
Copy link
Contributor Author

cadriel commented Nov 16, 2017

Looking at this further, it might make more sense to have the showThumb property on the field itself, rather than defining it on the adapter.

That way you can have multiple image fields in one model - and only show the thumb where wanted. I'll take a quick gander and see if I can implement that..

@cadriel
Copy link
Contributor Author

cadriel commented Nov 16, 2017

@wmertens @jossmac @JedWatson

Might want to have another quick look. Instead of defining the showThumb property on setup of the Storage adapter, you now set it per field.

This makes more sense because a) it doesn't save it to the database now and b) you can set it per field.

Model.add({
  image: { type: Types.File, thumb: true, storage: myStorage },
  ...

@cadriel
Copy link
Contributor Author

cadriel commented Feb 22, 2018

@wmertens @JedWatson @jossmac

Is this, or any other PR going to be looked at soon? It's quite disconcerting to have no movement on any of our PR's or Issues over this length of time - especially given the investment thus far into the project.

@jossmac
Copy link
Member

jossmac commented Feb 27, 2018

@cadriel looks good mate

@jossmac jossmac merged commit b847d19 into keystonejs:master Feb 27, 2018
@jossmac
Copy link
Member

jossmac commented Feb 27, 2018

Will need @Noviny or @JedWatson to release

@htor
Copy link

htor commented Apr 20, 2018

allright! so glad that this made it in. is this feature documented somewhere?

@cadriel
Copy link
Contributor Author

cadriel commented Apr 20, 2018

No docs;

But - as per example above, its easy to apply;

Model.add({
  image: { type: Types.File, thumb: true, storage: myStorage },
  ...

This isn't currently smart enough to use a thumbnail image, or set dimensions. It'll just do its best to present the original file in keystone.

@htor
Copy link

htor commented Apr 20, 2018

@cadriel
which i think is what many people need right know. just being able to look at the images you upload into your cms is absolutely essential! after reading issues after issues about this not being possible (any longer) i got the feeling it was not being a priority. i got it working just fine.

@htor htor mentioned this pull request Apr 22, 2018
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants