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

end of sprint merge #138

Merged
merged 90 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ba12ccb
feat: add `addSection` service
JaneMoroz Apr 11, 2024
74be4a7
Merge branch 'feature/sprints-functionality-pt2' into feature/sprints…
JaneMoroz Apr 17, 2024
99e8513
feature: add `editSection` service
JaneMoroz Apr 17, 2024
eb56b57
feature: fetch sections data
JaneMoroz Apr 17, 2024
c3d243e
feat: add `addSection` functionality
JaneMoroz Apr 17, 2024
73a6403
feature: add `addNotesSection` functionality
JaneMoroz Apr 18, 2024
38daebc
feat: add `editNotes` functionality
JaneMoroz Apr 18, 2024
b818b3a
feat: add `editSection` functionality pt1
JaneMoroz Apr 20, 2024
83043e4
feat: add `editSection` functionality pt2
JaneMoroz Apr 20, 2024
c1277f6
fix: fix notes/description
JaneMoroz Apr 20, 2024
f6e0d32
Merge branch 'dev' into feature/sprints-functionality-pt3
JaneMoroz Apr 30, 2024
befecaf
feature: show `Save` button only when `isDirty` is true
JaneMoroz Apr 30, 2024
c6ce47b
reset password requests set up
winniecwng Mar 20, 2024
3772b7e
authservices
winniecwng Mar 20, 2024
47c67fa
NewPasswordContainer
winniecwng Mar 20, 2024
f4d3ec8
ResetPasswordContainer
winniecwng Mar 20, 2024
dbbcdf6
SignInFormContainer
winniecwng Mar 20, 2024
342cf12
SignInFormContainer
winniecwng Mar 20, 2024
e0a7190
AuthHeader
winniecwng Mar 20, 2024
a08b3d1
add users reset password page
winniecwng Mar 20, 2024
63c2b04
remove email params from reset
winniecwng Mar 22, 2024
10ef9cd
reset password container state
winniecwng Mar 28, 2024
d1365b8
yarn linting
winniecwng Mar 28, 2024
7e91074
handle resend email function
winniecwng Mar 28, 2024
b95ca1b
address comments
winniecwng Mar 28, 2024
c6e6ccd
routepath for sign in
winniecwng Apr 1, 2024
a5ae2a1
refactor
winniecwng Apr 2, 2024
6013ae5
add res to ignore prettire
winniecwng Apr 2, 2024
17c413d
commit
winniecwng Apr 4, 2024
68b51a9
address comment
winniecwng Apr 14, 2024
bc93870
comments
winniecwng Apr 14, 2024
8892d32
remove redundant reset complete component
winniecwng Apr 14, 2024
2e10ff9
banner
winniecwng Apr 30, 2024
97f9185
refactor authbanner to layout
winniecwng Apr 30, 2024
005116e
static banner image
winniecwng Apr 30, 2024
dd88f98
fix issue with active border effect on input getting cut off
Dan-Y-Ko May 1, 2024
c87a62c
replace image with banner
Dan-Y-Ko May 1, 2024
66972cc
replace image with banner
Dan-Y-Ko May 1, 2024
20cecbb
remove console log
Dan-Y-Ko May 1, 2024
6aa1088
refactor: make section fields required, finish submit logic
JaneMoroz May 1, 2024
cba7977
refactor: change a current date to sprint 6
JaneMoroz May 1, 2024
1fa12ab
Merge branch 'dev' into feature/sprints-functionality-pt3
JaneMoroz May 2, 2024
1bffc65
update ideation slice
Dan-Y-Ko May 3, 2024
5934f79
enforce type imports
Dan-Y-Ko May 3, 2024
f6d0fe1
add selector hook for finalized ideation
Dan-Y-Ko May 3, 2024
a615860
setup conditional to render finalized ideation if there is one
Dan-Y-Ko May 3, 2024
985b7b2
refactor ideation container
Dan-Y-Ko May 3, 2024
7516492
refactor contribution card
Dan-Y-Ko May 3, 2024
740fcd2
refactor finalize ideation item
Dan-Y-Ko May 3, 2024
10ac249
finalize ideation server action
Dan-Y-Ko May 3, 2024
72d5b95
finish finalize functionality
Dan-Y-Ko May 3, 2024
5926c80
fix button disabled state
Dan-Y-Ko May 3, 2024
e311599
fix UI for finalized ideation
Dan-Y-Ko May 3, 2024
511271b
rename props
Dan-Y-Ko May 3, 2024
914393a
refactor contribution card
Dan-Y-Ko May 3, 2024
5fa8e26
finalized ideation card
Dan-Y-Ko May 3, 2024
90f2b63
fix conflicts
Dan-Y-Ko May 4, 2024
6b8bc36
add go back button and redirect user to sign in when clicked
Dan-Y-Ko May 4, 2024
ff95eb5
refactor resend email flow
Dan-Y-Ko May 4, 2024
7034038
cleanup
Dan-Y-Ko May 4, 2024
1f4f19e
Merge branch 'dev' into feature/resetPasswordV3
Dan-Y-Ko May 4, 2024
e854490
Merge pull request #121 from chingu-x/feature/resetPasswordV3
Dan-Y-Ko May 4, 2024
68777d3
fix conflicts
Dan-Y-Ko May 4, 2024
8bd833a
eslint
Dan-Y-Ko May 4, 2024
01f3404
Merge branch 'dev' into feature/sprints-functionality-pt3
JaneMoroz May 4, 2024
78adb41
fix: fix default values thing (use useEffect)
JaneMoroz May 5, 2024
526c566
Merge pull request #129 from chingu-x/feature/sprints-functionality-pt3
Dan-Y-Ko May 6, 2024
4da3df1
resolve conflicts
Dan-Y-Ko May 6, 2024
5cfc9ab
eslint
Dan-Y-Ko May 6, 2024
66d955d
check for current voyage team in finalize ideation page
Dan-Y-Ko May 6, 2024
3867501
display project ideas with most amount of votes in finalize page
Dan-Y-Ko May 6, 2024
7d76c14
disable finalize button if no project with votes exists
Dan-Y-Ko May 6, 2024
4debd32
fix issue with crashing when finalize page is accessed through url di…
Dan-Y-Ko May 6, 2024
994fc93
fix: fix meeting dateTime, add conversion
JaneMoroz May 8, 2024
8a95ebb
fix: fix `getCurrentSprint` error
JaneMoroz May 8, 2024
5655c89
fix: prettier
JaneMoroz May 8, 2024
1d4a527
Merge pull request #131 from chingu-x/feature/ideation-functionality-pt4
Dan-Y-Ko May 8, 2024
5cfb5b4
Merge branch 'dev' into fix/meeting-dateTime-conversion
JaneMoroz May 9, 2024
410de7d
fix: fix `maxDate` display
JaneMoroz May 9, 2024
abe9d2c
Merge pull request #132 from chingu-x/fix/meeting-dateTime-conversion
Dan-Y-Ko May 9, 2024
11b20e5
fix tooltip
winniecwng May 10, 2024
2726255
tooltip template
winniecwng May 10, 2024
d986993
remove cursor from non display tooltip
winniecwng May 10, 2024
1ccb8c9
Merge pull request #134 from chingu-x/fix/tooltip
Dan-Y-Ko May 10, 2024
0aec77e
fix: some urgent fixes due to the GET sprints endpoint's respose updates
JaneMoroz May 11, 2024
ba96bb4
fix: add a few fields to `sprintSllice`, also remove unnecessary curr…
JaneMoroz May 11, 2024
2952075
refactor: refactor `sprintSlice`
JaneMoroz May 11, 2024
d75551c
fix: fixes
JaneMoroz May 11, 2024
076899a
Merge pull request #135 from chingu-x/fix/sprints
Dan-Y-Ko May 13, 2024
6b7fe85
Merge branch 'main' into dev
Dan-Y-Ko May 16, 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
9 changes: 8 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,21 @@
}
}
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
"dot-notation": "off",
"@typescript-eslint/dot-notation": "error"
},
"overrides": [
{
"files": ["src/stories/**/*.{js,ts,tsx}"],
"rules": {
"no-console": "off"
"no-console": "off",
"@typescript-eslint/consistent-type-imports": "off"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/app/(auth)/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { useEffect } from "react";
import { clientSignIn, clientSignOut } from "@/store/features/auth/authSlice";
import { useAppDispatch } from "@/store/hooks";
import { User, getUserState } from "@/store/features/user/userSlice";
import { AppError } from "@/types/types";
import { type User, getUserState } from "@/store/features/user/userSlice";
import { type AppError } from "@/types/types";

interface AuthProviderProps {
user: User | null;
Expand Down
62 changes: 54 additions & 8 deletions src/app/(auth)/authService.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use server";

import { cookies } from "next/headers";
import { AsyncActionResponse, handleAsync } from "@/utils/handleAsync";
import { type AsyncActionResponse, handleAsync } from "@/utils/handleAsync";
import { getAccessToken, getRefreshToken } from "@/utils/getCookie";
import { POST } from "@/utils/requests";
import { POST, UNAUTHPOST } from "@/utils/requests";

interface AuthResponse {
message: string;
Expand All @@ -13,12 +13,23 @@ interface ServerSignInResponse extends AuthResponse {}

interface ServerSignOutResponse extends AuthResponse {}

interface ServerSignInProps {
email: string;
password: string;
}

interface ResetPasswordRequestProps {
email?: string;
token?: string;
password?: string;
}

// prettier-ignore
// prettier causing issues here with eslint rules
export async function serverSignIn(): Promise<
export async function serverSignIn({ email, password }: ServerSignInProps ): Promise<
AsyncActionResponse<ServerSignInResponse>
> {
const userOrError = async () => asyncSignIn();
const userOrError = async () => asyncSignIn(email, password);

return handleAsync(userOrError);
}
Expand Down Expand Up @@ -46,9 +57,44 @@ export async function serverSignOut(): Promise<

}

export async function resetPasswordRequestEmail(
email: string,
): Promise<AsyncActionResponse<void>> {
const asyncPasswordResetEmail = async () =>
UNAUTHPOST<ResetPasswordRequestProps, void>(
"api/v1/auth/reset-password/request",
"no-store",
{
email,
},
);

return handleAsync(asyncPasswordResetEmail);
}

export async function resetPassword({
password,
token,
}: ResetPasswordRequestProps): Promise<AsyncActionResponse<void>> {
const asyncResetPassword = async () =>
UNAUTHPOST<ResetPasswordRequestProps, void>(
"api/v1/auth/reset-password",
"no-store",
{
password,
token,
},
);

return handleAsync(asyncResetPassword);
}

/////////////////////////////////////////////////////////////////////////////

async function asyncSignIn(): Promise<ServerSignInResponse> {
async function asyncSignIn(
email: string,
password: string,
): Promise<ServerSignInResponse> {
try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/api/v1/auth/login`,
Expand All @@ -59,12 +105,12 @@ async function asyncSignIn(): Promise<ServerSignInResponse> {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: "[email protected]",
password: "password",
email,
password,
}),
credentials: "include",
cache: "no-store",
}
},
);

if (!res.ok) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(auth)/components/AuthBannerContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Banner from "@/components/banner/Banner";

export default function AuthBannerContainer() {
return (
<div className="flex min-h-[486px] flex-col justify-center">
<div className="flex h-[486px] flex-col justify-center">
<div>
<Banner
imageLight="/img/login_image_light.png"
Expand Down
10 changes: 8 additions & 2 deletions src/app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ModeToggle from "@/components/ModeToggle";
import Navbar from "@/components/navbar/Navbar";
import AuthBannerContainer from "@/app/(auth)/components/AuthBannerContainer";

interface LayoutProps {
children: React.ReactNode;
Expand All @@ -13,8 +14,13 @@ export default function Layout({ children }: LayoutProps) {
<ModeToggle />
</div>
</Navbar>
<main className="flex flex-col items-center w-full p-10 overflow-y-auto">
<div className="gap-y-9">{children}</div>
<main className="flex flex-col items-center w-full p-10 overflow-y-auto h-full">
<div className="gap-y-9 h-full xl:flex">
<div className="flex items-center justify-center">
<AuthBannerContainer />
{children}
</div>
</div>
</main>
</div>
);
Expand Down
95 changes: 65 additions & 30 deletions src/app/(auth)/sign-in/components/EmailCheckContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,92 @@
import Image from "next/image";
import { type Dispatch, type SetStateAction } from "react";
import { ContainerState } from "./SignInContainer";
import Button from "@/components/Button";
import Banner from "@/components/banner/Banner";
import { useAppDispatch } from "@/store/hooks";
import useServerAction from "@/hooks/useServerAction";
import { resetPasswordRequestEmail } from "@/app/(auth)/authService";
import { onOpenModal } from "@/store/features/modal/modalSlice";
import Spinner from "@/components/Spinner";

type ResendEmailContainerProp = {
email: string;
setContainerState: Dispatch<SetStateAction<ContainerState>>;
};

function EmailCheckContainer({
email,
setContainerState,
}: ResendEmailContainerProp) {
const dispatch = useAppDispatch();

const {
runAction: resetPwdReqEmailAction,
isLoading: resetPwdReqEmailLoading,
setIsLoading: setResetPwdReqEmailLoading,
} = useServerAction(resetPasswordRequestEmail);

async function handleResendEmail() {
const [, error] = await resetPwdReqEmailAction(email);

if (error) {
dispatch(
onOpenModal({ type: "error", content: { message: error.message } }),
);
}

setResetPwdReqEmailLoading(false);
}

function renderButtonContent() {
if (resetPwdReqEmailLoading) {
return <Spinner />;
}
return "Resend Email";
}

function handleClick() {
setContainerState(ContainerState.SignIn);
}

function EmailCheckContainer() {
return (
<div className="flex flex-col items-center w-[400px] min-h-[652px] bg-base-200 rounded-2xl xl:ml-60 px-6 py-9">
<p className="text-base-300 text-2xl text-center mb-[26px] font-medium">
Welcome to Chingu
Reset Link Sent
</p>
<div
data-hide-on-theme="dark"
className="flex h-[171px] w-[168px] relative shrink-0"
>
<Image
src="/img/link_retro_mac_light.png"
alt="Light login image"
fill={true}
style={{ objectFit: "contain" }}
priority={true}
/>
</div>
<div
data-hide-on-theme="light"
className="flex h-[171px] w-[168px] relative shrink-0"
>
<Image
src="/img/link_retro_mac_dark.png"
alt="Light login image"
fill={true}
style={{ objectFit: "contain" }}
priority={true}
<div>
<Banner
imageLight="/img/link_retro_mac_light.png"
imageDark="/img/link_retro_mac_dark.png"
height="h-[171px]"
width="w-[168px]"
alt="Email confirmation image"
/>
</div>
<div className="flex flex-col items-center">
<p className="text-base-300 text-xl font-medium mt-8">
<p className="text-base-300 text-xl font-medium mt-8 mb-2">
Check Your Email Address
</p>
<p className="text-base-300 text-base font-medium">
If that email address exists, we will send an email to it with a link
to reset your password. Please open it and click on the link in it to
reset your password.
</p>
<p className="text-base-300 text-base font-medium mt-6 mb-[166px]">
<p className="text-base-300 text-base font-medium mt-6 mb-[60px] 3xl:mb-[166px]">
If you have not received an email shortly, then please check your
spam/trash folders or click the button below to request a new reset
email.
</p>
</div>
<Button
type="button"
title="Resend Email"
className="text-base gap-x-0 border-none font-semibold capitalize bg-base-100 text-base-300 hover:bg-base-100 w-full"
onClick={handleResendEmail}
variant="outline"
className="w-full"
>
Resend Email
{renderButtonContent()}
</Button>
<Button type="button" variant="link" onClick={handleClick}>
Go Back
</Button>
</div>
);
Expand Down
75 changes: 0 additions & 75 deletions src/app/(auth)/sign-in/components/NewPasswordContainer.tsx

This file was deleted.

Loading
Loading