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

Testing next #85

Draft
wants to merge 110 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
f8755cf
Extracted API requests for sendLoginCode and register
Nautman Apr 1, 2021
3e6fe3c
Changed all instances of axios to API axios
Nautman Apr 1, 2021
bc51e8a
Added delete request to API instance + getAdmins + delete request
Nautman Apr 2, 2021
352e3ae
Added custom useAxios and improved admin hooks
Nautman Apr 4, 2021
88998e4
Improved admin hooks
Nautman Apr 4, 2021
2f075b6
Flattened admin file structure
Nautman Apr 4, 2021
3eba4b8
Improved admin grading types and added useApi
Nautman Apr 4, 2021
bd1d8b1
Restructured admi requests to api structure
Nautman Apr 4, 2021
8885416
Moved files and fixed errors
Nautman Apr 5, 2021
dd7c2ba
Merge branch 'add-applicant-information' into refactor
Nautman Apr 5, 2021
7de6e09
Created recommendationsSlice
Nautman Apr 5, 2021
0b5f3b7
Merge branch 'add-applicant-information' into refactor
Nautman Apr 5, 2021
ed304a6
Fixed warnings
Nautman Apr 5, 2021
bc55805
Improved references
Nautman Apr 5, 2021
98765a1
Made axios calls into api calls
Nautman Apr 5, 2021
80b7a03
Extracted Chapters and References from Portal
Nautman Apr 5, 2021
d2286bc
Extracted survey from portal
Nautman Apr 5, 2021
feb1952
Extracted Introduction from portal
Nautman Apr 5, 2021
4339b2e
Extracted survey hooks
Nautman Apr 5, 2021
ab8cdd9
Moved NoMatch
Nautman Apr 5, 2021
7ac9072
Extracted Reference
Nautman Apr 5, 2021
58f476f
Improved redux state
Nautman Apr 5, 2021
9674335
Added progress bars to two places
Nautman Apr 5, 2021
3b1b23d
Changed name of FileChapters export
Nautman Apr 5, 2021
cebfb45
Changed FileChapters into TranslatedChapters to improve resuability
Nautman Apr 5, 2021
e409541
Moved disabled loading logic from FileChapters to Upload feature
Nautman Apr 5, 2021
b2a2ebd
Extracted downloadFile from Upload
Nautman Apr 5, 2021
87128ce
Add comments to useFiles
Nautman Apr 5, 2021
ab29bd0
Added comments to filesSlice
Nautman Apr 5, 2021
8220ea2
Added comments to api/files
Nautman Apr 5, 2021
8e4353f
Bug fix to FileChapters
Nautman Apr 5, 2021
1a439c3
Commented Upload
Nautman Apr 5, 2021
59b87fc
Added translation to Upload and disabled property to Button in Contac…
Nautman Apr 5, 2021
7832f3a
Bug fix for survey redux
Nautman Apr 5, 2021
7f1f073
Improved Chapter code style
Nautman Apr 5, 2021
83dab6f
Added comments to Chapter and CopyLoginCode
Nautman Apr 5, 2021
ec3f240
Imported bootstrap css to storybook
Nautman Apr 5, 2021
2e7816f
Fixed storybook css import bug
Nautman Apr 5, 2021
8f06ef1
Added error field for firstName and lastName in AdminContact
Nautman Apr 9, 2021
462a706
Began adding comments to API calls
Nautman May 4, 2021
4ca8a90
Flattened components folder
Nautman May 6, 2021
f2eccec
Deleted unused footer component
Nautman May 6, 2021
d71be08
Fixed import problems
Nautman May 7, 2021
755f895
Converted Chapter story to TypeScript
Nautman May 8, 2021
6444383
Converted AddButton story to TypeScript
Nautman May 9, 2021
cc134d1
Converted ContactPerson story to TypeScript
Nautman May 10, 2021
d7b7a01
Converted GradingData story to TypeScript
Nautman May 11, 2021
3d959ee
Fixed type bug in GradingData story
Nautman May 12, 2021
461d3a5
Converted GradingModal story to TypeScript
Nautman May 13, 2021
b2a7cf8
Converted OpenPDF story to TypeScript
Nautman May 14, 2021
22e3ed4
Added Story args to AdminContact
Nautman May 15, 2021
1a0fb88
Exported RatingProps
Nautman May 15, 2021
95ac3dc
Made onDownload prop optional in OpenPDF
Nautman May 15, 2021
0a0c20c
Added controls to AddButton story
Nautman May 15, 2021
dca0ecb
Revert "Made onDownload prop optional in OpenPDF"
Nautman May 15, 2021
62f5d6d
Converted Rating story to TypeScript
Nautman May 16, 2021
b9e75f7
Converted StyledGroup story to TypeScript
Nautman May 17, 2021
14cc64a
Converted Survey story to TypeScript
Nautman May 18, 2021
b0cf8ee
Converted Plate component to TypeScript
Nautman May 20, 2021
de5e59e
Convert Star component to TypeScript and renamed it to AnimatedStar
Nautman May 21, 2021
2c4366a
Converted StyledTitle to TypeScript
Nautman May 21, 2021
2d8cc8b
Converted service worker code to TypeScript
Nautman May 21, 2021
69fad00
Converted test code to TypeScript
Nautman May 21, 2021
ae5fa00
Converted StyledGroup to TypeScript
Nautman May 21, 2021
3ac05fa
Fixed StyledGroup error
Nautman May 21, 2021
e4970d6
Fixed warnings in stories
Nautman May 21, 2021
934c7e0
Removed unused default react logo
Nautman May 22, 2021
a349e2d
Moved logo to config folder
Nautman May 23, 2021
18f3b38
Moved portal translations to config and removed unnecessary translations
Nautman May 24, 2021
2e8b7dc
Fixed incorrect import in Logo
Nautman May 24, 2021
53ae5e5
Added deadline to config
Nautman May 25, 2021
17fedca
Deleted unnecessary code in GradingView
Nautman May 26, 2021
7f984c3
Simplified survey component
Nautman May 27, 2021
4a0632b
Began working on a custom survey feature
Nautman May 28, 2021
56e2cc9
Fixed type bug in CustomSurvey story
Nautman May 29, 2021
1952416
Added survey questions to config
Nautman May 30, 2021
44cd895
Added select question type to survey type definitions
Nautman May 30, 2021
534c77e
Developed question type react components in CustomSurvey
Nautman May 30, 2021
6092256
Added range translation and component to CustomSurvey
Nautman May 30, 2021
9fead6d
Separated CustomSurveyAccordion into a Form and Question
Nautman May 31, 2021
ef3b802
Added initialValues to CustomSurvey
Nautman Jun 1, 2021
23fcd4d
Bug fix for initialValues in CustomSurvey
Nautman Jun 1, 2021
f28bfdf
Added submit button and required fields to CustomSurvey
Nautman Jun 2, 2021
f1316b1
Made CustomSurveyAccordionProps the same as props for Form
Nautman Jun 2, 2021
901c9a2
Moved chapter JSON into chapters key in translations
Nautman Jun 3, 2021
6a11d5b
Began to make config even more customizable
Nautman Jun 4, 2021
e4d1b6c
Began working on more customisable Chapters
Nautman Jun 5, 2021
2978c2e
Made the Chapter show a Survey instead of a FileChapter, for now
Nautman Jun 6, 2021
a52ae0b
Added RecommendationChapter to custom chapters
Nautman Jun 7, 2021
13f2463
Fixed bug
Nautman Jun 8, 2021
aae2223
Began implementing the CustomSurvey in reality
Nautman Jun 9, 2021
1eee68f
Temporary solution to include survey in application
Nautman Jun 10, 2021
08f0e58
Bug fix
Nautman Jun 11, 2021
cd614a6
Switched out FileType in favour of a custom id
Nautman Jun 11, 2021
fe48ef4
Fixed duplicate chapter descriptions and added initialValues to survey
Nautman Jun 12, 2021
a0fd4b8
Removed unused uncustomised FileChapters and SurveyChapter
Nautman Jun 13, 2021
cefd681
Testing next
Nautman Jan 23, 2022
34afd40
Added netlify.toml variables
Nautman Jan 23, 2022
1deac0f
Updated node version
Nautman Jan 23, 2022
e8176aa
Added baseUrl
Nautman Jan 25, 2022
efb1176
Added packages again
Nautman Jan 25, 2022
0ba1cad
Fixed errors
Nautman Jan 25, 2022
6f37612
Fixed eslint, vscode and netlify
Nautman Jan 25, 2022
7518bed
Added @netlify/plugin-nextjs
Nautman Jan 25, 2022
6eae821
Deleted unnecessary index.html file
Nautman Jan 25, 2022
2d96473
Added storybook build scripts back
Nautman Jan 25, 2022
0fac32b
Merge branch 'refactor' into nextjs-rewrite
Nautman Jan 25, 2022
12d7d99
Old work
Nautman Jun 14, 2022
871f8b0
Began work on file api
Nautman Mar 7, 2023
e3dec5e
Almost functioning portal
Nautman Mar 17, 2023
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: 3 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ module.exports = {
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
Expand All @@ -19,9 +18,6 @@ module.exports = {
ecmaVersion: 12,
sourceType: "module",
},
plugins: ["react", "@typescript-eslint", "jest"],
rules: {
"react/prop-types": 0,
"react/jsx-one-expression-per-line": "off",
},
plugins: ["react", "@typescript-eslint", "jest", "prettier"],
rules: {},
};
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# storybook
build-storybook.log
storybook-static

# dependencies
/node_modules
Expand All @@ -13,6 +14,10 @@ build-storybook.log
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

Expand All @@ -21,6 +26,14 @@ build-storybook.log

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
Expand All @@ -29,3 +42,9 @@ build-storybook.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# vercel
.vercel

# typescript
*.tsbuildinfo
36 changes: 35 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
const path = require("path");

module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: ["../public"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app",
{
/**
* Fix Storybook issue with PostCSS@8
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
*/
name: "@storybook/addon-postcss",
options: {
postcssLoaderOptions: {
implementation: require("postcss"),
},
},
},
],
core: {
builder: "webpack5",
},
webpackFinal: (config) => {
config.resolve.modules = [
...(config.resolve.modules || []),
path.resolve(__dirname, "../src"),
];

/**
* Fixes font import with /
* @see https://github.com/storybookjs/storybook/issues/12844#issuecomment-867544160
*/
config.resolve.roots = [
path.resolve(__dirname, "../public"),
"node_modules",
];

return config;
},
typescript: { reactDocgen: "react-docgen" },
};
3 changes: 3 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import "bootstrap/dist/css/bootstrap.min.css";

import CustomThemeProvider from "./../src/components/CustomThemeProvider";
import { I18nextProvider } from "react-i18next";
import i18n from "../src/i18n";
import "../src/styles/globals.css";

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand Down
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
12 changes: 8 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[[plugins]]
package = "@netlify/plugin-nextjs"

[context.production.environment]
REACT_APP_API_URL = "https://api.infrarays.digitalungdom.se"

Expand All @@ -10,7 +13,8 @@
[context.dev.environment]
REACT_APP_API_URL = "https://devapi.infrarays.digitalungdom.se"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[build]
NETLIFY_USE_YARN = "true"
environment = { YARN_VERSION = "1.22.17", NODE_VERSION = "16.13.1" }
command = "yarn next build"
publish = ".next"
4 changes: 4 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// <reference types="next" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
7 changes: 7 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
images: {
disableStaticImages: true,
},
};
Loading