Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from bharatari/dev
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
bharatari authored Apr 27, 2020
2 parents b161598 + fbe382c commit 2d855e8
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 17 deletions.
32 changes: 32 additions & 0 deletions client/components/Animations/FadeIn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { useState, useEffect } from 'react';

const defaultStyle = {
transition: 'opacity 300ms ease-out',
opacity: 0,
};

const transitionStyles = {
entering: {
opacity: 0,
},
entered: {
opacity: 1,
}
};

export default function FadeIn({ startAt, children }) {
const [display, setDisplay] = useState(false);

useEffect(() => {
setTimeout(() => setDisplay(true), startAt);
}, []);

return (
React.cloneElement(children, {
style: {
...defaultStyle,
...transitionStyles[display ? 'entered' : 'entering'],
}
})
);
}
16 changes: 8 additions & 8 deletions client/components/Animations/SlideUp.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import React, { useState, useEffect } from "react";
import { Transition } from "react-transition-group";
import React, { useState, useEffect } from 'react';
import { Transition } from 'react-transition-group';

const defaultStyle = {
transition: "all 300ms ease-out",
transition: 'all 300ms ease-out',
opacity: 0,
};

const transitionStyles = {
entering: {
opacity: 0,
transform: "translateY(20%)",
transform: 'translateY(20%)',
},
entered: {
opacity: 1,
transform: "translateY(0%)",
transform: 'translateY(0%)',
},
exiting: {
opacity: 1,
transform: "translateY(0%)",
transform: 'translateY(0%)',
},
exited: {
opacity: 0,
transform: "scale(0.9) translateY(50%)",
transform: 'scale(0.9) translateY(50%)',
},
};

Expand All @@ -39,7 +39,7 @@ export default function SlideUp({ startAt, children }) {
style: {
...defaultStyle,
...transitionStyles[state],
}
},
})
}
</Transition>
Expand Down
2 changes: 2 additions & 0 deletions client/components/Animations/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import SlideUp from './SlideUp';
import FadeIn from './FadeIn';

export default {
SlideUp,
FadeIn,
};
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "utd-grades-client",
"version": "1.2.1",
"version": "1.3.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
16 changes: 9 additions & 7 deletions client/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import Router from 'next/router';
import styled from 'styled-components';
import { Core, Form, Animations } from '../components';
import { Row, Col } from 'antd';
import { Col } from 'antd';

const { SlideUp } = Animations;
const { FadeIn } = Animations;

const Content = styled.div`
display: block;
Expand Down Expand Up @@ -54,13 +54,15 @@ export default function Home() {
<Core>
<Content>
<Main>
<SlideUp startAt={100}>
<Col lg={{ span: 8, offset: 8 }} sm={{ span: 18, offset: 3 }} xs={{ span: 20, offset: 2 }}>
<Col lg={{ span: 8, offset: 8 }} sm={{ span: 18, offset: 3 }} xs={{ span: 20, offset: 2 }}>
<FadeIn startAt={0}>
<Header><HeaderBold>UTD</HeaderBold> Grades</Header>
</FadeIn>
<FadeIn startAt={300}>
<Description>See how students did in any given class. And it's <strong>free, forever.</strong></Description>
<Form onSubmit={handleSubmit} />
</Col>
</SlideUp>
</FadeIn>
<Form onSubmit={handleSubmit} />
</Col>
</Main>
</Content>
</Core>
Expand Down
2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "utd-grades-functions",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"scripts": {
"test": "jest",
Expand Down
16 changes: 16 additions & 0 deletions functions/services/section/find/__tests__/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ describe('Test sample queries', () => {
}
});

test('Should handle professor-only', async () => {
const queries = [
{ search: 'Stephen Perkins', expected: { professorFirstName: 'Stephen J', professorLastName: 'Perkins' } },
{ search: 'Kristen Lawson', expected: { professorFirstName: 'Kristen A', professorLastName: 'Lawson' } }
];

for (let i = 0; i < queries.length; i++) {
const { search, expected } = queries[i];
const response = await find({ search }, connection);

expect(response).not.toHaveLength(0);
expect(response[0].professor.firstName).toEqual(expected.professorFirstName);
expect(response[0].professor.lastName).toEqual(expected.professorLastName);
}
});

test('Should handle everything together', async () => {
const queries = [
{ search: 'CS 1337 502 fall 2019 Stephen Perkins', expected: { coursePrefix: 'CS', courseNumber: '1337', sectionNumber: '501', semesterType: 'fall', year: 2019, professorFirstName: 'Stephen J', professorLastName: 'Perkins' } },
Expand Down

1 comment on commit 2d855e8

@vercel
Copy link

@vercel vercel bot commented on 2d855e8 Apr 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.