Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
47bcdd72
Commit
47bcdd72
authored
Aug 23, 2018
by
Florent Chehab
Browse files
Files reorganized
parent
0717fd76
Changes
8
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/App.js
View file @
47bcdd72
import
React
from
"
react
"
;
import
ReactDOM
from
"
react-dom
"
;
import
{
Provider
}
from
"
react-redux
"
;
// Inspired by https://github.com/mui-org/material-ui/tree/master/docs/src/pages/page-layout-examples/dashboard
import
store
from
"
../store/index
"
;
import
Dashboard
from
"
./Dashboard
"
;
import
{
BrowserRouter
as
Router
,
Route
}
from
'
react-router-dom
'
;
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
import
{
withStyles
}
from
'
@material-ui/core/styles
'
;
import
CssBaseline
from
'
@material-ui/core/CssBaseline
'
;
import
Drawer
from
'
@material-ui/core/Drawer
'
;
import
List
from
'
@material-ui/core/List
'
;
import
Divider
from
'
@material-ui/core/Divider
'
;
import
IconButton
from
'
@material-ui/core/IconButton
'
;
import
MenuIcon
from
'
@material-ui/icons/Menu
'
;
import
Chip
from
'
@material-ui/core/Chip
'
;
import
Avatar
from
'
@material-ui/core/Avatar
'
;
import
ChevronLeftIcon
from
'
@material-ui/icons/ChevronLeft
'
;
import
SchoolIcon
from
'
@material-ui/icons/School
'
;
import
{
mainListItems
,
secondaryListItems
}
from
'
./template/listItems
'
;
const
App
=
()
=>
(
<
Provider
store
=
{
store
}
>
<
Router
>
<
Route
path
=
"
/:filter?
"
component
=
{
Dashboard
}
/
>
<
/Router
>
<
/Provider
>
);
// import route Components here
import
{
BrowserRouter
as
Router
,
Route
,
}
from
'
react-router-dom
'
;
import
PageMap
from
'
./pages/PageMap
'
;
import
PageHome
from
'
./pages/PageHome
'
;
const
w
ra
pper
=
document
.
getElementById
(
"
app
"
)
;
const
d
ra
werWidth
=
240
;
wrapper
?
ReactDOM
.
render
(
<
App
/>
,
wrapper
)
:
null
;
const
styles
=
theme
=>
({
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
,
},
},
content
:
{
flexGrow
:
1
,
padding
:
theme
.
spacing
.
unit
*
3
,
height
:
'
100vh
'
,
overflow
:
'
auto
'
,
},
chartContainer
:
{
marginLeft
:
-
22
,
},
tableContainer
:
{
height
:
320
,
},
myPaper
:
{
padding
:
16
}
});
class
App
extends
React
.
Component
{
state
=
{
open
:
true
,
};
handleDrawerOpen
=
()
=>
{
this
.
setState
({
open
:
true
});
};
handleDrawerClose
=
()
=>
{
this
.
setState
({
open
:
false
});
};
render
()
{
const
{
classes
}
=
this
.
props
;
return
(
<
React
.
Fragment
>
<
CssBaseline
/>
<
div
className
=
{
classes
.
root
}
>
<
Drawer
variant
=
"
permanent
"
classes
=
{{
paper
:
classNames
(
classes
.
drawerPaper
,
!
this
.
state
.
open
&&
classes
.
drawerPaperClose
),
}}
open
=
{
this
.
state
.
open
}
>
<
div
className
=
{
classNames
(
classes
.
toolbarIcon
)}
>
<
div
className
=
{(
!
this
.
state
.
open
)
&&
classes
.
hideIt
}
>
<
Chip
avatar
=
{
<
Avatar
>
<
SchoolIcon
/>
<
/Avatar>
}
label
=
"
Outgoing REX
"
className
=
{
classes
.
chip
}
color
=
"
primary
"
/>
<
/div
>
<
IconButton
onClick
=
{
this
.
handleDrawerOpen
}
className
=
{
classNames
(
classes
.
menuButton
,
this
.
state
.
open
&&
classes
.
hideIt
)}
>
<
MenuIcon
/>
<
/IconButton
>
<
IconButton
onClick
=
{
this
.
handleDrawerClose
}
className
=
{
classNames
(
classes
.
menuButton
,
(
!
this
.
state
.
open
)
&&
classes
.
hideIt
)}
>
<
ChevronLeftIcon
/>
<
/IconButton
>
<
/div
>
<
Divider
/>
<
List
>
{
mainListItems
}
<
/List
>
<
Divider
/>
<
List
>
{
secondaryListItems
}
<
/List
>
<
/Drawer
>
<
main
className
=
{
classes
.
content
}
>
<
Route
path
=
"
/app/
"
exact
=
{
true
}
component
=
{
PageHome
}
/
>
<
Route
path
=
"
/app/map
"
component
=
{
PageMap
}
/
>
<
/main
>
<
/div
>
<
/React.Fragment
>
);
}
}
App
.
propTypes
=
{
classes
:
PropTypes
.
object
.
isRequired
,
};
export
default
withStyles
(
styles
)(
App
);
frontend/src/components/Dashboard.js
deleted
100644 → 0
View file @
0717fd76
// Inspired by https://github.com/mui-org/material-ui/tree/master/docs/src/pages/page-layout-examples/dashboard
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
import
{
withStyles
}
from
'
@material-ui/core/styles
'
;
import
CssBaseline
from
'
@material-ui/core/CssBaseline
'
;
import
Drawer
from
'
@material-ui/core/Drawer
'
;
import
List
from
'
@material-ui/core/List
'
;
import
Grid
from
'
@material-ui/core/Grid
'
;
import
Typography
from
'
@material-ui/core/Typography
'
;
import
Divider
from
'
@material-ui/core/Divider
'
;
import
IconButton
from
'
@material-ui/core/IconButton
'
;
import
MenuIcon
from
'
@material-ui/icons/Menu
'
;
import
Chip
from
'
@material-ui/core/Chip
'
;
import
Avatar
from
'
@material-ui/core/Avatar
'
;
import
ChevronLeftIcon
from
'
@material-ui/icons/ChevronLeft
'
;
import
SchoolIcon
from
'
@material-ui/icons/School
'
;
import
UnivMap
from
'
./UnivMap
'
;
import
UnivMapReloadButton
from
'
./UnivMapReloadButton
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
import
{
mainListItems
,
secondaryListItems
}
from
'
./listItems
'
;
// import route Components here
import
{
BrowserRouter
as
Router
,
Route
,
Link
,
Switch
,
Redirect
}
from
'
react-router-dom
'
;
import
PageMap
from
'
./PageMap
'
;
import
PageHome
from
'
./PageHome
'
;
const
drawerWidth
=
240
;
const
styles
=
theme
=>
({
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
,
},
},
content
:
{
flexGrow
:
1
,
padding
:
theme
.
spacing
.
unit
*
3
,
height
:
'
100vh
'
,
overflow
:
'
auto
'
,
},
chartContainer
:
{
marginLeft
:
-
22
,
},
tableContainer
:
{
height
:
320
,
},
myPaper
:
{
padding
:
16
}
});
class
Dashboard
extends
React
.
Component
{
state
=
{
open
:
true
,
};
handleDrawerOpen
=
()
=>
{
this
.
setState
({
open
:
true
});
};
handleDrawerClose
=
()
=>
{
this
.
setState
({
open
:
false
});
};
render
()
{
const
{
classes
}
=
this
.
props
;
return
(
<
React
.
Fragment
>
<
CssBaseline
/>
<
div
className
=
{
classes
.
root
}
>
<
Drawer
variant
=
"
permanent
"
classes
=
{{
paper
:
classNames
(
classes
.
drawerPaper
,
!
this
.
state
.
open
&&
classes
.
drawerPaperClose
),
}}
open
=
{
this
.
state
.
open
}
>
<
div
className
=
{
classNames
(
classes
.
toolbarIcon
)}
>
<
div
className
=
{(
!
this
.
state
.
open
)
&&
classes
.
hideIt
}
>
<
Chip
avatar
=
{
<
Avatar
>
<
SchoolIcon
/>
<
/Avatar>
}
label
=
"
Outgoing REX
"
className
=
{
classes
.
chip
}
color
=
"
primary
"
/>
<
/div
>
<
IconButton
onClick
=
{
this
.
handleDrawerOpen
}
className
=
{
classNames
(
classes
.
menuButton
,
this
.
state
.
open
&&
classes
.
hideIt
)}
>
<
MenuIcon
/>
<
/IconButton
>
<
IconButton
onClick
=
{
this
.
handleDrawerClose
}
className
=
{
classNames
(
classes
.
menuButton
,
(
!
this
.
state
.
open
)
&&
classes
.
hideIt
)}
>
<
ChevronLeftIcon
/>
<
/IconButton
>
<
/div
>
<
Divider
/>
<
List
>
{
mainListItems
}
<
/List
>
<
Divider
/>
<
List
>
{
secondaryListItems
}
<
/List
>
<
/Drawer
>
<
main
className
=
{
classes
.
content
}
>
<
Route
path
=
"
/app/
"
exact
=
{
true
}
component
=
{
PageHome
}
/
>
<
Route
path
=
"
/app/map
"
component
=
{
PageMap
}
/
>
<
/main
>
<
/div
>
<
/React.Fragment
>
);
}
}
Dashboard
.
propTypes
=
{
classes
:
PropTypes
.
object
.
isRequired
,
};
export
default
withStyles
(
styles
)(
Dashboard
);
frontend/src/components/UnivMap.js
→
frontend/src/components/
map/
UnivMap.js
View file @
47bcdd72
import
React
,
{
Component
}
from
'
react
'
;
import
{
connect
}
from
"
react-redux
"
;
import
Loading
from
'
./other/Loading
'
;
import
Loading
from
'
.
.
/other/Loading
'
;
import
{
Map
,
TileLayer
,
Marker
,
Popup
,
LayersControl
,
FeatureGroup
,
Circle
,
LayerGroup
}
from
'
react-leaflet
'
;
// import MarkerClusterGroup from 'react-leaflet-markercluster';
import
{
universitiesFetchData
,
universitiesInvalidated
}
from
'
../actions/universities
'
;
}
from
'
../
../
actions/universities
'
;
...
...
frontend/src/components/UnivMapReloadButton.js
→
frontend/src/components/
map/
UnivMapReloadButton.js
View file @
47bcdd72
...
...
@@ -6,7 +6,7 @@ import { withStyles } from '@material-ui/core/styles';
import
{
universitiesInvalidated
}
from
'
../actions/universities
'
;
}
from
'
../
../
actions/universities
'
;
const
styles
=
theme
=>
({
...
...
frontend/src/components/PageHome.js
→
frontend/src/components/
pages/
PageHome.js
View file @
47bcdd72
File moved
frontend/src/components/PageMap.js
→
frontend/src/components/
pages/
PageMap.js
View file @
47bcdd72
// Inspired by https://github.com/mui-org/material-ui/tree/master/docs/src/pages/page-layout-examples/dashboard
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
UnivMap
from
'
./UnivMap
'
;
import
UnivMapReloadButton
from
'
./UnivMapReloadButton
'
;
import
UnivMap
from
'
.
./map
/UnivMap
'
;
import
UnivMapReloadButton
from
'
.
./map
/UnivMapReloadButton
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
const
styles
=
theme
=>
({
...
...
frontend/src/components/listItems.js
→
frontend/src/components/
template/
listItems.js
View file @
47bcdd72
File moved
frontend/src/index.js
View file @
47bcdd72
import
'
babel-polyfill
'
;
import
App
from
"
./components/App
"
;
\ No newline at end of file
import
React
from
"
react
"
;
import
ReactDOM
from
"
react-dom
"
;
import
{
Provider
}
from
"
react-redux
"
;
import
{
BrowserRouter
as
Router
,
Route
}
from
'
react-router-dom
'
;
import
store
from
"
./store/index
"
;
import
App
from
"
./components/App
"
;
const
MainReactEntry
=
()
=>
(
<
Provider
store
=
{
store
}
>
<
Router
>
<
Route
path
=
"
/:filter?
"
component
=
{
App
}
/
>
<
/Router
>
<
/Provider
>
);
const
wrapper
=
document
.
getElementById
(
"
app
"
);
wrapper
?
ReactDOM
.
render
(
<
MainReactEntry
/>
,
wrapper
)
:
null
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment