diff --git a/frontend/src/actions/action-types.js b/frontend/src/actions/action-types.js
index dd10ef5325f1d2a048ffa0f26f6bc55c683f0b36..421b95ff58d8acfd2e8275319805124310b0c4cf 100644
--- a/frontend/src/actions/action-types.js
+++ b/frontend/src/actions/action-types.js
@@ -1,3 +1,5 @@
export const SAVE_MAIN_MAP_POSITION = 'SAVE_MAIN_MAP_POSITION';
export const SAVE_SELECTED_UNIVERSITIES = 'SAVE_SELECTED_UNIVERSITIES';
export const SAVE_FILTER_CONFIG = 'SAVE_FILTER_CONFIG';
+export const SAVE_APP_THEME = 'SAVE_APP_THEME';
+export const SAVE_APP_COLOR_PICKER = 'SAVE_APP_COLOR_PICKER';
diff --git a/frontend/src/actions/theme.js b/frontend/src/actions/theme.js
new file mode 100644
index 0000000000000000000000000000000000000000..25ac55d25bb969dfcffa0273382e91c2c322168b
--- /dev/null
+++ b/frontend/src/actions/theme.js
@@ -0,0 +1,20 @@
+
+import {
+ SAVE_APP_THEME,
+ SAVE_APP_COLOR_PICKER
+} from "./action-types";
+
+
+export function saveAppTheme(theme) {
+ return {
+ type: SAVE_APP_THEME,
+ theme
+ };
+}
+
+export function saveAppColorPicker(s) {
+ return {
+ type: SAVE_APP_COLOR_PICKER,
+ state: s
+ };
+}
diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js
index d08ab9a0a692d648fbe1f435aeda6dae2d6fe59b..95f05b348f6a4f5a06bec519040df2745acc9789 100644
--- a/frontend/src/components/App.js
+++ b/frontend/src/components/App.js
@@ -22,12 +22,12 @@ import MyComponent from './MyComponent'
// import route Components here
import {
- Route,
+ Route,
} from 'react-router-dom';
import {
- countriesFetchData,
- currenciesFetchData,
+ countriesFetchData,
+ currenciesFetchData,
} from '../generated/actions';
@@ -35,160 +35,160 @@ import PageMap from './pages/PageMap';
import PageHome from './pages/PageHome';
import PageFilter from './pages/PageFilter';
import PageSearch from './pages/PageSearch';
+import PageSettings from './pages/PageSettings';
const drawerWidth = 240;
const styles = theme => ({
- root: {
- display: 'flex',
+ root: {
+ display: 'flex',
+ },
+ toolbar: {
+ paddingRight: 24, // keep right padding when drawer closed
+ },
+ toolbarIcon: {
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'flex-end',
+ padding: '0 8px',
+ ...theme.mixins.toolbar,
+ },
+ chip: {
+ margin: theme.spacing.unit,
+ },
+ menuButton: {
+ marginRight: 4,
+ },
+ hideIt: {
+ display: 'none',
+ },
+ title: {
+ flexGrow: 1,
+ },
+ drawerPaper: {
+ position: 'relative',
+ whiteSpace: 'nowrap',
+ width: drawerWidth,
+ transition: theme.transitions.create('width', {
+ easing: theme.transitions.easing.sharp,
+ duration: theme.transitions.duration.enteringScreen,
+ }),
+ },
+ drawerPaperClose: {
+ overflowX: 'hidden',
+ transition: theme.transitions.create('width', {
+ easing: theme.transitions.easing.sharp,
+ duration: theme.transitions.duration.leavingScreen,
+ }),
+ width: theme.spacing.unit * 7,
+ [theme.breakpoints.up('sm')]: {
+ width: theme.spacing.unit * 9,
},
- toolbar: {
- paddingRight: 24, // keep right padding when drawer closed
- },
- toolbarIcon: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'flex-end',
- padding: '0 8px',
- ...theme.mixins.toolbar,
- },
- chip: {
- margin: theme.spacing.unit,
- },
- menuButton: {
- marginRight: 4,
- },
- hideIt: {
- display: 'none',
- },
- title: {
- flexGrow: 1,
- },
- drawerPaper: {
- position: 'relative',
- whiteSpace: 'nowrap',
- width: drawerWidth,
- transition: theme.transitions.create('width', {
- easing: theme.transitions.easing.sharp,
- duration: theme.transitions.duration.enteringScreen,
- }),
- },
- drawerPaperClose: {
- overflowX: 'hidden',
- transition: theme.transitions.create('width', {
- easing: theme.transitions.easing.sharp,
- duration: theme.transitions.duration.leavingScreen,
- }),
- width: theme.spacing.unit * 7,
- [theme.breakpoints.up('sm')]: {
- width: theme.spacing.unit * 9,
- },
- },
- content: {
- flexGrow: 1,
- padding: theme.spacing.unit * 3,
- height: '100vh',
- overflow: 'auto',
- },
- chartContainer: {
- marginLeft: -22,
- },
- tableContainer: {
- height: 320,
- },
- myPaper: {
- padding: 16
- },
- null: {}
+ },
+ content: {
+ flexGrow: 1,
+ padding: theme.spacing.unit * 3,
+ height: '100vh',
+ overflow: 'auto',
+ },
+ chartContainer: {
+ marginLeft: -22,
+ },
+ tableContainer: {
+ height: 320,
+ },
+ myPaper: {
+ padding: 16
+ },
+ null: {}
});
class App extends MyComponent {
- state = {
- open: true,
- };
-
- handleDrawerOpen = () => {
- this.setState({ open: true });
- };
-
- handleDrawerClose = () => {
- this.setState({ open: false });
- };
-
- myRender() {
-
- const { classes } = this.props;
-
- return (
-
-
-
-
-
-
- }
- label="Outgoing REX"
- className={classes.chip}
- color="primary"
- />
-
-
-
-
-
-
-
-
-
-
-
- {mainListItems}
-
- {secondaryListItems}
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
+ state = {
+ open: true,
+ };
+
+ handleDrawerOpen = () => {
+ this.setState({ open: true });
+ };
+
+ handleDrawerClose = () => {
+ this.setState({ open: false });
+ };
+
+ myRender() {
+
+ const { classes } = this.props;
+
+ return (
+
+
+
+
+
+
+ }
+ label="Outgoing REX"
+ className={classes.chip}
+ color="primary"
+ />
+
+
+
+
+
+
+
+
+
+
+
+ {mainListItems}
+
+ {secondaryListItems}
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
}
App.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired,
};
const mapStateToProps = (state) => {
- return {
- countries: state.countries,
- currencies: state.currencies
- }
+ return {
+ countries: state.countries,
+ currencies: state.currencies
+ }
};
const mapDispatchToProps = (dispatch) => {
- return {
- fetchData: {
- countries: () => dispatch(countriesFetchData()),
- currencies: () => dispatch(currenciesFetchData()),
- }
- };
+ return {
+ fetchData: {
+ countries: () => dispatch(countriesFetchData()),
+ currencies: () => dispatch(currenciesFetchData()),
+ }
+ };
};
-export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(App));
+export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles, { withTheme: true })(App));
diff --git a/frontend/src/components/ThemeProvider.js b/frontend/src/components/ThemeProvider.js
new file mode 100644
index 0000000000000000000000000000000000000000..c48385fc1dabbfc75105035e8159db6a1e32261f
--- /dev/null
+++ b/frontend/src/components/ThemeProvider.js
@@ -0,0 +1,33 @@
+
+import React from "react";
+import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
+import createMuiTheme from '@material-ui/core/styles/createMuiTheme';
+import { connect } from "react-redux";
+import { BrowserRouter as Router, Route } from 'react-router-dom';
+
+
+
+class ThemeProvider extends React.Component {
+
+ render() {
+ console.log("ici")
+ return (
+
+
+
+ {this.props.children}
+
+
+
+ )
+ }
+}
+
+const mapStateToProps = (state) => {
+ return {
+ theme: state.app.appTheme
+ };
+};
+
+
+export default connect(mapStateToProps)(ThemeProvider);
diff --git a/frontend/src/components/map/UnivMap.js b/frontend/src/components/map/UnivMap.js
index 61061ce1a392da62b3ea36827a87788552cb6385..fe93272401bcea12bce6ecd778384594e3f2b6d1 100644
--- a/frontend/src/components/map/UnivMap.js
+++ b/frontend/src/components/map/UnivMap.js
@@ -36,13 +36,13 @@ class UnivMap extends MyComponent {
}
saveLeafletInstance = (l) => {
- this.setState(Object.assign(this.state, {
+ this.setState(Object.assign({},this.state, {
leaflet_instance: l,
}))
}
saveSelectedLayer = (e) => {
- this.setState(Object.assign(this.state, {
+ this.setState(Object.assign({},this.state, {
selected_layer: e.name,
}))
}
diff --git a/frontend/src/components/pages/PageSettings.js b/frontend/src/components/pages/PageSettings.js
new file mode 100644
index 0000000000000000000000000000000000000000..614ad30885a2888138d474fe75ecc8dc370cd7ba
--- /dev/null
+++ b/frontend/src/components/pages/PageSettings.js
@@ -0,0 +1,37 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { withStyles } from '@material-ui/core/styles';
+import Grid from '@material-ui/core/Grid';
+import Typography from '@material-ui/core/Typography';
+import Settings from '../settings/Settings';
+import Paper from '@material-ui/core/Paper';
+
+const styles = theme => ({
+ myPaper: {
+ padding: 16
+ }
+});
+
+class PageSettings extends React.Component {
+ render() {
+ const { classes } = this.props;
+ return (
+
+
+
+
+ Paramètres
+
+
+
+
+
+ );
+ }
+}
+
+PageSettings.propTypes = {
+ classes: PropTypes.object.isRequired,
+};
+
+export default withStyles(styles)(PageSettings);
diff --git a/frontend/src/components/search/Search.js b/frontend/src/components/search/Search.js
index e66d76efebbcdbbcb67cd0a59ca2c4b10670118a..be3df402912ff2126a94eff401190f4e04cb2f03 100644
--- a/frontend/src/components/search/Search.js
+++ b/frontend/src/components/search/Search.js
@@ -31,7 +31,6 @@ class Search extends MyComponent {
}
getSuggestions(value) {
- console.log(value)
const { universities } = this.getAllFetchedData();
const filter = fuzzysort.go(value, _.map(universities, (univ) => univ), { keys: ['name', 'acronym'] });
let out;
diff --git a/frontend/src/components/search/UnivList.js b/frontend/src/components/search/UnivList.js
index 15f960294d55686788a043d7843bd99761c5df24..c83b67c2a38f2d0a394a2077e2d4f8a0b2863bae 100644
--- a/frontend/src/components/search/UnivList.js
+++ b/frontend/src/components/search/UnivList.js
@@ -46,21 +46,18 @@ class UnivList extends React.Component {
handleNext = () => {
- console.log("next")
this.setState(prevState => ({
activeStep: prevState.activeStep + 1,
}));
};
handleBack = () => {
- console.log("back")
this.setState(prevState => ({
activeStep: prevState.activeStep - 1,
}));
};
handleStepChange = activeStep => {
- console.log("step change")
this.setState({ activeStep });
};
@@ -75,7 +72,6 @@ class UnivList extends React.Component {
}
const maxSteps = Math.ceil(numberOfItems / itemsPerPage);
- console.log("maxSteps", maxSteps, "numberOfItems", numberOfItems, "itemsPerPage");
return (
({
+ root: {
+ position: 'relative',
+ overflow: 'hidden',
+ },
+ appFrame: {
+ position: 'relative',
+ height: 200,
+ backgroundColor: theme.palette.background.paper,
+ },
+ statusBar: {
+ width: '100%',
+ height: 24,
+ },
+ menuButton: {
+ marginLeft: -12,
+ marginRight: 20,
+ },
+ code: {
+ marginTop: theme.spacing.unit,
+ '& pre': {
+ margin: '0px !important',
+ },
+ },
+ fab: {
+ position: 'absolute',
+ bottom: theme.spacing.unit * 2,
+ right: theme.spacing.unit * 2,
+ },
+});
+
+function ColorDemo(props) {
+ const { classes } = props;
+
+ return (
+
+
+
+
+
+
+
+
+
+ Color sample
+
+
+
+
+
+
+ );
+}
+
+ColorDemo.propTypes = {
+ classes: PropTypes.object.isRequired,
+ theme: PropTypes.object.isRequired,
+};
+
+export default withStyles(styles, { withTheme: true })(ColorDemo);
\ No newline at end of file
diff --git a/frontend/src/components/settings/ColorTools.js b/frontend/src/components/settings/ColorTools.js
new file mode 100644
index 0000000000000000000000000000000000000000..9bc6ff54d024b6b43a45dfc95bf66cac0a98647f
--- /dev/null
+++ b/frontend/src/components/settings/ColorTools.js
@@ -0,0 +1,302 @@
+// Inspired by from https://github.com/mui-org/material-ui/blob/master/docs/src/pages/style/color/ColorTool.js
+// MIT Licence and modified
+
+import React from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+import compose from 'recompose/compose';
+import { withStyles } from '@material-ui/core/styles';
+import * as colors from '@material-ui/core/colors';
+import Grid from '@material-ui/core/Grid';
+import Input from '@material-ui/core/Input';
+import Radio from '@material-ui/core/Radio';
+import Tooltip from '@material-ui/core/Tooltip';
+import Typography from '@material-ui/core/Typography';
+import Button from '@material-ui/core/Button';
+import CheckIcon from '@material-ui/icons/Check';
+import Slider from '@material-ui/lab/Slider';
+import { rgbToHex } from '@material-ui/core/styles/colorManipulator';
+import { capitalize } from '@material-ui/core/utils/helpers';
+// import actionTypes from 'docs/src/modules/redux/actionTypes';
+import ColorDemo from './ColorDemo';
+import { saveAppTheme, saveAppColorPicker } from '../../actions/theme';
+import FormGroup from '@material-ui/core/FormGroup';
+import FormControlLabel from '@material-ui/core/FormControlLabel';
+import Switch from '@material-ui/core/Switch';
+import createMuiTheme from '@material-ui/core/styles/createMuiTheme';
+import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
+
+
+const hues = Object.keys(colors).slice(1, 17);
+const shades = [900, 800, 700, 600, 500, 400, 300, 200, 100, 50, 'A700', 'A400', 'A200', 'A100'];
+
+const styles = theme => ({
+ radio: {
+ width: 48,
+ height: 48,
+ },
+ radioSelected: {
+ width: 48,
+ height: 48,
+ border: '1px solid white',
+ color: theme.palette.common.white,
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ },
+ swatch: {
+ width: 192,
+ },
+ sliderContainer: {
+ display: 'flex',
+ alignItems: 'center',
+ marginTop: theme.spacing.unit * 2,
+ marginBottom: theme.spacing.unit,
+ },
+ slider: {
+ width: 'calc(100% - 80px)',
+ },
+ colorBar: {
+ marginTop: theme.spacing.unit * 2,
+ },
+ colorSquare: {
+ width: 64,
+ height: 64,
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ },
+});
+
+class ColorTool extends React.Component {
+ state = this.props.state
+ componentWillUnmount() {
+ this.props.saveColorPicker(this.state);
+ }
+ componentDidMount() {
+ if (JSON.stringify(this.props.state) != JSON.stringify(this.state)) {
+ this.setState(this.props.state);
+ }
+ }
+
+ handleChangeColor = name => event => {
+ const isRgb = string => /#?([0-9a-f]{6})/i.test(string);
+
+ const {
+ target: { value: color },
+ } = event;
+
+ this.setState({
+ [`${name}Input`]: color,
+ });
+
+ if (isRgb(color)) {
+ this.setState({
+ [name]: color,
+ });
+ }
+ };
+
+ handleChangeHue = name => event => {
+ const {
+ target: { value: hue },
+ } = event;
+
+ this.setState(state => {
+ const color = colors[hue][shades[state[`${name}Shade`]]];
+ return {
+ [`${name}Hue`]: hue,
+ [name]: color,
+ [`${name}Input`]: color,
+ };
+ });
+ };
+
+ handleChangeShade = name => (event, shade) => {
+ this.setState(state => {
+ const color = colors[state[`${name}Hue`]][shades[shade]];
+ return {
+ [`${name}Shade`]: shade,
+ [name]: color,
+ [`${name}Input`]: color,
+ };
+ });
+ };
+
+ handleChangeNightMode() {
+ this.setState({
+ darkModeActivated: !this.state.darkModeActivated
+ })
+ }
+
+ handleChangeDocsColors = () => {
+ this.props.saveTheme(this.getThemeFromState());
+ };
+
+ getThemeFromState() {
+ return {
+ palette: {
+ primary: { main: this.state.primary },
+ secondary: { main: this.state.secondary },
+ type: this.state.darkModeActivated ? 'dark' : 'light'
+ },
+ }
+ }
+
+ render() {
+ const { classes, theme } = this.props;
+ const { primaryShade, secondaryShade } = this.state;
+
+ const colorBar = color => {
+ const background = { main: color };
+ theme.palette.augmentColor(background);
+
+ return (
+
+ {['dark', 'main', 'light'].map(key => (
+
+
+ {rgbToHex(background[key])}
+
+
+ ))}
+
+ );
+ };
+
+ const colorPicker = intent => {
+ const intentInput = this.state[`${intent}Input`];
+ const intentShade = this.state[`${intent}Shade`];
+ const color = this.state[`${intent}`];
+ const caption = intent == 'primary' ? "Couleur primaire" : "Couleur secondaire";
+ return (
+
+
+ {caption}
+
+
+
+ Nuance :
+
+ {shades[intentShade]}
+
+
+ {hues.map(hue => {
+ const shade = intent === 'primary' ? shades[primaryShade] : shades[secondaryShade];
+ const backgroundColor = colors[hue][shade];
+
+ return (
+
+ }
+ checkedIcon={
+
+
+
+ }
+ />
+
+ );
+ })}
+
+ {colorBar(color)}
+
+ );
+ };
+
+ const { currentUiTheme } = this.props;
+ const tmp = {
+ palette: {
+ primary: { main: currentUiTheme.palette.primary.main },
+ secondary: { main: currentUiTheme.palette.secondary.main }
+ }
+ }
+ const hasChanges = JSON.stringify(tmp) != JSON.stringify(this.getThemeFromState());
+ return (
+
+
+
+ this.handleChangeNightMode()}
+ value="Nimportequoi"
+ />
+ }
+ />
+
+ {colorPicker('primary')}
+ {colorPicker('secondary')}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+ColorTool.propTypes = {
+ classes: PropTypes.object.isRequired,
+ theme: PropTypes.object.isRequired,
+};
+
+
+const mapStateToProps = (state) => {
+ return {
+ currentUiTheme: state.app.appTheme,
+ state: state.app.colorPickerState
+ }
+};
+
+const mapDispatchToProps = (dispatch) => {
+ return {
+ saveTheme: (theme) => dispatch(saveAppTheme(theme)),
+ saveColorPicker: (partialState) => dispatch(saveAppColorPicker(partialState))
+ };
+};
+export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles, { withTheme: true })(ColorTool));
diff --git a/frontend/src/components/settings/Settings.js b/frontend/src/components/settings/Settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..101cbeaa18815345c6d2348edaf36bb4679b5642
--- /dev/null
+++ b/frontend/src/components/settings/Settings.js
@@ -0,0 +1,54 @@
+import React from 'react';
+
+import MyComponent from '../MyComponent'
+import { connect } from "react-redux";
+import _ from 'underscore';
+import ColorTools from './ColorTools';
+// import { saveSelectedUniversities, saveSettingsConfig } from '../../actions/Settings';
+
+// import {
+// universitiesFetchData,
+// mainCampusesFetchData,
+// citiesFetchData,
+// countriesFetchData
+// } from '../../generated/actions';
+
+class Settings extends MyComponent {
+
+ myRender() {
+
+ return (
+
+
+ );
+ }
+}
+
+
+
+// const mapStateToProps = (state) => {
+// return {
+// universities: state.universities,
+// mainCampuses: state.mainCampuses,
+// cities: state.cities,
+// countries: state.countries,
+// contriesSettingsConfig: state.app.Settings.contriesSettings
+// };
+// };
+
+// const mapDispatchToProps = (dispatch) => {
+// return {
+// fetchData: {
+// universities: () => dispatch(universitiesFetchData()),
+// mainCampuses: () => dispatch(mainCampusesFetchData()),
+// cities: () => dispatch(citiesFetchData()),
+// countries: () => dispatch(countriesFetchData())
+// },
+// saveSelection: (selectedUniversities) => dispatch(saveSelectedUniversities(selectedUniversities)),
+// saveConfig: (config) => dispatch(saveSettingsConfig(config))
+// };
+// };
+
+
+// export default connect(mapStateToProps, mapDispatchToProps)(Settings);
+export default Settings;
diff --git a/frontend/src/components/template/listItems.js b/frontend/src/components/template/listItems.js
index 860f61b6ce98b16063530bb2627eb765f59cd5ba..ca4ca04503cd05189d3bd4cf73d4b4c9358d143c 100644
--- a/frontend/src/components/template/listItems.js
+++ b/frontend/src/components/template/listItems.js
@@ -10,6 +10,7 @@ import BarChartIcon from '@material-ui/icons/BarChart';
import HomeIcon from '@material-ui/icons/Home';
import SearchIcon from '@material-ui/icons/Search';
import FilterIcon from '@material-ui/icons/FilterList';
+import SettingsIcon from '@material-ui/icons/Settings';
import AssignmentIcon from '@material-ui/icons/Assignment';
import { NavLink } from 'react-router-dom'
@@ -58,6 +59,15 @@ export const mainListItems = (
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/index.js b/frontend/src/index.js
index acd062ca24c8c29863aa186959260e87ba2f05fb..5429a41ca19f03d8fa4f10ec5c9703071688cf2b 100644
--- a/frontend/src/index.js
+++ b/frontend/src/index.js
@@ -7,14 +7,15 @@ import { BrowserRouter as Router, Route } from 'react-router-dom';
import store from "./store/index";
import App from "./components/App";
+import ThemeProvider from './components/ThemeProvider'
const MainReactEntry = () => (
-
-
-
-
-
+
+
+
+
+
);
diff --git a/frontend/src/reducers/filter.js b/frontend/src/reducers/filter.js
index df4d7e424b2a8810e601d2a3529bbc613c0776bb..c70f94bdabdf82994708b296d58a017803f2c6c0 100644
--- a/frontend/src/reducers/filter.js
+++ b/frontend/src/reducers/filter.js
@@ -15,7 +15,7 @@ export function saveSelectedUniversities(state = [], action) {
export function saveFilterConfig(state = { contriesFilter: { selectedItems: [], inputValue: '' } }, action) {
switch (action.type) {
case SAVE_FILTER_CONFIG:
- return Object.assign(state, action.config)
+ return Object.assign({}, state, action.config)
default:
return state;
diff --git a/frontend/src/reducers/index.js b/frontend/src/reducers/index.js
index f31d9a37b24f1789f54f2c726265a420e11ff519..da06364f0e4dba561c84cb20a09c3d4fd4a9c0ae 100644
--- a/frontend/src/reducers/index.js
+++ b/frontend/src/reducers/index.js
@@ -13,11 +13,14 @@ import {
import { saveMainMapPosition } from './map';
import { saveSelectedUniversities } from './filter';
import { saveFilterConfig } from './filter';
+import { saveAppTheme, saveAppColorPicker } from './theme';
const appReducers = combineReducers({
mainMap: saveMainMapPosition,
selectedUniversities: saveSelectedUniversities,
filter: saveFilterConfig,
+ appTheme: saveAppTheme,
+ colorPickerState: saveAppColorPicker
})
const rootReducer = combineReducers({
diff --git a/frontend/src/reducers/search.js b/frontend/src/reducers/search.js
new file mode 100644
index 0000000000000000000000000000000000000000..c70f94bdabdf82994708b296d58a017803f2c6c0
--- /dev/null
+++ b/frontend/src/reducers/search.js
@@ -0,0 +1,24 @@
+import { SAVE_SELECTED_UNIVERSITIES, SAVE_FILTER_CONFIG } from '../actions/action-types'
+
+export function saveSelectedUniversities(state = [], action) {
+ switch (action.type) {
+ case SAVE_SELECTED_UNIVERSITIES:
+ return {
+ selection: action.new_selection,
+ }
+
+ default:
+ return state;
+ }
+}
+
+export function saveFilterConfig(state = { contriesFilter: { selectedItems: [], inputValue: '' } }, action) {
+ switch (action.type) {
+ case SAVE_FILTER_CONFIG:
+ return Object.assign({}, state, action.config)
+
+ default:
+ return state;
+ }
+}
+
diff --git a/frontend/src/reducers/theme.js b/frontend/src/reducers/theme.js
new file mode 100644
index 0000000000000000000000000000000000000000..7e5db62eae8dd67c7bd7935fb90f3bd26dcdc435
--- /dev/null
+++ b/frontend/src/reducers/theme.js
@@ -0,0 +1,43 @@
+import { SAVE_APP_THEME, SAVE_APP_COLOR_PICKER } from '../actions/action-types'
+import indigo from '@material-ui/core/colors/indigo';
+import pink from '@material-ui/core/colors/pink';
+
+const defaultTheme = {
+ palette: {
+ primary: pink,
+ secondary: indigo, // Indigo is probably a good match with pink,
+ type: 'dark'
+ }
+}
+export function saveAppTheme(state = defaultTheme, action) {
+ switch (action.type) {
+ case SAVE_APP_THEME:
+ return Object.assign({}, state, action.theme)
+
+ default:
+ return state;
+ }
+}
+
+
+const defaultColorPicker = {
+ primary: defaultTheme.palette.primary[500],
+ secondary: defaultTheme.palette.secondary['A400'],
+ primaryInput: '#2196f3',
+ secondaryInput: '#f50057',
+ primaryHue: 'blue',
+ secondaryHue: 'pink',
+ primaryShade: 4,
+ secondaryShade: 11,
+ darkModeActivated: defaultTheme.palette.type == 'dark'
+};
+
+export function saveAppColorPicker(state = defaultColorPicker, action) {
+ switch (action.type) {
+ case SAVE_APP_COLOR_PICKER:
+ console.log("je passe ici !")
+ return Object.assign({}, state, action.state)
+ default:
+ return state;
+ }
+}
diff --git a/frontend/templates/frontend/index.html b/frontend/templates/frontend/index.html
index 1a3d93f579de037c60dce8132b9e8bb8ffbb46dc..5573f431665e5e6f978661b4279ac61ff408bb3b 100644
--- a/frontend/templates/frontend/index.html
+++ b/frontend/templates/frontend/index.html
@@ -2,7 +2,11 @@
-
+
Outgoing REX
diff --git a/package-lock.json b/package-lock.json
index 6c751c51484cd444e3be7aae93902667c6030178..20c12d107fec57f284c56c24caa71a7536570354 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -81,6 +81,17 @@
}
}
},
+ "@material-ui/docs": {
+ "version": "1.0.0-alpha.5",
+ "resolved": "https://registry.npmjs.org/@material-ui/docs/-/docs-1.0.0-alpha.5.tgz",
+ "integrity": "sha512-JeXSV4ICzL4xf9dZhAi/2N3EMkZT22z2GBF5tf/KjNXOKbb7yp93b2YLKl/Z1Ua4IIi28oh5YTRJ5v2mZK3MAQ==",
+ "requires": {
+ "@babel/runtime": "7.0.0-rc.1",
+ "marked": "^0.5.0",
+ "nprogress": "^0.2.0",
+ "prismjs": "^1.8.4"
+ }
+ },
"@material-ui/icons": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-2.0.3.tgz",
@@ -91,6 +102,31 @@
"recompose": "^0.28.0"
}
},
+ "@material-ui/lab": {
+ "version": "3.0.0-alpha.14",
+ "resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-3.0.0-alpha.14.tgz",
+ "integrity": "sha512-OQHF+eWdCCUrnYEcubG+Ok+gcAjxzuj3UlzpbzVEy1W5Ja50MVuz1i2ZsAjOxwBDBASaMLYqHkuyT4vA746K3Q==",
+ "requires": {
+ "@babel/runtime": "7.0.0",
+ "classnames": "^2.2.5",
+ "keycode": "^2.1.9"
+ },
+ "dependencies": {
+ "@babel/runtime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz",
+ "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==",
+ "requires": {
+ "regenerator-runtime": "^0.12.0"
+ }
+ },
+ "regenerator-runtime": {
+ "version": "0.12.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz",
+ "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg=="
+ }
+ }
+ },
"@types/jss": {
"version": "9.5.5",
"resolved": "https://registry.npmjs.org/@types/jss/-/jss-9.5.5.tgz",
@@ -1944,6 +1980,17 @@
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
"dev": true
},
+ "clipboard": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.1.tgz",
+ "integrity": "sha512-7yhQBmtN+uYZmfRjjVjKa0dZdWuabzpSKGtyQZN+9C8xlC788SSJjOHWh7tzurfwTqTD5UDYAhIv5fRJg3sHjQ==",
+ "optional": true,
+ "requires": {
+ "good-listener": "^1.2.2",
+ "select": "^1.1.2",
+ "tiny-emitter": "^2.0.0"
+ }
+ },
"cliui": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
@@ -2426,6 +2473,12 @@
}
}
},
+ "delegate": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
+ "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
+ "optional": true
+ },
"des.js": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz",
@@ -3732,6 +3785,15 @@
}
}
},
+ "good-listener": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
+ "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
+ "optional": true,
+ "requires": {
+ "delegate": "^3.1.2"
+ }
+ },
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
@@ -4565,6 +4627,11 @@
"object-visit": "^1.0.0"
}
},
+ "marked": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-0.5.0.tgz",
+ "integrity": "sha512-UhjmkCWKu1SS/BIePL2a59BMJ7V42EYtTfksodPRXzPEGEph3Inp5dylseqt+KbU9Jglsx8xcMKmlumfJMBXAA=="
+ },
"math-expression-evaluator": {
"version": "1.2.17",
"resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz",
@@ -4853,6 +4920,11 @@
"path-key": "^2.0.0"
}
},
+ "nprogress": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz",
+ "integrity": "sha1-y480xTIT2JVyP8urkH6UIq28r7E="
+ },
"number-is-nan": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
@@ -5227,6 +5299,14 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
"dev": true
},
+ "prismjs": {
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.15.0.tgz",
+ "integrity": "sha512-Lf2JrFYx8FanHrjoV5oL8YHCclLQgbJcVZR+gikGGMqz6ub5QVWDTM6YIwm3BuPxM/LOV+rKns3LssXNLIf+DA==",
+ "requires": {
+ "clipboard": "^2.0.0"
+ }
+ },
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
@@ -6035,6 +6115,12 @@
"ajv-keywords": "^3.1.0"
}
},
+ "select": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
+ "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
+ "optional": true
+ },
"semver": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
@@ -6489,6 +6575,12 @@
"setimmediate": "^1.0.4"
}
},
+ "tiny-emitter": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz",
+ "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==",
+ "optional": true
+ },
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
diff --git a/package.json b/package.json
index 8d928477f8d733d79dc82a951734c89c998810f3..f2fba1a015266cc43b23e65671a3abf1df32b99a 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,8 @@
"license": "ISC",
"dependencies": {
"@material-ui/core": "^3.0.1",
+ "@material-ui/docs": "^1.0.0-alpha.5",
+ "@material-ui/lab": "^3.0.0-alpha.14",
"babel-polyfill": "^6.26.0",
"cross-fetch": "^2.2.2",
"downshift": "^2.2.0",