Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE][CU-86drct9ww] Differentiate/Identify users who came in via /pilot and via /c-org #88

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions apps/eo_web/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"src": "../../packages/ui/src/assets/avatar.svg"
},
"src/main.css": {
"file": "assets/main-d3160e96.css",
"file": "assets/main-ddf6ac53.css",
"src": "src/main.css"
},
"src/main.tsx": {
"assets": [
"assets/UploadFile-694e44b5.svg"
],
"css": [
"assets/main-d3160e96.css"
"assets/main-ddf6ac53.css"
],
"file": "assets/main-6d1547c3.js",
"file": "assets/main-26785659.js",
"isEntry": true,
"src": "src/main.tsx"
}
Expand Down
1 change: 0 additions & 1 deletion apps/eo_web/src/api/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export const useApi = () => {
await apiElixir.post<LaravelSuccessBase<unknown> | LaravelErrorValidation>(
"/v2/profiles/eligible",
{ email },
authHeader,
cgarcia-lightit marked this conversation as resolved.
Show resolved Hide resolved
);

const postCancerFormSubmission = async (data: object) =>
Expand Down
25 changes: 13 additions & 12 deletions apps/eo_web/src/screens/ProfilingThankYou.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ import { toast } from "react-toastify";
import { Typography } from "@eo/ui";

import { useApi } from "~/api/useApi";
import { AllDonePanel } from "~/components/AllDonePanel";
import { FAQs } from "~/components/FAQs";
import { HowEOWorks } from "~/components/HowEOWorks";
import { WEB_APP_URL } from "~/configs/env";
import { useMount } from "~/hooks/useMount";
import { LayoutDefault } from "~/layouts";
import { FooterFull } from "~/layouts/FooterFull";
import { ROUTES } from "~/router";
import { useProfilingStore } from "~/stores/useProfilingStore";
import { FAQs } from "~/components/FAQs";
import { HowEOWorks } from "~/components/HowEOWorks";
import { AllDonePanel } from "~/components/AllDonePanel";
import { WEB_APP_URL } from "~/configs/env";


export const ProfilingThankYou = () => {
const [searchParams] = useSearchParams();

const { account, introQuestionSubmissionId, channel, usePayment } = useProfilingStore(
(state) => state,
);
const { account, introQuestionSubmissionId, channel, usePayment, flow } =
useProfilingStore((state) => state);
const submissionId = searchParams.get("submission_id") || "";

const navigate = useNavigate();
Expand Down Expand Up @@ -63,6 +62,7 @@ export const ProfilingThankYou = () => {
agree_receive_notifications: account.agreeReceiveNotifications,
agree_terms_and_conditions: account.agreeTermsAndConditions,
channel,
flow,
}),
);

Expand All @@ -76,19 +76,20 @@ export const ProfilingThankYou = () => {
<Typography
variant="base"
font="regular"
className="text-center text-[22px] font-normal leading-[36px] max-w-3xl"
className="max-w-3xl text-center text-[22px] font-normal leading-[36px]"
>
You’ll be able to review your initial, personalized,
clinician-approved care plan within 24 hours. When your care plan is ready, we
will send you an email with a link to{" "}
clinician-approved care plan within 24 hours. When your care plan is
ready, we will send you an email with a link to{" "}
<span className="cursor-pointer underline" onClick={goToWebApp}>
log into your account.
</span>
<br />
<br />
Have questions? We’re here. Email [email protected], call <a href="tel:+1-877-707-0706">877-707-0706</a>, or {" "}
Have questions? We’re here. Email [email protected], call{" "}
<a href="tel:+1-877-707-0706">877-707-0706</a>, or{" "}
<a
className="cursor-pointer underline font-new-hero text-[22px]"
className="cursor-pointer font-new-hero text-[22px] underline"
href="https://eo-care-telemed.as.me/schedule.php"
target="_blank"
>
Expand Down
8 changes: 6 additions & 2 deletions apps/eo_web/src/screens/UserRolSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ROUTES } from "~/router";
import {
useProfilingStore,
type Channel,
type Flows,
type Type,
} from "~/stores/useProfilingStore";

Expand All @@ -21,6 +22,7 @@ export const UserRolSelector = () => {
const origin = searchParams.get("origin") ?? "localhost:5173";
const channel = searchParams.get("channel") as Channel;
const symptoms = searchParams.get("symptoms") ?? "";
const flow: Flows = (searchParams.get("flow") as Flows) ?? "marketing_site";

const {
setChannel,
Expand All @@ -29,10 +31,12 @@ export const UserRolSelector = () => {
setUsePayment,
resetProfilingStore,
setOrigin,
setFlow,
} = useProfilingStore((state) => state);

const redirectForm = (type: Type) => {
setOrigin(origin);
setFlow(flow);
setSymptoms(symptoms.split(","));
setChannel(channel);
setType(type);
Expand Down Expand Up @@ -62,7 +66,7 @@ export const UserRolSelector = () => {
className={tw(
"flex h-12 items-center justify-start gap-2 rounded border border-solid border-gray-800 px-[15px] py-[9px] font-nunito text-gray-800 lg:w-1/2",
selectedValue === "Patient" &&
"border-[#5AADFD] bg-[#5AADFD] bg-opacity-20",
"border-[#5AADFD] bg-[#5AADFD] bg-opacity-20",
)}
onClick={() => setSelectedValue("Patient")}
>
Expand Down Expand Up @@ -94,7 +98,7 @@ export const UserRolSelector = () => {
className={tw(
"flex h-12 items-center justify-start gap-2 rounded border border-solid border-gray-800 px-[15px] py-[9px] font-nunito text-gray-800 lg:w-1/2",
selectedValue === "Caregiver" &&
"border-[#5AADFD] bg-[#5AADFD] bg-opacity-20",
"border-[#5AADFD] bg-[#5AADFD] bg-opacity-20",
)}
onClick={() => setSelectedValue("Caregiver")}
>
Expand Down
12 changes: 12 additions & 0 deletions apps/eo_web/src/stores/useProfilingStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export interface Account {

export type Type = "Patient" | "Caregiver" | null;

export type Flows =
| "c_org"
| "marketing_site"
| "cancer_pilot"
| "employer_center";

export interface ProfilingStore {
symptoms: string[];
channel: Channel | null;
Expand All @@ -29,6 +35,7 @@ export interface ProfilingStore {
origin: string;
experience: string;
account: Account;
flow: Flows;
setAccountData: (account: Account) => void;
setChannel: (channel: Channel) => void;
setType: (type: Type) => void;
Expand All @@ -39,6 +46,7 @@ export interface ProfilingStore {
resetProfilingStore: () => void;
setOrigin: (origin: string) => void;
setExperience: (experience: string) => void;
setFlow: (flow: Flows) => void;
}

const defaultState = {
Expand All @@ -59,6 +67,7 @@ const defaultState = {
agreeTermsAndConditions: false,
},
usePayment: true,
flow: "marketing-site" as Flows,
};

export const useProfilingStore = create<ProfilingStore>()(
Expand Down Expand Up @@ -94,6 +103,9 @@ export const useProfilingStore = create<ProfilingStore>()(
setExperience: (experience: string) => {
set({ experience });
},
setFlow: (flow: Flows) => {
set({ flow });
},
...defaultState,
}),
{
Expand Down
Loading