Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
# Conflicts:
#	client/src/js/api/index.js
  • Loading branch information
OscarWang114 committed Mar 10, 2019
2 parents 17cda43 + 41c21bf commit 12a9d12
Show file tree
Hide file tree
Showing 48 changed files with 883 additions and 711 deletions.
68 changes: 64 additions & 4 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
"ajv": "^6.9.1",
"axios": "^0.17.1",
"http-proxy-middleware": "^0.19.0",
"i18next": "^12.0.0",
"no-scroll": "^2.1.1",
"normalize-css": "^2.3.1",
"normalizr": "^3.2.4",
"npm-run-all": "^4.1.2",
"prop-types": "^15.6.0",
"prop-types": "^15.6.2",
"query-string": "^5.1.1",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-ga": "^2.4.0",
"react-helmet": "^5.2.0",
"react-i18next": "^8.1.0",
"react-localize-redux": "^3.4.1",
"react-modal": "^3.4.4",
"react-popper": "^1.0.0-beta.6",
Expand Down
14 changes: 10 additions & 4 deletions client/src/js/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
FETCH_BUILDINGS_FAILURE
} from './types';
import * as schema from '../data/schema';
import { wasetimeApiStatic } from '../api/index';
import { wasetimeApiStatic } from '../config/api';

export const fetchStats = () => async (dispatch, getState) => {
dispatch({
Expand All @@ -25,13 +25,16 @@ export const fetchStats = () => async (dispatch, getState) => {
response: stats
});
} catch (error) {
const response = error.response || {status: 501, statusText: "Not Implemented"};
const response = error.response || {
status: 501,
statusText: 'Not Implemented'
};
dispatch({
type: FETCH_STATS_FAILURE,
error: response
});
}
}
};

export const fetchBuildings = () => async (dispatch, getState) => {
dispatch({
Expand All @@ -47,7 +50,10 @@ export const fetchBuildings = () => async (dispatch, getState) => {
response: normalizedBuildings
});
} catch (error) {
const response = error.response || {status: 501, statusText: "Not Implemented"};
const response = error.response || {
status: 501,
statusText: 'Not Implemented'
};
dispatch({
type: FETCH_BUILDINGS_FAILURE,
error: response
Expand Down
12 changes: 6 additions & 6 deletions client/src/js/actions/syllabus.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import { normalize } from 'normalizr';
import axios from "axios";
import { normalize } from "normalizr";

import {
FETCH_COURSES_REQUEST,
Expand All @@ -11,9 +11,9 @@ import {
CHANGE_COURSE_COLOR,
TOGGLE_COURSE_VISIBILITY,
CHANGE_COURSES_SORTING_OPTION
} from './types';
import * as schema from '../data/schema';
import { wasetimeApiStatic } from '../api/index';
} from "./types";
import * as schema from "../data/schema";
import { wasetimeApiStatic } from "../config/api";

export const fetchCourses = () => async (dispatch, getState) => {
dispatch({
Expand All @@ -31,7 +31,7 @@ export const fetchCourses = () => async (dispatch, getState) => {
} catch (error) {
const response = error.response || {
status: 501,
statusText: 'Not Implemented'
statusText: "Not Implemented"
};
dispatch({
type: FETCH_COURSES_FAILURE,
Expand Down
1 change: 1 addition & 0 deletions client/src/js/actions/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ export const REMOVE_COURSE = 'REMOVE_COURSE';
export const CHANGE_COURSE_COLOR = 'CHANGE_COURSE_COLOR';
export const TOGGLE_COURSE_VISIBILITY = 'TOGGLE_COURSE_VISIBILITY';
export const CHANGE_COURSES_SORTING_OPTION = 'CHANGE_COURSES_SORTING_OPTION';
export const CHANGE_USER_LANG = 'CHANGE_USER_LANG';
54 changes: 25 additions & 29 deletions client/src/js/components/syllabus/AddedCourseList.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import React from 'react';
import stickybits from 'stickybits';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faPlusCircle, faMinusCircle } from '@fortawesome/free-solid-svg-icons';
import styled from 'styled-components';
import React from "react";
import stickybits from "stickybits";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPlusCircle, faMinusCircle } from "@fortawesome/free-solid-svg-icons";
import styled from "styled-components";

import {
headerHeight,
semesterTabsHeight
} from '../../styled-components/variables';
import CourseListSummary from '../CourseListSummary';
import AddedCourseItem from '../../containers/syllabus/AddedCourseItem';
import { Wrapper } from '../../styled-components/Wrapper';
addedCourseListSwitchHeight
} from "../../styled-components/variables";
import CourseListSummary from "../CourseListSummary";
import AddedCourseItem from "../../containers/syllabus/AddedCourseItem";
import { Wrapper } from "../../styled-components/Wrapper";
import {
Article,
Section,
Subheading,
OList,
ListItem
} from '../../styled-components/Article';
} from "../../styled-components/Article";

const CourseListWrapper = styled(Wrapper)`
flex: none;
padding: 0.5em 1em 1em 1em;
overflow-y: auto;
height: calc(
100vh - ${props => props.theme.headerHeight} -
${props => props.theme.semesterTabsHeight}
${props => props.theme.addedCourseListSwitchHeight}
);
`;

Expand All @@ -46,7 +46,8 @@ class AddedCourseList extends React.Component {
if (this.wrapper) {
this.stickyWrapper = stickybits(this.wrapper, {
stickyBitStickyOffset:
parseInt(headerHeight, 10) + parseInt(semesterTabsHeight, 10)
parseInt(headerHeight, 10) +
parseInt(addedCourseListSwitchHeight, 10)
});
}
};
Expand Down Expand Up @@ -84,7 +85,7 @@ class AddedCourseList extends React.Component {
handleChangeSortingOption={handleChangeSortingOption}
/>
{addedCourses.length ? (
<div style={{ fontSize: '14px' }}>
<div style={{ fontSize: "14px" }}>
{addedCourses.map((course, index) => (
<AddedCourseItem key={course._id} course={course} />
))}
Expand All @@ -96,36 +97,31 @@ class AddedCourseList extends React.Component {
<Subheading>To add a course</Subheading>
<OList>
<ListItem>
Search for a course title or an instructor in the right search
bar.
Search for courses and instructors in the top search bar.
Japanese is supported.
<br />
E.g., "calculus" or "tanaka" or "calculus tanaka".
Try "kanji" "tanaka" "漢字" "田中"
</ListItem>
<ListItem>
Click on{' '}
Click on{" "}
<FontAwesomeIcon
style={{ color: '#48af37' }}
style={{ color: "#48af37" }}
icon={faPlusCircle}
size="1x"
/>{' '}
to add,{' '}
/>{" "}
to add,{" "}
<FontAwesomeIcon
style={{ color: '#ce0115' }}
style={{ color: "#ce0115" }}
icon={faMinusCircle}
size="1x"
/>{' '}
/>{" "}
to remove.
</ListItem>
</OList>
</Section>
<Section>
<Subheading>Pro Tips!</Subheading>
<Subheading>Pro Tip!</Subheading>
<OList>
<ListItem>
Type only the start of the word.
<br />
E.g., "vec calc" instead of "vector calculus"
</ListItem>
<ListItem>Use "Filter by" to narrow down your search.</ListItem>
</OList>
</Section>
Expand Down
Loading

0 comments on commit 12a9d12

Please sign in to comment.