Skip to content

Commit

Permalink
Merge pull request #4436 from webkom/ivarnakken/aba-786-add-social-me…
Browse files Browse the repository at this point in the history
…dia-promotion-to-company-interest-form

Include social media profiling to company interest form
  • Loading branch information
ivarnakken committed Feb 3, 2024
2 parents f6f2fd2 + 8b5b9ea commit fbca597
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
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

0 comments on commit fbca597

Please sign in to comment.