Skip to content

Commit

Permalink
Release Sprint 6
Browse files Browse the repository at this point in the history
## 1.19.7 (19/09/2023)

* BSR - voir les sources

## 1.19.6 (19/09/2023)

* B12 - alignements boutons

## 1.19.5 (19/09/2023)

* A26 - texte modale stockage 1 Go

## 1.19.4 (19/09/2023)

* B12 - bugs UI iframe horizontale

## 1.19.3 (19/09/2023)

* B9 - réparation SEO : ajout du robots.txt

## 1.19.2 (19/09/2023)

* B12 - prévisualisation iframe horizontale

## 1.19.1 (18/09/2023)

* U37b - couleur darkMode

## 1.19.0 (18/09/2023)

* U37 - je donne mon avis

## 1.18.18 (18/09/2023)

* BSR - bug integration iframe

## 1.18.17 (11/09/2023)

* U21 - améliorations UI

## 1.18.16 (11/09/2023)

* A28 - syntaxe disclaimer

## 1.18.15 (11/09/2023)

* B10 - coquille de texte

## 1.18.14 (11/09/2023)

* U29 – Tag livraison

## 1.18.13 (09/09/2023)

* B3 : bug slider responsive

## 1.18.12 (08/09/2023)

* B3 : bug slider

## 1.18.11 (07/09/2023)

* U25 : documentation publicode

## 1.18.10 (04/09/2023)

* BSR : tests de non-régression pour la partie livraison
  • Loading branch information
bdavidxyz authored Sep 19, 2023
1 parent 9f8ac4a commit 4489c5d
Show file tree
Hide file tree
Showing 35 changed files with 2,084 additions and 297 deletions.
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,74 @@
# CHANGELOG


## 1.19.7 (19/09/2023)

* BSR - voir les sources

## 1.19.6 (19/09/2023)

* B12 - alignements boutons

## 1.19.5 (19/09/2023)

* A26 - texte modale stockage 1 Go

## 1.19.4 (19/09/2023)

* B12 - bugs UI iframe horizontale

## 1.19.3 (19/09/2023)

* B9 - réparation SEO : ajout du robots.txt

## 1.19.2 (19/09/2023)

* B12 - prévisualisation iframe horizontale

## 1.19.1 (18/09/2023)

* U37b - couleur darkMode

## 1.19.0 (18/09/2023)

* U37 - je donne mon avis

## 1.18.18 (18/09/2023)

* BSR - bug integration iframe

## 1.18.17 (11/09/2023)

* U21 - améliorations UI

## 1.18.16 (11/09/2023)

* A28 - syntaxe disclaimer

## 1.18.15 (11/09/2023)

* B10 - coquille de texte

## 1.18.14 (11/09/2023)

* U29 – Tag livraison

## 1.18.13 (09/09/2023)

* B3 : bug slider responsive

## 1.18.12 (08/09/2023)

* B3 : bug slider

## 1.18.11 (07/09/2023)

* U25 : documentation publicode

## 1.18.10 (04/09/2023)

* BSR : tests de non-régression pour la partie livraison

## 1.18.9 (11/08/2023)

* B7 - bugs post-MEP : hotfix date mise à jour, et valeur stockage de données
Expand Down
4 changes: 3 additions & 1 deletion iframe/livraison.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { iframeResize } from "iframe-resizer";

const script = document.getElementById("impact-livraison");
const src = `https://deploy-preview-306--impactco2.netlify.app/iframes/livraison/simulation`;
// below : injected WEBPACK_SITE_URL constant from env var, see webpack.config.js
// eslint-disable-next-line no-undef
const src = `https://${WEBPACK_SITE_URL}/iframes/livraison/simulation`;

const iframe = document.createElement("iframe");

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dev": "next dev",
"build": "yarn iframe && next build",
"postbuild": "next-sitemap",
"iframe": "webpack",
"iframe": "dotenv -e .env.local webpack",
"start": "next start",
"lint": "next lint",
"prepare": "husky install"
Expand All @@ -24,6 +24,7 @@
"axios": "^1.3.2",
"chrome-aws-lambda": "^10.1.0",
"copy-to-clipboard": "^3.3.3",
"dotenv-cli": "^7.3.0",
"focus-trap-react": "^10.2.1",
"fuse.js": "^6.6.2",
"html-to-image": "^1.11.11",
Expand All @@ -32,14 +33,16 @@
"next": "^13.1.6",
"next-query-params": "^4.1.0",
"next-sitemap": "^3.1.52",
"publicodes": "^1.0.0-beta.66",
"publicodes": "1.0.0-beta.72",
"publicodes-react": "1.0.0-beta.72",
"puppeteer-core": "^19.6.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-flip-toolkit": "^7.0.17",
"react-highlight-words": "^0.20.0",
"react-hotjar": "^5.4.1",
"react-range": "^1.8.14",
"react-responsive-carousel": "^3.2.23",
"react-share": "^4.4.1",
"react-slick": "^0.29.0",
"react-switch": "^7.0.0",
Expand Down
20 changes: 20 additions & 0 deletions pages/documentation/[...slug].jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RulesProviderLivraison } from "components/livraison/RulesProviderLivraison";
import dynamic from "next/dynamic";
import { useRouter } from "next/router";

export default function Documentation() {
const router = useRouter();
const rootDoc = "livraison";

const DocumentationLivraison = dynamic(() => import("components/base/DocumentationLivraison"), {
ssr: false,
});

return (
<>
<RulesProviderLivraison>
<DocumentationLivraison slug={router?.query?.slug?.join("/") || rootDoc} />
</RulesProviderLivraison>
</>
);
}
17 changes: 6 additions & 11 deletions pages/iframes/livraison/simulation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Section2 from "components/base/Section2";
import Iframe from "components/layout/Iframe";
import CalculateurLivraison from "components/livraison/CalculateurLivraison";
import IntroLivraison from "components/livraison/IntroLivraison";
Expand All @@ -8,16 +7,12 @@ import React from "react";
export default function Default() {
return (
<Iframe>
<Section2>
<Section2.InnerMargin>
<RulesProviderLivraison>
<main id="contenu">
<IntroLivraison />
<CalculateurLivraison />
</main>
</RulesProviderLivraison>
</Section2.InnerMargin>
</Section2>
<RulesProviderLivraison>
<main id="contenu">
<IntroLivraison embedded={true} />
<CalculateurLivraison embedded={true} />
</main>
</RulesProviderLivraison>
</Iframe>
);
}
2 changes: 2 additions & 0 deletions pages/impactlivraison.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Section2 from "components/base/Section2";
import AdviceLivraison from "components/livraison/AdviceLivraison";
import AvisLivraison from "components/livraison/AvisLivraison";
import CalculateurLivraison from "components/livraison/CalculateurLivraison";
import ConclusionLivraison from "components/livraison/ConclusionLivraison";
import IntroLivraison from "components/livraison/IntroLivraison";
Expand All @@ -19,6 +20,7 @@ export default function Impactlivraison() {
</Section2.InnerMargin>
</Section2>
<ConclusionLivraison />
<AvisLivraison />
</main>
);
}
Expand Down
35 changes: 28 additions & 7 deletions pages/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const StyledSectionContent = styled(Section.Content)`
display: block;
}
`;
const ConfiguratorWrapper = styled.div`
align-items: center;
display: flex;
justify-content: center;
`;

export default function Integration() {
const { equivalents, categories } = useContext(DataContext);

Expand Down Expand Up @@ -58,7 +64,7 @@ export default function Integration() {
return (
<Web title={"Intégrer l'outil"}>
<Section>
<StyledSectionContent flex>
<ConfiguratorWrapper>
<Configurator
equivalents={equivalents}
categories={categories}
Expand All @@ -69,12 +75,27 @@ export default function Integration() {
setSlug={setSlug}
path={path}
/>
<StyledIframeResizer
src={`/iframes/${path}?theme=${theme}`}
allowfullscreen="true"
webkitallowfullscreen="true"
mozallowfullscreen="true"
/>
</ConfiguratorWrapper>
<StyledSectionContent flex>
{path == "livraison" ? (
<>
<StyledIframeResizer
src={`/iframes/livraison/simulation?theme=${theme}`}
allowFullScreen={true}
webkitallowfullscreen="true"
mozallowfullscreen="true"
/>
</>
) : (
<>
<StyledIframeResizer
src={`/iframes/${path}?theme=${theme}`}
allowFullScreen={true}
webkitallowfullscreen="true"
mozallowfullscreen="true"
/>
</>
)}
</StyledSectionContent>
</Section>
</Web>
Expand Down
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Disallow:

Sitemap: https://impactco2.fr/sitemap.xml
22 changes: 22 additions & 0 deletions src/components/base/DocumentationLivraison.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import RulesContextLivraison from "components/livraison/RulesProviderLivraison";
import Head from "next/head";
import Link from "next/link";
import { RulePage } from "publicodes-react";
import React, { useContext } from "react";

export default function DocumentationLivraison(props) {
const { engine } = useContext(RulesContextLivraison);

return (
<RulePage
documentationPath="/documentation"
rulePath={props.slug}
engine={engine}
language="fr"
renderers={{
Head,
Link: ({ to, children }) => <Link href={to}>{children}</Link>,
}}
/>
);
}
22 changes: 11 additions & 11 deletions src/components/base/Section2.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import styled from 'styled-components'
import styled from "styled-components";

const Section2 = styled.div``
const Section2 = styled.div``;

Section2.WideContent = styled.div`
${(props) => props.theme.mq.medium} {
width: 100vw;
}
`
`;
Section2.InnerMargin = styled.div`
margin-left: 8rem;
margin-right: 8rem;
margin-left: ${(props) => (props.embedded ? 2 : 8)}rem;
margin-right: ${(props) => (props.embedded ? 2 : 8)}rem;
${(props) => props.theme.mq.medium} {
margin-left: 4rem;
margin-right: 4rem;
margin-left: ${(props) => (props.embedded ? 1.5 : 4)}rem;
margin-right: ${(props) => (props.embedded ? 1.5 : 4)}rem;
}
${(props) => props.theme.mq.small} {
margin-left: 1rem;
margin-right: 1rem;
margin-left: ${(props) => (props.embedded ? 0.5 : 1)}rem;
margin-right: ${(props) => (props.embedded ? 0.5 : 1)}rem;
}
`
`;

export default Section2
export default Section2;
6 changes: 4 additions & 2 deletions src/components/layout/Web2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import BreadCrumb2 from "./web/BreadCrumb2";
import Footer2 from "./web/Footer2";
import Header2 from "./web/Header2";
import Header from "./web/Header";
import Nav from "./web/Nav";
import Seo from "./web/Seo";
import useInteraction from "hooks/useInteraction";
import React from "react";
Expand All @@ -15,7 +16,8 @@ export default function Web2(props) {
<>
<VerticalContainer className={props.theme === "night" ? "bl" : "r"}>
<Seo title={props.title} description={props.description} image={"metalivraison.png"} />
<Header2 />
<Header />
<Nav />
<BreadCrumb2 breadcrumb={props.breadcrumb} />
{props.children}
<Footer2 />
Expand Down
39 changes: 20 additions & 19 deletions src/components/layout/iframe/IframeFooter.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import React from 'react'
import styled from 'styled-components'

import useWindow from 'hooks/useWindow'

import Ademe from 'components/base/Ademe'
import Logo from 'components/base/Logo'
import MagicLink from 'components/base/MagicLink'
import Marianne from 'components/base/Marianne'
import Ademe from "components/base/Ademe";
import Logo from "components/base/Logo";
import MagicLink from "components/base/MagicLink";
import Marianne from "components/base/Marianne";
import useWindow from "hooks/useWindow";
import React from "react";
import styled from "styled-components";

const Wrapper = styled.footer`
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
`
`;
const StyledMagicLink = styled(MagicLink)`
display: block;
font-size: 0.75rem;
font-weight: 300;
margin: 0.75rem auto;
text-align: center;
`
`;
const Logos = styled.div`
align-items: center;
display: flex;
Expand All @@ -30,16 +28,19 @@ const Logos = styled.div`
font-size: ${(props) => (props.iframe ? 0.75 : 1)}rem;
padding: 0 0.25rem;
}
`
`;
export default function IframeFooter() {
const window = useWindow()
const window = useWindow();
const siteUrl = process?.env?.NEXT_PUBLIC_SITE_URL || "impactco2.fr";
const protocol = siteUrl.indexOf("localhost") >= 0 ? "http://" : "https://";
const baseUrl = `${protocol}${siteUrl}`;
let actualSrc = window?.location.href.split("iframes")[1] || "";
if (actualSrc.indexOf("livraison") > 0) {
actualSrc = "/livraison";
}
return (
<Wrapper>
<StyledMagicLink
to={`https://impactco2.fr${
window?.location.href.split('iframes')[1] || ''
}`}
>
<StyledMagicLink to={`${baseUrl}${actualSrc}`}>
Voir la version détaillée
<br />
(et les sources)
Expand All @@ -50,5 +51,5 @@ export default function IframeFooter() {
<Logo />
</Logos>
</Wrapper>
)
);
}
Loading

0 comments on commit 4489c5d

Please sign in to comment.