Skip to content

Commit

Permalink
content: remove 3rd party with no personnal data (#1067)
Browse files Browse the repository at this point in the history
* content: remove 3rd party with no personnal data

* feat: add cgu link

* fix: redirect not bieng logged

* fix: glitches in dirigeant useSession/getSession conflict

* content: update vie-privee

* chore: bump next because so many bugs
  • Loading branch information
XavierJp committed May 17, 2024
1 parent 9811d81 commit a8228d4
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 372 deletions.
13 changes: 7 additions & 6 deletions app/(header-default)/dirigeants/_component/sections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ export async function DirigeantInformation({
uniteLegale: IUniteLegale;
session: ISession | null;
}) {
const [immatriculationRNE, mandatairesRCS] = await Promise.all([
getImmatriculationRNE(uniteLegale.siren),
hasRights(session, EScope.mandatairesRCS) &&
getMandatairesRCS(uniteLegale.siren, session?.user?.siret),
]);

if (
!estDiffusible(uniteLegale) &&
!hasRights(session, EScope.nonDiffusible)
) {
return <DonneesPriveesSection />;
}

const [immatriculationRNE, mandatairesRCS] = await Promise.all([
getImmatriculationRNE(uniteLegale.siren),
hasRights(session, EScope.mandatairesRCS) &&
getMandatairesRCS(uniteLegale.siren, session?.user?.siret),
]);

return (
<>
<DirigeantSummary
Expand Down
536 changes: 236 additions & 300 deletions app/(header-default)/vie-privee/page.tsx

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions app/(header-without-search)/lp/agent-public/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const LandingPageAgent = (props: AppRouterProps) => {
Accessible à toutes les administrations, collectivités et services
publics de l’Etat.
</p>
<p>
<a href="/cgu" rel="noreferrer noopener" target="_blank">
Consultez nos conditions générales d’utilisation
</a>
.
</p>
</header>
<ButtonAgentConnect
useCurrentPathForRediction={false}
Expand Down
2 changes: 1 addition & 1 deletion clients/api-proxy/rne/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fetchRNEImmatriculation = async (siren: Siren, useCache = true) =>
clientAPIProxy<IImmatriculationRNE>(
routes.proxy.rne.immatriculation + siren,
{
timeout: constants.timeout.XXXXL,
timeout: constants.timeout.XXXL,
useCache,
}
);
Expand Down
15 changes: 9 additions & 6 deletions components/espace-agent-components/agent-wall/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ const AgentWall: React.FC<{
.
</p>
<p>
Disponible pour toutes les administrations, sans création de compte.
Disponible pour toutes les administrations, sans création de compte
(consultez les{' '}
<a href="/cgu" rel="noreferrer noopener" target="_blank">
conditions générales d’utilisation
</a>
).
</p>
<ButtonAgentConnect useCurrentPathForRediction />
</FloatingModal>
Expand All @@ -56,12 +61,10 @@ const AgentWall: React.FC<{
['Développeur backend', 'Typescript, Rails, Python etc.'],
['Data Engineer', 'Airflow, Python'],
['Devops', 'Ansible, Scalingo, OVH'],
[
'Chargé de déploiement',
'SEO, relations avec les administrations',
],
['Chargé de déploiement', 'Relations avec les administrations'],
['Chargé de marketing', 'SEO, communication'],
['Product Manager', 'Gestion du produit'],
['Designer', 'UX, UI, Product designer'],
['Chargé de communication', 'X, Linkedin, newsletters internes'],
['Chargé des relations usagers', 'Outils de support'],
].map(([a, b]) => [a, b])}
/>
Expand Down
5 changes: 5 additions & 0 deletions components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ const Footer = () => (
Mentions légales
</a>
</li>
<li className="fr-footer__bottom-item">
<a className="fr-footer__bottom-link" href="/cgu">
Conditions Générales d’Utilisation
</a>
</li>
<li className="fr-footer__bottom-item">
<a className="fr-footer__bottom-link" href="/accessibilite">
Accessibilité : non conforme
Expand Down
8 changes: 2 additions & 6 deletions components/unite-legale-page-link/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use client';

import { getNomComplet } from '#models/core/statut-diffusion';
import { IUniteLegale, isAssociation } from '#models/core/types';
import useSession from 'hooks/use-session';

type IProp = {
/**
Expand All @@ -20,11 +18,9 @@ type IProp = {
};

export function UniteLegalePageLink({ uniteLegale, href, siteName }: IProp) {
const session = useSession();
const nomComplet = getNomComplet(uniteLegale, session);
const linkLabel = isAssociation(uniteLegale)
? `la page de l’association ${nomComplet}`
: `la page de l’entreprise ${nomComplet}`;
? `la page de l’association`
: `la page de l’entreprise`;
const siteDescription = siteName ? ` sur ${siteName}` : '';
return (
<>
Expand Down
5 changes: 3 additions & 2 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const shouldRedirect = (path: string, search: string, url: string) => {
const sirenOrSiretParam = extractSirenOrSiretSlugFromUrl(slug);

if (isLikelyASiret(sirenOrSiretParam)) {
return new URL(`/etablissement/${sirenOrSiretParam}`, url);
return new URL(`/etablissement/${sirenOrSiretParam}?redirected=1`, url);
} else if (isLikelyASiren(sirenOrSiretParam)) {
return new URL(`/entreprise/${sirenOrSiretParam}`, url);
return new URL(`/entreprise/${sirenOrSiretParam}?redirected=1`, url);
}
}
} catch (e) {
Expand Down Expand Up @@ -87,6 +87,7 @@ export async function middleware(request: NextRequest) {
*/
const nextUrl = request.nextUrl;
const paramIsPresent = nextUrl.search.indexOf('redirected=1') > -1;

if (paramIsPresent) {
// store redirection status in custom header as referrer seems missing from headers in RSC
// isRedirected = params is present + previous page is coming from site
Expand Down
104 changes: 54 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"js-yaml-loader": "~1.2.2",
"maplibre-gl": "^4.1.2",
"matomo-tracker": "~2.2.4",
"next": "^14.1.4",
"next": "^14.2.3",
"next-seo": "^6.4.0",
"openid-client": "^5.6.4",
"qrcode": "^1.5.3",
Expand Down

0 comments on commit a8228d4

Please sign in to comment.