Skip to content
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

Media Queries added #28

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
1ed986c
Merge branch 'DynamicUrls' into TestPage-TestLibrary-Integration
EmmaluFox Apr 28, 2020
78f02bc
Merge remote-tracking branch 'origin/test-library-page' into TestPage…
EmmaluFox Apr 28, 2020
c0df017
step 1
EmmaluFox Apr 28, 2020
324b681
Merge branch 'master' into TestPage-TestLibrary-Integration
EmmaluFox Apr 29, 2020
dfd672b
Integrate stepper
EmmaluFox Apr 29, 2020
cc45acc
Merge branch 'TestPage-TestLibrary-Integration' into origin/test-libr…
EmmaluFox Apr 29, 2020
7e0f822
Merge remote-tracking branch 'origin/test-library-page' into TestPage…
EmmaluFox Apr 29, 2020
69e0e5c
Merge branch 'TestPage-TestLibrary-Integration' into origin/TestPage-…
EmmaluFox Apr 29, 2020
5d127ff
Merge remote-tracking branch 'origin/TestPage-TestLibrary-Integration…
EmmaluFox Apr 29, 2020
8758f62
Working on media queries
EmmaluFox Apr 30, 2020
28006b7
Working on media queries
EmmaluFox Apr 30, 2020
0b5f788
Working on media queries
EmmaluFox Apr 30, 2020
f53152b
Working on media queries
EmmaluFox Apr 30, 2020
80bb986
Working on media queries
EmmaluFox Apr 30, 2020
f964170
Working on media queries
EmmaluFox Apr 30, 2020
81d9304
Media Qs
EmmaluFox May 1, 2020
2c07993
Media Qs
EmmaluFox May 1, 2020
0dfd2ee
Media Qs
EmmaluFox May 1, 2020
4ce6491
Media Qs
EmmaluFox May 1, 2020
591f404
Media Qs
EmmaluFox May 1, 2020
585d04b
Media Qs
EmmaluFox May 1, 2020
43f71e2
Media Qs
EmmaluFox May 1, 2020
d645c29
Media Qs
EmmaluFox May 1, 2020
1bf4e1b
Media Qs
EmmaluFox May 1, 2020
b7a308f
Media Qs
EmmaluFox May 1, 2020
ce7df68
Merge branch 'TestPage-TestLibrary-Integration' into MediaQueries
EmmaluFox May 1, 2020
7a58f1b
Media Qs
EmmaluFox May 1, 2020
fdbe41e
Merge pull request #27 from techswitch-learners/MediaQueries
EmmaluFox May 1, 2020
3c52295
Media Qs
EmmaluFox May 1, 2020
4191975
Media Qs
EmmaluFox May 1, 2020
0f90eaf
improved media queries
EmmaluFox May 3, 2020
35e1a74
improved media queries
EmmaluFox May 3, 2020
8f3abcd
reverted to section structure
EmmaluFox May 4, 2020
d8b89b9
changes requested
EmmaluFox May 4, 2020
0755992
changes requested
EmmaluFox May 4, 2020
b83a21a
Merge remote-tracking branch 'origin/testLibraryApi' into TestPage-Te…
EmmaluFox May 5, 2020
bd2563e
Merge remote-tracking branch 'origin/candidatetestpageapiconnect' int…
EmmaluFox May 5, 2020
17e9b18
Merge branch 'TestPage-TestLibrary-Integration' into origin/TestPage-…
EmmaluFox May 5, 2020
8643c99
Merge remote-tracking branch 'origin/candidateTokenQueryParam' into T…
EmmaluFox May 5, 2020
8ddd33e
Merge branch 'TestPage-TestLibrary-Integration' into origin/TestPage-…
EmmaluFox May 5, 2020
df9cf1a
Merge branch 'TestPage-TestLibrary-Integration' into origin/TestPage-…
EmmaluFox May 5, 2020
c321f3b
Merge remote-tracking branch 'origin/TestPage-TestLibrary-Integration…
EmmaluFox May 5, 2020
31731eb
Merge branch 'TestPage-TestLibrary-Integration' into origin/TestPage-…
EmmaluFox May 5, 2020
d91cd6d
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 5, 2020
07ef78b
.
EmmaluFox May 5, 2020
adb11d8
Incorporating tokens
EmmaluFox May 5, 2020
1cd6ab3
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 5, 2020
016f785
Merge branch 'TestPage-TestLibrary-Integration' into origin/candidate…
EmmaluFox May 5, 2020
0bcb4f4
Merge remote-tracking branch 'origin/candidatetestpageapiconnect' int…
EmmaluFox May 5, 2020
5be20bd
Incorporating tokens
EmmaluFox May 5, 2020
e2e8db0
Incorporating tokens
EmmaluFox May 5, 2020
e348f84
Stepper checks tests remaining
EmmaluFox May 5, 2020
972f988
Stepper checks tests remaining
EmmaluFox May 5, 2020
452df1a
Stepper checks tests remaining
EmmaluFox May 5, 2020
8aa36e6
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 6, 2020
398f899
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 6, 2020
6e7b335
Auto stash before merge of "TestPage-TestLibrary-Integration" and "or…
EmmaluFox May 6, 2020
c77227d
working
EmmaluFox May 6, 2020
8294459
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 6, 2020
a39b249
changes
EmmaluFox May 6, 2020
246ec9b
Instructions scss module returned
EmmaluFox May 6, 2020
77b1af5
Instructions scss module returned
EmmaluFox May 6, 2020
224f110
Replacing vw/vh with px where possible
EmmaluFox May 6, 2020
98d9434
Replacing vw/vh with px where possible
EmmaluFox May 6, 2020
1a020b5
Replacing vw/vh with px where possible
EmmaluFox May 6, 2020
71fe5b9
Replacing vw/vh with px where possible
EmmaluFox May 6, 2020
bf0bc9f
Env
EmmaluFox May 6, 2020
83e9d92
error page
EmmaluFox May 6, 2020
56f511a
error page
EmmaluFox May 6, 2020
ab7421b
Loading appropriate tests from stepper
EmmaluFox May 6, 2020
9f6596d
reorganising
EmmaluFox May 6, 2020
292b98c
restructuring
EmmaluFox May 6, 2020
a6863b3
restructuring
EmmaluFox May 7, 2020
e094598
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 7, 2020
0b3db5b
latest
EmmaluFox May 7, 2020
4189aec
Consolidated api files
EmmaluFox May 7, 2020
24d8990
Consolidated interfaces into models
EmmaluFox May 7, 2020
387b629
Consolidated interfaces into models
EmmaluFox May 7, 2020
c90aa4d
Consolidated interfaces into models
EmmaluFox May 7, 2020
b19e296
Consolidated interfaces into models
EmmaluFox May 7, 2020
734fb0d
Consolidated interfaces into models
EmmaluFox May 7, 2020
8a8731e
Consolidated interfaces into models
EmmaluFox May 7, 2020
f9438f9
Consolidated interfaces into models
EmmaluFox May 7, 2020
19ce29f
Consolidated interfaces into models
EmmaluFox May 7, 2020
bba4f21
Consolidated interfaces into models
EmmaluFox May 7, 2020
c62f44a
changes
EmmaluFox May 7, 2020
a02aedb
Merge branch 'TestPage-TestLibrary-Integration' into origin/master
EmmaluFox May 7, 2020
dba84d5
Merge remote-tracking branch 'origin/master' into TestPage-TestLibrar…
EmmaluFox May 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Models/CandidateTestModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ export interface CandidateTestModel {
outputDescription: string;
expectedOutput: string | number;
}

45 changes: 0 additions & 45 deletions api/candidateApiClient.module.ts

This file was deleted.

31 changes: 31 additions & 0 deletions api/candidateApiClientModule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import getConfig from "next/config";
import fetch from "node-fetch";

export interface SessionCandidate {
firstName: string;
lastName: string;
testStatuses: CandidateTestStatus[];
}
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved

export interface CandidateTestStatus {
testName: string;
testStatus: string;
}
export interface NewTestSubmission{
testId: number;
testAnswer: string;
}
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved

export async function addTestSubmission( tokenId: string, newTestSubmission: NewTestSubmission) {
EmmaluFox marked this conversation as resolved.
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),
});
}

42 changes: 36 additions & 6 deletions api/sessionClient.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
import getConfig from 'next/config';
import fetch from "node-fetch";
import {assertTokenIsValid} from "../helpers/tokenHelpers";

import getConfig from 'next/config';
import fetch from "node-fetch";
import {GetServerSideProps} from "next";
import {CandidateTestStatus} from "./candidateApiClientModule";
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 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> {
const {publicRuntimeConfig} = getConfig();
const baseUrl = publicRuntimeConfig.API_URL;

const response = await fetch(`${baseUrl}/sessions/${token}`);
return response.ok;
}
try {
const result = await fetch(
`${baseUrl}/sessions/${token}`
);
const data = await result.json();
return data;
} catch (error) {
console.error(error);
return error.message;
}
}
8 changes: 3 additions & 5 deletions components/CandidateTestView/CandidateTestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ interface CandidateTestViewProps {
token: string;
}
const CandidateTestView = (candidateTestViewProps: CandidateTestViewProps): JSX.Element => (

<div className={scss.testPage}>
<h1 className={scss.testTitle}>Test {candidateTestViewProps.test.number}: {candidateTestViewProps.test.title}</h1>
<section className={scss.testInstructions}>
<h2 className={scss.instructionsHeader}>{candidateTestViewProps.test.title}</h2>
<div id={"testInstructions"} className={scss.instructions}>
{InstructionsBlock(candidateTestViewProps.test)}
</div>
</section>
<section className={scss.textEditor}>
<TextEditorContainer
height="50vh"
<TextEditorContainer
height="50vh"
width="100%"
defaultText={candidateTestViewProps.test.testStarterCode}
token={candidateTestViewProps.token}
Expand All @@ -30,4 +28,4 @@ const CandidateTestView = (candidateTestViewProps: CandidateTestViewProps): JSX.
</div>

);
export default CandidateTestView;
export default CandidateTestView;
46 changes: 34 additions & 12 deletions components/CandidateTestView/Instructions/Instructions.module.scss
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;
}
}

}
15 changes: 8 additions & 7 deletions components/CandidateTestView/Instructions/Instructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ import scss from "../Instructions/Instructions.module.scss";
import {CandidateTestModel} from "../../../Models/CandidateTestModel";

const InstructionsBlock = (testModel: CandidateTestModel): JSX.Element => (
<div>
<p className={scss.instructionList}>{testModel.brief}</p>
<h2>Example</h2>
<p className={scss.instructionList}>{testModel.example}</p>
<h2>Input/Output</h2>
<ul className={scss.instructionList}>
<div className={scss.testInstructions}>
<h2 className={scss.instructionsSubheader}><strong>{testModel.title}</strong></h2>
<p className={scss.instructionsBody}>{testModel.brief}</p>
<h2 className={scss.instructionsSubheader}><strong>Example</strong></h2>
<p className={scss.instructionsBody}>{testModel.example}</p>
<h2 className={scss.instructionsSubheader}><strong>Input/Output</strong></h2>
<ul className={scss.instructionsBody}>
<li className={scss.instructionList}><strong>[input] {testModel.inputType}</strong><br/>{testModel.inputDescription}</li>
<li className={scss.instructionList}><strong>[output] {testModel.outputType}</strong><br/>{testModel.outputDescription}</li>
</ul>
</div>
);

export default InstructionsBlock;
export default InstructionsBlock;
104 changes: 38 additions & 66 deletions components/CandidateTestView/candidateTestView.module.scss
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.
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;
}
}


26 changes: 7 additions & 19 deletions components/Layout/layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,18 @@
.layout {
background-color: $techSwitchBlack;
box-sizing: border-box;
padding: 0;
margin: 0;
border-style: none;
font-family: $techSwitchFont;
}

body {
max-height: 100vh;
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
max-width: 100vw;
margin: 0;
padding: 0;
}

.logoHeader {
width: 100px;
padding: 15px;
margin: 6px;
box-sizing: border-box;
width: 180px;
padding: 0.2rem;
margin: 0.2rem;
align-self: flex-start;
}

@media (min-width: 768px){
.logoHeader{
width: 200px;
}
}

.layoutHeader {
width: 100vw;
text-align: left;
}
Loading