From 662b4970820a0b26f8ed4c80b0af91d0312c6496 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:29:59 +0530 Subject: [PATCH 1/5] fix: create issue modal project select (#3549) --- web/components/issues/issue-modal/modal.tsx | 22 ++++++++------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/web/components/issues/issue-modal/modal.tsx b/web/components/issues/issue-modal/modal.tsx index da13e6353..4dfee1ea2 100644 --- a/web/components/issues/issue-modal/modal.tsx +++ b/web/components/issues/issue-modal/modal.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react"; import { observer } from "mobx-react-lite"; import { Dialog, Transition } from "@headlessui/react"; // hooks -import { useApplication, useCycle, useIssues, useModule, useProject, useUser, useWorkspace } from "hooks/store"; +import { useApplication, useCycle, useIssues, useModule, useProject, useWorkspace } from "hooks/store"; import useToast from "hooks/use-toast"; import useLocalStorage from "hooks/use-local-storage"; // components @@ -32,7 +32,6 @@ export const CreateUpdateIssueModal: React.FC = observer((prop const { eventTracker: { postHogEventTracker }, } = useApplication(); - const { currentUser } = useUser(); const { router: { workspaceSlug, projectId, cycleId, moduleId, viewId: projectViewId }, } = useApplication(); @@ -49,27 +48,22 @@ export const CreateUpdateIssueModal: React.FC = observer((prop const issueStores = { [EIssuesStoreType.PROJECT]: { store: projectIssues, - dataIdToUpdate: activeProjectId, viewId: undefined, }, [EIssuesStoreType.PROJECT_VIEW]: { store: viewIssues, - dataIdToUpdate: activeProjectId, viewId: projectViewId, }, [EIssuesStoreType.PROFILE]: { store: profileIssues, - dataIdToUpdate: currentUser?.id || undefined, viewId: undefined, }, [EIssuesStoreType.CYCLE]: { store: cycleIssues, - dataIdToUpdate: activeProjectId, viewId: cycleId, }, [EIssuesStoreType.MODULE]: { store: moduleIssues, - dataIdToUpdate: activeProjectId, viewId: moduleId, }, }; @@ -78,7 +72,7 @@ export const CreateUpdateIssueModal: React.FC = observer((prop // local storage const { setValue: setLocalStorageDraftIssue } = useLocalStorage("draftedIssue", {}); // current store details - const { store: currentIssueStore, viewId, dataIdToUpdate } = issueStores[storeType]; + const { store: currentIssueStore, viewId } = issueStores[storeType]; useEffect(() => { // if modal is closed, reset active project to null @@ -129,13 +123,13 @@ export const CreateUpdateIssueModal: React.FC = observer((prop }; const handleCreateIssue = async (payload: Partial): Promise => { - if (!workspaceSlug || !dataIdToUpdate) return; + if (!workspaceSlug || !payload.project_id) return; try { - const response = await currentIssueStore.createIssue(workspaceSlug, dataIdToUpdate, payload, viewId); + const response = await currentIssueStore.createIssue(workspaceSlug, payload.project_id, payload, viewId); if (!response) throw new Error(); - currentIssueStore.fetchIssues(workspaceSlug, dataIdToUpdate, "mutation", viewId); + currentIssueStore.fetchIssues(workspaceSlug, payload.project_id, "mutation", viewId); if (payload.cycle_id && payload.cycle_id !== "" && storeType !== EIssuesStoreType.CYCLE) await addIssueToCycle(response, payload.cycle_id); @@ -182,10 +176,10 @@ export const CreateUpdateIssueModal: React.FC = observer((prop }; const handleUpdateIssue = async (payload: Partial): Promise => { - if (!workspaceSlug || !dataIdToUpdate || !data?.id) return; + if (!workspaceSlug || !payload.project_id || !data?.id) return; try { - const response = await currentIssueStore.updateIssue(workspaceSlug, dataIdToUpdate, data.id, payload, viewId); + const response = await currentIssueStore.updateIssue(workspaceSlug, payload.project_id, data.id, payload, viewId); setToastAlert({ type: "success", title: "Success!", @@ -226,7 +220,7 @@ export const CreateUpdateIssueModal: React.FC = observer((prop }; const handleFormSubmit = async (formData: Partial) => { - if (!workspaceSlug || !dataIdToUpdate || !storeType) return; + if (!workspaceSlug || !formData.project_id || !storeType) return; const payload: Partial = { ...formData, From 2eab3b41a24048d0bd6c147f378736e622472c14 Mon Sep 17 00:00:00 2001 From: Ramesh Kumar Chandra <31303617+rameshkumarchandra@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:49:42 +0530 Subject: [PATCH 2/5] chore: responsive and styling fixes (#3541) --- packages/ui/src/icons/priority-icon.tsx | 1 + .../account/deactivate-account-modal.tsx | 4 ++-- .../widgets/dropdowns/duration-filter.tsx | 10 +++++----- .../widgets/issue-panels/issues-list.tsx | 2 +- .../dashboard/widgets/overview-stats.tsx | 15 ++++++++++++--- web/components/headers/workspace-dashboard.tsx | 2 +- web/layouts/app-layout/sidebar.tsx | 2 +- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/packages/ui/src/icons/priority-icon.tsx b/packages/ui/src/icons/priority-icon.tsx index 0b98b3e6b..caa821305 100644 --- a/packages/ui/src/icons/priority-icon.tsx +++ b/packages/ui/src/icons/priority-icon.tsx @@ -47,6 +47,7 @@ export const PriorityIcon: React.FC = (props) => { > = (props) => {
-
-