Skip to content

Commit

Permalink
added placeholder screen for application lifecycle. only visible in d…
Browse files Browse the repository at this point in the history
…ev/test mode
  • Loading branch information
Norman Eremic committed Jul 21, 2016
1 parent b93fd86 commit 1f73461
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function ApplicationDetail({applicationId, application, versions,
<Placeholder applicationId={applicationId} /> :
<DefaultError error={application.getResult()} />;
}
console.log("ENV_TEST = %O", ENV_TEST);
return <div className='applicationDetail'>
<h1>{application.name || applicationId}</h1>
<div className='btn-group'>
Expand Down Expand Up @@ -44,6 +45,14 @@ export default function ApplicationDetail({applicationId, application, versions,
className='btn btn-primary'>
<Icon name='list' /> Versions
</Link>
{ENV_DEVELOPMENT ?
<Link
to={Routes.lifecycle(LINK_PARAMS)}
className='btn btn-primary'>
<Icon name='list' /> Lifecycle
</Link>
: null
}
</div>

<h4>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';

class ApplicationLifeCycle extends React.Component {
constructor(props) {
super(props);
}

render() {
return (
<div>
<div>
Here be dragons!
</div>
<div>
..and some props: {JSON.stringify(this.props, (k, v) => v, 2)}
</div>
</div>
)
}
}

export default ApplicationLifeCycle;
32 changes: 32 additions & 0 deletions client/lib/application/src/router.react.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import VersionList from './version-list/version-list.jsx';
import VersionForm from './version-form/version-form.jsx';
import VersionDetail from './version-detail/version-detail.jsx';
import ApprovalForm from './approval-form/approval-form.jsx';
import ApplicationLifeCycle from './application-lifecycle/application-lifecycle.jsx'

import {appList} from 'application/src/routes';

Expand Down Expand Up @@ -634,6 +635,29 @@ let ConnectedApprovalFormHandler = connect(state => ({
magnificentStore: bindGettersToState(state.magnificent, MagnificentGetter)
}))(ApprovalFormHandler);

class ApplicationLifecycleHandler extends React.Component {
constructor() {
super();
}

render() {
return <ApplicationLifeCycle
applicationId={this.props.params.applicationId}
{...this.props} />;
}
}
ApplicationLifecycleHandler.displayName = 'ApplicationLifecycleHandler';
ApplicationLifecycleHandler.propTypes = {
params: React.PropTypes.object.isRequired
};
ApplicationLifecycleHandler.fetchData = function(routerState, state) {
return;
};
let ConnectedApplicationLifecycleHandler = connect(state => ({
kioStore: bindGettersToState(state.kio, KioGetter)
}))(ApplicationLifecycleHandler);


const ROUTES =
<Route path='application'>
<IndexRoute
Expand All @@ -660,6 +684,14 @@ const ROUTES =
<IndexRoute
onEnter={wrapEnter(AppDetailHandler.fetchData)}
component={ConnectedAppDetailHandler} />
{ENV_DEVELOPMENT ?
<Route path='lifecycle'>
<IndexRoute
onEnter={wrapEnter(ApplicationLifecycleHandler.fetchData)}
component={ConnectedApplicationLifecycleHandler}/>
</Route>
: null
}
<Route path='version'>
<IndexRoute
onEnter={wrapEnter(VersionListHandler.fetchData)}
Expand Down
7 changes: 6 additions & 1 deletion client/lib/application/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function verEdit({applicationId, versionId}) {
return `/application/detail/${applicationId}/version/edit/${versionId}`;
}

function lifecycle({applicationId}) {
return `/application/detail/${applicationId}/lifecycle`;
}

export {
appList,
appCreate,
Expand All @@ -57,5 +61,6 @@ export {
verCreate,
verApproval,
verDetail,
verEdit
verEdit,
lifecycle
};

0 comments on commit 1f73461

Please sign in to comment.