cannercms icon indicating copy to clipboard operation
cannercms copied to clipboard

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

Open fredalai opened this issue 6 years ago • 0 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

  2. Selects the filter is "Draft" Show_draft_posts

  3. 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
        }
      }
    }
  ]}
/>

fredalai avatar May 09 '19 03:05 fredalai