Skip to content

Commit

Permalink
🐛 [Hotfix] Fix broken group link (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlaa authored Jan 28, 2025
1 parent b48390a commit 3dadbf4
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/integration/pages/groupes.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clickSkipTutorialButton } from '../../../helpers/elements/buttons'
import { recursivelyFillSimulation } from '../../../helpers/simulation/recursivelyFillSimulation'
import { skipRiddle } from '../../../helpers/simulation/skipRiddle'

describe('The Group creation page /amis/creer', () => {
describe('The Group creation page', () => {
let ownerUserId = ''

it('allows to create a new group and displays it afterwards', () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nosgestesclimat-site-nextjs",
"license": "MIT",
"version": "2.8.0",
"version": "2.8.1",
"description": "The leading open source climate footprint calculator",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import StepsDisplay from '@/components/groups/StepsDisplay'
import { linkToGroupCreation } from '@/constants/group'
import { amisCreationVosInformationsRetour } from '@/constants/tracking/pages/amisCreation'
import GoBackLink from '@/design-system/inputs/GoBackLink'
import Title from '@/design-system/layout/Title'
import { getServerTranslation } from '@/helpers/getServerTranslation'
import { getMetadataObject } from '@/helpers/metadata/getMetadataObject'
import { linkToGroupCreation } from '@/helpers/navigation/groupPages'
import GroupCreationForm from './_component/GroupCreationForm'

export async function generateMetadata() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import StepsDisplay from '@/components/groups/StepsDisplay'
import { linkToGroupCreation } from '@/constants/group'
import { amisCreationVotreGroupeRetour } from '@/constants/tracking/pages/amisCreation'
import GoBackLink from '@/design-system/inputs/GoBackLink'
import Title from '@/design-system/layout/Title'
import { getServerTranslation } from '@/helpers/getServerTranslation'
import { getMetadataObject } from '@/helpers/metadata/getMetadataObject'
import { linkToGroupCreation } from '@/helpers/navigation/groupPages'
import NameForm from './_components/NameForm'

export async function generateMetadata() {
Expand All @@ -30,7 +30,7 @@ export default async function GroupNamePage() {
<div className="p-4 md:p-8">
<GoBackLink
className="mb-4 font-bold"
href={'/amis/creer/vos-informations'}
href={linkToGroupCreation}
eventTracked={amisCreationVotreGroupeRetour}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import GroupLoader from '@/components/groups/GroupLoader'
import Trans from '@/components/translation/Trans'
import { linkToGroupCreation } from '@/constants/group'
import { classementCreateGroup } from '@/constants/tracking/pages/classements'
import ButtonLink from '@/design-system/inputs/ButtonLink'
import Title from '@/design-system/layout/Title'
import { linkToGroupCreation } from '@/helpers/navigation/groupPages'
import { useFetchGroupsOfUser } from '@/hooks/groups/useFetchGroupsOfUser'
import { useClientTranslation } from '@/hooks/useClientTranslation'
import Image from 'next/image'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Trans from '@/components/translation/Trans'
import { linkToGroupCreation } from '@/constants/group'
import { classementCreateGroup } from '@/constants/tracking/pages/classements'
import ButtonLink from '@/design-system/inputs/ButtonLink'
import { linkToGroupCreation } from '@/helpers/navigation/groupPages'

export default function CreateFirstGroupSection() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import Trans from '@/components/translation/Trans'
import { linkToGroupCreation } from '@/constants/group'
import {
ORGANISATION_TYPES,
OrganisationTypeEnum,
Expand Down Expand Up @@ -158,7 +159,7 @@ export default function CreationForm() {
ou celle ayant la plus faible empreinte gagne !
</Trans>
</p>
<ButtonLink href="/amis/creer" size="sm">
<ButtonLink href={linkToGroupCreation} size="sm">
<Trans>Créer un groupe d'amis</Trans>
</ButtonLink>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/(simulation)/(large-layout)/plan-du-site/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Trans from '@/components/translation/Trans'
import { linkToGroupCreation } from '@/constants/group'
import Title from '@/design-system/layout/Title'
import { getServerTranslation } from '@/helpers/getServerTranslation'
import { getMetadataObject } from '@/helpers/metadata/getMetadataObject'
Expand Down Expand Up @@ -44,7 +45,7 @@ export default async function PlanDuSitePage() {
},
amis: {
title: t(`Dans un groupe d'amis`),
href: '/amis/creer/vos-informations',
href: linkToGroupCreation,
},
},
Informations: {
Expand Down
3 changes: 2 additions & 1 deletion src/app/blog/_components/GroupBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Trans from '@/components/translation/Trans'
import { linkToGroupCreation } from '@/constants/group'
import ButtonLink from '@/design-system/inputs/ButtonLink'
import { getServerTranslation } from '@/helpers/getServerTranslation'
import Image from 'next/image'
Expand All @@ -21,7 +22,7 @@ export default async function GroupBlock() {
height={240}
/>

<ButtonLink size="lg" color="secondary" href="/amis/creer">
<ButtonLink size="lg" color="secondary" href={linkToGroupCreation}>
<Trans>Créer un groupe</Trans>
</ButtonLink>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/constants/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ export const GROUP_EMOJIS = [
'🍐',
'🍌',
]

export const linkToGroupCreation = '/amis/creer/vos-informations'
2 changes: 0 additions & 2 deletions src/helpers/navigation/groupPages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { Group } from '@/types/groups'

export const linkToGroupCreation = '/amis/creer/vos-informations'

type Props = {
group?: Group
groupId?: string
Expand Down

0 comments on commit 3dadbf4

Please sign in to comment.