GithubHelp home page GithubHelp logo

andful / netlify-cms-widget-create-select Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 18.52 MB

A simple create select widget for netlify-cms which allows creating entries. The create select widget's entries are up to date to the last website build. The create select can be populated by plain text file, json file, RSS feed or HTML page.

License: MIT License

JavaScript 15.10% HTML 1.70% TypeScript 83.20%
select-widgets rss-feed html-page hugo netlify-cms netlify netlify-cms-widgets netlify-cms-widget

netlify-cms-widget-create-select's People

Contributors

andful avatar chrisboustead avatar hursey013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

netlify-cms-widget-create-select's Issues

Add opt-in cache system.

Especially with netlify-cms widget list, multiple requests are sent to the same resource. This can be prevented with a cache system.

Local Backend - CORS error means always loading, no manual entry/create

Last Issue today, this one is less pressing because I know it works on production servers just not localhost/127.0.0.1

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <URL>. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.

I'm using the netlify-cms-proxy-server and local_backend option, and getting this error. This is normal CORS limitation, but the uncaught error means that the widget displays "Loading" forever, and the create functionality doesn't work. I think it would be a good alternative to have it catch the failed html scraping and still allow you to manually enter values.

Thank you for your prompt work on this today!

HTML mode: Correctly scrapes but throws error on save/publish

Error thrown:

throw new Error(`attribute "query" must be defined in mode "html"`);

Configuration

- label: "Tags"
  name: "tags"
  hint: 'Do not duplicate any tags you would rather add for the whole Story!'
  widget: "create-select"
  mode: html
  url: FOO
  query: "h2.tag-title"
  attribute: "data-tag"
  multiple: true
  required: false

When this is used as a field, the html data is properly pulled and scraped into a list in the dropdown, but Save/Publish fails silently with an uncaught promise rejection, the field highlighting red and displaying the error above. Any assistance would be much appreciated. I was very excited to use this widget of yours.

Feature request: Additional event when creating entries using the widget

Hi,

Thanks for the awesome widget 😀

I have set up the widget to get existing values from an API route (server/api route in a Nuxt3 app).
I was wondering if you could add functionality such that when creating an entry, the widget makes a POST request to an endpoint specified in another property of the widget.

With such functionality, I can sync my entries without having to visit the collection itself and make the additions manually (interrupts the editing flow).

Error on page read, when field is present but empty

In some of my markdown files with frontmatter, I created them before netlify-cms with a template consisting of all usable fields being present but blank. I am using this widget to adjust a tags: list that has no entries yet, and upon opening the post edit page, I receive an error:

TypeError: e is null
Source: render, https://unpkg.com/netlify-cms-widget-create-select@^1.1.0:10

I believe this is from an unhandled exception to an empty read of that field.

React 17 and NextJS 12 Fails to install

Unable to install as normal under React 17. When forcing it, it breaks the page:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of 'm'.
import dynamic from 'next/dynamic'
import {
  CreatableSelectControl,
  CreatableSelectPreview
} from 'netlify-cms-widget-create-select'

const CMS = dynamic(
  () =>
    import('netlify-cms-app').then(cms => {
      cms.init()
      cms.registerWidget(
        'create-select',
        window.CreatableSelectControl,
        window.CreatableSelectPreview
      )
    }),
  {
    ssr: false
  }
)

const CMSPage: React.FC = () => {
  return (
    <>
      <CMS />
    </>
  )
}
export default CMSPage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.