Skip to content

Commit

Permalink
Revert "Init commit, creating aws beanstalk"
Browse files Browse the repository at this point in the history
This reverts commit 0f67001.
  • Loading branch information
matthlh committed Nov 27, 2024
1 parent 0f67001 commit 4a0b7af
Show file tree
Hide file tree
Showing 38 changed files with 14,134 additions and 24,330 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,3 @@ webpack-stats.json

# VSCode
.history/

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
50 changes: 0 additions & 50 deletions Dockerrun.aws.json

This file was deleted.

128 changes: 64 additions & 64 deletions assets/src/components/CourseListCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,86 +7,86 @@ import { Link } from 'react-router-dom'
const PREFIX = 'CourseListCard'

const classes = {
root: `${PREFIX}-root`,
paper: `${PREFIX}-paper`,
container: `${PREFIX}-container`,
grow: `${PREFIX}-grow`,
card: `${PREFIX}-card`,
content: `${PREFIX}-content`,
title: `${PREFIX}-title`,
description: `${PREFIX}-description`,
root: `${PREFIX}-root`,
paper: `${PREFIX}-paper`,
container: `${PREFIX}-container`,
grow: `${PREFIX}-grow`,
card: `${PREFIX}-card`,
content: `${PREFIX}-content`,
title: `${PREFIX}-title`,
description: `${PREFIX}-description`
}

const StyledCard = styled(Card)(({ theme }) => ({
[`& .${classes.root}`]: {
flexGrow: 1,
},
const StyledCard = styled(Card)((
{
theme
}
) => ({
[`& .${classes.root}`]: {
flexGrow: 1
},

[`& .${classes.paper}`]: {
padding: theme.spacing(2),
color: theme.palette.text.secondary,
display: 'flex',
},
[`& .${classes.paper}`]: {
padding: theme.spacing(2),
color: theme.palette.text.secondary,
display: 'flex'
},

[`& .${classes.container}`]: {
display: 'flex',
justifyContent: 'center',
},
[`& .${classes.container}`]: {
display: 'flex',
justifyContent: 'center'
},

[`& .${classes.grow}`]: {
flexGrow: 1,
},
[`& .${classes.grow}`]: {
flexGrow: 1
},

[`&.${classes.card}`]: {
margin: theme.spacing(3),
},
[`&.${classes.card}`]: {
margin: theme.spacing(3)
},

[`& .${classes.content}`]: {
height: 110,
padding: 0,
},
[`& .${classes.content}`]: {
height: 110,
padding: 0
},

[`& .${classes.title}`]: {
boxSizing: 'border-box',
padding: theme.spacing(1),
color: 'white',
marginBottom: 0,
backgroundColor: theme.palette.primary.main,
},
[`& .${classes.title}`]: {
boxSizing: 'border-box',
padding: theme.spacing(1),
color: 'white',
marginBottom: 0,
backgroundColor: theme.palette.primary.main
},

[`& .${classes.description}`]: {
padding: theme.spacing(1),
color: 'black',
},
[`& .${classes.description}`]: {
padding: theme.spacing(1),
color: 'black'
}
}))

const CourseListCard = (props) => {
return (
<StyledCard className={classes.card} elevation={2}>
<Link tabIndex={-1} style={{ textDecoration: 'none' }} to={props.path}>
<CardContent className={classes.content}>
<Typography
gutterBottom
variant='h5'
component='h4'
className={classes.title}>
{props.courseName}
</Typography>
<Typography component='p' className={classes.description}>
{props.description}
</Typography>
</CardContent>
</Link>
</StyledCard>
)
return (
<StyledCard className={classes.card} elevation={2}>
<Link tabIndex={-1} style={{ textDecoration: 'none' }} to={props.path}>
<CardContent className={classes.content}>
<Typography gutterBottom variant='h5' component='h4' className={classes.title}>
{props.courseName}
</Typography>
<Typography component='p' className={classes.description}>
{props.description}
</Typography>
</CardContent>
</Link>
</StyledCard>
)
}

CourseListCard.propTypes = {
path: PropTypes.string.isRequired,
courseName: PropTypes.string.isRequired,
description: PropTypes.string,
path: PropTypes.string.isRequired,
courseName: PropTypes.string.isRequired,
description: PropTypes.string
}

CourseListCard.defaultProps = {}

export default CourseListCard
export default (CourseListCard)
43 changes: 0 additions & 43 deletions assets/src/components/Sidebar.js

This file was deleted.

63 changes: 24 additions & 39 deletions assets/src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,32 @@ import Course from './Course'
import WarningBanner from '../components/WarningBanner'
import AlertBanner from '../components/AlertBanner'
import { Helmet } from 'react-helmet'
import Sidebar from '../components/Sidebar'

function App(props) {
const { user, gaId, cspNonce } = props
function App (props) {
const { user, gaId, cspNonce } = props

if (!user.isLoggedIn) {
if (user.loginURL === '') {
return (
<WarningBanner>
This tool needs to be launched from a Canvas course.
</WarningBanner>
)
}
return (window.location.href = user.loginURL)
}
const coursePageMatch = useMatch('/courses/:courseId/*')
const courseId = coursePageMatch ? coursePageMatch.params.courseId : null
return (
<>
<Helmet titleTemplate='%s | My Learning Analytics' title='Courses' />
<Sidebar />
<GoogleAnalyticsTracking {...{ gaId, cspNonce }} />
<Routes>
{/* Don't forget to change this */}
<Route path='/' element={<CourseList user={user} />} />
<Route path='/courses' element={<CourseList user={user} />} />
<Route
path='/courses/:courseId/*'
element={
courseId ? (
<Course user={user} courseId={Number(courseId)} {...props} />
) : (
<AlertBanner>
Application Launch did not happened properely
</AlertBanner>
)
}
/>
</Routes>
</>
)
if (!user.isLoggedIn) {
if (user.loginURL === '') {
return (<WarningBanner>This tool needs to be launched from a Canvas course.</WarningBanner>)
}
return (window.location.href = user.loginURL)
}
const coursePageMatch = useMatch('/courses/:courseId/*')
const courseId = coursePageMatch ? coursePageMatch.params.courseId : null
return (
<>
<Helmet titleTemplate='%s | My Learning Analytics' title='Courses' />
<GoogleAnalyticsTracking {...{ gaId, cspNonce }} />
<Routes>
<Route path='/' element={<CourseList user={user} />} />
<Route path='/courses' element={<CourseList user={user} />} />
<Route
path='/courses/:courseId/*'
element={courseId ? <Course user={user} courseId={Number(courseId)} {...props} /> : <AlertBanner>Application Launch did not happened properely</AlertBanner>}
/>
</Routes>
</>
)
}

export default App
Loading

0 comments on commit 4a0b7af

Please sign in to comment.