keystonejs/keystone-classic

Cloudinary select

Open

#4099 aperta il 14 mar 2017

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)JavaScript (2288 fork)batch import
bughelp wanted

Metriche repository

Star
 (14.656 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor