Skip to content

Commit

Permalink
fix: remove the save button since it won't be used any longer (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMercy235 committed Mar 28, 2020
1 parent 4611fa8 commit 6c4e6f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ActionsToolbarComponent extends Component {
};

render () {
const { onSaveStory } = this.props;
return (
<div className={styles.toolbarContainer}>
<Button
Expand All @@ -33,13 +32,6 @@ class ActionsToolbarComponent extends Component {
New Option
</Button>
<div className={styles.divider}/>
<Button
onClick={onSaveStory}
variant="contained"
color="primary"
>
Save
</Button>
</div>
);
}
Expand All @@ -48,7 +40,6 @@ class ActionsToolbarComponent extends Component {
ActionsToolbarComponent.propTypes = {
onAddNewSequenceModalOpen: PropTypes.func.isRequired,
onAddNewOptionModalOpen: PropTypes.func.isRequired,
onSaveStory: PropTypes.func.isRequired,
};

export default ActionsToolbarComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { toJS } from 'mobx';

import { Card, CardContent } from '@material-ui/core';
import {
getNewGraph,
getOptionsBetweenNodes,
optionToLink,
seqToNode,
Expand Down Expand Up @@ -54,10 +53,6 @@ class WriteStoryComponent extends Component {
}, GRAPH_WAIT_FOR_GRAPH_STATE_CHANGE);
}

onSaveStory = () => {
console.log(getNewGraph(this.graphRef));
};

getSequence = (sequenceId) => {
const { sequences } = this.props;
const result = sequences.find(({ _id }) => _id === sequenceId);
Expand Down Expand Up @@ -183,7 +178,6 @@ class WriteStoryComponent extends Component {
<ActionsToolbarComponent
onAddNewSequenceModalOpen={this.onOpenSaveSeqModal}
onAddNewOptionModalOpen={this.onOpenSaveOptionsModal}
onSaveStory={this.onSaveStory}
/>
{!!data.nodes.length && (
<Card className={styles.writeStoryCard}>
Expand Down
24 changes: 0 additions & 24 deletions src/shared/utils/graphUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,6 @@ export const optionToLink = (option, index, options) => {
}
};

export const getNewGraph = (graphRef) => {
const {
current: {
state: {
nodes,
links
}
}
} = graphRef;
return {
nodes: Object.values(nodes).map(node => {
return { id: node.id, x: node.x, y: node.y };
}),
links: Object.entries(links).map(([source, targets]) => {
return Object.keys(targets).map(target => {
return {
source,
target,
};
});
}).flat()
};
};

export const sourceDestInitialValues = {
sequence: undefined,
nextSeq: undefined,
Expand Down

0 comments on commit 6c4e6f9

Please sign in to comment.