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 19/06/2024 #181

Merged
merged 19 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c986df0
build(deps): bump pnpm/action-setup from 2.2.4 to 4.0.0 (#155)
dependabot[bot] Jun 14, 2024
a330977
build(deps): bump @hookform/resolvers from 3.1.0 to 3.6.0 (#167)
dependabot[bot] Jun 14, 2024
5f6a835
build(deps): bump husky from 8.0.3 to 9.0.11 (#163)
dependabot[bot] Jun 14, 2024
690b90b
build(deps-dev): bump @types/lodash from 4.14.194 to 4.17.5 (#166)
dependabot[bot] Jun 14, 2024
08a35b4
build(deps): bump @ianvs/prettier-plugin-sort-imports (#161)
dependabot[bot] Jun 14, 2024
925594b
build(deps): bump zustand from 4.3.7 to 4.5.2 (#160)
dependabot[bot] Jun 14, 2024
3a82810
build(deps): bump actions/cache from 3 to 4 (#158)
dependabot[bot] Jun 14, 2024
59f48a0
build(deps): bump actions/setup-node from 3 to 4 (#157)
dependabot[bot] Jun 14, 2024
4a252c3
build(deps): bump actions/checkout from 2 to 4 (#156)
dependabot[bot] Jun 14, 2024
062bc3f
Revert "build(deps): bump husky from 8.0.3 to 9.0.11 (#163)" (#172)
sgoycoechea-lightit Jun 14, 2024
e617c36
build(deps): bump husky from 8.0.3 to 9.0.11 (#173)
dependabot[bot] Jun 17, 2024
e4d0336
build(deps): bump date-fns from 2.29.3 to 3.6.0 (#174)
dependabot[bot] Jun 17, 2024
b2f27be
build(deps): bump @tanstack/react-query-devtools from 4.29.5 to 5.45.…
dependabot[bot] Jun 17, 2024
0fc7002
build(deps): bump eslint-config-prettier from 8.8.0 to 9.1.0 (#176)
dependabot[bot] Jun 17, 2024
cf7cfc2
build(deps-dev): bump @vitejs/plugin-react from 3.1.0 to 4.3.1 (#177)
dependabot[bot] Jun 17, 2024
7283334
Revert "Revert "build(deps): bump husky from 8.0.3 to 9.0.11 (#163)" …
sgoycoechea-lightit Jun 17, 2024
8c79d9e
fix: after upgrade is require update prepare command with the newest …
cgarcia-lightit Jun 17, 2024
7a32b25
Merge pull request #179 from Light-it-labs/bugfix/fixing-husky-command
cgarcia-lightit Jun 17, 2024
6affdfc
[CU-86dtub3qj] pre profile (#180)
cgarcia-lightit Jun 19, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4.0.0

- name: Setup Node 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

Expand All @@ -36,7 +36,7 @@ jobs:
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand All @@ -47,7 +47,7 @@ jobs:
run: pnpm install

- name: Training project cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}apps/training/.next/cache
key: ${{ runner.os }}-${{ runner.node }}-${{ hashFiles('**/pnpm-lock.yaml') }}-training
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
remove_label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: draft
Expand Down
1 change: 1 addition & 0 deletions apps/eo_web/dist/assets/main-17ed8018.css

Large diffs are not rendered by default.

121 changes: 0 additions & 121 deletions apps/eo_web/dist/assets/main-1935110a.js

This file was deleted.

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

Large diffs are not rendered by default.

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

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-a73a2c36.css",
"file": "assets/main-17ed8018.css",
"src": "src/main.css"
},
"src/main.tsx": {
"assets": [
"assets/UploadFile-694e44b5.svg"
],
"css": [
"assets/main-a73a2c36.css"
"assets/main-17ed8018.css"
],
"file": "assets/main-1935110a.js",
"file": "assets/main-33e11077.js",
"isEntry": true,
"src": "src/main.tsx"
}
Expand Down
10 changes: 5 additions & 5 deletions apps/eo_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"@eo/shared": "*",
"@eo/ui": "*",
"@headlessui/react": "^1.7.13",
"@hookform/resolvers": "^3.1.0",
"@hookform/resolvers": "^3.6.0",
"@react-oauth/google": "^0.9.0",
"@tanstack/react-query": "^4.29.3",
"@tanstack/react-query-devtools": "^4.29.3",
"@tanstack/react-query-devtools": "^5.45.1",
"autoprefixer": "^10.4.14",
"axios": "^1.3.5",
"date-fns": "^2.29.3",
"date-fns": "^3.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-multi-date-picker": "^3.3.4",
Expand All @@ -32,15 +32,15 @@
"swiper": "^11.0.5",
"uuid": "^9.0.0",
"zod": "^3.21.4",
"zustand": "^4.3.7"
"zustand": "^4.5.2"
},
"devDependencies": {
"@eo/eslint-config": "*",
"@eo/tailwind-config": "*",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.11",
"@types/react-router-dom": "5.3.3",
"@vitejs/plugin-react": "^3.1.0",
"@vitejs/plugin-react": "^4.3.1",
"dotenv-cli": "^7.2.1",
"eslint": "^8.38.0",
"postcss": "^8.4.22",
Expand Down
13 changes: 12 additions & 1 deletion apps/eo_web/src/api/useApi.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { apiElixir, apiLaravel } from "~/api/axios";
import {
type AvoidPresentation,
type Maladies,
Expand All @@ -6,7 +7,6 @@ import {
type ThcProductPreferences,
type WorseSymptomsMoment,
} from "~/api/PrePlanTypes";
import { apiElixir, apiLaravel } from "~/api/axios";
import { useProfileStore, type Profile } from "~/stores/useProfileStore";
import { type FlowType } from "~/stores/useProfilingStore";

Expand Down Expand Up @@ -74,6 +74,13 @@ export interface ProfileOne {
};
}

interface CreatePreProfileParams {
first_name: string;
last_name: string;
email: string;
phone_number: string;
}

export const useApi = () => {
const token = useProfileStore((state) => state.session?.token);

Expand Down Expand Up @@ -171,6 +178,9 @@ export const useApi = () => {
const checkoutComplete = async (data: object) =>
await apiLaravel.patch("/api/profiles/checkout-complete", data);

const createPreProfile = (data: CreatePreProfileParams) =>
apiLaravel.post<LaravelSuccessBase<void>>("api/pre-profiling", data);

return {
validateZipCode,
combineProfileOne,
Expand All @@ -188,5 +198,6 @@ export const useApi = () => {
surveyStatus,
getProfilingFlow,
checkoutComplete,
createPreProfile,
};
};
16 changes: 16 additions & 0 deletions apps/eo_web/src/api/usePreProfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useMutation } from "@tanstack/react-query";

import { useApi } from "~/api/useApi";

export const usePreProfile = () => {
const { createPreProfile } = useApi();

const preProfileMutation = useMutation({
mutationFn: createPreProfile,
mutationKey: ["createPreProfile"],
});

return {
preProfileMutation,
};
};
46 changes: 27 additions & 19 deletions apps/eo_web/src/screens/AccountCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import { toast } from "react-toastify";
import { z } from "zod";

import { tw } from "@eo/shared/src";
import { Button, Input, Typography, icons } from "@eo/ui";
import { Button, icons, Input, Typography } from "@eo/ui";
import { CheckBox } from "@eo/ui/src/form/CheckBox";

import { useApi } from "~/api/useApi";
import { usePreProfile } from "~/api/usePreProfile";
import { useMount } from "~/hooks/useMount";
import { LayoutDefault } from "~/layouts";
import { ROUTES } from "~/router";
Expand All @@ -24,17 +25,16 @@ export const signUpSchema = z.object({
.string()
.min(1, { message: "Email is required" })
.email({ message: "Enter a valid email." }),
phoneNumber: z
.string().superRefine((phoneNumber, ctx) => {
const phoneWithOnlyNumbers = phoneNumber.replace(/\D/g, "");
const numberOfDigits = phoneWithOnlyNumbers.length;
if (numberOfDigits !== 10) {
ctx.addIssue({
code: "custom",
message: "Contact number must be 10 digits"
});
}
}),
phoneNumber: z.string().superRefine((phoneNumber, ctx) => {
const phoneWithOnlyNumbers = phoneNumber.replace(/\D/g, "");
const numberOfDigits = phoneWithOnlyNumbers.length;
if (numberOfDigits !== 10) {
ctx.addIssue({
code: "custom",
message: "Contact number must be 10 digits",
});
}
}),
password: z
.string()
.regex(
Expand Down Expand Up @@ -72,11 +72,10 @@ export const AccountCreation = () => {
setState,
setExperience,
} = useProfilingStore((state) => state);
// const navigate = useNavigate();
const { eligibleEmail } = useApi();

const [validatingForm, setValidatingForm] = useState(false);

const { mutate: createPreProfile } = usePreProfile().preProfileMutation;
const {
formState: { errors },
handleSubmit,
Expand All @@ -98,8 +97,16 @@ export const AccountCreation = () => {
setValidatingForm(false);
return;
} else {
setAccountData({ ...data, phoneNumber: data.phoneNumber.replace(/\D/g, "") });

setAccountData({
...data,
phoneNumber: data.phoneNumber.replace(/\D/g, ""),
});
createPreProfile({
first_name: data.firstName,
last_name: data.lastName,
email: data.email,
phone_number: data.phoneNumber.replace(/\D/g, ""),
});
switch (channel) {
case "cancer":
navigate(ROUTES.cancerForm);
Expand Down Expand Up @@ -211,10 +218,11 @@ export const AccountCreation = () => {
className={tw(
"font-nunito text-[11px] font-light ",
errors.agreeReceiveNotifications?.message &&
"text-red-500",
"text-red-500",
)}
>
I agree to receive emails and text messages related to my care.
I agree to receive emails and text messages related to my
care.
</Typography>
}
/>
Expand All @@ -232,7 +240,7 @@ export const AccountCreation = () => {
className={tw(
"font-nunito text-[11px] font-light !leading-4",
errors.agreeTermsAndConditions?.message &&
"text-red-500",
"text-red-500",
)}
>
I have read and agree to the{" "}
Expand Down
64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"name": "create-t3-turbo",
"private": true,
"engines": {
"node": ">=18.0.0"
},
"packageManager": "[email protected]",
"scripts": {
"build": "turbo build",
"clean:all": "turbo clean",
"clean:root-only": "git clean -xdf node_modules",
"dev": "turbo dev --parallel",
"format": "prettier --write \"**/*.{js,cjs,mjs,ts,tsx,md,json}\" --ignore-path .gitignore",
"lint": "turbo lint && manypkg check",
"lint:fix": "turbo lint:fix && manypkg fix",
"prepare": "chmod +x ./node_modules/husky/lib/bin.js && husky install",
"spell-checker": "cspell . --no-progress",
"spell-checker:staged": "git diff --cached --name-only | npx cspell --no-summary --no-progress --no-must-find-files --file-list stdin",
"type-check": "turbo type-check"
},
"dependencies": {
"@eo/eslint-config": "*",
"@ianvs/prettier-plugin-sort-imports": "^3.7.2",
"@manypkg/cli": "^0.20.0",
"@types/prettier": "^2.7.2",
"cspell": "^6.31.1",
"eslint": "^8.38.0",
"husky": "^8.0.3",
"prettier": "^2.8.7",
"prettier-plugin-tailwindcss": "^0.2.7",
"turbo": "^1.9.3",
"typescript": "^5.0.4"
}
"name": "create-t3-turbo",
"private": true,
"engines": {
"node": ">=18.0.0"
},
"packageManager": "[email protected]",
"scripts": {
"build": "turbo build",
"clean:all": "turbo clean",
"clean:root-only": "git clean -xdf node_modules",
"dev": "turbo dev --parallel",
"format": "prettier --write \"**/*.{js,cjs,mjs,ts,tsx,md,json}\" --ignore-path .gitignore",
"lint": "turbo lint && manypkg check",
"lint:fix": "turbo lint:fix && manypkg fix",
"prepare": "chmod +x ./node_modules/husky/husky && husky install",
"spell-checker": "cspell . --no-progress",
"spell-checker:staged": "git diff --cached --name-only | npx cspell --no-summary --no-progress --no-must-find-files --file-list stdin",
"type-check": "turbo type-check"
},
"dependencies": {
"@eo/eslint-config": "*",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@manypkg/cli": "^0.20.0",
"@types/prettier": "^2.7.2",
"cspell": "^6.31.1",
"eslint": "^8.38.0",
"husky": "^9.0.11",
"prettier": "^2.8.7",
"prettier-plugin-tailwindcss": "^0.2.7",
"turbo": "^1.9.3",
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/config/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"eslint-config-next": "^13.3.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^1.9.3",
"eslint-plugin-react": "7.32.2"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@eo/tailwind-config": "*",
"@headlessui/react": "^1.7.13",
"@heroicons/react": "^2.0.12",
"date-fns": "^2.29.3",
"date-fns": "^3.6.0",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -26,7 +26,7 @@
"@eo/eslint-config": "*",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.9",
"@types/lodash": "^4.14.194",
"@types/lodash": "^4.17.5",
"@types/node": "^18.15.11",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.11",
Expand Down
Loading
Loading