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

Add a sidebar menu item will get Network Error

fredalai opened this issue · comments

Describe the bug
Add a sidebar menu item will be failed

To Reproduce
Steps to reproduce the behavior:

  1. Use CLI tool to build blog type CMS

  2. Add a sidebar menu item for the canner.server.js file

sidebarMenu: [{
  title: "Posts",
  pathname: "posts",
  icon: "read"
}, {
  title: "Categories",
  pathname: "categories",
  icon: "tag"
},{
  title: "OtherMenuItem",
  pathname: "otherMenuItem",
}],
  1. Add "otherMenuItem.schema.js" file into the schema folder

E.g.,

import CannerScript, { Tabs } from "canner-script";

const columns = [
  {
    dataIndex: "title",
    key: "title",
    title: "Title",
  }
];

export default ({ attributes }) => (
  <array
    dataSource={attributes.dataSource}
    keyName="OtherMenuItem"
    title="otherMenuItem"
    ui="tableRoute"
    uiParams={{columns}}
  >
    <toolbar>
      <pagination />
    </toolbar>
    <Tabs>
      <string
        keyName="title"
        title="title"
        required
        layout="horizontal"
      />
    </Tabs>
  </array>
);
  1. Include and use otherMenuItem.schema.js for the canner.schema.js
  2. Run CLI command: canner start
  3. Go to http://localhost:3000/cms/othermenuitem page
  4. See error

Expected behavior

Screenshots
Web_Error

CLI_Error

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
if pathname and keyName are "othermenuitem" will be executed successfully.