From 31a610e22e0380bbbb036295ea0a8a8079565718 Mon Sep 17 00:00:00 2001 From: Jerry Holmes Date: Sat, 13 May 2017 19:54:05 -0400 Subject: [PATCH] Tests left over field value for null --- example/config.yml | 1 + example/index.html | 2 +- src/components/EntryListing/EntryListing.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example/config.yml b/example/config.yml index fd9d855a..3f59b46f 100644 --- a/example/config.yml +++ b/example/config.yml @@ -15,6 +15,7 @@ collections: # A list of collections the CMS should be able to edit - {label: "Publish Date", name: "date", widget: "datetime", format: "YYYY-MM-DD hh:mma"} - {label: "Cover Image", name: "image", widget: "image", required: false, tagname: ""} - {label: "Body", name: "body", widget: "markdown"} + - {label: "Some Field", name: "somefield", widget: "string", required: false} # Testing empty field meta: - {label: "SEO Description", name: "description", widget: "text"} diff --git a/example/index.html b/example/index.html index 0779ff47..013b5750 100644 --- a/example/index.html +++ b/example/index.html @@ -14,7 +14,7 @@ content: "---\ntitle: This is a YAML front matter post\nimage: /nf-logo.png\ndate: 2015-02-14T00:00:00.000Z\n---\n\n# I Am a Title in Markdown\n\nHello, world\n\n* One Thing\n* Another Thing\n* A Third Thing\n" }, "2015-02-14-this-is-test-post.md": { - content: "---\ntitle: This is a test post\nimage: /Photo 1-lobby_FS.jpg\ndate: 2015-02-14T00:00:00.000Z\n---\n\n# I Am a Title in Markdown\n\nHello, world\n\n* One Thing\n* Another Thing\n* A Third Thing\n" + content: "---\ntitle: This is a test post\nimage: /Photo 1-lobby_FS.jpg\ndate: 2015-02-14T00:00:00.000Z\nsomefield: null\n---\n\n# I Am a Title in Markdown\n\nHello, world\n\n* One Thing\n* Another Thing\n* A Third Thing\n" }, "2015-02-15-this-is-a-json-frontmatter-post.md": { content: "{\n\"title\": \"This is a JSON front matter post\",\n\"image\": \"/nf-logo.png\",\n\"date\": \"2015-02-15T00:00:00.000Z\"\n}\n\n# I Am a Title in Markdown\n\nHello, world\n\n* One Thing\n* Another Thing\n* A Third Thing\n" diff --git a/src/components/EntryListing/EntryListing.js b/src/components/EntryListing/EntryListing.js index 20692af7..b9ce1203 100644 --- a/src/components/EntryListing/EntryListing.js +++ b/src/components/EntryListing/EntryListing.js @@ -57,7 +57,7 @@ export default class EntryListing extends React.Component { : inferedFields.remainingFields && inferedFields.remainingFields.map(f => (

{f.get('label')}:{' '} - { entry.getIn(['data', f.get('name')], '').toString() } + { entry.getIn(['data', f.get('name')], '')?entry.getIn(['data', f.get('name')], '').toString():'' }

)) }