Merge branch 'master' into 'production'

Merge master to production

See merge request sahkoinsinoorikilta/vtmk/web2.0-frontend!103
This commit is contained in:
Ilari Ojakorpi
2022-05-04 08:58:45 +00:00
17 changed files with 5908 additions and 8581 deletions
-16
View File
@@ -1,16 +0,0 @@
{
"presets": [
"next/babel"
],
"plugins": [
[
"babel-plugin-styled-components",
{
"ssr": true,
"displayName": true,
"preprocess": false,
"pure": true
}
]
]
}
+5 -1
View File
@@ -3,7 +3,7 @@ module.exports = {
"eslint:recommended", "eslint:recommended",
"airbnb", "airbnb",
"airbnb-typescript", "airbnb-typescript",
"airbnb/hooks", // "airbnb/hooks",
"plugin:import/recommended", "plugin:import/recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking", // "plugin:@typescript-eslint/recommended-requiring-type-checking",
@@ -36,6 +36,10 @@ module.exports = {
"react/jsx-one-expression-per-line": "off", "react/jsx-one-expression-per-line": "off",
"react/require-default-props": "off", "react/require-default-props": "off",
"react/default-props-match-prop-types": "off", "react/default-props-match-prop-types": "off",
"react/function-component-definition": ["error", {
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
}],
// Temp // Temp
"react/no-array-index-key": "warn", "react/no-array-index-key": "warn",
"jsx-a11y/label-has-associated-control": "off", "jsx-a11y/label-has-associated-control": "off",
+1
View File
@@ -40,6 +40,7 @@ yarn-error.log*
# SEO # SEO
public/robots.txt public/robots.txt
public/sitemap.xml public/sitemap.xml
public/sitemap-0.xml
# Sentry # Sentry
.sentryclirc .sentryclirc
+5844 -8514
View File
File diff suppressed because it is too large Load Diff
+33 -32
View File
@@ -34,58 +34,59 @@
"prepare": "husky install" "prepare": "husky install"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.1", "@types/jest": "^27.4.1",
"@types/js-cookie": "^2.2.7", "@types/js-cookie": "^3.0.1",
"@types/react": "^17.0.19", "@types/react": "^17.0.19",
"@types/react-beautiful-dnd": "^13.1.1", "@types/react-beautiful-dnd": "^13.1.2",
"@types/react-csv": "^1.1.2", "@types/react-csv": "^1.1.2",
"@types/react-dom": "^17.0.9", "@types/react-dom": "^17.0.9",
"@types/shortid": "^0.0.29", "@types/shortid": "^0.0.29",
"@types/styled-components": "^5.1.12", "@types/styled-components": "^5.1.25",
"@typescript-eslint/eslint-plugin": "^4.29.2", "@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^4.29.2", "@typescript-eslint/parser": "^5.18.0",
"babel-plugin-styled-components": "^1.13.2", "babel-plugin-styled-components": "^2.0.7",
"eslint": "^7.32.0", "eslint": "^8.13.0",
"eslint-config-airbnb": "^18.2.1", "eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^13.0.0", "eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "^12.0.7", "eslint-config-next": "^12.1.4",
"husky": "^7.0.1", "eslint-plugin-import": "^2.26.0",
"jest": "^27.1.0", "husky": "^7.0.4",
"next-sitemap": "^1.6.203", "jest": "^27.5.1",
"next-sitemap": "^2.5.19",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"postcss-jsx": "^0.36.4", "postcss-jsx": "^0.36.4",
"postcss-syntax": "^0.36.2", "postcss-syntax": "^0.36.2",
"stylelint": "^14.2.0", "stylelint": "^14.2.0",
"stylelint-config-recommended": "^6.0.0", "stylelint-config-recommended": "^6.0.0",
"stylelint-config-styled-components": "^0.1.1", "stylelint-config-styled-components": "^0.1.1",
"testcafe": "^1.15.3", "testcafe": "^1.18.5",
"ts-jest": "^27.0.5", "ts-jest": "^27.1.4",
"typescript": "^4.3.5" "typescript": "^4.6.3"
}, },
"dependencies": { "dependencies": {
"@next/bundle-analyzer": "^12.0.7", "@next/bundle-analyzer": "^12.1.4",
"@rjsf/core": "^3.2.1", "@rjsf/core": "^4.1.1",
"@sentry/nextjs": "^6.16.0", "@sentry/nextjs": "^6.19.6",
"axios": "^0.21.1", "axios": "^0.26.1",
"date-fns": "^2.23.0", "date-fns": "^2.28.0",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"js-cookie": "^3.0.0", "js-cookie": "^3.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"next": "^12.0.7", "next": "^12.1.4",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"react": "^17.0.2", "react": "^17.0.2",
"react-beautiful-dnd": "^13.1.0", "react-beautiful-dnd": "^13.1.0",
"react-csv": "^2.0.3", "react-csv": "^2.2.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-is": "^17.0.2", "react-is": "^17.0.2",
"react-markdown": "^7.0.0", "react-markdown": "^8.0.2",
"react-mde": "^11.5.0", "react-mde": "^11.5.0",
"react-toastify": "^7.0.4", "react-toastify": "^8.2.0",
"rehype-raw": "^6.0.0", "rehype-raw": "^6.1.1",
"rehype-sanitize": "^5.0.0", "rehype-sanitize": "^5.0.1",
"sharp": "^0.29.0", "sharp": "^0.30.3",
"shortid": "^2.2.16", "shortid": "^2.2.16",
"styled-components": "^5.3.0", "styled-components": "^5.3.5",
"swr": "^0.5.6" "swr": "^1.2.2"
} }
} }
+1
View File
@@ -1,3 +1,4 @@
/* eslint-disable react/no-invalid-html-attribute */
import React from "react"; import React from "react";
const Icons = (): JSX.Element => ( const Icons = (): JSX.Element => (
+3 -3
View File
@@ -28,13 +28,13 @@ const generateFetchParams = (id = "", options: Options = {}) => {
}; };
interface FetchArguments { interface FetchArguments {
initialData?: Event | Event[], fallbackData?: Event | Event[],
id?: string; id?: string;
options?: Options options?: Options
} }
const useFetchEvents = ({ const useFetchEvents = ({
initialData, fallbackData,
id = "", id = "",
options = {}, options = {},
}: FetchArguments) => { }: FetchArguments) => {
@@ -46,7 +46,7 @@ const useFetchEvents = ({
configRef.current = config; configRef.current = config;
} }
const { data, error } = useSWR([url, configRef.current], fetcher, { initialData }); const { data, error } = useSWR([url, configRef.current], fetcher, { fallbackData });
return { return {
data: data?.results || data, data: data?.results || data,
error, error,
+3 -3
View File
@@ -25,13 +25,13 @@ const generateFetchParams = (id = "", options: Options = {}) => {
}; };
interface FetchArguments { interface FetchArguments {
initialData?: Post | Post[], fallbackData?: Post | Post[],
id?: string; id?: string;
options?: Options options?: Options
} }
const useFetchFeed = ({ const useFetchFeed = ({
initialData, fallbackData,
id = "", id = "",
options = {}, options = {},
}: FetchArguments) => { }: FetchArguments) => {
@@ -43,7 +43,7 @@ const useFetchFeed = ({
configRef.current = config; configRef.current = config;
} }
const { data, error } = useSWR([url, configRef.current], feedFetcher, { initialData }); const { data, error } = useSWR([url, configRef.current], feedFetcher, { fallbackData });
return { return {
data: data?.results || data, data: data?.results || data,
error, error,
+3 -3
View File
@@ -28,13 +28,13 @@ const generateFetchParams = (id = "", options: Options = {}) => {
}; };
interface FetchArguments { interface FetchArguments {
initialData?: JobAd | JobAd[], fallbackData?: JobAd | JobAd[],
id?: string; id?: string;
options?: Options; options?: Options;
} }
const useFetchJobAds = ({ const useFetchJobAds = ({
initialData, fallbackData,
id = "", id = "",
options = {}, options = {},
}: FetchArguments) => { }: FetchArguments) => {
@@ -46,7 +46,7 @@ const useFetchJobAds = ({
configRef.current = config; configRef.current = config;
} }
const { data, error } = useSWR([url, configRef.current], jobAdFetcher, { initialData }); const { data, error } = useSWR([url, configRef.current], jobAdFetcher, { fallbackData });
return { return {
data: data?.results || data, data: data?.results || data,
error, error,
+2 -2
View File
@@ -24,8 +24,8 @@ interface InitialProps {
} }
const InEnglishPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => { const InEnglishPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => {
const eventResult = useFetchEvents({ initialData: initialEvents, options: eventOptions }); const eventResult = useFetchEvents({ fallbackData: initialEvents, options: eventOptions });
const feedResult = useFetchFeed({ initialData: initialFeed, options: feedOptions }); const feedResult = useFetchFeed({ fallbackData: initialFeed, options: feedOptions });
return ( return (
<> <>
+2 -2
View File
@@ -24,8 +24,8 @@ interface InitialProps {
} }
const FrontPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => { const FrontPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => {
const eventResult = useFetchEvents({ initialData: initialEvents, options: eventOptions }); const eventResult = useFetchEvents({ fallbackData: initialEvents, options: eventOptions });
const feedResult = useFetchFeed({ initialData: initialFeed, options: feedOptions }); const feedResult = useFetchFeed({ fallbackData: initialFeed, options: feedOptions });
return ( return (
<> <>
+2 -2
View File
@@ -16,8 +16,8 @@ interface InitialProps {
} }
const ActualPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => { const ActualPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => {
const eventResult = useFetchEvents({ initialData: initialEvents }); const eventResult = useFetchEvents({ fallbackData: initialEvents });
const feedResult = useFetchFeed({ initialData: initialFeed }); const feedResult = useFetchFeed({ fallbackData: initialFeed });
return ( return (
<> <>
+1 -1
View File
@@ -24,7 +24,7 @@ const SignUpPage: NextPage<InitialProps> = ({ initialForm }) => {
const router = useRouter(); const router = useRouter();
const id = String(initialForm?.id ?? ""); const id = String(initialForm?.id ?? "");
const URL = `${FORM_URL}${id}/`; const URL = `${FORM_URL}${id}/`;
const { data, error } = useSWR<SignupForm>(URL, (url) => axios.get(url).then((res) => res.data), { initialData: initialForm }); const { data, error } = useSWR<SignupForm>(URL, (url) => axios.get(url).then((res) => res.data), { fallbackData: initialForm });
if (error) { if (error) {
console.error(error); console.error(error);
+1 -1
View File
@@ -13,7 +13,7 @@ interface InitialProps {
const CorporatePage: NextPage<InitialProps> = ({ initialJobAds }) => { const CorporatePage: NextPage<InitialProps> = ({ initialJobAds }) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data, error } = useFetchJobAds({ initialData: initialJobAds }); const { data, error } = useFetchJobAds({ fallbackData: initialJobAds });
return ( return (
<> <>
<Head> <Head>
+1 -1
View File
@@ -10,7 +10,7 @@
{ {
"name": "Mikko Suhonen", "name": "Mikko Suhonen",
"phone_number": null, "phone_number": null,
"email": null, "email": "puheenjohtaja@sahkoinsinoorikilta.fi",
"image": "https://static.sahkoinsinoorikilta.fi/img/board/mikko.jpg" "image": "https://static.sahkoinsinoorikilta.fi/img/board/mikko.jpg"
} }
] ]
@@ -99,6 +99,7 @@ const HonoraryPageView: React.FC = () => (
<li>2012 Koneinsinöörikilta ry</li> <li>2012 Koneinsinöörikilta ry</li>
<li>2013 Martti Valtonen</li> <li>2013 Martti Valtonen</li>
<li>2016 ABB Oy</li> <li>2016 ABB Oy</li>
<li>2021 Elektroteknologsektionens Kalle Anka-Kommitté</li>
</ul> </ul>
<h2>Kultaiset ansiomerkit</h2> <h2>Kultaiset ansiomerkit</h2>
<p> <p>
+5
View File
@@ -20,6 +20,11 @@ const MarkdownStyles = styled(ReactMarkdown)`
} }
} }
img {
width: 100%;
object-fit: scale-down;
}
table { table {
tr { tr {
vertical-align: top; vertical-align: top;