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 60 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
10 changes: 10 additions & 0 deletions Models/CandidateTestModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ export interface CandidateTestModel {
expectedOutput: string | number;
}

export interface CandidateTestStatusModel {
candidateTest: CandidateTestModel;
testStartedTimeStamp: number | undefined;
testSubmittedTimeStamp: number | undefined;
}

export interface TestLibraryStepperProps {
candidateTestsStatus: CandidateTestStatusModel[];
candidateUniqueUrl: string;
}
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions api/sessionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fetch from "node-fetch";
export async function checkToken(token: string): Promise<boolean> {
const {publicRuntimeConfig} = getConfig();
const baseUrl = publicRuntimeConfig.API_URL;
const response = await fetch(`${baseUrl}/sessions/${token}`);

const response = await fetch(`https://testswitch-api-staging.herokuapp.com/sessions/${token}`);
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
return response.ok;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function createCandidateTestStatus() {

}
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 6 additions & 3 deletions components/CandidateTestView/CandidateTestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ import InstructionsBlock from "./Instructions/Instructions";

interface CandidateTestViewProps {
test: CandidateTestModel;
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>
<p className={scss.instructionsSubheader}><strong>{candidateTestViewProps.test.title}</strong></p>
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
<div id={"testInstructions"} className={scss.instructions}>
{InstructionsBlock(candidateTestViewProps.test)}
</div>
</section>
<section className={scss.textEditor}>
<div className={scss.textEditor}>
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
<TextEditorContainer
height="50vh"
width="100%"
defaultText={candidateTestViewProps.test.testStarterCode}
token={candidateTestViewProps.token}
testId={candidateTestViewProps.test.number}
/>
</section>
</div>
</div>

);
Expand Down
14 changes: 0 additions & 14 deletions components/CandidateTestView/Instructions/Instructions.module.scss

This file was deleted.

6 changes: 3 additions & 3 deletions components/CandidateTestView/Instructions/Instructions.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import scss from "../Instructions/Instructions.module.scss";
import scss from "../CandidateTestView.module.scss";
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
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.instructionsSubheader}><strong>Example</strong></p>
<p className={scss.instructionList}>{testModel.example}</p>
<h2>Input/Output</h2>
<p className={scss.instructionsSubheader}><strong>Input/Output</strong></p>
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
<ul className={scss.instructionList}>
<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>
Expand Down
118 changes: 72 additions & 46 deletions components/CandidateTestView/candidateTestView.module.scss
Original file line number Diff line number Diff line change
@@ -1,82 +1,108 @@
@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;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;

}

.testInstructions {
height: 500px;
max-width: 50vw;

}
.instructionList {
margin-bottom: 1em;
padding: 1vw;
}

.testInstructionsHeader {
color: $techSwitchWhite;
.instructionsSubheader {
font-size: $desktopSubHeaderFontSize;
margin-bottom: 12px;
padding: 5px;
line-height: 1rem;
}

.testInstructions {
box-sizing: border-box;
color: $techSwitchWhite;
white-space: pre-wrap;
font-size: $bodyFontSize;
font-size: $desktopBodyFontSize;
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;
margin-left: 1rem;
line-height: 130%;

}

.textEditor {
box-sizing: border-box;
color: $techSwitchWhite;
font-size: $buttonFontSize;
justify-content: right;
font-size: $desktopBodyFontSize;
margin-top: 5vh;
margin-right: 1vw;
width: 50vw;
}

.testTitle {
box-sizing: border-box;
color: $techSwitchYellow;
font-size: 30pt;
font-size: $desktopHeaderFontSize;
max-width: 40vw;
white-space: nowrap;
margin: 5px;
padding: 5px;
top: 1vh;
right: 2vw;
overflow: hidden;
position: absolute;
top: 0;
right: 0;
text-align: right;
margin: 0.5rem;
}

.editorBox {
border-style: solid;
border-width: 5px;
border-color: $techSwitchYellow;
}
//Media Queries

.sampleInputOutput {
margin: 5px;
padding: 5px;
top: 85vh;
left: 46vw;
display: flex;
flex-direction: column;
line-height: 0;
position: absolute;
overflow: hidden;
}
//@media (min-width: $mediaHighResMinWidth){
// //High Resolution 2000px and above
// .instructionsSubheader {
// box-sizing: border-box;
// font-size: $highResSubHeaderFontSize;
// }
// .instructionsHeader {
// font-size: $highResSubHeaderFontSize;
// }
// .testInstructions {
// font-size: $highResBodyFontSize;
// line-height: 200%;
// }
// .testTitle {
// font-size: $highResHeaderFontSize;
// margin-top: 0.5vh;
// margin-bottom: 0.8vh;
// padding: 2.5rem;
// }
// .buttonYellow{
// @include techSwitchButton($techSwitchYellow, $techSwitchBlack, $highResBodyFontSize);
// min-width: 15vw;
// margin: 3rem;
// }
//}
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
@media (max-width: $mediaLowResMaxWidth){
//Low Resolution 900px and below
.instructionsSubheader {
box-sizing: border-box;
font-size: $lowResSubHeaderFontSize;
}
.instructionsHeader {
font-size: $lowResSubHeaderFontSize;
}
.testInstructions {
font-size: $lowResBodyFontSize;
}
.testTitle {
font-size: $lowResHeaderFontSize;
white-space: normal;
overflow-wrap: break-spaces;
margin-right: 1rem;
margin-top: 1.5rem;
}
.buttonYellow{
@include techSwitchButton($techSwitchYellow, $techSwitchBlack, $lowResBodyFontSize);
max-width: 40vw;
}
}


34 changes: 19 additions & 15 deletions components/Layout/layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,34 @@
.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: 20vw;
EmmaluFox marked this conversation as resolved.
Show resolved Hide resolved
padding: 0.2rem;
margin: 0.2rem;
align-self: flex-start;
}

@media (min-width: 768px){
.logoHeader{
width: 200px;
//@media (min-width: $mediaHighResMinWidth){
// .logoHeader {
// //High Resolution 2000px and above
// width: 12vw;
// }
//}
@media (max-width: $mediaLowResMaxWidth){
.logoHeader {
//Low Resolution 900px and below
width: 40vw;

}
}

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

3 changes: 1 addition & 2 deletions components/Layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ type LayoutProps = {children: React.ReactNode };
const Layout = ({children}: LayoutProps): JSX.Element => (
<section>
<header title={"layoutHeader"} className={scss.layoutHeader}>
<img className={scss.logoHeader} alt="TechSwitch" src={'/logo.png'}>
</img>
<img className={scss.logoHeader} alt="TechSwitch" src={'/logo.png'}/>
</header>
<main className={scss.layout}>
{children}
Expand Down
41 changes: 24 additions & 17 deletions components/TestLibraryStepper/TestLibraryStepper.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
import React from "react";
import {Step, StepLabel, Stepper, Typography} from '@material-ui/core';
import {MuiThemeProvider} from '@material-ui/core/styles';
import {CandidateTestStatus} from "../../pages/api/candidateApiClient.module";
import TestSwitchStepIcon from "../TestLibraryStepperIcons/TestLibraryStepperIcons";
import {h1Style, TestSwitchConnector, TestSwitchTheme} from "../TestLibraryOverrides/TestLibraryOverrides"
import scss from '../TestLibraryStepper/TestLibraryStepper.module.scss';
import {TestList} from "../CandidateTestView/Tests/TestList";
import {testToRender} from "../../pages";
import TokenLink from "../TokenLink/TokenLink";

interface CandidateTestStatus {
testName: string;
testStatus: string;
}

interface TestLibraryStepperProps {
candidateTestStatus: CandidateTestStatus[];
candidateTestStatuses: CandidateTestStatus[];
}

function getSteps() {
//TODO: mock data, set number of steps based on test range, maybe props.candidateTestStatus.tests.length?
const testNumber = 3;

function getSteps(): string[] {
//set labels for steps
const testLabelArray = [];
while (testLabelArray.length + 1 <= testNumber) {
testLabelArray.push(`Test ${testLabelArray.length + 1}`);
}
const testLabelArray = TestList.map(test => test.title)
const dummyTest = testLabelArray.shift();
return testLabelArray;
}

function getActiveStep(testArr: CandidateTestStatus[]): number {
//check for number of completed tests
const completedTests = (testArr.filter(({testStatus}) => testStatus === "Completed"));
return completedTests.length;
}


export default function TestLibraryStepper(props: TestLibraryStepperProps): JSX.Element {
const steps = getSteps();
//TODO this is example data, set active step with candidate number of results, maybe props.candidateTestStatus.results.length?
const activeStep = 1;
const activeStep = getActiveStep(props.candidateTestStatuses);

return (
<article className="stepperContainer">
<MuiThemeProvider theme={TestSwitchTheme}>
<Stepper style={{backgroundColor: "transparent"}} alternativeLabel activeStep={activeStep}
connector={<TestSwitchConnector/>}>
connector
={<TestSwitchConnector/>}>
{steps.map((label, status) => (
<Step key={label}>
<Step key={label.length}>
<StepLabel StepIconComponent={TestSwitchStepIcon} className="stepLabel"><h1
style={h1Style}>{label}</h1>
</StepLabel>
Expand All @@ -45,12 +52,12 @@ export default function TestLibraryStepper(props: TestLibraryStepperProps): JSX.
</MuiThemeProvider>
<section className="stepperBtnContainer">
{activeStep === steps.length ? (
<Typography align={"center"} className="finished">
<Typography style={h1Style} align={"center"} className="finished">
All tests completed.
</Typography>
) : (
<Typography align={"center"}>
<TokenLink href={`/test${activeStep + 1}`}>
<TokenLink href={`/test${activeStep + 1}`} as={testToRender.title}>
<a className={scss.buttonYellow}>
{activeStep === steps.length - 1 ? 'Start Final Test' : `Start Test ${activeStep + 1}`}
</a>
Expand All @@ -61,4 +68,4 @@ export default function TestLibraryStepper(props: TestLibraryStepperProps): JSX.
</article>
)
}

Loading