Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tddd96-grupp11/teknikattan-scoring-system
1 result
Show changes
Commits on Source (5)
Showing
with 280 additions and 42 deletions
{
"CurrentProjectSetting": null
}
\ No newline at end of file
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
\ No newline at end of file
File added
File added
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"project": [
"tsconfig.json"
]
},
"ecmaFeatures": {
"jsx": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": ["warn", {
"endOfLine":"auto"
}]
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"project": ["tsconfig.json"]
},
"ecmaFeatures": {
"jsx": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": [
"warn",
{
"endOfLine": "auto"
}
]
}
}
......@@ -2262,6 +2262,15 @@
"@babel/runtime": "^7.12.5"
}
},
"@tinymce/tinymce-react": {
"version": "3.12.2",
"resolved": "https://registry.npmjs.org/@tinymce/tinymce-react/-/tinymce-react-3.12.2.tgz",
"integrity": "sha512-M6YQ9e+9rpxrZDOeNPmjgroEfooEKiMVuI4I3+xQtMX1hQQ/t9pGE9nUdS0faZDvqhlc8B/w12GJQNU5ekPo4g==",
"requires": {
"prop-types": "^15.6.2",
"tinymce": "^5.7.1"
}
},
"@types/anymatch": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz",
......@@ -4635,6 +4644,11 @@
}
}
},
"classnames": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz",
"integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA=="
},
"clean-css": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
......@@ -7211,6 +7225,11 @@
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
},
"fast-memoize": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz",
"integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw=="
},
"fastq": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.1.tgz",
......@@ -13382,6 +13401,14 @@
}
}
},
"re-resizable": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/re-resizable/-/re-resizable-6.9.0.tgz",
"integrity": "sha512-3cUDG81ylyqI0Pdgle/RHwwRYq0ORZzsUaySOCO8IbEtNyaRtrIHYm/jMQ5pjcNiKCxR3vsSymIQZHwJq4gg2Q==",
"requires": {
"fast-memoize": "^2.5.1"
}
},
"react": {
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.1.tgz",
......@@ -13525,6 +13552,15 @@
"scheduler": "^0.20.1"
}
},
"react-draggable": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/react-draggable/-/react-draggable-4.4.3.tgz",
"integrity": "sha512-jV4TE59MBuWm7gb6Ns3Q1mxX8Azffb7oTtDtBgFkxRvhDp38YAARmRplrj0+XGkhOJB5XziArX+4HUUABtyZ0w==",
"requires": {
"classnames": "^2.2.5",
"prop-types": "^15.6.0"
}
},
"react-error-overlay": {
"version": "6.0.9",
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz",
......@@ -13557,6 +13593,23 @@
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz",
"integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg=="
},
"react-rnd": {
"version": "10.2.4",
"resolved": "https://registry.npmjs.org/react-rnd/-/react-rnd-10.2.4.tgz",
"integrity": "sha512-wseACIsxa1wuZz9XatO3/JAZR748Sddehh0NtJz1Yj3X5BQm5pwRShiadfnWrUajJATurHbN0NVTUn+jEkHkPw==",
"requires": {
"re-resizable": "6.9.0",
"react-draggable": "4.4.3",
"tslib": "2.0.3"
},
"dependencies": {
"tslib": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
}
}
},
"react-router": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
......@@ -15912,6 +15965,11 @@
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
},
"tinymce": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-5.7.1.tgz",
"integrity": "sha512-1gY8RClc734srSlkYwY0MQzmkS1j73PuPC+nYtNtrrQVPY9VNcZ4bOiRwzTbdjPPD8GOtv6BAk8Ww/H2RiqKpA=="
},
"tmpl": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz",
......
......@@ -10,6 +10,7 @@
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.6.3",
"@tinymce/tinymce-react": "^3.12.2",
"@types/jest": "^26.0.20",
"@types/node": "^12.19.16",
"@types/react": "^17.0.1",
......@@ -21,6 +22,7 @@
"react-axios": "^2.0.4",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-rnd": "^10.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.2",
"redux": "^4.0.5",
......
client/public/favicon.ico

3.78 KiB | W: 64px | H: 64px

client/public/favicon.ico

34.5 KiB | W: 256px | H: 256px

client/public/favicon.ico
client/public/favicon.ico
client/public/favicon.ico
client/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
......@@ -24,7 +21,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Teknikåttan</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
......
......@@ -6,6 +6,7 @@ import PresentationEditorPage from './pages/presentationEditor/PresentationEdito
import AudienceViewPage from './pages/views/AudienceViewPage'
import JudgeViewPage from './pages/views/JudgeViewPage'
import ParticipantViewPage from './pages/views/ParticipantViewPage'
import PresenterViewPage from './pages/views/PresenterViewPage'
import ViewSelectPage from './pages/views/ViewSelectPage'
import SecureRoute from './utils/SecureRoute'
......@@ -17,9 +18,10 @@ const Main: React.FC = () => {
<SecureRoute path="/admin" component={AdminPage} />
<SecureRoute path="/editor/competition-id=:id" component={PresentationEditorPage} />
<Route exact path="/view" component={ViewSelectPage} />
<Route exact path="/view/participant" component={ParticipantViewPage} />
<Route exact path="/view/judge" component={JudgeViewPage} />
<Route exact path="/view/audience" component={AudienceViewPage} />
<Route exact path="/participant/id=:id&code=:code" component={ParticipantViewPage} />
<SecureRoute exact path="/presenter/id=:id&code=:code" component={PresenterViewPage} />
<Route exact path="/judge/id=:id&code=:code" component={JudgeViewPage} />
<Route exact path="/audience/id=:id&code=:code" component={AudienceViewPage} />
</Switch>
</BrowserRouter>
)
......
import axios from 'axios'
import { CompetitionFilterParams } from '../interfaces/CompetitionFilterParams'
import { CompetitionFilterParams } from '../interfaces/FilterParams'
import { AppDispatch, RootState } from './../store'
import Types from './types'
......
import axios from 'axios'
import { Slide } from '../interfaces/Slide'
import { AppDispatch } from './../store'
import Types from './types'
export const getPresentationCompetition = (id: string) => async (dispatch: AppDispatch) => {
await axios
.get(`/competitions/${id}`)
.then((res) => {
dispatch({
type: Types.SET_PRESENTATION_COMPETITION,
payload: res.data,
})
})
.catch((err) => {
console.log(err)
})
}
export const getPresentationTeams = (id: string) => async (dispatch: AppDispatch) => {
await axios
.get(`/competitions/${id}/teams`)
.then((res) => {
dispatch({
type: Types.SET_PRESENTATION_TEAMS,
payload: res.data.items,
})
})
.catch((err) => {
console.log(err)
})
}
export const setCurrentSlide = (slide: Slide) => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_SLIDE, payload: slide })
}
export const setCurrentSlidePrevious = () => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_SLIDE_PREVIOUS })
}
export const setCurrentSlideNext = () => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_SLIDE_NEXT })
}
import axios from 'axios'
import { UserFilterParams } from '../interfaces/UserData'
import { UserFilterParams } from '../interfaces/FilterParams'
import { AppDispatch, RootState } from './../store'
import Types from './types'
......
......@@ -15,6 +15,11 @@ export default {
SET_COMPETITIONS_FILTER_PARAMS: 'SET_COMPETITIONS_FILTER_PARAMS',
SET_COMPETITIONS_TOTAL: 'SET_COMPETITIONS_TOTAL',
SET_COMPETITIONS_COUNT: 'SET_COMPETITIONS_COUNT',
SET_PRESENTATION_COMPETITION: 'SET_PRESENTATION_COMPETITION',
SET_PRESENTATION_SLIDE: 'SET_PRESENTATION_SLIDE',
SET_PRESENTATION_SLIDE_PREVIOUS: 'SET_PRESENTATION_SLIDE_PREVIOUS',
SET_PRESENTATION_SLIDE_NEXT: 'SET_PRESENTATION_SLIDE_NEXT',
SET_PRESENTATION_TEAMS: 'SET_PRESENTATION_TEAMS',
SET_CITIES: 'SET_CITIES',
SET_CITIES_TOTAL: 'SET_CITIES_TOTAL',
SET_CITIES_COUNT: 'SET_CITIES_COUNT',
......
import axios from 'axios'
import { History } from 'history'
import { AppDispatch } from '../store'
import { AdminLoginData } from './../interfaces/AdminLoginData'
import { AccountLoginModel } from './../interfaces/FormModels'
import Types from './types'
export const loginUser = (userData: AdminLoginData, history: History) => async (dispatch: AppDispatch) => {
export const loginUser = (userData: AccountLoginModel, history: History) => async (dispatch: AppDispatch) => {
dispatch({ type: Types.LOADING_UI })
await axios
.post('/auth/login', userData)
......
export enum ComponentTypes {
Text,
Checkbox,
Image,
}
......@@ -7,6 +7,15 @@ body {
-moz-osx-font-smoothing: grayscale;
}
.tox-edit-area__iframe,
.tox-edit-area {
background: transparent !important;
}
.tox-notifications-container {
display: none;
}
html,
#root {
height: 100%;
......
export interface AdminLoginData {
email: string
password: string
}
interface NameID {
id: number
name: string
}
export interface City extends NameID {}
export interface Role extends NameID {}
export interface MediaType extends NameID {}
export interface QuestionType extends NameID {}
export interface Media {
id: number
filename: string
mediatype_id: number
user_id: number
}
export interface User extends NameID {
email: string
role_id: number
city_id: number
}
export interface Competition extends NameID {
city_id: number
year: number
}
export interface Team extends NameID {
competition_id: number
}
export interface Question extends NameID {
slide_id: number
title: string
total_score: number
type_id: number
}
export interface QuestionAlternative {
id: number
text: string
value: boolean
question_id: number
}
export interface QuestionAnswer {
id: number
question_id: number
team_id: string
data: string
score: number
}
export interface Component {
id: number
x: number
y: number
w: number
h: number
type: number
}
export interface ImageComponent extends Component {
media_id: number
}
export interface TextComponent extends Component {
text: string
font: string
}
export interface QuestionAlternativeComponent extends Component {
question_alternative_id: number
font: string
}
import { City, Component, Media, QuestionAnswer, QuestionType } from './ApiModels'
export interface RichCompetition {
name: string
id: number
year: number
city: City
slides: RichSlide[]
teams: RichTeam[]
}
export interface RichSlide {
id: number
order: number
timer: number
title: string
competition_id: number
question: RichQuestion[]
components: Component[]
medias: Media[]
}
export interface RichTeam {
id: number
name: string
question_answers: QuestionAnswer[]
competition_id: number
}
export interface RichQuestion {
id: number
slide_id: number
name: string
title: string
total_score: number
question_type: QuestionType
}