Skip to content

Instantly share code, notes, and snippets.

@zindel
Created August 31, 2015 15:42
Show Gist options
  • Save zindel/eb27ad9f478b3d210631 to your computer and use it in GitHub Desktop.
Save zindel/eb27ad9f478b3d210631 to your computer and use it in GitHub Desktop.
/**
* @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