Skip to content

Commit

Permalink
chore: add link to change password (#740)
Browse files Browse the repository at this point in the history
* chore: add link to change password

* chore: changed link for better accessibility
  • Loading branch information
LucasCharrier authored Jan 21, 2025
1 parent 342daf6 commit efcadf6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 24 deletions.
13 changes: 11 additions & 2 deletions src/components/MemberPage/Email/EmailContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { fr } from "@codegouvfr/react-dsfr";
import Accordion from "@codegouvfr/react-dsfr/Accordion";
import Alert from "@codegouvfr/react-dsfr/Alert";
import Badge from "@codegouvfr/react-dsfr/Badge";
import Button from "@codegouvfr/react-dsfr/Button";
import Table from "@codegouvfr/react-dsfr/Table";
import { match } from "ts-pattern";

Expand All @@ -17,6 +18,7 @@ import BlocEmailResponder from "./BlocEmailResponder";
import BlocRedirection from "./BlocRedirection";
import { WebMailButtons } from "./WebMailButtons";
import { MemberPageProps } from "../MemberPage";
import { BadgeEmailPlan } from "@/components/BadgeEmailPlan";
import frontConfig from "@/frontConfig";
import {
EmailInfos,
Expand All @@ -26,8 +28,6 @@ import {
import { EmailStatusCode } from "@/models/member";
import { EMAIL_STATUS_READABLE_FORMAT } from "@/models/misc";
import { EMAIL_PLAN_TYPE, OvhRedirection, OvhResponder } from "@/models/ovh";
import { BadgeEmailPlan } from "@/components/BadgeEmailPlan";
import Button from "@codegouvfr/react-dsfr/Button";

const EmailLink = ({ email }: { email: string }) => (
<a href={`mailto:${email}`}>{email}</a>
Expand Down Expand Up @@ -66,6 +66,15 @@ const emailStatusRow = (
}
</Badge>
))}
{userInfos.primary_email_status ===
EmailStatusCode.EMAIL_ACTIVE_AND_PASSWORD_DEFINITION_PENDING && (
<span>
Le mot de passe doit être défini. Rendez vous dans{" "}
<a href={"/account?tab=compte-email#password"}>
Changer mon mot de passe
</a>
</span>
)}
</>,
];
};
Expand Down
20 changes: 11 additions & 9 deletions src/components/MemberPage/MemberContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ export const MemberContact = ({
}
</Badge>
)}
{userInfos.primary_email_status ===
EmailStatusCode.EMAIL_VERIFICATION_WAITING && (
<span>
Le mot de passe doit être défini. Rendez vous dans{" "}
<a href={"/account?tab=compte-email#password"}>
Changer mon mot de passe
</a>
</span>
)}
{isCurrentUser &&
userInfos.primary_email_status ===
EmailStatusCode.EMAIL_ACTIVE_AND_PASSWORD_DEFINITION_PENDING && (
<span>
Le mot de passe doit être défini. Rendez vous
dans{" "}
<a href={"/account?tab=compte-email#password"}>
Changer mon mot de passe
</a>
</span>
)}
</>
),
});
Expand Down
20 changes: 10 additions & 10 deletions src/components/MemberPage/MemberStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ const emailStatusRow = (
<br />
Le mot de passe doit être défini. Rendez
vous dans{" "}
<Link
<a
href={
"/account?tab=compte-email#password"
}
>
Changer mon mot de passe
</Link>
</a>
</>
)
)
Expand Down Expand Up @@ -298,11 +298,11 @@ const MatomoInfoRow = (
</Accordion>
) : isCurrentUser ? (
<>
Tu n'as pas de compte matomo. Si tu as besoin d'un compte tu
peux en faire la demande{" "}
<a href="/services/matomo" className="fr-link">
ici
"Tu n'as pas de compte Matomo. Si tu en as besoin, tu peux{" "}
<a href="/services/matomo">
faire une demande de compte Matomo
</a>
.
</>
) : (
<>
Expand Down Expand Up @@ -336,11 +336,11 @@ const sentryInfoRow = (sentry: MemberPageProps["sentryInfo"]) => {
match([sentry && sentry.status, !!sentry])
.with([P._, false], () => (
<>
Tu n'as pas de compte sentry. Si tu as besoin d'un compte tu
peux en faire la demande{" "}
<a href="/services/sentry" className="fr-link">
ici
"Tu n'as pas de compte Sentry. Si tu en as besoin, tu peux{" "}
<a href="/services/sentry">
faire une demande de compte Sentry
</a>
.
</>
))
.with([ACCOUNT_SERVICE_STATUS.ACCOUNT_INVITATION_SENT, P._], () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import { useRouter } from "next/navigation";
import { useLiveChat } from "../live-chat/useLiveChat";
import MemberSelect from "../MemberSelect";
import { safeGetUserPublicInfo } from "@/app/api/member/actions";
import { BadgeEmailPlan } from "@/components/BadgeEmailPlan";
import { EmailStatusCode } from "@/models/member";
import {
memberPublicInfoSchemaType,
memberWrapperPublicInfoSchemaType,
} from "@/models/member";
import { EMAIL_STATUS_READABLE_FORMAT } from "@/models/misc";
import { EMAIL_PLAN_TYPE } from "@/models/ovh";
import { startupSchemaType } from "@/models/startup";
import routes from "@/routes/routes";
import { getLastMission } from "@/utils/member";
import { EMAIL_PLAN_TYPE } from "@/models/ovh";
import { BadgeEmailPlan } from "@/components/BadgeEmailPlan";

enum STEP {
whichMember = "whichMember",
Expand Down Expand Up @@ -1248,7 +1248,6 @@ export const WhatIsGoingOnWithMember = function (
<li>
Fais un renouvellement de mot de passe :{" "}
<a
className="fr-link"
href="https://mattermost.incubateur.net/reset_password"
target={"_blank"}
>
Expand Down

0 comments on commit efcadf6

Please sign in to comment.