keystonejs/keystone-classic

Cloudinary select

Open

#4,099 建立於 2017年3月14日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)JavaScript (14,656 star) (2,288 fork)batch import
bughelp wanted

描述

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.

貢獻者指南