Merge branch 'master' into 'production'

master to production merge

See merge request sahkoinsinoorikilta/vtmk/web2.0-frontend!31
This commit is contained in:
Toni Lyttinen
2021-02-11 16:37:44 +00:00
37 changed files with 381 additions and 1550 deletions
+28 -32
View File
@@ -5,10 +5,15 @@
"node": true "node": true
}, },
"extends": [ "extends": [
"airbnb", "eslint:recommended",
"airbnb/hooks", "plugin:react/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
"plugin:react/recommended" "airbnb-typescript",
"airbnb/hooks"
], ],
"globals": { "globals": {
"Atomics": "readonly", "Atomics": "readonly",
@@ -33,37 +38,28 @@
} }
}, },
"rules": { "rules": {
"camelcase": "off", "@typescript-eslint/naming-convention": "off",
"max-len": [ "max-len": [
"warn", "warn",
160 160
], ],
"no-mixed-operators": "off", "@typescript-eslint/quotes": [
"no-shadow": "off", "error",
"no-use-before-define": "off", "double"
"quotes": [ ],
"error", "import/prefer-default-export": "warn",
"double" "react/jsx-props-no-spreading": "off",
], "react/prop-types": "off",
"import/extensions": "off", // Temp
"import/no-unresolved": "off", "react/jsx-one-expression-per-line": "off",
"import/order": "off", "react/no-array-index-key": "off",
"import/prefer-default-export": "warn", "@typescript-eslint/explicit-function-return-type": "off",
"operator-linebreak": "off", "@typescript-eslint/explicit-module-boundary-types": "off",
"no-unused-vars": "off", "jsx-a11y/alt-text": "off",
"react/jsx-filename-extension": "off", "jsx-a11y/iframe-has-title": "off",
"react/jsx-one-expression-per-line": "off", "jsx-a11y/label-has-associated-control": "off",
"react/jsx-props-no-spreading": "off", "jsx-a11y/click-events-have-key-events": "off",
"react/prop-types": "off", "jsx-a11y/no-noninteractive-element-interactions": "off",
"@typescript-eslint/no-shadow": "error", "jsx-a11y/no-static-element-interactions": "off"
// Temp
"react/no-array-index-key": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/iframe-has-title": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-static-element-interactions": "off"
} }
} }
+283 -1443
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -49,14 +49,14 @@
"@types/react-jsonschema-form": "1.7.3", "@types/react-jsonschema-form": "1.7.3",
"@types/shortid": "0.0.29", "@types/shortid": "0.0.29",
"@types/styled-components": "5.1.1", "@types/styled-components": "5.1.1",
"@typescript-eslint/eslint-plugin": "4.8.2", "@typescript-eslint/eslint-plugin": "4.15.0",
"@typescript-eslint/parser": "4.8.2", "@typescript-eslint/parser": "4.15.0",
"babel-plugin-styled-components": "1.10.7", "babel-plugin-styled-components": "1.10.7",
"eslint": "7.14.0", "eslint": "7.19.0",
"eslint-config-airbnb": "18.2.1", "eslint-config-airbnb-typescript": "12.3.1",
"eslint-plugin-import": "2.22.1", "eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.4.1", "eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.21.5", "eslint-plugin-react": "7.22.0",
"eslint-plugin-react-hooks": "4.2.0", "eslint-plugin-react-hooks": "4.2.0",
"husky": "1.3.1", "husky": "1.3.1",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
+2 -2
View File
@@ -1,7 +1,7 @@
import React, { useState } from "react"; import React, { useState } from "react";
import styled from "styled-components"; import styled from "styled-components";
import AccordionIcon from "./AccordionIcon";
import { colors } from "@theme/colors"; import { colors } from "@theme/colors";
import AccordionIcon from "./AccordionIcon";
const Container = styled.div` const Container = styled.div`
margin: 0.2em; margin: 0.2em;
@@ -38,7 +38,7 @@ const Container = styled.div`
} }
`; `;
const Panel = styled.div<{visible?: boolean}>` const Panel = styled.div<{ visible?: boolean }>`
margin-top: ${(p) => (p.visible ? "0" : "-100%")}; margin-top: ${(p) => (p.visible ? "0" : "-100%")};
display: flex; display: flex;
+1 -1
View File
@@ -22,7 +22,7 @@ const StyledLink = styled(Link)`
type AddLinkProps = ComponentProps<typeof Link> & { type AddLinkProps = ComponentProps<typeof Link> & {
text: string; text: string;
} };
const AddLink: React.FC<AddLinkProps> = ({ text, ...props }) => ( const AddLink: React.FC<AddLinkProps> = ({ text, ...props }) => (
<StyledLink passHref {...props}> <StyledLink passHref {...props}>
+1 -1
View File
@@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled from "styled-components";
import HeaderLogo from "./HeaderLogo";
import { colors } from "@theme/colors"; import { colors } from "@theme/colors";
import HeaderLogo from "./HeaderLogo";
const Header = styled.header` const Header = styled.header`
background-color: ${colors.darkBlue}; background-color: ${colors.darkBlue};
+1 -1
View File
@@ -20,7 +20,7 @@ const SideBar = styled.nav`
} }
`; `;
const StyledLink = styled(Link)<{$path: string}>` const StyledLink = styled(Link)<{ $path: string }>`
padding: 1rem 3rem 1rem 1rem; padding: 1rem 3rem 1rem 1rem;
letter-spacing: 3px; letter-spacing: 3px;
text-transform: uppercase; text-transform: uppercase;
+1 -1
View File
@@ -1,8 +1,8 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled from "styled-components";
import ContactCard from "./ContactCard";
import { Committee } from "@views/ContactsPage/ContactsPageView"; import { Committee } from "@views/ContactsPage/ContactsPageView";
import { colors } from "@theme/colors"; import { colors } from "@theme/colors";
import ContactCard from "./ContactCard";
const blank_profile = "/img/blank_profile.png"; const blank_profile = "/img/blank_profile.png";
+2 -2
View File
@@ -1,9 +1,9 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import Navigation from "./Navigation";
import throttle from "lodash/throttle"; import throttle from "lodash/throttle";
import styled from "styled-components"; import styled from "styled-components";
import colors from "@theme/colors"; import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints"; import breakpoints from "@theme/breakpoints";
import Navigation from "./Navigation";
import NavigationMobile from "./NavigationMobile"; import NavigationMobile from "./NavigationMobile";
import HeaderLogo from "./HeaderLogo"; import HeaderLogo from "./HeaderLogo";
@@ -15,7 +15,7 @@ const StyledHeader = styled.header`
} }
`; `;
const Sticky = styled.div<{$isHidden?: boolean}>` const Sticky = styled.div<{ $isHidden?: boolean }>`
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 10; z-index: 10;
+1 -1
View File
@@ -1,7 +1,7 @@
import styled from "styled-components"; import styled from "styled-components";
import { colors } from "@theme/colors"; import { colors } from "@theme/colors";
const Buttons = styled.div<{row?: boolean}>` const Buttons = styled.div<{ row?: boolean }>`
min-width: 20%; min-width: 20%;
max-width: fit-content; max-width: fit-content;
margin: auto; margin: auto;
+1 -1
View File
@@ -1,9 +1,9 @@
import React, { useState } from "react"; import React, { useState } from "react";
import styled from "styled-components"; import styled from "styled-components";
import DropDownBox from "./DropDownBox";
import { Link } from "@components/index"; import { Link } from "@components/index";
import colors from "@theme/colors"; import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints"; import breakpoints from "@theme/breakpoints";
import DropDownBox from "./DropDownBox";
const Container = styled.div` const Container = styled.div`
position: relative; position: relative;
+3 -3
View File
@@ -25,7 +25,7 @@ const HiddenDefaultElement = styled.input`
`; `;
/* Create a custom checkbox */ /* Create a custom checkbox */
const CustomCBoxElement = styled.span<{checked?: boolean}>` const CustomCBoxElement = styled.span<{ checked?: boolean }>`
border-radius: 4px; border-radius: 4px;
position: absolute; position: absolute;
top: 0; top: 0;
@@ -60,8 +60,8 @@ const Checkmark = styled.div`
`; `;
type CheckboxProps = Omit< type CheckboxProps = Omit<
React.InputHTMLAttributes<HTMLInputElement>, React.InputHTMLAttributes<HTMLInputElement>,
"type" "type"
>; >;
const Checkbox: React.FC<CheckboxProps> = ({ children, checked, ...props }) => ( const Checkbox: React.FC<CheckboxProps> = ({ children, checked, ...props }) => (
@@ -33,10 +33,8 @@ const Checkboxes: React.FC<CheckboxesProps> = ({
<div className="checkboxes" id={id}> <div className="checkboxes" id={id}>
{enumOptions.map((option, index) => { {enumOptions.map((option, index) => {
const checked = value.indexOf(option.value) !== -1; const checked = value.indexOf(option.value) !== -1;
const itemDisabled = const itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
enumDisabled && enumDisabled.indexOf(option.value) !== -1; const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
const disabledCls =
disabled || itemDisabled || readonly ? "disabled" : "";
const checkbox = ( const checkbox = (
<Checkbox <Checkbox
id={`${id}_${index}`} id={`${id}_${index}`}
@@ -22,7 +22,7 @@ const HiddenDefaultElement = styled.input`
width: 0; width: 0;
`; `;
const CustomRadioElement = styled.span<{checked?: boolean}>` const CustomRadioElement = styled.span<{ checked?: boolean }>`
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@@ -43,8 +43,8 @@ const Indicator = styled.div`
`; `;
type RadioButtonProps = Omit< type RadioButtonProps = Omit<
React.InputHTMLAttributes<HTMLInputElement>, React.InputHTMLAttributes<HTMLInputElement>,
"type" "type"
>; >;
const RadioButton: React.FC<RadioButtonProps> = ({ const RadioButton: React.FC<RadioButtonProps> = ({
@@ -33,10 +33,8 @@ const RadioButtonWidget: React.FC<RadioButtonWidgetProps> = (props) => {
<div className="field-radio-group" id={id}> <div className="field-radio-group" id={id}>
{enumOptions.map((option, i) => { {enumOptions.map((option, i) => {
const checked = option.value === value; const checked = option.value === value;
const itemDisabled = const itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
enumDisabled && enumDisabled.indexOf(option.value) !== -1; const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
const disabledCls =
disabled || itemDisabled || readonly ? "disabled" : "";
const radio = ( const radio = (
<RadioButton <RadioButton
checked={checked} checked={checked}
@@ -1,8 +1,8 @@
import React from "react"; import React from "react";
import Checkbox from "@components/Widgets/Checkbox/Checkbox";
import { import {
Question, InputProps, optionTypes, SignupQuestionError, Question, InputProps, optionTypes, SignupQuestionError,
} from "./index"; } from "./common";
import Checkbox from "@components/Widgets/Checkbox/Checkbox";
interface OptionsWidgetProps { interface OptionsWidgetProps {
inputProps: InputProps; inputProps: InputProps;
@@ -17,7 +17,7 @@ class OptionsWidget extends React.Component<OptionsWidgetProps> {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
questions[index].options = lst; questions[index].options = lst;
onChange(questions); onChange(questions);
} };
handleTextOptionsChange = (questions: Question[], index: number) => (event) => { handleTextOptionsChange = (questions: Question[], index: number) => (event) => {
const { onChange } = this.props; const { onChange } = this.props;
@@ -25,7 +25,7 @@ class OptionsWidget extends React.Component<OptionsWidgetProps> {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
questions[index].options = val; questions[index].options = val;
onChange(questions); onChange(questions);
} };
handleIntegerOptionsChange = (questions: Question[], index: number) => (event) => { handleIntegerOptionsChange = (questions: Question[], index: number) => (event) => {
const { onChange } = this.props; const { onChange } = this.props;
@@ -41,7 +41,7 @@ class OptionsWidget extends React.Component<OptionsWidgetProps> {
} }
onChange(questions); onChange(questions);
} };
handleRequiredChange = (questions: Question[], index: number) => (event) => { handleRequiredChange = (questions: Question[], index: number) => (event) => {
const { onChange } = this.props; const { onChange } = this.props;
@@ -50,7 +50,7 @@ class OptionsWidget extends React.Component<OptionsWidgetProps> {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
questions[index].required = val; questions[index].required = val;
onChange(questions); onChange(questions);
} };
requiredField() { requiredField() {
const { inputProps } = this.props; const { inputProps } = this.props;
@@ -1,11 +1,11 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled from "styled-components";
import { Draggable } from "react-beautiful-dnd"; import { Draggable } from "react-beautiful-dnd";
import { Question, InputProps } from "./index"; import { colors } from "@theme/colors";
import { Question, InputProps } from "./common";
import OptionsWidget from "./OptionsWidget"; import OptionsWidget from "./OptionsWidget";
import TypeWidget from "./TypeWidget"; import TypeWidget from "./TypeWidget";
import QuestionElement from "./Question"; import QuestionElement from "./Question";
import { colors } from "@theme/colors";
const WidgetRow = styled.div` const WidgetRow = styled.div`
margin-bottom: 1rem; margin-bottom: 1rem;
@@ -25,7 +25,7 @@ interface QuestionListProps {
class QuestionList extends React.Component<QuestionListProps> { class QuestionList extends React.Component<QuestionListProps> {
renderTextWidget = ({ questions, value, index }: InputProps) => ( renderTextWidget = ({ questions, value, index }: InputProps) => (
<input type="text" value={value} onChange={this.handleNameInputChange(questions, index)} /> <input type="text" value={value} onChange={this.handleNameInputChange(questions, index)} />
) );
handleNameInputChange = (questions: Question[], index: number) => (event) => { handleNameInputChange = (questions: Question[], index: number) => (event) => {
const { onChange } = this.props; const { onChange } = this.props;
@@ -33,17 +33,17 @@ class QuestionList extends React.Component<QuestionListProps> {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
questions[index].name = val; questions[index].name = val;
onChange(questions); onChange(questions);
} };
handleElementRemove = (questions: Question[], index: number) => () => { handleElementRemove = (questions: Question[], index: number) => () => {
const { onChange } = this.props; const { onChange } = this.props;
const newQuestions = [...questions]; const newQuestions = [...questions];
newQuestions.splice(index, 1); newQuestions.splice(index, 1);
onChange(newQuestions); onChange(newQuestions);
} };
renderQuestions() { renderQuestions() {
const { questions, onChange, placeholder } = this.props; const { questions, onChange } = this.props;
return questions.map((q, index) => { return questions.map((q, index) => {
const nameWidgetProps = { const nameWidgetProps = {
value: q.name, type: "text", questions, index, value: q.name, type: "text", questions, index,
@@ -2,10 +2,10 @@ import React from "react";
import styled from "styled-components"; import styled from "styled-components";
import shortid from "shortid"; import shortid from "shortid";
import { DragDropContext, Droppable } from "react-beautiful-dnd"; import { DragDropContext, Droppable } from "react-beautiful-dnd";
import { Question } from ".";
import colors from "@theme/colors"; import colors from "@theme/colors";
import QuestionList from "./QuestionList";
import AddIcon from "@components/AddIcon"; import AddIcon from "@components/AddIcon";
import QuestionList from "./QuestionList";
import { Question } from "./common";
const Widget = styled.div` const Widget = styled.div`
& > button { & > button {
@@ -21,6 +21,7 @@ const Widget = styled.div`
margin-right: 8px !important; margin-right: 8px !important;
margin-top: -2px !important; margin-top: -2px !important;
} }
} }
`; `;
@@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import { Question, InputProps, optionTypes } from "./index"; import { Question, InputProps, optionTypes } from "./common";
interface TypeWidgetProps { interface TypeWidgetProps {
inputProps: InputProps; inputProps: InputProps;
@@ -13,7 +13,7 @@ class TypeWidget extends React.Component<TypeWidgetProps> {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
questions[index].type = val; questions[index].type = val;
onChange(questions); onChange(questions);
} };
render() { render() {
const { inputProps } = this.props; const { inputProps } = this.props;
@@ -1,5 +1,3 @@
import SignupQuestionsWidget from "./SignupQuestionsWidget";
export interface Question { export interface Question {
id: string; id: string;
name: string; name: string;
@@ -35,5 +33,3 @@ export const optionTypes = [
]; ];
export class SignupQuestionError extends Error { } export class SignupQuestionError extends Error { }
export default SignupQuestionsWidget;
+1 -1
View File
@@ -1,6 +1,6 @@
import axios from "axios"; import axios from "axios";
import { getAuthHeader } from "@utils/auth"; import { getAuthHeader } from "@utils/auth";
import { Question } from "@components/Widgets/SignupQuestionsWidget"; import { Question } from "@components/Widgets/SignupQuestionsWidget/common";
import { Signup } from "./Signup"; import { Signup } from "./Signup";
const URL = `${process.env.NEXT_PUBLIC_API_URL}/signupForm/`; const URL = `${process.env.NEXT_PUBLIC_API_URL}/signupForm/`;
+7 -7
View File
@@ -33,8 +33,8 @@ html {
} }
@media screen and (min-width: 2560px) { @media screen and (min-width: 2560px) {
/* 32px */ /* 24px */
font-size: ${fontSize * 2}pt; font-size: ${fontSize * 1.5}pt;
} }
} }
@@ -128,12 +128,12 @@ const Web20App = ({ Component, pageProps }: AppProps) => (
<Head> <Head>
<meta httpEquiv="Content-Type" content="text/html; charset=utf-8" /> <meta httpEquiv="Content-Type" content="text/html; charset=utf-8" />
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,800,900&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,800,900&display=swap" rel="stylesheet" />
{/* <link rel="icon" href="/favicon.ico" /> */} <link rel="icon" href="/favicon.png" />
{/* <meta httpEquiv="X-UA-Compatible" content="IE=edge" /> */} <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
{/* <meta name="description" content="SIK turns 100 years old!" /> */} <title>Aalto-yliopiston Sähköinsinöörikilta ry</title>
{/* <meta name="keywords" content="SIK100" /> */} <meta name="description" content="Aalto-yliopiston Sähköinsinöörikilta ry on Otaniemessä vaikuttava opiskelijajärjestö, joka on perustettu vuonna 1921. Kilta järjestää kaikenlaista toimintaa liittyen opintoihin ja vapaa-ajan viettoon." />
{/* <title>SIK100</title> */} <meta name="keywords" content="SIK AYY" />
{/* <link rel="manifest" href="/manifest.json" /> */} {/* <link rel="manifest" href="/manifest.json" /> */}
{/* <link rel="apple-touch-icon" href="/logo192.png" /> */} {/* <link rel="apple-touch-icon" href="/logo192.png" /> */}
{/* <meta name="theme-color" content={theme.colors.darkBlue2} /> */} {/* <meta name="theme-color" content={theme.colors.darkBlue2} /> */}
+2 -2
View File
@@ -29,8 +29,8 @@ const renderData = (jobAds: JobAd[]) => {
<td><Link to={`${URL}/${ad.id}`}>{ad.title_fi}</Link></td> <td><Link to={`${URL}/${ad.id}`}>{ad.title_fi}</Link></td>
<td>{ad.description_fi}</td> <td>{ad.description_fi}</td>
<td> <td>
{ad.autohide_enabled ? {ad.autohide_enabled
formatRelative(new Date(ad.autohide_at), new Date()) ? formatRelative(new Date(ad.autohide_at), new Date())
: "Disabled"} : "Disabled"}
</td> </td>
</tr> </tr>
+3 -3
View File
@@ -7,14 +7,14 @@ import {
SignupForm, createForm, getForm, updateForm, SignupForm, createForm, getForm, updateForm,
} from "@models/SignupForm"; } from "@models/SignupForm";
import DatetimeWidget from "@components/Widgets/DatetimeWidget"; import DatetimeWidget from "@components/Widgets/DatetimeWidget";
import SignupQuestionsWidget from "@components/Widgets/SignupQuestionsWidget"; import SignupQuestionsWidget from "@components/Widgets/SignupQuestionsWidget/SignupQuestionsWidget";
import MarkdownEditorWidget from "@components/Widgets/MarkdownEditorWidget"; import MarkdownEditorWidget from "@components/Widgets/MarkdownEditorWidget";
import { buildValidationSchema } from "@views/SignUpPage/FormUtils"; import { buildValidationSchema } from "@views/SignUpPage/FormUtils";
const DEFAULT_EMAIL = const DEFAULT_EMAIL = `Moikka,
`Moikka,
Ilmottautuminen saapui perille.`; Ilmottautuminen saapui perille.`;
const widgets = { const widgets = {
datetime: DatetimeWidget, datetime: DatetimeWidget,
signup: SignupQuestionsWidget, signup: SignupQuestionsWidget,
+1
View File
@@ -16,6 +16,7 @@ interface InitialProps {
const EventPage: NextPage<InitialProps> = ({ initialEvent }) => { const EventPage: NextPage<InitialProps> = ({ initialEvent }) => {
const router = useRouter(); const router = useRouter();
const { id } = router.query; const { id } = router.query;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data, error } = useFetchEvents({ initialData: initialEvent, id: id as string }); const { data, error } = useFetchEvents({ initialData: initialEvent, id: id as string });
if (!data) return <LoadingView />; if (!data) return <LoadingView />;
+2 -2
View File
@@ -67,11 +67,11 @@ const SignUpPage: NextPage = () => {
try { try {
if (uuid) { if (uuid) {
const resp = await updateSignup(payload, uuid); await updateSignup(payload, uuid);
// TODO: Update signup list, so user sees possible changes in the list // TODO: Update signup list, so user sees possible changes in the list
setStatus("Sign-up submission updated successfully"); setStatus("Sign-up submission updated successfully");
} else { } else {
const resp = await createSignup(payload); await createSignup(payload);
// TODO: Fetch/update signup list, so user sees the signup in the list // TODO: Fetch/update signup list, so user sees the signup in the list
setStatus("Sign-up submitted successfully"); setStatus("Sign-up submitted successfully");
} }
+1
View File
@@ -12,6 +12,7 @@ interface InitialProps {
} }
const CorporatePage: NextPage<InitialProps> = ({ initialJobAds }) => { const CorporatePage: NextPage<InitialProps> = ({ initialJobAds }) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data, error } = useFetchJobAds({ initialData: initialJobAds }); const { data, error } = useFetchJobAds({ initialData: initialJobAds });
return ( return (
<> <>
+1 -1
View File
@@ -2,9 +2,9 @@ import React, { useState } from "react";
import { Event } from "@models/Event"; import { Event } from "@models/Event";
import Button from "@components/Button"; import Button from "@components/Button";
import FilterContainer from "./FilterContainer";
import { CardSection, Card, FullWidthSection } from "@components/index"; import { CardSection, Card, FullWidthSection } from "@components/index";
import noop from "@utils/noop"; import noop from "@utils/noop";
import FilterContainer from "./FilterContainer";
interface EventCalendarProps { interface EventCalendarProps {
events: Event[]; events: Event[];
+1 -1
View File
@@ -2,9 +2,9 @@ import React, { useState } from "react";
import { Post } from "@models/Feed"; import { Post } from "@models/Feed";
import Button from "@components/Button"; import Button from "@components/Button";
import FilterContainer from "./FilterContainer";
import { CardSection, Card, FullWidthSection } from "@components/index"; import { CardSection, Card, FullWidthSection } from "@components/index";
import noop from "@utils/noop"; import noop from "@utils/noop";
import FilterContainer from "./FilterContainer";
interface NewsProps { interface NewsProps {
feed: Post[]; feed: Post[];
@@ -1,9 +1,9 @@
import React from "react"; import React from "react";
import CorporatePageHero from "./CorporatePageHero";
import { import {
CTASection, TextSection, PageLink, Link, CTASection, TextSection, PageLink, Link,
} from "@components/index"; } from "@components/index";
import { JobAd } from "@models/JobAd"; import { JobAd } from "@models/JobAd";
import CorporatePageHero from "./CorporatePageHero";
import JobAdList from "./JobAdList"; import JobAdList from "./JobAdList";
const EXCURSION_RULES = "https://static.sahkoinsinoorikilta.fi/saannot/excursiosaannot.pdf"; const EXCURSION_RULES = "https://static.sahkoinsinoorikilta.fi/saannot/excursiosaannot.pdf";
+1 -1
View File
@@ -1,10 +1,10 @@
import React from "react"; import React from "react";
import Image from "next/image"; import Image from "next/image";
import styled from "styled-components"; import styled from "styled-components";
import FreshmenPageHero from "./FreshmenPageHero";
import { import {
CTASection, TextSection, InfoBox, PageLink, Link, CTASection, TextSection, InfoBox, PageLink, Link,
} from "@components/index"; } from "@components/index";
import FreshmenPageHero from "./FreshmenPageHero";
const FOPAS_LINK = ""; const FOPAS_LINK = "";
const FUKSI_POINTS_LINK = ""; const FUKSI_POINTS_LINK = "";
+1 -1
View File
@@ -9,13 +9,13 @@ import {
CTASection, CTASection,
Link, Link,
} from "@components/index"; } from "@components/index";
import FrontPageHero from "./FrontPageHero";
import { Event } from "@models/Event"; import { Event } from "@models/Event";
import { Post } from "@models/Feed"; import { Post } from "@models/Feed";
import { colors } from "@theme/colors"; import { colors } from "@theme/colors";
import FullWidthSection from "@components/Sections/FullWidthSection"; import FullWidthSection from "@components/Sections/FullWidthSection";
import noop from "@utils/noop"; import noop from "@utils/noop";
import FrontPageHero from "./FrontPageHero";
// Corporate logos import // Corporate logos import
const ABB = "/img/corporate_logos/abb.png"; const ABB = "/img/corporate_logos/abb.png";
+2 -2
View File
@@ -3,10 +3,10 @@ import styled from "styled-components";
import { import {
CTASection, TextSection, PageLink, Link, CTASection, TextSection, PageLink, Link,
} from "@components/index"; } from "@components/index";
import GuildPageHero from "./GuildPageHero";
import FullWidthSection from "@components/Sections/FullWidthSection"; import FullWidthSection from "@components/Sections/FullWidthSection";
import colors from "@theme/colors"; import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints"; import breakpoints from "@theme/breakpoints";
import GuildPageHero from "./GuildPageHero";
const Column = styled.div` const Column = styled.div`
display: flex; display: flex;
@@ -60,7 +60,7 @@ const GuildPageView: React.FC = () => (
<aside> <aside>
<div> <div>
<PageLink to="/jaseneksi/" desc="ja tule mukaan toimintaamme&nbsp;"> <PageLink to="https://api.sahkoinsinoorikilta.fi/members/application/" desc="ja tule mukaan toimintaamme&nbsp;">
Liity jäseneksi Liity jäseneksi
</PageLink> </PageLink>
</div> </div>
+1 -1
View File
@@ -1,4 +1,4 @@
import { Question } from "@components/Widgets/SignupQuestionsWidget"; import { Question } from "@components/Widgets/SignupQuestionsWidget/common";
import { SignupForm } from "@models/SignupForm"; import { SignupForm } from "@models/SignupForm";
import { EMAIL_REGEX } from "@utils/regexes"; import { EMAIL_REGEX } from "@utils/regexes";
import escapeRegExp from "lodash/escapeRegExp"; import escapeRegExp from "lodash/escapeRegExp";
+1 -1
View File
@@ -2,13 +2,13 @@ import React from "react";
import styled from "styled-components"; import styled from "styled-components";
import { IChangeEvent, ISubmitEvent, ErrorSchema } from "react-jsonschema-form"; import { IChangeEvent, ISubmitEvent, ErrorSchema } from "react-jsonschema-form";
import { SignupForm } from "@models/SignupForm"; import { SignupForm } from "@models/SignupForm";
import { buildFormSchema, buildUISchema } from "./FormUtils";
import Checkboxes from "@components/Widgets/Checkbox/Checkboxes"; import Checkboxes from "@components/Widgets/Checkbox/Checkboxes";
import RadioButtonWidget from "@components/Widgets/RadioButton/RadioButtonWidget"; import RadioButtonWidget from "@components/Widgets/RadioButton/RadioButtonWidget";
import { TextSection } from "@components/index"; import { TextSection } from "@components/index";
import { colors } from "@theme/colors"; import { colors } from "@theme/colors";
import FormWrapper from "@views/common/FormWrapper"; import FormWrapper from "@views/common/FormWrapper";
import Loader from "@components/Loader"; import Loader from "@components/Loader";
import { buildFormSchema, buildUISchema } from "./FormUtils";
const customWidgets = { const customWidgets = {
radio: RadioButtonWidget, radio: RadioButtonWidget,
+1 -1
View File
@@ -51,7 +51,7 @@ type AdminCreateCommonProps = {
widgets: { widgets: {
[name: string]: any; [name: string]: any;
}; };
} };
const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({ const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
title, title,
+1 -1
View File
@@ -58,7 +58,7 @@ const useShouldRedirect = (enabled = true) => {
type PageProps = { type PageProps = {
requiresAuthentication: boolean; requiresAuthentication: boolean;
} };
const AdminPageWrapper: React.FC<PageProps> = ({ requiresAuthentication, children }) => { const AdminPageWrapper: React.FC<PageProps> = ({ requiresAuthentication, children }) => {
const router = useRouter(); const router = useRouter();