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

[RELEASE] Version 0.1.0 #32

Merged
merged 18 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e6e612f
feat: add SurveyForm view and change naming for files into Cancer Folder
cgarcia-lightit Aug 31, 2023
49e0ec6
feat: add missing view and route. and also add the app builded
cgarcia-lightit Aug 31, 2023
6528bb6
feat: add compiled files
cgarcia-lightit Aug 31, 2023
8cbc7e8
feat: create a common config file, and change the references
cgarcia-lightit Aug 31, 2023
3054a24
fix: import bad cancer id from env.ts file
cgarcia-lightit Sep 1, 2023
90a5f26
feat: modify jotform in local environment and set full-hight in thnak…
cgarcia-lightit Sep 5, 2023
147d237
[FEATURE] Environments separations (#27)
cgarcia-lightit Sep 5, 2023
6af3696
[FEATURE][CU-866awnk61] Cancer Landing Page Edits (#28)
cgarcia-lightit Sep 12, 2023
60b4e34
Bugfix/changes classes (#29)
cgarcia-lightit Sep 12, 2023
45ccf3d
feat: add new modification for client demo
cgarcia-lightit Sep 13, 2023
78cdc42
Bugfix/fix tailwind nunito font reference (#30)
cgarcia-lightit Sep 13, 2023
7088722
Merge branch 'develop' into feature/latest-modification-for-demo
cgarcia-lightit Sep 13, 2023
b60068d
merge: develop into branch and build new app
cgarcia-lightit Sep 13, 2023
2494b9c
feat: add new modification for client demo (#31)
cgarcia-lightit Sep 13, 2023
2641717
feat: save changes
cgarcia-lightit Sep 13, 2023
9957e2a
merge: merge develop into local branch
cgarcia-lightit Sep 13, 2023
8310cbd
fix: resolve redirect with jotform and web app
cgarcia-lightit Sep 13, 2023
0c63221
bugfix: change url
cgarcia-lightit Sep 13, 2023
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
120 changes: 120 additions & 0 deletions apps/eo_web/dist/assets/main-281f57f2.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/eo_web/dist/assets/main-6104ee8d.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion apps/eo_web/dist/assets/main-b2263767.css

This file was deleted.

120 changes: 0 additions & 120 deletions apps/eo_web/dist/assets/main-bd64df5e.js

This file was deleted.

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-b2263767.css",
"file": "assets/main-6104ee8d.css",
"src": "src/main.css"
},
"src/main.tsx": {
"assets": [
"assets/UploadFile-694e44b5.svg"
],
"css": [
"assets/main-b2263767.css"
"assets/main-6104ee8d.css"
],
"file": "assets/main-bd64df5e.js",
"file": "assets/main-281f57f2.js",
"isEntry": true,
"src": "src/main.tsx"
}
Expand Down
20 changes: 16 additions & 4 deletions apps/eo_web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@
<body>
<div id="root"></div>
<script type="text/javascript">
const hosts = ['www.eo.care', 'partner.eo.care', 'eo-marketing-06cbaf66a5b1fbfeecb0ca9525.webflow.io', 'eo-marketing.webflow.io']

window.data = {
API_URL: null,
API_URL_LARAVEL: null,
PROFILE_TWO_ID: null,
PROFILE_ONE_ID: null
hosts: hosts,
isProduction: false,
environments: {
'www.eo.care': {},
'partner.eo.care': {},
'eo-marketing-06cbaf66a5b1fbfeecb0ca9525.webflow.io': {},
'eo-marketing.webflow.io': {}
},
getEnv: function (key) {
if (this.hosts.includes(window.location.host)) {
return this.environments[window.location.host][key]
}
return null
}
}
</script>
<script type="module" src="/src/main.tsx"></script>
Expand Down
29 changes: 22 additions & 7 deletions apps/eo_web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,31 @@ import "react-toastify/dist/ReactToastify.css";


const queryClient = new QueryClient();
type Hosts =
| "www.eo.care"
| "partner.eo.care"
| "eo-marketing-06cbaf66a5b1fbfeecb0ca9525.webflow.io"
| "eo-marketing.webflow.io";

interface EnvironmentsConfigs {
API_URL: string;
API_LARAVEL: string;
PROFILE_ONE_ID: string;
PROFILE_TWO_ID: string;
ZUKO_SLUG_ID_PROCESS_START: string;
CANCER_PROFILE_PATIENT_ID: string;
CANCER_PROFILE_CAREGIVER_ID: string;
CANCER_USER_DATA: string;
CANCER_SURVEY_FORM: string;
}

declare global {
interface Window {
data: {
API_URL: string;
API_LARAVEL: string;
PROFILE_ONE_ID: string;
PROFILE_TWO_ID: string;
ZUKO_SLUG_ID_PROCESS_START: string;
CANCER_PROFILING: string;
CANCER_USER_DATA: string;
hosts: Hosts[];
isProduction: boolean;
environments: Record<Hosts, EnvironmentsConfigs>;
getEnv: (key: keyof EnvironmentsConfigs) => string | null;
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion apps/eo_web/src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { api } from "~/api/axios";
import { API_URL } from "~/api/common";
import { API_URL } from "~/configs/env";
import {
useProfileStore,
type Profile,
Expand Down Expand Up @@ -27,6 +27,7 @@ export interface RegisterRequest {
first_name: string;
last_name: string;
}

export const register = async (registrationForm: RegisterRequest) => {
return await api.post<string>(`${API_URL}/v2/profile`, registrationForm);
};
Expand Down
2 changes: 0 additions & 2 deletions apps/eo_web/src/api/common.ts

This file was deleted.

7 changes: 6 additions & 1 deletion apps/eo_web/src/api/email.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { api } from "~/api/axios";
import { API_URL } from "~/api/common";
import { API_URL } from "~/configs/env";





export interface ResendEmailVerificationResponse {
success: boolean;
}

export const resendEmailVerification = async (email: string) => {
return await api.post<ResendEmailVerificationResponse>(
`${API_URL}/v2/profile/resend_confirmation_email`,
Expand Down
10 changes: 9 additions & 1 deletion apps/eo_web/src/api/useElixirApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type WorseSymptomsMoment,
} from "~/api/PrePlanTypes";
import { api } from "~/api/axios";
import { API_LARAVEL, API_URL } from "~/api/common";
import { API_LARAVEL, API_URL } from "~/configs/env";
import { useProfileStore, type Profile } from "~/stores/useProfileStore";

export interface ZipCodeValidationResponseError {
Expand Down Expand Up @@ -122,6 +122,13 @@ export const useElixirApi = () => {
);
};

const postCancerSurveyFormSubmission = async (data: object) => {
return await api.post<{ success: boolean; message: string }>(
`${API_LARAVEL}/api/cancer/survey`,
data,
);
};

return {
validateZipCode,
combineProfileOne,
Expand All @@ -132,5 +139,6 @@ export const useElixirApi = () => {
getSubmissionById,
eligibleEmail,
postCancerFormSubmission,
postCancerSurveyFormSubmission,
};
};
19 changes: 19 additions & 0 deletions apps/eo_web/src/configs/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const PROFILE_ONE_ID =
window.data.getEnv("PROFILE_ONE_ID") || 231014818128147;
export const PROFILE_TWO_ID =
window.data.getEnv("PROFILE_TWO_ID") || 231015554139147;
export const ZUKO_SLUG_ID =
window.data.getEnv("ZUKO_SLUG_ID_PROCESS_START") || "4e9cc7ceea3e22fb";

export const CANCER_USER_PROFILE =
window.data.getEnv("CANCER_USER_DATA") || 232256418562659;
export const CANCER_PROFILE_PATIENT_ID =
window.data.getEnv("CANCER_PROFILE_PATIENT_ID") || 232545133592657;
export const CANCER_PROFILE_CAREGIVER_ID =
window.data.getEnv("CANCER_PROFILE_CAREGIVER_ID") || 232545861869672;
export const CANCER_SURVEY_ID =
window.data.getEnv("CANCER_SURVEY_FORM") || 232395615249664;

export const API_URL = window.data.getEnv("API_URL") || "http://localhost:4200";
export const API_LARAVEL =
window.data.getEnv("API_LARAVEL") || "http://localhost";
30 changes: 21 additions & 9 deletions apps/eo_web/src/router/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from "react";
import { Route, Routes } from "react-router-dom";

import { ROUTES } from "~/router/routes";
import { CancerForm } from "~/screens/Cancer/CancerForm";
import { CancerThankYou } from "~/screens/Cancer/CancerThankYou";
import { UserCancerProfile } from "~/screens/Cancer/UserCancerProfile";
import { UserCancerVerification } from "~/screens/Cancer/UserCancerVerification";
import { Form } from "~/screens/Cancer/Form";
import { FormDemo } from "~/screens/Cancer/FormDemo";
import { FormThankYou } from "~/screens/Cancer/FormThankYou";
import { SurveyForm } from "~/screens/Cancer/SurveyForm";
import { SurveyThankYou } from "~/screens/Cancer/SurveyThankYou";
import { UserProfile } from "~/screens/Cancer/UserProfile";
import { UserTypeSelectorDemo } from "~/screens/Cancer/UserTypeSelectorDemo";
import { UserVerification } from "~/screens/Cancer/UserVerification";
import { EligibleProfile } from "~/screens/EligibleProfile";
import { EmailVerificationUncompletedButLogged } from "~/screens/EmailVerificationUncompletedButLogged";
import { ForgotPassword } from "~/screens/ForgotPassword";
Expand Down Expand Up @@ -80,14 +85,21 @@ export const Router = () => {
/>

{/* CANCER */}
<Route element={<UserCancerProfile />} path={ROUTES.cancerProfile} />

<Route element={<UserProfile />} path={ROUTES.cancerProfile} />
<Route
element={<UserTypeSelectorDemo />}
path={ROUTES.cancerUserTypeSelectDemo}
/>
<Route element={<FormDemo />} path={ROUTES.cancerFormDemo} />
<Route
element={<UserCancerVerification />}
element={<UserVerification />}
path={ROUTES.cancerUserVerification}
/>
<Route element={<CancerForm />} path={ROUTES.cancerForm} />
<Route element={<CancerThankYou />} path={ROUTES.cancerThankYou} />
<Route element={<Form />} path={ROUTES.cancerForm} />
<Route element={<FormThankYou />} path={ROUTES.cancerThankYou} />

<Route element={<SurveyForm />} path={ROUTES.cancerSurvey} />
<Route element={<SurveyThankYou />} path={ROUTES.cancerSurveyThankYou} />
</Routes>
);
};
4 changes: 3 additions & 1 deletion apps/eo_web/src/router/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export const ROUTES = {
prePlanV2: `${BASE}/preplan`,

// Cancer PATH
cancerUserTypeSelectDemo: "/cancer/start",
cancerFormDemo: "/cancer/profiling-start",
cancerProfile: "/cancer/personal-information",
cancerUserVerification: "/cancer/user-validate",
cancerForm: "/cancer/profiling",
cancerThankYou: "/cancer/thank-you",
cancerUnion: "/cancer/union-survey",
cancerSurvey: "/cancer/survey",
cancerSurveyThankYou: "/cancer/survey-thank-you",
} as const;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect } from "react";
import { useNavigate, useSearchParams } from "react-router-dom";

import { CANCER_PROFILE_PATIENT_ID } from "~/configs/env";
import { jotformScript } from "~/helpers/jotform_script";
import { LayoutDefault } from "~/layouts";
import { ROUTES } from "~/router";
Expand All @@ -9,9 +10,7 @@ import { ROUTES } from "~/router";



const CANCER_PROFILE_ID = window.data.CANCER_PROFILING || 232256466069664;

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

const name = searchParams.get("name");
Expand All @@ -30,19 +29,19 @@ export const CancerForm = () => {
}

useEffect(() => {
jotformScript(CANCER_PROFILE_ID);
jotformScript(CANCER_PROFILE_PATIENT_ID);
}, []);
return (
<LayoutDefault>
<div className="mb-10 flex h-screen flex-col">
<iframe
id={`JotFormIFrame-${CANCER_PROFILE_ID}`}
id={`JotFormIFrame-${CANCER_PROFILE_PATIENT_ID}`}
title=""
onLoad={() => window.parent.scrollTo(0, 0)}
allow="geolocation; microphone; camera"
allowTransparency={true}
allowFullScreen={true}
src={`https://form.jotform.com/${CANCER_PROFILE_ID}?name[0]=${name}&name[1]=${last}&email=${email}&dob[month]=${month}&dob[day]=${day}&dob[year]=${year}&caregiver=${caregiver}&gender=${gender}`}
src={`https://form.jotform.com/${CANCER_PROFILE_PATIENT_ID}?name[0]=${name}&name[1]=${last}&email=${email}&dob[month]=${month}&dob[day]=${day}&dob[year]=${year}&caregiver=${caregiver}&gender=${gender}`}
className="h-full w-full"
style={{
minWidth: "100%",
Expand Down
57 changes: 57 additions & 0 deletions apps/eo_web/src/screens/Cancer/FormDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { useNavigate, useSearchParams } from "react-router-dom";

import {
CANCER_PROFILE_CAREGIVER_ID,
CANCER_PROFILE_PATIENT_ID,
} from "~/configs/env";
import { jotformScript } from "~/helpers/jotform_script";
import { useMount } from "~/hooks/useMount";
import { LayoutDefault } from "~/layouts";
import { ROUTES } from "~/router";





export const FormDemo = () => {
const [searchParams] = useSearchParams();
const navigate = useNavigate();
const type = searchParams.get("type");
const cancerProfileId =
type === "Patient"
? CANCER_PROFILE_PATIENT_ID
: CANCER_PROFILE_CAREGIVER_ID;

if (!type) {
navigate(ROUTES.cancerUserTypeSelectDemo);
}

useMount(() => {
setTimeout(() => {
jotformScript(cancerProfileId);
}, 400);
});

return (
<LayoutDefault>
<div className="mb-10 flex h-screen flex-col">
{/* uncomment for real flow */}
<iframe
id={`JotFormIFrame-${cancerProfileId}`}
title=""
onLoad={() => window.parent.scrollTo(0, 0)}
allow="geolocation; microphone; camera"
allowTransparency={true}
allowFullScreen={true}
src={`https://form.jotform.com/${cancerProfileId}`}
className="h-full w-full"
style={{
minWidth: "100%",
height: "539px",
border: "none",
}}
></iframe>
</div>
</LayoutDefault>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ROUTES } from "~/router";



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

const submission_id = searchParams.get("submission_id") || "";
Expand Down
41 changes: 41 additions & 0 deletions apps/eo_web/src/screens/Cancer/SurveyForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { useEffect } from "react";
import { useSearchParams } from "react-router-dom";

import { CANCER_SURVEY_ID } from "~/configs/env";
import { jotformScript } from "~/helpers/jotform_script";
import { LayoutDefault } from "~/layouts";





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

const email = searchParams.get("email") || "";

useEffect(() => {
jotformScript(CANCER_SURVEY_ID);
}, []);
return (
<LayoutDefault>
<div className="mb-10 flex h-screen flex-col">
<iframe
id={`JotFormIFrame-${CANCER_SURVEY_ID}`}
title=""
onLoad={() => window.parent.scrollTo(0, 0)}
allow="geolocation; microphone; camera"
allowTransparency={true}
allowFullScreen={true}
src={`https://form.jotform.com/${CANCER_SURVEY_ID}?email=${email}`}
className="h-full w-full"
style={{
minWidth: "100%",
height: "539px",
border: "none",
}}
></iframe>
</div>
</LayoutDefault>
);
};
Loading