From cba680ac8ace019343dea0876cb0c534abebaf2c Mon Sep 17 00:00:00 2001 From: Ida Marie Andreassen Date: Wed, 13 Nov 2024 09:20:28 +0100 Subject: [PATCH 1/6] Add competences to chewbaccaEmployee --- src/types/employees.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/types/employees.ts b/src/types/employees.ts index 0fb875b8e..2817161f3 100644 --- a/src/types/employees.ts +++ b/src/types/employees.ts @@ -24,6 +24,7 @@ export interface ChewbaccaEmployee { imageThumbUrl?: string | null; officeName?: string | null; startDate?: string | null; + competences: string[]; } export function isChewbaccaEmployee( @@ -52,6 +53,9 @@ export function isChewbaccaEmployee( value.officeName === null) && (!("startDate" in value) || typeof value.startDate === "string" || - value.startDate === null) + value.startDate === null) && + (!("competences" in value) || + typeof value.competences === "object" || + value.competences === null) ); } From 7f0d98fbacb0d62d71f16cea42e0844586c5c3f1 Mon Sep 17 00:00:00 2001 From: Ida Marie Andreassen Date: Wed, 13 Nov 2024 09:21:12 +0100 Subject: [PATCH 2/6] Add competence/role to employees page --- src/components/sections/employees/Employees.tsx | 13 ++++++++++--- .../sections/employees/employees.module.css | 4 +--- src/styles/global.css | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/sections/employees/Employees.tsx b/src/components/sections/employees/Employees.tsx index 25ec2e8b0..5c508d3fe 100644 --- a/src/components/sections/employees/Employees.tsx +++ b/src/components/sections/employees/Employees.tsx @@ -2,6 +2,7 @@ import { headers } from "next/headers"; import Image from "next/image"; import Link from "next/link"; +import Text from "src/components/text/Text"; import formatPhoneNumber from "src/components/utils/formatPhoneNumber"; import { aliasFromEmail, @@ -74,9 +75,15 @@ export default async function Employees({ language, section }: EmployeesProps) {

{employee.name}

- {employee.officeName && ( -

{employee.officeName}

- )} + {employee.competences.map((competence, index) => ( + + {competence} + + ))} {employee.email && (

{employee.email}

)} diff --git a/src/components/sections/employees/employees.module.css b/src/components/sections/employees/employees.module.css index 02432b0bf..fab3a7777 100644 --- a/src/components/sections/employees/employees.module.css +++ b/src/components/sections/employees/employees.module.css @@ -70,9 +70,7 @@ } .employeeRole { - color: var(--primary-black); - font-size: 16px; - font-weight: 300; + color: var(--primary-grey); } .employeeEmail, diff --git a/src/styles/global.css b/src/styles/global.css index 320b29940..52cc75311 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -20,6 +20,7 @@ html { --primary-white: #faf8f5; --primary-black: #2d2d2d; --primary-black-darker: #000000; + --primary-grey: #5E5E5E; --secondary-off-white1: #f4efe8; --secondary-off-white2: #ece1d3; From b745267c935ba4fa299b242df3b832f2830e7bb0 Mon Sep 17 00:00:00 2001 From: Ida Marie Andreassen Date: Wed, 13 Nov 2024 09:22:09 +0100 Subject: [PATCH 3/6] Add competence/role to consultants on customer case page, and employeepage --- src/components/consultantCard/ConsultantCard.tsx | 6 ++++++ src/components/employeePage/EmployeePage.tsx | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/components/consultantCard/ConsultantCard.tsx b/src/components/consultantCard/ConsultantCard.tsx index 76145249f..31fe6fc51 100644 --- a/src/components/consultantCard/ConsultantCard.tsx +++ b/src/components/consultantCard/ConsultantCard.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { useTranslations } from "next-intl"; import CustomLink from "src/components/link/CustomLink"; +import Text from "src/components/text/Text"; import formatPhoneNumber from "src/components/utils/formatPhoneNumber"; import { ChewbaccaEmployee } from "src/types/employees"; import { aliasFromEmail } from "src/utils/employees"; @@ -47,6 +48,11 @@ export default function ConsultantCard({ ) : ( title )} + {consultant.competences.map((competence, index) => ( + + {competence} + + ))} {consultant.officeName && (

{consultant.officeName}

)} diff --git a/src/components/employeePage/EmployeePage.tsx b/src/components/employeePage/EmployeePage.tsx index 99a9a3178..c67a1237a 100644 --- a/src/components/employeePage/EmployeePage.tsx +++ b/src/components/employeePage/EmployeePage.tsx @@ -45,6 +45,11 @@ export default function EmployeePage({ employee }: EmployeePageProps) { {employee.officeName} )} + {employee.competences.map((competence, index) => ( + + {competence} + + ))}
From 270688ef1657c285527e51e916c0b0874bebd63c Mon Sep 17 00:00:00 2001 From: Ida Marie Andreassen Date: Wed, 13 Nov 2024 09:22:27 +0100 Subject: [PATCH 4/6] Fix bug --- .../customerCase/sections/splitSection/SplitSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/customerCases/customerCase/sections/splitSection/SplitSection.tsx b/src/components/customerCases/customerCase/sections/splitSection/SplitSection.tsx index 12ac8ccb3..9db621502 100644 --- a/src/components/customerCases/customerCase/sections/splitSection/SplitSection.tsx +++ b/src/components/customerCases/customerCase/sections/splitSection/SplitSection.tsx @@ -26,7 +26,7 @@ export default function SplitSection({ section }: SplitSectionProps) { return (
- {section.sections.map((section) => ( + {section.sections?.map((section) => ( ))}
From 0518ffd5052b833216433c1d5868d0383ef16837 Mon Sep 17 00:00:00 2001 From: Ida Marie Andreassen Date: Wed, 13 Nov 2024 09:29:02 +0100 Subject: [PATCH 5/6] Fix failed prettier check --- src/styles/global.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/global.css b/src/styles/global.css index 52cc75311..be6cb532b 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -20,7 +20,7 @@ html { --primary-white: #faf8f5; --primary-black: #2d2d2d; --primary-black-darker: #000000; - --primary-grey: #5E5E5E; + --primary-grey: #5e5e5e; --secondary-off-white1: #f4efe8; --secondary-off-white2: #ece1d3; From 5709c2c5109be6c00bc0ff94498f9e81bb330c1d Mon Sep 17 00:00:00 2001 From: Ida Marie Andreassen Date: Wed, 13 Nov 2024 10:58:24 +0100 Subject: [PATCH 6/6] Fix: do not use index as key in map --- src/components/consultantCard/ConsultantCard.tsx | 4 ++-- src/components/employeePage/EmployeePage.tsx | 4 ++-- src/components/sections/employees/Employees.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/consultantCard/ConsultantCard.tsx b/src/components/consultantCard/ConsultantCard.tsx index 31fe6fc51..cfc2d3303 100644 --- a/src/components/consultantCard/ConsultantCard.tsx +++ b/src/components/consultantCard/ConsultantCard.tsx @@ -48,8 +48,8 @@ export default function ConsultantCard({ ) : ( title )} - {consultant.competences.map((competence, index) => ( - + {consultant.competences.map((competence) => ( + {competence} ))} diff --git a/src/components/employeePage/EmployeePage.tsx b/src/components/employeePage/EmployeePage.tsx index c67a1237a..6e94cdde4 100644 --- a/src/components/employeePage/EmployeePage.tsx +++ b/src/components/employeePage/EmployeePage.tsx @@ -45,8 +45,8 @@ export default function EmployeePage({ employee }: EmployeePageProps) { {employee.officeName} )} - {employee.competences.map((competence, index) => ( - + {employee.competences.map((competence) => ( + {competence} ))} diff --git a/src/components/sections/employees/Employees.tsx b/src/components/sections/employees/Employees.tsx index 5c508d3fe..3fb4fa227 100644 --- a/src/components/sections/employees/Employees.tsx +++ b/src/components/sections/employees/Employees.tsx @@ -75,10 +75,10 @@ export default async function Employees({ language, section }: EmployeesProps) {

{employee.name}

- {employee.competences.map((competence, index) => ( + {employee.competences.map((competence) => ( {competence}