From a8d60f3a4d43810ee8816de94bf7c4f9c4730304 Mon Sep 17 00:00:00 2001 From: Timothy Russo Date: Fri, 14 Jun 2024 07:38:46 +0200 Subject: [PATCH 1/7] feat: add disabled links for weekly checkin --- .../components/Calendar/Calendar.logic.ts | 1 + .../components/Calendar/Calendar.tsx | 1 + .../Calendar/components/SprintItem.tsx | 26 ++++++++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/app/(main)/dashboard/components/Calendar/Calendar.logic.ts b/src/app/(main)/dashboard/components/Calendar/Calendar.logic.ts index 2a67d1b7..275fb49f 100644 --- a/src/app/(main)/dashboard/components/Calendar/Calendar.logic.ts +++ b/src/app/(main)/dashboard/components/Calendar/Calendar.logic.ts @@ -195,6 +195,7 @@ export const useCalendarLogic = ( check: sprintsData?.some((day) => isSameDay(new Date(day.endDate), date)), label: "Weekly Check-in Due", link: weeklyCheckInLink(), + isDisabled: isBefore(date, new Date()), }, { id: 3, diff --git a/src/app/(main)/dashboard/components/Calendar/Calendar.tsx b/src/app/(main)/dashboard/components/Calendar/Calendar.tsx index a1efe389..3a5a5e59 100644 --- a/src/app/(main)/dashboard/components/Calendar/Calendar.tsx +++ b/src/app/(main)/dashboard/components/Calendar/Calendar.tsx @@ -176,6 +176,7 @@ export default function Calendar({ title={condition.label} link={condition?.link} useTargetBlank={false} + isDisabled={condition?.isDisabled} /> ) : null, diff --git a/src/app/(main)/dashboard/components/Calendar/components/SprintItem.tsx b/src/app/(main)/dashboard/components/Calendar/components/SprintItem.tsx index 719dd994..2b9800ea 100644 --- a/src/app/(main)/dashboard/components/Calendar/components/SprintItem.tsx +++ b/src/app/(main)/dashboard/components/Calendar/components/SprintItem.tsx @@ -7,25 +7,43 @@ type SprintItemProps = { link: string; time?: string; useTargetBlank?: boolean; + isDisabled?: boolean; }; function SprintItem({ title, link, time, useTargetBlank = true, + isDisabled = false, }: SprintItemProps) { return ( - + isDisabled && e.preventDefault()} + >
{time ? ( - + ) : null} -

+

{title}

- +
); From 52aa464358ce8212311c2ab143253db418b21521 Mon Sep 17 00:00:00 2001 From: Stan Stanislaus Date: Wed, 19 Jun 2024 19:22:58 -0500 Subject: [PATCH 2/7] fix: display CreateIdeationContainer AND text --- .../components/IdeationComponentWrapper.tsx | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx index 3b915bba..a54b4c73 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx @@ -99,63 +99,63 @@ export default async function IdeationComponentWrapper({ ); } - if (projectIdeas.length === 0) { - return ( -
-
-

- Be the First to Share! -

-

- It looks like no one has posted anything yet, but don’t worry, you - can be the first to create a new project idea and vision for your - team! -

-

- Click on the{" "} - - Add Project Idea - {" "} - button at the top to get started! -

-
- -
- ); - } - return ( <> - - {projectIdeas.map((projectIdea) => ( - - } - secondChild={ - + +
+
+

+ Be the First to Share! +

+

+ It looks like no one has posted anything yet, but don’t worry, + you can be the first to create a new project idea and vision + for your team! +

+

+ Click on the + + Add Project Idea + + button at the top to get started! +

+
+ - } - /> - ))} +
+ + ) : ( + projectIdeas.map((projectIdea) => ( + + } + secondChild={ + + } + /> + )) + )} ); } From a992771c75b1d827a239bd84d5495a7f58b308d8 Mon Sep 17 00:00:00 2001 From: Stan Stanislaus Date: Wed, 19 Jun 2024 19:41:51 -0500 Subject: [PATCH 3/7] refactor: move subComponents below IdeationWrapper --- .../components/IdeationComponentWrapper.tsx | 25 ++++++++++--------- .../AddProjectIdeaButton.tsx | 0 .../{ => dependencies}/ContributionCard.tsx | 0 .../CreateIdeationContainer.tsx | 0 .../FinalizeIdeationButton.tsx | 0 .../FinalizedIdeationCard.tsx | 0 .../{ => dependencies}/IdeationContainer.tsx | 0 .../{ => dependencies}/IdeationProvider.tsx | 0 .../{ => dependencies}/VoteCard.tsx | 0 .../VoteDescriptionCard.tsx | 0 .../my-voyage/[teamId]/ideation/page.tsx | 2 +- 11 files changed, 14 insertions(+), 13 deletions(-) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/AddProjectIdeaButton.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/ContributionCard.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/CreateIdeationContainer.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/FinalizeIdeationButton.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/FinalizedIdeationCard.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/IdeationContainer.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/IdeationProvider.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/VoteCard.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{ => dependencies}/VoteDescriptionCard.tsx (100%) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx index a54b4c73..6f8fe443 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx @@ -1,21 +1,22 @@ import { redirect } from "next/navigation"; -import IdeationContainer from "./IdeationContainer"; -import IdeationProvider from "./IdeationProvider"; -import CreateIdeationContainer from "./CreateIdeationContainer"; -import ContributionCard from "./ContributionCard"; -import VoteCard from "./VoteCard"; -import FinalizedIdeationCard from "./FinalizedIdeationCard"; +import ContributionCard from "./dependencies/ContributionCard"; +import CreateIdeationContainer from "./dependencies/CreateIdeationContainer"; +import FinalizedIdeationCard from "./dependencies/FinalizedIdeationCard"; +import IdeationContainer from "./dependencies/IdeationContainer"; +import IdeationProvider from "./dependencies/IdeationProvider"; +import VoteCard from "./dependencies/VoteCard"; import { type FetchIdeationsProps } from "@/app/(main)/my-voyage/[teamId]/ideation/ideationService"; -import { type IdeationData } from "@/store/features/ideation/ideationSlice"; -import { getAccessToken } from "@/utils/getCookie"; -import { GET } from "@/utils/requests"; import Banner from "@/components/banner/Banner"; -import { type AsyncActionResponse, handleAsync } from "@/utils/handleAsync"; -import { CacheTag } from "@/utils/cacheTag"; import VoyagePageBannerContainer from "@/components/banner/VoyagePageBannerContainer"; +import { type IdeationData } from "@/store/features/ideation/ideationSlice"; +import { CacheTag } from "@/utils/cacheTag"; +import { getAccessToken } from "@/utils/getCookie"; import { getCurrentVoyageData } from "@/utils/getCurrentVoyageData"; -import routePaths from "@/utils/routePaths"; import { getUser } from "@/utils/getUser"; +import { handleAsync, type AsyncActionResponse } from "@/utils/handleAsync"; +import { GET } from "@/utils/requests"; +import routePaths from "@/utils/routePaths"; + // import { ideation } from "./fixtures/ideation"; // If user is not logged in, nav should be updated to reflect signed out state diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/AddProjectIdeaButton.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/AddProjectIdeaButton.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/AddProjectIdeaButton.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/AddProjectIdeaButton.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/ContributionCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/ContributionCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/ContributionCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/ContributionCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/CreateIdeationContainer.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/CreateIdeationContainer.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/CreateIdeationContainer.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/CreateIdeationContainer.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizeIdeationButton.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizeIdeationButton.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizeIdeationButton.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizeIdeationButton.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizedIdeationCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizedIdeationCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizedIdeationCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizedIdeationCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationContainer.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationContainer.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationContainer.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationContainer.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationProvider.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationProvider.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationProvider.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationProvider.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteDescriptionCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteDescriptionCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/VoteDescriptionCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteDescriptionCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx index a1b702db..35917b95 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx @@ -1,6 +1,6 @@ +import Spinner from "@/components/Spinner"; import { Suspense } from "react"; import IdeationComponentWrapper from "./components/IdeationComponentWrapper"; -import Spinner from "@/components/Spinner"; interface IdeationPageProps { params: { From b79d8559a101e19bfefc2600eec1869ec053bbfc Mon Sep 17 00:00:00 2001 From: Stan Stanislaus Date: Wed, 19 Jun 2024 19:43:34 -0500 Subject: [PATCH 4/7] # (use "git push" to publish your local commits) --- src/app/(main)/my-voyage/[teamId]/ideation/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx index 35917b95..6c9a42a4 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx @@ -1,6 +1,6 @@ +import IdeationComponentWrapper from "./components/IdeationComponentWrapper"; import Spinner from "@/components/Spinner"; import { Suspense } from "react"; -import IdeationComponentWrapper from "./components/IdeationComponentWrapper"; interface IdeationPageProps { params: { From ff839db66137bcd8ebb329ef19dcf9e486802614 Mon Sep 17 00:00:00 2001 From: Stan Stanislaus Date: Wed, 19 Jun 2024 19:44:20 -0500 Subject: [PATCH 5/7] chore: reorder imports to satisfy lint --- src/app/(main)/my-voyage/[teamId]/ideation/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx index 6c9a42a4..a1b702db 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/page.tsx @@ -1,6 +1,6 @@ +import { Suspense } from "react"; import IdeationComponentWrapper from "./components/IdeationComponentWrapper"; import Spinner from "@/components/Spinner"; -import { Suspense } from "react"; interface IdeationPageProps { params: { From 74c25b5857c6f2ef07ac0175a9f2ea071b22812d Mon Sep 17 00:00:00 2001 From: Stan Stanislaus Date: Wed, 19 Jun 2024 20:26:35 -0500 Subject: [PATCH 6/7] fix: add spaces around styled phrase --- .../[teamId]/ideation/components/IdeationComponentWrapper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx index 6f8fe443..75eccd3d 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx @@ -116,10 +116,10 @@ export default async function IdeationComponentWrapper({ for your team!

- Click on the + Click on the{" "} Add Project Idea - + {" "} button at the top to get started!

From 30eac7e6fcff74ae82aae288240cef9a5145fa31 Mon Sep 17 00:00:00 2001 From: biometricPsychography Date: Thu, 20 Jun 2024 13:14:59 -0500 Subject: [PATCH 7/7] refactor: keep deps w/ IdeationComponentWrapper That is, keep them as file siblings and not in a sub folder --- .../{dependencies => }/AddProjectIdeaButton.tsx | 0 .../{dependencies => }/ContributionCard.tsx | 0 .../{dependencies => }/CreateIdeationContainer.tsx | 0 .../{dependencies => }/FinalizeIdeationButton.tsx | 0 .../{dependencies => }/FinalizedIdeationCard.tsx | 0 .../ideation/components/IdeationComponentWrapper.tsx | 12 ++++++------ .../{dependencies => }/IdeationContainer.tsx | 0 .../{dependencies => }/IdeationProvider.tsx | 0 .../components/{dependencies => }/VoteCard.tsx | 0 .../{dependencies => }/VoteDescriptionCard.tsx | 0 10 files changed, 6 insertions(+), 6 deletions(-) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/AddProjectIdeaButton.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/ContributionCard.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/CreateIdeationContainer.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/FinalizeIdeationButton.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/FinalizedIdeationCard.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/IdeationContainer.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/IdeationProvider.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/VoteCard.tsx (100%) rename src/app/(main)/my-voyage/[teamId]/ideation/components/{dependencies => }/VoteDescriptionCard.tsx (100%) diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/AddProjectIdeaButton.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/AddProjectIdeaButton.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/AddProjectIdeaButton.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/AddProjectIdeaButton.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/ContributionCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/ContributionCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/ContributionCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/ContributionCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/CreateIdeationContainer.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/CreateIdeationContainer.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/CreateIdeationContainer.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/CreateIdeationContainer.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizeIdeationButton.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizeIdeationButton.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizeIdeationButton.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizeIdeationButton.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizedIdeationCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizedIdeationCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/FinalizedIdeationCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/FinalizedIdeationCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx index 75eccd3d..afe67bc7 100644 --- a/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx +++ b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationComponentWrapper.tsx @@ -1,10 +1,10 @@ import { redirect } from "next/navigation"; -import ContributionCard from "./dependencies/ContributionCard"; -import CreateIdeationContainer from "./dependencies/CreateIdeationContainer"; -import FinalizedIdeationCard from "./dependencies/FinalizedIdeationCard"; -import IdeationContainer from "./dependencies/IdeationContainer"; -import IdeationProvider from "./dependencies/IdeationProvider"; -import VoteCard from "./dependencies/VoteCard"; +import ContributionCard from "./ContributionCard"; +import CreateIdeationContainer from "./CreateIdeationContainer"; +import FinalizedIdeationCard from "./FinalizedIdeationCard"; +import IdeationContainer from "./IdeationContainer"; +import IdeationProvider from "./IdeationProvider"; +import VoteCard from "./VoteCard"; import { type FetchIdeationsProps } from "@/app/(main)/my-voyage/[teamId]/ideation/ideationService"; import Banner from "@/components/banner/Banner"; import VoyagePageBannerContainer from "@/components/banner/VoyagePageBannerContainer"; diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationContainer.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationContainer.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationContainer.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationContainer.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationProvider.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationProvider.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/IdeationProvider.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/IdeationProvider.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/VoteCard.tsx diff --git a/src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteDescriptionCard.tsx b/src/app/(main)/my-voyage/[teamId]/ideation/components/VoteDescriptionCard.tsx similarity index 100% rename from src/app/(main)/my-voyage/[teamId]/ideation/components/dependencies/VoteDescriptionCard.tsx rename to src/app/(main)/my-voyage/[teamId]/ideation/components/VoteDescriptionCard.tsx