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