Created
August 31, 2015 15:42
-
-
Save zindel/eb27ad9f478b3d210631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @copyright 2015, Prometheus Research, LLC | |
*/ | |
'use strict'; | |
var React = require('react'); | |
var {Wizard, createEntity} = require('rex-action'); | |
var TodoWizardIframe = React.createClass({ | |
render() { | |
let {mode, path, ...props} = this.props; | |
let context = {}; | |
if (window.parent && window.parent.INDIVIDUAL_ID) { | |
context = { | |
individual: createEntity('individual', window.parent.INDIVIDUAL_ID) | |
}; | |
path = path['pick-individual']; | |
} | |
else { | |
if (mode == 'data-entry') { | |
path = {'pick-individual': { | |
'pick-data-entry-todo': path['pick-individual']['pick-todo'], | |
'adhoc-measure-todo': path['pick-individual']['adhoc-measure-todo'] | |
}}; | |
} | |
else if (mode == 'reconciliation') { | |
path = {'pick-individual': { | |
'pick-reconciliation-todo': path['pick-individual']['pick-todo'], | |
}}; | |
} | |
} | |
return ( | |
<Wizard | |
path={path} | |
{...props} | |
initialContext={context} | |
disableHistory={true} | |
/> | |
); | |
}, | |
}); | |
module.exports = TodoWizardIframe; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment