diff --git a/ui/src/visualizations/File-Evolution/config.js b/ui/src/visualizations/File-Evolution/config.js new file mode 100644 index 00000000..21f44b5c --- /dev/null +++ b/ui/src/visualizations/File-Evolution/config.js @@ -0,0 +1,165 @@ +'use strict'; + +import { connect } from 'react-redux'; +import styles from './styles.scss'; + +import { + setSelectedAuthors, + setCommitBoxHeight, + setCommitBoxWidth, + setCommitBoxColor, + setSelectedBranches, + setShowCommitDate, + setShowCommitMessage, + setShowCommitAuthor +} from './sagas'; + +import React from 'react'; +import CheckboxLegend from '../../components/CheckboxLegend'; +import TabCombo from '../../components/TabCombo'; + +const mapStateToProps = (state /*, ownProps*/) => { + //console.log(state); + const FileEvolutionState = state.visualizations.fileEvolution.state; + console.log(FileEvolutionState); + return { + branches: FileEvolutionState.data.data.branches, + committers: FileEvolutionState.data.data.committers, + commits: FileEvolutionState.data.data.commits, + authorsColorPalette: FileEvolutionState.data.data.authorsColorPalette, + branchesColorPalette: FileEvolutionState.data.data.branchesColorPalette, + selectedAuthors: FileEvolutionState.config.selectedAuthors, + selectedBranches: FileEvolutionState.config.selectedBranches, + commitBoxHeight: FileEvolutionState.config.commitBoxHeight, + commitBoxWidth: FileEvolutionState.config.commitBoxWidth, + commitBoxColor: FileEvolutionState.config.commitBoxColor, + showCommitDate: FileEvolutionState.config.showCommitDate, + showCommitAuthor: FileEvolutionState.config.showCommitAuthor, + showCommitMessage: FileEvolutionState.config.showCommitMessage + }; +}; + +const mapDispatchToProps = (dispatch /*, ownProps*/) => { + return { + onSetSelectedAuthors: selectedAuthors => dispatch(setSelectedAuthors(selectedAuthors)), + onSetSelectedBranches: selectedBranches => dispatch(setSelectedBranches(selectedBranches)), + onSetCommitBoxHeight: commitBoxHeight => dispatch(setCommitBoxHeight(commitBoxHeight)), + onSetCommitBoxWidth: commitBoxWidth => dispatch(setCommitBoxWidth(commitBoxWidth)), + onClickShowCommitBoxDate: showCommitDate => dispatch(setShowCommitDate(showCommitDate)), + onClickShowCommitBoxAuthor: showCommitAuthor => dispatch(setShowCommitAuthor(showCommitAuthor)), + onSetShowCommitMessage: showCommitMessage => dispatch(setShowCommitMessage(showCommitMessage)), + onClickCommitBoxColor: commitBoxColor => dispatch(setCommitBoxColor(commitBoxColor)) + }; +}; + +//TODO ICONS in TabCombo +const FileEvolutionConfigComponent = props => { + return ( +
+
+
+
+ +
+ + { + props.onSetCommitBoxHeight(parseInt(e.target.value, 10)); + }} + /> +
+
+ + { + props.onSetCommitBoxWidth(parseInt(e.target.value, 10)); + }} + /> +
+ + + props.onClickCommitBoxColor(value)} + /> +
+
+ + + + + + props.onSetShowCommitMessage(value)} + /> +
+
+ +
+ +
+
+ +
+
+
+
+
+ ); +}; + +const FileEvolutionConfig = connect(mapStateToProps, mapDispatchToProps)(FileEvolutionConfigComponent); + +export default FileEvolutionConfig; diff --git a/ui/src/visualizations/File-Evolution/styles.scss b/ui/src/visualizations/File-Evolution/styles.scss new file mode 100644 index 00000000..b717df68 --- /dev/null +++ b/ui/src/visualizations/File-Evolution/styles.scss @@ -0,0 +1,35 @@ +@import '~bulma'; + +.help { + width: 100%; + overflow-y: scroll; + font-size: 1.5em; + + h2 { + font-size: 1.2em; + font-weight: bold; + } + + h3 { + font-size: 1.1em; + font-weight: bold; + } + + ul { + list-style-type: circle; + margin-left: 1.5em; + } + + p { + margin-bottom: 1em; + } + + i { + width: 25px; + text-align: center; + } +} + +.configContainer{ +} +