'use strict'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nextProvider } from 'react-i18next'; import i18n from '../lib/i18n'; import { Section } from '../lib/page'; import ListsList from './List'; import ListsCUD from './CUD'; import FormsList from './forms/List'; import FormsCUD from './forms/CUD'; import FieldsList from './fields/List'; import FieldsCUD from './fields/CUD'; import Share from '../shares/Share'; const getStructure = t => { const subPaths = {}; return { '': { title: t('Home'), externalLink: '/', children: { 'lists': { title: t('Lists'), link: '/lists', component: ListsList, children: { /* FIXME ':listId': { title: resolved => t('List "{{name}}"', {name: resolved.list.name}), resolve: { list: match => `/rest/lists/${match.params.listId}` }, actions: { edit: { title: t('Edit'), params: [':action?'], render: props => () }, create: { title: t('Create'), render: props => () }, share: { title: t('Share'), render: props => () } } }, */ edit: { title: t('Edit List'), params: [':id', ':action?'], render: props => () }, create: { title: t('Create List'), render: props => () }, share: { title: t('Share List'), params: [':id'], render: props => ( t('Share List "{{name}}"', {name: entity.name})} getUrl={id => `/rest/lists/${id}`} entityTypeId="list" {...props} />) }, fields: { title: t('Fields'), params: [':listId'], link: match => `/lists/fields/${match.params.listId}`, component: FieldsList, children: { edit: { title: t('Edit Field'), params: [':listId', ':fieldId', ':action?'], render: props => () }, create: { title: t('Create Field'), params: [':listId'], render: props => () }, } }, forms: { title: t('Custom Forms'), link: '/lists/forms', component: FormsList, children: { edit: { title: t('Edit Custom Forms'), params: [':id', ':action?'], render: props => () }, create: { title: t('Create Custom Forms'), render: props => () }, share: { title: t('Share Custom Forms'), params: [':id'], render: props => ( t('Custom Forms "{{name}}"', {name: entity.name})} getUrl={id => `/rest/forms/${id}`} entityTypeId="customForm" {...props} />) } } } } } } } } }; export default function() { ReactDOM.render(
, document.getElementById('root') ); };