Skip to content

Commit

Permalink
Release 1.1.2
Browse files Browse the repository at this point in the history
- Tracking northstar 1 pété sur NextJS [NGC-270] #256 
- Corrige la fonction de remplacement de locale dans l'url [NGC-96] #262
- Optimisation test e2e #254
- Set category colors in website config (NGC-317) #248
- Retire bloc de feedback de la page de résultats amis [NGC-104] #246
- Corrige l'affichage de la page Plan du site [NGC-212] #243
- Corrige le style bouton mode groupe [NGC-180] #241
- Fix: show subcategories in the /fin page for the 'services sociétaux' - [NGC-226] #235
- Supprime les enregistrement localStorage pour les trajets détaillés [NGC-233] #234
- 💅 Corrige erreur de style sur le tutoriel [NGC-199] #233
- Modifie le style du footer [NGC-245] #232
- Corrige une redirection [NGC-174] #231
- Ajoute le tally - retire les anciens modes de retours [NGC-104] #230
- Améliore le comportement de redirection en cas de partage d'url de fin [NGC-201] #229
- Ajoute la documentation affichée côté serveur [NGC-236] [NGC-119] #228
- Ajoute redirections + workflow de détection de liens morts [NGC-174][NGC-269] #226
- Documentation / Enlever lien retour au test [NGC-97] #223
- Remplace les mentions à Netlify par Vercel [NGC-196] #222
- 🐛 Correction lien profil > fin + correction affichage nombre d'actions dans la page profil [NGC-192] #221
- Ajoute un bouton "Voir mes résultats" sur la page profil [NGC-198] [NGC-192] #219
- Améliore le comportement de partage de la page de fin [NGC-201] #218
- Split testing, fait maison 🧑‍🍳 #211
- ✨ Ajout de la nouvelle barre de navigation #210
florianpanchout authored Nov 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents a56d801 + b363b23 commit 7422e70
Showing 265 changed files with 5,199 additions and 2,609 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@
},
"globals": {
"React": "writable",
"NodeJS": "writable"
"NodeJS": "writable",
"JSX": "writable"
},
"rules": {
"react/no-unescaped-entities": "off",
@@ -33,7 +34,7 @@
"jsx-a11y/label-has-associated-control": 1,
"react/jsx-no-target-blank": 1,
"no-unreachable": 1,
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"react-hooks/exhaustive-deps": "error"
22 changes: 22 additions & 0 deletions .github/workflows/check-links-validity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check links validity
on:
workflow_dispatch:
schedule:
# https://crontab.guru/#0_11_*_*_2
- cron: '0 11 * * 2'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install
- name: Install RipGrep
run: sudo apt install -y ripgrep
- id: invalid_links
run: node ./scripts/check-links-validity.mjs --ci
timeout-minutes: 15
- if: steps.invalid_links.outputs.comment
uses: ./.github/actions/reopen-issue-with-comment
with:
issue-number: 225
comment: ${{ steps.invalid_links.outputs.comment }}
2 changes: 1 addition & 1 deletion .github/workflows/e2e-snapshots.yaml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
needs: sleep
container:
image: cypress/browsers:node18.12.0-chrome107
image: cypress/browsers:latest
options: --user 1001
strategy:
fail-fast: false
20 changes: 11 additions & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -13,23 +13,26 @@ on:

jobs:
sleep:
name: Wait 3 min for the Vercel preview to be deployed
name: Wait for the vercel build to complete
runs-on: ubuntu-latest
steps:
- name: Sleep for 90s
run: sleep 90s
shell: bash
- name: Waiting for Vercel Preview
uses: patrickedqvist/[email protected]
id: waitForVercel
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 300

e2e:
cypress-run:
runs-on: ubuntu-latest
needs: sleep
needs: [sleep]
container:
image: cypress/browsers:node18.12.0-chrome107
image: cypress/browsers:latest
options: --user 1001
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
containers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
name: Testing e2e in worker ${{ matrix.containers }}
if: github.event.pull_request.draft == false
steps:
@@ -55,7 +58,6 @@ jobs:
- name: Test - e2e [${{ env.MODE }}]
uses: cypress-io/[email protected]
with:
install: true
build: yarn run e2e:generate:personas
browser: chrome
parallel: true
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -43,9 +43,6 @@ yarn-error.log
node_modules/
.env

# Local Netlify folder
.netlify

/cypress/videos/*
/cypress/screenshots/*
/cypress/snapshots/__all/__diff_output__/**/*
@@ -55,3 +52,5 @@ dist

# Sentry Config File
.sentryclirc

.vscode
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
18.17
64 changes: 64 additions & 0 deletions config/redirects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const redirects = [
{
source: '/actions/liste',
destination: '/actions',
permanent: true,
},
{
source: '/groupes/:path*',
destination: '/amis/:path*',
permanent: true,
},
{
source: '/conférence/:path*',
destination: 'https://sondages.nosgestesclimat.fr/conférence/:path*',
permanent: true,
},
{
source: '/sondage/:path*',
destination: 'https://sondages.nosgestesclimat.fr/sondage/:path*',
permanent: true,
},
{
source: '/mon-empreinte-carbone/:path*',
destination: '/fin/:path*',
permanent: true,
},
{
source: '/nouveaut%C3%A9s/:path*',
destination: '/nouveautes/:path*',
permanent: true,
},
{
source: '/vie-priv%C3%A9e',
destination: '/vie-privee',
permanent: true,
},
{
source: '/partenaires',
destination: '/diffuser',
permanent: true,
},
{
source: '/blog/journée-mondial-environnement',
destination: '/blog/journee-mondial-environnement',
permanent: true,
},
{
source: '/mod%C3%A8le',
destination: '/modele',
permanent: true,
},
{
source: '/%C3%A0-propos',
destination: '/a-propos',
permanent: true,
},
{
source: '/groupe/:path*',
destination: 'https://sondages.nosgestesclimat.fr/',
permanent: true,
},
]

module.exports = redirects
1 change: 0 additions & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ export default defineConfig({
experimentalRunAllSpecs: true,
specPattern: 'cypress/e2e/**/*.cy.js',
},

component: {
devServer: {
framework: 'next',
12 changes: 0 additions & 12 deletions cypress/e2e/integration/pages/groupes.cy.js
Original file line number Diff line number Diff line change
@@ -8,8 +8,6 @@ describe(
'The Group creation page /amis/creer',
{ testIsolation: false },
() => {
let groupURL = ''

it('allows to create a new group and displays it afterwards', () => {
cy.visit('/amis')

@@ -22,14 +20,10 @@ describe(
)
cy.get('[data-cypress-id="button-create-group"]').click()

cy.wait(2000)

// Fill simulation
clickSkipTutorialButton()
recursivelyFillSimulation(null, 'group')

cy.wait(2000)

cy.get('[data-cypress-id="group-name"]')

// Check that we can create a second group
@@ -59,18 +53,12 @@ describe(
cy.clearLocalStorage()
cy.reload()

cy.wait(2000)

cy.get('[data-cypress-id="member-name"]').type('Jean-Claude')
cy.get('[data-cypress-id="button-join-group"]').click()

cy.wait(2000)

clickSkipTutorialButton()
recursivelyFillSimulation(null, 'group')

cy.wait(2000)

cy.get('[data-cypress-id="group-name"]')

// Check that the main sections are displayed
2 changes: 1 addition & 1 deletion cypress/helpers/elements/buttons.js
Original file line number Diff line number Diff line change
@@ -54,5 +54,5 @@ export function clickDoTheTestLink() {
}

export function clickAmisLink() {
click(AMIS_LINK)
cy.get(`[data-cypress-id="${AMIS_LINK}"]`).eq(1).click()
}
4 changes: 2 additions & 2 deletions cypress/helpers/interactions/click.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function click(elementId) {
cy.get(`[data-cypress-id="${elementId}"]`).click()
export function click(elementId, options = {}) {
cy.get(`[data-cypress-id="${elementId}"]`).first().click()
}
14 changes: 0 additions & 14 deletions cypress/helpers/simulation/recursivelyFillSimulation.js
Original file line number Diff line number Diff line change
@@ -30,17 +30,13 @@ export async function recursivelyFillSimulation(persona = {}) {
function skipQuestion() {
clickNextButton()

cy.wait(1000)

answerCurrentQuestion()
}

// Is last question
if (dottedName === LAST_QUESTION_ID) {
clickNextButton()

cy.wait(1000)

return resolve()
}

@@ -54,8 +50,6 @@ export async function recursivelyFillSimulation(persona = {}) {
const [dottedNameWithoutValueSuffix, value] = dottedName.split('-')
if (persona?.situation?.[dottedNameWithoutValueSuffix] === value) {
cy.get(`label[data-cypress-id="${dottedName}-label"]`).click()

cy.wait(1000)
} else if (!dottedName === LAST_QUESTION_ID) {
skipQuestion()
}
@@ -72,8 +66,6 @@ export async function recursivelyFillSimulation(persona = {}) {
cy.get(`input[data-cypress-id="${dottedName}"]`).type(
persona.situation[dottedName]
)

cy.wait(1000)
}

const mosaicChildren = Object.keys(persona?.situation ?? {}).filter(
@@ -86,17 +78,11 @@ export async function recursivelyFillSimulation(persona = {}) {
cy.get(
`input[data-cypress-id="${mosaicItemDottedName}---${mosaicDottedName}"]`
).type(persona.situation[mosaicItemDottedName])

cy.wait(1000)
}
}

cy.wait(1000)

clickNextButton()

cy.wait(1000)

// Call itself recursively to go to the next question
answerCurrentQuestion()
})
5 changes: 0 additions & 5 deletions cypress/helpers/simulation/setupSimulation.js
Original file line number Diff line number Diff line change
@@ -5,10 +5,5 @@ import {

export function setupSimulation() {
clickDoTheTestLink()

cy.wait(2000)

clickSkipTutorialButton()

cy.wait(2000)
}
6 changes: 0 additions & 6 deletions i18nConfig.js

This file was deleted.

56 changes: 9 additions & 47 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const withMDX = require('@next/mdx')({
extension: /\.mdx$/,
})

const redirects = require('./config/redirects.js')

/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure pageExtensions to include md and mdx
@@ -13,6 +17,10 @@ const nextConfig = {
test: /\.ya?ml$/,
use: 'js-yaml-loader',
})
config.module.rules.push({
test: /\.publicodes$/,
use: 'js-yaml-loader',
})

config.resolve.fallback = {
// if you miss it, all the other options in fallback, specified
@@ -53,53 +61,7 @@ const nextConfig = {
],
},
async redirects() {
return [
{
source: '/actions/liste',
destination: '/actions',
permanent: true,
},
{
source: '/groupes/:path*',
destination: '/amis/:path*',
permanent: true,
},
{
source: '/conférence/:path*',
destination: 'https://sondages.nosgestesclimat.fr/conférence/:path*',
permanent: true,
},
{
source: '/sondage/:path*',
destination: 'https://sondages.nosgestesclimat.fr/sondage/:path*',
permanent: true,
},
{
source: '/mon-empreinte-carbone/:path*',
destination: '/fin/:path*',
permanent: true,
},
{
source: '/nouveaut%C3%A9s',
destination: '/nouveautes',
permanent: true,
},
{
source: '/vie-priv%C3%A9e',
destination: '/vie-privee',
permanent: true,
},
{
source: '/partenaires',
destination: '/diffuser',
permanent: true,
},
{
source: '/blog/journée-mondial-environnement',
destination: '/blog/journee-mondial-environnement',
permanent: true,
},
]
return redirects
},
experimental: {
mdxRs: true,
Loading

0 comments on commit 7422e70

Please sign in to comment.