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

Include social media profiling to company interest form #4436

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 18 additions & 11 deletions app/routes/companyInterest/components/CompanyInterestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import {
import styles from './CompanyInterest.css';
import {
EVENTS,
README,
OTHER_OFFERS,
SURVEY_OFFERS,
TARGET_GRADES,
FORM_LABELS,
Expand Down Expand Up @@ -181,7 +181,7 @@ const OtherBox = ({
<Field
key={`otherOffers[${index}]`}
name={`otherOffers[${index}].checked`}
label={readmeIfy(README[otherOffersToString(key)][language])}
label={readmeIfy(OTHER_OFFERS[otherOffersToString(key)][language])}
type="checkbox"
component={CheckBox.Field}
normalize={(v) => !!v}
Expand Down Expand Up @@ -334,7 +334,7 @@ const CompanyInterestPage = () => {
);

const allEvents = Object.keys(EVENTS);
const allOtherOffers = Object.keys(README);
const allOtherOffers = Object.keys(OTHER_OFFERS);
const allCollaborations = Object.keys(COLLABORATION_TYPES);
const allTargetGrades = Object.keys(TARGET_GRADES);
const allParticipantRanges = Object.keys(PARTICIPANT_RANGE_MAP);
Expand Down Expand Up @@ -513,9 +513,13 @@ const CompanyInterestPage = () => {
},
];

const title = edit
? 'Rediger bedriftsinteresse'
: FORM_LABELS.mainHeading[language];

return (
<Content>
<Helmet title={isEnglish ? 'Company interest' : 'Bedriftsinteresse'} />
<Helmet title={title} />

<LegoFinalForm
onSubmit={onSubmit}
Expand All @@ -529,19 +533,22 @@ const CompanyInterestPage = () => {
{({ handleSubmit }) => (
<form onSubmit={handleSubmit}>
<FlexRow alignItems="center" justifyContent="space-between">
<h1>{FORM_LABELS.mainHeading[language]}</h1>
<h1>{title}</h1>
{!edit && (
<Link to={isEnglish ? '/interesse' : '/register-interest'}>
<LanguageFlag language={language} />
</Link>
)}
</FlexRow>
<Card severity="info">
{FORM_LABELS.subHeading[language]}
<a href={'mailto:bedriftskontakt@abakus.no'}>
bedriftskontakt@abakus.no
</a>
</Card>

{!edit && (
<Card severity="info">
{FORM_LABELS.subHeading[language]}
<a href={'mailto:bedriftskontakt@abakus.no'}>
bedriftskontakt@abakus.no
</a>
</Card>
)}

<Field
name="company"
Expand Down
6 changes: 5 additions & 1 deletion app/routes/companyInterest/components/Translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ export const SURVEY_OFFERS = {
},
};

export const README = {
export const OTHER_OFFERS = {
readme: {
norwegian: 'Annonse i readme',
english: 'Advertisement in readme',
},
social_media: {
norwegian: 'Profilering på sosiale medier',
english: 'Profiling on social media',
},
};

export const COMPANY_TYPES: Record<
Expand Down
4 changes: 2 additions & 2 deletions app/routes/companyInterest/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import config from 'app/config';
import {
COLLABORATION_TYPES,
EVENTS,
README,
SURVEY_OFFERS,
OTHER_OFFERS,
TARGET_GRADES,
} from './components/Translations';
import type { CompanySemesterEntity } from 'app/reducers/companySemesters';
Expand Down Expand Up @@ -73,7 +73,7 @@ export const surveyOffersToString = (offer) =>
Object.keys(SURVEY_OFFERS)[Number(offer.charAt(offer.length - 2))];

export const otherOffersToString = (offer) =>
Object.keys(README)[Number(offer.charAt(offer.length - 2))];
Object.keys(OTHER_OFFERS)[Number(offer.charAt(offer.length - 2))];

export const collaborationToString = (collab) =>
Object.keys(COLLABORATION_TYPES)[Number(collab.charAt(collab.length - 2))];
Expand Down