Skip to content

Commit

Permalink
Finalize company interest form changes
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas de Luna Skulberg <jonasdls@gmail.com>
  • Loading branch information
Arash Farzaneh Taleghani and jonasdeluna committed Feb 21, 2023
1 parent db8c251 commit 9977488
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 36 deletions.
2 changes: 1 addition & 1 deletion app/components/Form/Field.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.field {
display: flex;
flex-direction: column;

margin-bottom: 20px;
width: 100%;
}

Expand Down
2 changes: 1 addition & 1 deletion app/reducers/companyInterest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type CompanyInterestEntity = {
comment: boolean;
semesters: Array<CompanySemesterEntity>;
companyType: string;
accomodating: string;
accommodating: string;
};
export default createEntityReducer({
key: 'companyInterest',
Expand Down
2 changes: 1 addition & 1 deletion app/routes/companyInterest/CompanyInterestEditRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import CompanyInterestPage, {
OTHER_TYPES,
TARGET_GRADE_TYPES,
PARTICIPANT_RANGE_MAP,
ACCOMODATING,
ACCOMMODATING,
SURVEY_OFFER_TYPES,
} from './components/CompanyInterestPage';
import { sortSemesterChronologically } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion app/routes/companyInterest/CompanyInterestRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const mapStateToProps = (state, props) => {
})),
participantRange: null,
companyTypes: null,
accomodating: null,
accommodating: null,
semesters: semesters.sort(sortSemesterChronologically),
},
interestForm: {
Expand Down
5 changes: 5 additions & 0 deletions app/routes/companyInterest/components/CompanyInterest.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,8 @@ ion-icon {
gap: 4px;
align-items: center;
}

.tooltip {
text-transform: initial;
font-weight: initial;
}
53 changes: 34 additions & 19 deletions app/routes/companyInterest/components/CompanyInterestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import {
RadioButton,
RadioButtonGroup,
} from 'app/components/Form';
import Icon from 'app/components/Icon';
import { Image } from 'app/components/Image';
import Flex from 'app/components/Layout/Flex';
import LoadingIndicator from 'app/components/LoadingIndicator';
import withAutocomplete from 'app/components/Search/withAutocomplete';
import Tooltip from 'app/components/Tooltip';
import type { CompanyInterestEntity } from 'app/reducers/companyInterest';
import type { CompanySemesterEntity } from 'app/reducers/companySemesters';
import { createValidator, required, isEmail } from 'app/utils/validation';
import { interestText, semesterToText } from '../utils';
import styles from './CompanyInterest.css';
import type { ReactNode } from 'react';
import type { FormProps, FieldArrayProps } from 'redux-form';
import Tooltip from 'app/components/Tooltip';
import Icon from 'app/components/Icon';

export const EVENT_TYPES = {
company_presentation: {
Expand Down Expand Up @@ -113,9 +113,9 @@ export const OTHER_TYPES = {
*/
};

export const ACCOMODATING = {
accomodating_true: { norwegian: 'Ja', english: 'Yes' },
accomodating_false: { norwegian: 'Nei', english: 'No' },
export const ACCOMMODATING = {
accommodating_true: { norwegian: 'Ja', english: 'Yes' },
accommodating_false: { norwegian: 'Nei', english: 'No' },
};

export const COLLABORATION_TYPES = {
Expand Down Expand Up @@ -300,9 +300,8 @@ const EventBox = ({
)[index]
][language]
}
onClick={() => console.log(key)}
>
<Icon name="alert-circle-outline" />
<Icon name="information-circle-outline" />
</Tooltip>
</span>
</label>
Expand Down Expand Up @@ -438,7 +437,7 @@ type CompanyInterestFormEntity = {
companyToCompanyComment: string;
companyPresentationComment: string;
companyType: string;
accomodating: string;
accommodating: string;
};
type Props = FormProps & {
allowedBdb: boolean;
Expand Down Expand Up @@ -468,7 +467,7 @@ type Props = FormProps & {
companyToCompanyComment: string;
companyPresentationComment: string;
companyType: string;
accomodating: string;
accommodating: string;
};

const CompanyInterestPage = (props: Props) => {
Expand All @@ -490,7 +489,7 @@ const CompanyInterestPage = (props: Props) => {
contactPerson: data.contactPerson,
mail: data.mail,
phone: data.phone,
accomodating: data.accomodating,
accommodating: data.accommodating,
semesters: data.semesters
.filter((semester) => semester.checked)
.map((semester) => semester.id),
Expand Down Expand Up @@ -558,7 +557,7 @@ const CompanyInterestPage = (props: Props) => {
english: 'Company name',
},
},
accomodating: {
accommodating: {
norwegian:
'Har bedriften et kontor i Trondheim som ønsker/egner seg for besøk?',
english:
Expand Down Expand Up @@ -591,7 +590,7 @@ const CompanyInterestPage = (props: Props) => {
english: 'Events',
},
otherOffers: {
norwegian: 'Annter',
norwegian: 'Annet',
english: 'Other',
},
companyTypes: {
Expand Down Expand Up @@ -670,7 +669,7 @@ const CompanyInterestPage = (props: Props) => {
</FlexRow>
<h5 className={styles.subHeading}>
{labels.subHeading[language]}
<a href={`mailto:bedriftskontakt@abakus.no`}>
<a href={'mailto:bedriftskontakt@abakus.no'}>
bedriftskontakt@abakus.no
</a>
</h5>
Expand Down Expand Up @@ -724,15 +723,15 @@ const CompanyInterestPage = (props: Props) => {
</RadioButtonGroup>
</Flex>
<Flex column className={styles.interestBox}>
<label htmlFor="accomodating" className={styles.heading}>
{labels.accomodating[language]}
<label htmlFor="accommodating" className={styles.heading}>
{labels.accommodating[language]}
</label>
<RadioButtonGroup name="accomodating">
{Object.keys(ACCOMODATING).map((key, index) => (
<RadioButtonGroup name="accommodating">
{Object.keys(ACCOMMODATING).map((key, index) => (
<Field
key={key}
name={key}
label={ACCOMODATING[key][language]}
label={ACCOMMODATING[key][language]}
component={RadioButton.Field}
inputValue={key}
/>
Expand All @@ -741,8 +740,24 @@ const CompanyInterestPage = (props: Props) => {
</Flex>
<Flex column className={styles.interestBox}>
<label htmlFor="companySurveyOffers" className={styles.heading}>
{labels.companySurveyOffers[language]}
<Flex alignItems="center" gap="5px">
{labels.companySurveyOffers[language]}
<Tooltip
className={styles.tooltip}
renderDirection="right"
content={
<span>
{language === 'norwegian'
? 'Dette er temaer fra bedriftsundersøkelsen som studenter uttrykte interesse for å lære mer om. Vil noen av disse være av interesse å inkludere for dere? (Uforpliktende)'
: 'These are topics from the company survey that students expressed interest in learning more about. Would any of these be of interest to you to include? (Non-binding)'}
</span>
}
>
<Icon name="alert-circle-outline" />
</Tooltip>
</Flex>
</label>

<FieldArray
label="companySurveyOffers"
name="companySurveyOffers"
Expand Down
4 changes: 2 additions & 2 deletions app/store/models/CompanyInterest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface CompleteCompanyInterest {
phone: string;
semesters: ID[];
createdAt: Dateish;
accomodating: string;
accommodating: string;
events: string[];
companySurveyOffers: string[];
otherOffers: string[];
Expand Down Expand Up @@ -55,7 +55,7 @@ export type DetailedCompanyInterest = Pick<
| 'bedexComment'
| 'companyToCompanyComment'
| 'companyPresentationComment'
| 'accomodating'
| 'accommodating'
>;

export type ListCompanyInterest = Pick<
Expand Down
13 changes: 2 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@
"@babel/parser" "^7.20.7"
"@babel/types" "^7.20.7"

"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.21.0", "@babel/traverse@^7.7.2":
"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.7.2":
version "7.21.0"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.0.tgz#0e1807abd5db98e6a19c204b80ed1e3f5bca0edc"
integrity sha512-Xdt2P1H4LKTO8ApPfnO1KmzYMFpp7D/EinoXzLYN/cHcBNrVCAkAtGUcXnHXrl/VGktureU6fkQrHSBE2URfoA==
Expand All @@ -1110,16 +1110,7 @@
debug "^4.1.0"
globals "^11.1.0"

"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.4", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
version "7.21.0"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.0.tgz#1da00d89c2f18b226c9207d96edbeb79316a1819"
integrity sha512-uR7NWq2VNFnDi7EYqiRz2Jv/VQIu38tu64Zy8TX2nQFQ6etJ9V/Rr2msW8BS132mum2rL645qpDrLtAJtVpuow==
dependencies:
"@babel/helper-string-parser" "^7.19.4"
"@babel/helper-validator-identifier" "^7.19.1"
to-fast-properties "^2.0.0"

"@babel/types@^7.20.0", "@babel/types@^7.21.0":
"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.4", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
version "7.21.0"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.0.tgz#1da00d89c2f18b226c9207d96edbeb79316a1819"
integrity sha512-uR7NWq2VNFnDi7EYqiRz2Jv/VQIu38tu64Zy8TX2nQFQ6etJ9V/Rr2msW8BS132mum2rL645qpDrLtAJtVpuow==
Expand Down

0 comments on commit 9977488

Please sign in to comment.