From 6e41af028464cb5f2f6c087fdc13e955cef6f6ee Mon Sep 17 00:00:00 2001 From: Ivan Florentin Date: Wed, 24 Aug 2016 13:44:37 -0400 Subject: [PATCH] dead code cleaning --- src/createMainContainer.js | 44 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/createMainContainer.js b/src/createMainContainer.js index 646d806..d506bef 100644 --- a/src/createMainContainer.js +++ b/src/createMainContainer.js @@ -6,15 +6,12 @@ const createMainContainer = (MainRoute, apps, MainContainer) =>{ for (let appName in apps) { const app = apps[appName] if (app.appDef) { - // console.log(`app ${appName}`, apps[appName]) for (let component of apps[appName].appDef.components) { - // console.log('components', component) const componentName = component.componentName const appPath = `/${apps[appName].appDef.appRoute}/` const editName = `${componentName}Edit` const listName = `${componentName}List` const displayName = `${componentName}Display` -// const relationDisplayName = `${componentName}RelationDisplay` const editPath = `${appPath}${componentName}/edit` const listPath = `${appPath}${componentName}/list` const displayPath = `${appPath}${componentName}/display` @@ -27,13 +24,11 @@ const createMainContainer = (MainRoute, apps, MainContainer) =>{ props[setRoute]({name: listName, path: listPath}) props[setRoute]({name: displayName, path: displayPath}) props[setTemplate]({name: editName, - template: templates[`edit${componentProperName}`]}) + template: templates[`edit${componentProperName}`]}) props[setTemplate]({name: displayName, - template: templates[`display${componentProperName}`]}) - // props[setTemplate]({name: relationDisplayName, -// template: templates[`relationDisplay${componentProperName}`]}) + template: templates[`display${componentProperName}`]}) props[setTemplate]({name: listName, - template: templates[`list${componentProperName}`]}) + template: templates[`list${componentProperName}`]}) } } } @@ -44,27 +39,24 @@ const createMainContainer = (MainRoute, apps, MainContainer) =>{ - } - Container.propTypes = {} + } + Container.propTypes = {} - for (let appName in apps) { - const app = apps[appName] - if (app.appDef) { - //console.log('app', apps[appName].appDef) - const components = apps[appName].appDef.components - for (let component of components) { - // console.log('CCCCCCCC', component) - const componentName = component.componentName - const componentProperName = componentName[0].toUpperCase() + componentName.substring(1) - const setRoute = `setRoute${componentProperName}` - const setTemplate = `setTemplate${componentProperName}` - //const setComponentDef = `setComponentDef${componentProperName}` - Container.propTypes[`setComponentDef${componentProperName}`] = PropTypes.func - Container.propTypes[setRoute] = PropTypes.func - Container.propTypes[setTemplate] = PropTypes.func + for (let appName in apps) { + const app = apps[appName] + if (app.appDef) { + const components = apps[appName].appDef.components + for (let component of components) { + const componentName = component.componentName + const componentProperName = componentName[0].toUpperCase() + componentName.substring(1) + const setRoute = `setRoute${componentProperName}` + const setTemplate = `setTemplate${componentProperName}` + Container.propTypes[`setComponentDef${componentProperName}`] = PropTypes.func + Container.propTypes[setRoute] = PropTypes.func + Container.propTypes[setTemplate] = PropTypes.func + } } } -} return Container }