From a8fdd42cb935427e8281423915fa1ccea998d306 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:43:09 +0530 Subject: [PATCH 1/2] fix: label color select popover overflow (#1949) Co-authored-by: Aaryan Khandelwal --- .../components/issues/sidebar-select/label.tsx | 17 ++++------------- apps/app/components/issues/sidebar.tsx | 4 ++-- .../projects/[projectId]/issues/[issueId].tsx | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/apps/app/components/issues/sidebar-select/label.tsx b/apps/app/components/issues/sidebar-select/label.tsx index 5f3539c86..3ac2f552e 100644 --- a/apps/app/components/issues/sidebar-select/label.tsx +++ b/apps/app/components/issues/sidebar-select/label.tsx @@ -17,13 +17,7 @@ import useUser from "hooks/use-user"; // ui import { Input, Spinner } from "components/ui"; // icons -import { - ChevronDownIcon, - PlusIcon, - RectangleGroupIcon, - TagIcon, - XMarkIcon, -} from "@heroicons/react/24/outline"; +import { PlusIcon, RectangleGroupIcon, TagIcon, XMarkIcon } from "@heroicons/react/24/outline"; // types import { IIssue, IIssueLabels } from "types"; // fetch-keys @@ -281,18 +275,15 @@ export const SidebarLabelSelect: React.FC = ({ {({ open }) => ( <> - + {watch("color") && watch("color") !== "" && ( )} - = ({ leaveFrom="opacity-100 translate-y-0" leaveTo="opacity-0 translate-y-1" > - + = ({ user={user} />
-
+

{issueDetail?.project_detail?.identifier}-{issueDetail?.sequence_id}

@@ -327,7 +327,7 @@ export const IssueDetailsSidebar: React.FC = ({
-
+
{showFirstSection && (
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx index be76d28e3..916c0141e 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx @@ -148,7 +148,7 @@ const IssueDetailsPage: NextPage = () => {
-
+
Date: Wed, 23 Aug 2023 15:44:27 +0530 Subject: [PATCH 2/2] fix: mutate projects list after joining (#1944) Co-authored-by: Aaryan Khandelwal --- apps/app/components/project/join-project-modal.tsx | 3 ++- apps/app/components/project/sidebar-list.tsx | 4 ++-- apps/app/pages/[workspaceSlug]/projects/index.tsx | 12 +++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/app/components/project/join-project-modal.tsx b/apps/app/components/project/join-project-modal.tsx index e0517ac6a..3128a0a42 100644 --- a/apps/app/components/project/join-project-modal.tsx +++ b/apps/app/components/project/join-project-modal.tsx @@ -19,6 +19,7 @@ export const JoinProjectModal: React.FC = ({ onClose, on const handleJoin = () => { setIsJoiningLoading(true); + onJoin() .then(() => { setIsJoiningLoading(false); @@ -59,7 +60,7 @@ export const JoinProjectModal: React.FC = ({ onClose, on leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - +
{ const { projects: allProjects } = useProjects(); - const joinedProjects = allProjects?.filter((p) => p.sort_order); + const joinedProjects = allProjects?.filter((p) => p.is_member); const favoriteProjects = allProjects?.filter((p) => p.is_favorite); const orderedJoinedProjects: IProject[] | undefined = joinedProjects @@ -201,7 +201,7 @@ export const ProjectSidebarList: FC = () => { key={project.id} draggableId={project.id} index={index} - isDragDisabled={project.sort_order === null} + isDragDisabled={!project.is_member} > {(provided, snapshot) => (
diff --git a/apps/app/pages/[workspaceSlug]/projects/index.tsx b/apps/app/pages/[workspaceSlug]/projects/index.tsx index 4dd6a234e..5c671e32a 100644 --- a/apps/app/pages/[workspaceSlug]/projects/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/index.tsx @@ -28,6 +28,8 @@ import type { NextPage } from "next"; import { PROJECT_MEMBERS } from "constants/fetch-keys"; // helper import { truncateText } from "helpers/string.helper"; +// types +import { IProject } from "types"; const ProjectsPage: NextPage = () => { // router @@ -39,7 +41,7 @@ const ProjectsPage: NextPage = () => { const { user } = useUserAuth(); // context data const { activeWorkspace } = useWorkspaces(); - const { projects } = useProjects(); + const { projects, mutateProjects } = useProjects(); // states const [deleteProject, setDeleteProject] = useState(null); const [selectedProjectToJoin, setSelectedProjectToJoin] = useState(null); @@ -101,6 +103,14 @@ const ProjectsPage: NextPage = () => { }) .then(async () => { mutate(PROJECT_MEMBERS(project.id)); + mutateProjects( + (prevData) => + (prevData ?? []).map((p) => ({ + ...p, + is_member: p.id === project.id ? true : p.is_member, + })), + false + ); setSelectedProjectToJoin(null); }) .catch(() => {