CannerCMS / cannercms

⚡️ Content Management Framework creates custom CMS fast and easy. Support data sources such as Firebase/Firestore, GraphQL and Restful APIs.

Home Page:https://www.cannerdata.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schema problem for The "All" select filter item condition (Blog template)

fredalai opened this issue · comments

Describe the bug
The "All" select filter item condition problem

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'posts' page
  2. Add "20190508001" posts, the draft type is yes
  3. Add "20190508002" posts, the draft type is no
  4. Selects the filter is "Draft"
  5. Selects the filter is "All"
  6. See error (Cannot see all posts in the table list)

Expected behavior
The user can see all posts in the table list

Screenshots

  1. Show All posts

Correct_Show_all_posts

  1. Selects the filter is "Draft"

Show_draft_posts

  1. Selects the filter is "All"

Incorrect_Show_all_posts

Dependencies (please complete the following information):

  • OS: MacOS 10.14.4
  • Browser: Chrome 74.0.3729.131
  • Node Version: v10.15.3
  • Canner Version: 3.2.13

Additional context
It's the schema problem since no keyName called "condition".

<selectFilter
  alwaysDisplay
  label=""
  defaultOptionIndex={0}
  options={[
    {
      text: "All",
      condition: {
        condition: {}
      }
    },
    {
      text: "Published",
      condition: {
        draft: {
          eq: false
        }
      }
    },
    {
      text: "Draft",
      condition: {
        draft: {
          eq: true
        }
      }
    }
  ]}
/>