keystonejs/keystone-classic

Cloudinary select

Open

#4,099 opened on Mar 14, 2017

View on GitHub
 (4 comments) (0 reactions) (0 assignees)JavaScript (2,288 forks)batch import
bughelp wanted

Repository metrics

Stars
 (14,656 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I'm using 4.0.0-beta.5 on Node 6.10.0.

Steps to reproduce the behavior

Create a new Keystone List and add an CloudinaryImage field, with the select option. Set cloudinary folders to true and make sure auto-create folders is enabled in Cloudinary upload settings.

Example:

Hero.add({
  language: { type: Types.Select, options: [{ value: 'nl', label: 'NL' }, { value: 'en', label: 'EN' }], required: true, initial: true, default: 'nl', index: true },
  title: { type: String, required: true, initial: true },
  subtitle: { type: String, required: true, initial: true },
  image: { type: Types.CloudinaryImage, folder: 'hero', autoCleanup: true, select: true },
  imageMobile: { type: Types.CloudinaryImage, folder: 'hero', autoCleanup: true, select: true },
});

Expected behavior

When I upload an image via the Admin UI, I expect the uploaded image to appear in Cloudinary in the folder 'hero'. Also I expect a selectbox to show up in the Admin UI when I'm creating a new item where I can select previously uploaded images in that specific folder.

Actual behavior

Images get uploaded in Cloudinary in the folder 'hero'. However when I create a new 'Hero' via the Admin UI all I see is an Upload Image button and no selectbox to select previously uploaded images.

Contributor guide