Skip to content

Commit

Permalink
fix error occur due to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarunmeena0901 committed Apr 23, 2024
1 parent e81bc36 commit 77ff0ff
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/client/entity-editor/entity-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ type OwnProps = {
};

type StateProps = {

aliasEditorVisible: boolean,
identifierEditorVisible: boolean,
};

type DispatchProps = {
Expand All @@ -51,6 +52,10 @@ type Props = StateProps & DispatchProps & OwnProps;
* Container component. Renders all of the sections of the entity editing form.
*
* @param {Object} props - The properties passed to the component.
* @param {boolean} props.aliasEditorVisible - Whether the alias editor modal
* should be made visible.
* @param {boolean} props.identifierEditorVisible - Whether the identifier
* editor modal should be made visible.
* @param {React.Node} props.children - The child content to wrap with this
* entity editor form.
* @param {Function} props.onSubmit - A function to be called when the
Expand All @@ -59,9 +64,12 @@ type Props = StateProps & DispatchProps & OwnProps;
*/
const EntityEditor = (props: Props) => {
const {
aliasEditorVisible,
children,
heading,
onSubmit
identifierEditorVisible,
onSubmit,
entity
} = props;
const currentState = (useSelector((state) => state) as any).toJS();
let entityURL;
Expand Down Expand Up @@ -109,6 +117,14 @@ const EntityEditor = (props: Props) => {
};
EntityEditor.displayName = 'EntityEditor';

function mapStateToProps(rootState): StateProps {
const state = rootState.get('buttonBar');
return {
aliasEditorVisible: state.get('aliasEditorVisible'),
identifierEditorVisible: state.get('identifierEditorVisible')
};
}

function mapDispatchToProps(dispatch, {submissionUrl}) {
return {
onSubmit: (event:React.FormEvent) => {
Expand All @@ -118,4 +134,4 @@ function mapDispatchToProps(dispatch, {submissionUrl}) {
};
}

export default connect(null, mapDispatchToProps)(EntityEditor);
export default connect(mapStateToProps, mapDispatchToProps)(EntityEditor);

0 comments on commit 77ff0ff

Please sign in to comment.