Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
dead code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanflorentin committed Aug 24, 2016
1 parent c896b77 commit 6e41af0
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions src/createMainContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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}`]})
}
}
}
Expand All @@ -44,27 +39,24 @@ const createMainContainer = (MainRoute, apps, MainContainer) =>{
</Route>
</Router>
</div>
}
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
}
Expand Down

0 comments on commit 6e41af0

Please sign in to comment.