Skip to content

Commit

Permalink
Merge pull request #36 from wasedatime/staging
Browse files Browse the repository at this point in the history
Merge staging to master
  • Loading branch information
OscarWang114 authored Oct 9, 2019
2 parents 52d8841 + 11c5da6 commit 2941e31
Show file tree
Hide file tree
Showing 18 changed files with 528 additions and 298 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ npm install
### Running the app for developing

```bash
cd wasedatime-web
npm run dev
```

Expand Down
10 changes: 5 additions & 5 deletions client/src/js/components/Bus.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import ModalContainer from "../containers/ModalContainer";
import { media } from "../styled-components/utils";
import { Wrapper } from "../styled-components/Wrapper";
import { Overlay } from "../styled-components/Overlay";
import busSchedule from "../data/busSchedule.json";
import { busSchedule } from "../data/busSchedule.js";
import safariExport from "../../img/safari-export.svg";
import a2hsChrome from "../../img/bus_a2hs_chrome.png";
import a2hsSafari from "../../img/bus_a2hs_safari.png";

const wasedaNishiwasedaBusUri =
"https://www.waseda.jp/fsci/assets/uploads/2018/03/2018waseda-nishiwaseda-shuttle-bus-timetable.pdf";
"https://www.waseda.jp/fsci/assets/uploads/2019/03/2019waseda-nishiwaseda-shuttlebus-timetable03.pdf";

const ExtendedOverlay = styled(Overlay)`
align-items: center;
Expand Down Expand Up @@ -129,7 +129,7 @@ const getSchduleType = (month, date, day) => {
monthString in outOfService &&
binarySearch(date, outOfService[monthString])
) {
return "no";
return "noSchedule";
} else if (
monthString in weekdaySchedule &&
binarySearch(date, weekdaySchedule[monthString])
Expand All @@ -147,7 +147,7 @@ const getSchduleType = (month, date, day) => {
return "special";
} else {
if (day === 0) {
return "no";
return "noSchedule";
} else if (day === 6) {
return "saturday";
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ const getBusStatuses = (now, lng, t) => {
nishiStatus = t("bus.Out of service");
const scheduleType = getSchduleType(month, date, day);
// No buses or special schedule
if (scheduleType === "no") {
if (scheduleType === "noSchedule") {
return { wasedaStatus, nishiStatus };
} else if (scheduleType === "special") {
wasedaStatus = t("bus.Special Schedule");
Expand Down
10 changes: 10 additions & 0 deletions client/src/js/components/BusModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styled, {keyframes} from 'styled-components';

import { media } from '../styled-components/utils';
import {Overlay} from '../styled-components/Overlay';
import PropTypes from 'prop-types';

const show = keyframes`
0% {
Expand Down Expand Up @@ -190,3 +191,12 @@ class BusModal extends React.Component {
}

export default BusModal;

BusModal.propTypes = {
onClose: PropTypes.func.isRequired,
children: PropTypes.element.isRequired
}

ExtendedOverlay.propTypes = {
animation: PropTypes.object.isRequired,
}
13 changes: 13 additions & 0 deletions client/src/js/components/CourseListSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import SortingOptions from './SortingOptions';
import { RowWrapper } from '../styled-components/Wrapper';
import { InvisibleButton } from '../styled-components/Button';
import { withNamespaces } from "react-i18next";
import PropTypes from 'prop-types';

const CourseAddedMessageWrapper = styled(RowWrapper)`
justify-content: space-between;
Expand Down Expand Up @@ -62,3 +63,15 @@ const CourseListSummary = ({
};

export default withNamespaces("translation")(CourseListSummary);

CourseListSummary.propTypes = {
courses: PropTypes.array.isRequired,
isSortingOptionOpen: PropTypes.bool.isRequired,
handleToggleSortingOptions: PropTypes.func.isRequired,
selectedSortingOption: PropTypes.string.isRequired,
handleChangeSortingOption: PropTypes.func.isRequired
}

SortByButton.propTypes = {
isSortingOptionOpen: PropTypes.bool.isRequired
}
7 changes: 7 additions & 0 deletions client/src/js/components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGithub, faTwitter } from "@fortawesome/free-brands-svg-icons";
Expand Down Expand Up @@ -109,3 +110,9 @@ const Footer = ({ finishTime, t, lng }) => {
};

export default withNamespaces("translation")(Footer);

Footer.propTypes = {
finishTime: PropTypes.string.isRequired,
t: PropTypes.func.isRequired,
lng: PropTypes.string.isRequired
}
6 changes: 6 additions & 0 deletions client/src/js/components/LanguageMenu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import PropTypes from "prop-types";
import i18n from "./i18n";
import Menu from "@material-ui/core/Menu";
import MenuItem from "@material-ui/core/MenuItem";
Expand Down Expand Up @@ -91,3 +92,8 @@ class LanguangeMenu extends React.Component {
}

export default withNamespaces("translation")(LanguangeMenu);

LanguangeMenu.propTypes = {
lng: PropTypes.string.isRequired,
t: PropTypes.func.isRequired
}
5 changes: 5 additions & 0 deletions client/src/js/components/LoadingSpinner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from "prop-types";
import styled, { keyframes } from 'styled-components';

import { Wrapper } from '../styled-components/Wrapper';
Expand Down Expand Up @@ -51,3 +52,7 @@ const LoadingSpinner = props => {
};

export default LoadingSpinner;

LoadingSpinner.propTypes = {
message: PropTypes.string.isRequired
}
10 changes: 10 additions & 0 deletions client/src/js/components/Navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import PropTypes from 'prop-types';
import { Link } from "react-router-dom";
import { withNamespaces } from "react-i18next";
import { withRouter } from "react-router";
Expand Down Expand Up @@ -99,3 +100,12 @@ const Navigation = props => {
};

export default withRouter(withNamespaces("translation")(Navigation));

Navigation.propTypes = {
location: PropTypes.object.isRequired,
t: PropTypes.func.isRequired
}

StyledButton.propTypes = {
isClicked: PropTypes.bool.isRequired
}
13 changes: 10 additions & 3 deletions client/src/js/components/syllabus/CourseChunk.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import React from "react";
import PropTypes from "prop-types";

import FetchedCourseItem from '../../containers/syllabus/FetchedCourseItem';
import { UnstyledUList } from '../../styled-components/List';
import FetchedCourseItem from "../../containers/syllabus/FetchedCourseItem";
import { UnstyledUList } from "../../styled-components/List";

const CourseChunk = ({ chunk, searchTerm, searchLang }) => {
return (
Expand All @@ -19,3 +20,9 @@ const CourseChunk = ({ chunk, searchTerm, searchLang }) => {
};

export default CourseChunk;

CourseChunk.propTypes = {
chunk: PropTypes.array.isRequired,
searchTerm: PropTypes.string.isRequired,
searchLang: PropTypes.string.isRequired
};
4 changes: 3 additions & 1 deletion client/src/js/components/syllabus/CourseItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,5 +307,7 @@ export default withNamespaces("translation")(CourseItem);

CourseItem.propTypes = {
searchTerm: PropTypes.string.isRequired,
course: PropTypes.object.isRequired
course: PropTypes.object.isRequired,
isAddable: PropTypes.bool.isRequired,
handleOnClick: PropTypes.func.isRequired,
};
3 changes: 2 additions & 1 deletion client/src/js/components/syllabus/FetchedCourseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,6 @@ class FetchedCourseList extends React.Component {
export default withNamespaces("translation")(FetchedCourseList);

FetchedCourseList.propTypes = {
searchTerm: PropTypes.string.isRequired
searchTerm: PropTypes.string.isRequired,
results: PropTypes.array.isRequired
};
16 changes: 11 additions & 5 deletions client/src/js/components/syllabus/FilterButton.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faFilter, faTimes } from '@fortawesome/free-solid-svg-icons';
import styled from 'styled-components';
import React from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faFilter, faTimes } from "@fortawesome/free-solid-svg-icons";
import styled from "styled-components";
import PropTypes from "prop-types";

import { InvisibleButton } from '../../styled-components/Button';
import { InvisibleButton } from "../../styled-components/Button";

const ExtendedInvisibleButton = styled(InvisibleButton)`
position: fixed;
Expand Down Expand Up @@ -36,3 +37,8 @@ const FilterButton = ({ isModalOpen, handleToggleModal }) => {
};

export default FilterButton;

FilterButton.propTypes = {
isModalOpen: PropTypes.bool.isRequired,
handleToggleModal: PropTypes.func.isRequired
};
17 changes: 17 additions & 0 deletions client/src/js/components/syllabus/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,20 @@ SearchBar.propTypes = {
inputText: PropTypes.string.isRequired,
onInputChange: PropTypes.func.isRequired
};

StyledForm.propTypes = {
onSubmit: PropTypes.func.isRequired
};

StyledInput.propTypes = {
type: PropTypes.string.isRequired,
placeholder: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired
}

StyledClearButton.propTypes = {
role: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired
};
12 changes: 12 additions & 0 deletions client/src/js/components/syllabus/SemesterTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import stickybits from 'stickybits';

import { headerHeight } from '../../styled-components/variables';
import { RowWrapper } from '../../styled-components/Wrapper';
import PropTypes from 'prop-types';


const ExtendedWrapper = styled(RowWrapper)`
Expand Down Expand Up @@ -99,3 +100,14 @@ class SemesterTabs extends React.Component {
}
}
export default SemesterTabs;

SemesterTabs.propTypes = {
handleChangeSemester: PropTypes.func.isRequired,
semester: PropTypes.string.isRequired
}

SemesterButton.propTypes = {
id: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired,
isSelected: PropTypes.bool.isRequired,
}
Loading

0 comments on commit 2941e31

Please sign in to comment.