-
Notifications
You must be signed in to change notification settings - Fork 4
Media Queries added #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 76 commits
1ed986c
78f02bc
c0df017
324b681
dfd672b
cc45acc
7e0f822
69e0e5c
5d127ff
8758f62
28006b7
0b5f788
f53152b
80bb986
f964170
81d9304
2c07993
0dfd2ee
4ce6491
591f404
585d04b
43f71e2
d645c29
1bf4e1b
b7a308f
ce7df68
7a58f1b
fdbe41e
3c52295
4191975
0f90eaf
35e1a74
8f3abcd
d8b89b9
0755992
b83a21a
bd2563e
17e9b18
8643c99
8ddd33e
df9cf1a
c321f3b
31731eb
d91cd6d
07ef78b
adb11d8
1cd6ab3
016f785
0bcb4f4
5be20bd
e2e8db0
e348f84
972f988
452df1a
8aa36e6
398f899
6e7b335
c77227d
8294459
a39b249
246ec9b
77b1af5
224f110
98d9434
1a020b5
71fe5b9
bf0bc9f
83e9d92
56f511a
ab7421b
9f6596d
292b98c
a6863b3
e094598
0b3db5b
4189aec
24d8990
387b629
c90aa4d
b19e296
734fb0d
8a8731e
f9438f9
19ce29f
bba4f21
c62f44a
a02aedb
dba84d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,3 @@ export interface CandidateTestModel { | |
| outputDescription: string; | ||
| expectedOutput: string | number; | ||
| } | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import getConfig from 'next/config'; | ||
| import fetch from "node-fetch"; | ||
| import {GetServerSideProps} from "next"; | ||
| import {ServerResponse} from "http"; | ||
| import {ParsedUrlQuery} from "querystring"; | ||
|
|
||
| const {publicRuntimeConfig} = getConfig(); | ||
| const baseUrl = publicRuntimeConfig.API_URL; | ||
|
|
||
| export async function checkToken(token: string): Promise<boolean> { | ||
| const response = await fetch(`${baseUrl}/sessions/${token}`); | ||
| return response.ok;} | ||
|
|
||
| export async function assertTokenIsValid(query: ParsedUrlQuery, response: ServerResponse): Promise<string> { | ||
| const token = query.token as string; | ||
| const tokenIsValid = await checkToken(token); | ||
|
|
||
| if (!tokenIsValid) { | ||
| response.statusCode = 404; | ||
| response.end(); | ||
| } | ||
| return token; | ||
| } | ||
|
|
||
| export const getServerSideProps: GetServerSideProps = async ({res, query}) => { | ||
| await assertTokenIsValid(query, res); | ||
| return { props: {}}; | ||
| }; | ||
|
||
|
|
||
| export interface SessionCandidate { | ||
| firstName: string; | ||
| lastName: string; | ||
| testStatuses: CandidateTestStatus[]; | ||
| } | ||
|
|
||
| export interface NewTestSubmission{ | ||
| testId: number; | ||
| testAnswer: string; | ||
| } | ||
|
|
||
| export async function getSessionCandidate(token: string | string[] | undefined): Promise<SessionCandidate> { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just |
||
| const {publicRuntimeConfig} = getConfig(); | ||
| const baseUrl = publicRuntimeConfig.API_URL; | ||
| try { | ||
| const result = await fetch( | ||
| `${baseUrl}/sessions/${token}` | ||
| ); | ||
| const data = await result.json(); | ||
| return data; | ||
| } catch (error) { | ||
| console.error(error); | ||
| return error.message; | ||
EmmaluFox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| export interface SessionCandidate { | ||
| firstName: string; | ||
| lastName: string; | ||
| testStatuses: CandidateTestStatus[]; | ||
| } | ||
EmmaluFox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| export interface CandidateTestStatus { | ||
| testName: string; | ||
| testStatus: string; | ||
| } | ||
| export interface NewTestSubmission{ | ||
| testId: number; | ||
| testAnswer: string; | ||
| } | ||
EmmaluFox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| export async function addTestSubmission( tokenId: string, newTestSubmission: NewTestSubmission) { | ||
EmmaluFox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const { publicRuntimeConfig } = getConfig(); | ||
| const apiURL = publicRuntimeConfig.API_URL; | ||
|
|
||
| return await fetch(`${apiURL}/sessions/${tokenId}`, { | ||
| method: "POST", | ||
| headers: { | ||
| "Content-Type": "application/json" | ||
| }, | ||
| body: JSON.stringify(newTestSubmission), | ||
| }); | ||
| } | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,36 @@ | ||
| .sampleInputOutput { | ||
| margin: 5px; | ||
| padding: 5px; | ||
| top: 78vh; | ||
| left: 46vw; | ||
| display: inline-block; | ||
| position: absolute; | ||
| overflow: hidden; | ||
| } | ||
| @import "pageStyles/constants"; | ||
|
|
||
| .testInstructions { | ||
| height: 500px; | ||
| max-width: 50vw; | ||
| box-sizing: border-box; | ||
| color: $techSwitchWhite; | ||
| white-space: pre-wrap; | ||
| font-size: $desktopBodyFontSize; | ||
| text-align: left; | ||
| padding-right: 1rem; | ||
| padding-left: 5rem; | ||
| line-height: 130%; | ||
| width: 700px; | ||
| } | ||
| .instructionsSubheader { | ||
| font-size: $desktopSubHeaderFontSize; | ||
| line-height: 1rem; | ||
| } | ||
|
|
||
| @media (max-width: $mediaLowResMaxWidth) { | ||
| //Low Resolution 900px and below | ||
| .instructionsHeader { | ||
| font-size: $lowResSubHeaderFontSize; | ||
| } | ||
| .instructionsSubheader { | ||
| box-sizing: border-box; | ||
| font-size: $lowResSubHeaderFontSize; | ||
| } | ||
| .testInstructions { | ||
| font-size: $lowResBodyFontSize; | ||
| box-sizing: border-box; | ||
| padding-left: 0.5rem; | ||
| padding-right: 0.5rem; | ||
| width: 300px; | ||
| } | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,82 +1,54 @@ | ||
| @import "../../pageStyles/constants"; | ||
| .testPage { | ||
| max-height: 800px; | ||
| box-sizing: border-box; | ||
| max-height: 100vh; | ||
EmmaluFox marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| max-width: 100vw; | ||
| display: flex; | ||
| flex-direction: column; | ||
| flex-wrap: wrap; | ||
| margin-top: 2vh; | ||
| } | ||
|
|
||
| .testInstructions { | ||
| height: 500px; | ||
| max-width: 50vw; | ||
|
|
||
| } | ||
| .instructionList { | ||
| margin-bottom: 1em; | ||
| } | ||
|
|
||
| .testInstructionsHeader { | ||
| color: $techSwitchWhite; | ||
| font-size: $desktopSubHeaderFontSize; | ||
| margin-bottom: 12px; | ||
| padding: 5px; | ||
| } | ||
|
|
||
| .testInstructions { | ||
| color: $techSwitchWhite; | ||
| white-space: pre-wrap; | ||
| font-size: $bodyFontSize; | ||
| justify-content: left; | ||
| text-align: left; | ||
| width: 40vw; | ||
| line-height: 1.5; | ||
| padding-left: 3vw; | ||
| margin-top: 12px; | ||
| margin-bottom: 24px; | ||
| margin-right: 5px; | ||
| margin-left: 5px; | ||
| } | ||
|
|
||
| .textEditor { | ||
| color: $techSwitchWhite; | ||
| font-size: $buttonFontSize; | ||
| justify-content: right; | ||
| margin-top: 5vh; | ||
| margin-right: 1vw; | ||
| flex-direction: row; | ||
| justify-content: center; | ||
| align-items: flex-start; | ||
| margin-top: 100px; | ||
| } | ||
|
|
||
| .testTitle { | ||
| box-sizing: border-box; | ||
| color: $techSwitchYellow; | ||
| font-size: 30pt; | ||
| max-width: 40vw; | ||
| font-size: $desktopHeaderFontSize; | ||
| white-space: nowrap; | ||
| margin: 5px; | ||
| padding: 5px; | ||
| top: 1vh; | ||
| right: 2vw; | ||
| overflow: hidden; | ||
| position: absolute; | ||
| top: 1px; | ||
| right: 2px; | ||
| text-align: right; | ||
| } | ||
|
|
||
| .editorBox { | ||
| border-style: solid; | ||
| border-width: 5px; | ||
| border-color: $techSwitchYellow; | ||
| } | ||
|
|
||
| .sampleInputOutput { | ||
| margin: 5px; | ||
| padding: 5px; | ||
| top: 85vh; | ||
| left: 46vw; | ||
| display: flex; | ||
| flex-direction: column; | ||
| line-height: 0; | ||
| position: absolute; | ||
| overflow: hidden; | ||
| } | ||
| @media (max-width: $mediaLowResMaxWidth){ | ||
| //Low Resolution 900px and below | ||
| .testPage { | ||
| box-sizing: border-box; | ||
| max-height: 100vh; | ||
EmmaluFox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| max-width: 100vw; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| margin-top: 50px; | ||
| } | ||
|
|
||
| .testTitle { | ||
| font-size: $lowResHeaderFontSize; | ||
| white-space: normal; | ||
| overflow-wrap: break-spaces; | ||
| position: absolute; | ||
| top: 1px; | ||
| right: 1px; | ||
| padding: 0; | ||
| margin: 0; | ||
| text-align: right; | ||
| } | ||
| .buttonYellow{ | ||
| @include techSwitchButton($techSwitchYellow, $techSwitchBlack, $lowResBodyFontSize); | ||
| width: 120px; | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this doesn't need to return anything.
Also could you move it back to where it was? Its not really part of the API client (because it doesn't directly call the API)