From 1872dff00d99c1731bec1363494fa23340b7c71e Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 8 Sep 2023 13:28:32 +0530 Subject: [PATCH 01/45] fix: custom date filter not working on my issues and profile issues (#2123) --- .../core/filters/date-filter-modal.tsx | 45 +++++++++---------- .../my-issues/my-issues-select-filters.tsx | 4 +- web/components/views/select-filters.tsx | 4 +- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/web/components/core/filters/date-filter-modal.tsx b/web/components/core/filters/date-filter-modal.tsx index abc2cc7c4..eb285fd6f 100644 --- a/web/components/core/filters/date-filter-modal.tsx +++ b/web/components/core/filters/date-filter-modal.tsx @@ -1,15 +1,11 @@ import { Fragment } from "react"; -import { useRouter } from "next/router"; - // react-hook-form import { Controller, useForm } from "react-hook-form"; // react-datepicker import DatePicker from "react-datepicker"; // headless ui import { Dialog, Transition } from "@headlessui/react"; -// hooks -import useIssuesView from "hooks/use-issues-view"; // components import { DateFilterSelect } from "./date-filter-select"; // ui @@ -23,8 +19,10 @@ import { IIssueFilterOptions } from "types"; type Props = { title: string; field: keyof IIssueFilterOptions; - isOpen: boolean; + filters: IIssueFilterOptions; handleClose: () => void; + isOpen: boolean; + onSelect: (option: any) => void; }; type TFormValues = { @@ -39,12 +37,14 @@ const defaultValues: TFormValues = { date2: new Date(new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()), }; -export const DateFilterModal: React.FC = ({ title, field, isOpen, handleClose }) => { - const { filters, setFilters } = useIssuesView(); - - const router = useRouter(); - const { viewId } = router.query; - +export const DateFilterModal: React.FC = ({ + title, + field, + filters, + handleClose, + isOpen, + onSelect, +}) => { const { handleSubmit, watch, control } = useForm({ defaultValues, }); @@ -53,10 +53,10 @@ export const DateFilterModal: React.FC = ({ title, field, isOpen, handleC const { filterType, date1, date2 } = formData; if (filterType === "range") { - setFilters( - { [field]: [`${renderDateFormat(date1)};after`, `${renderDateFormat(date2)};before`] }, - !Boolean(viewId) - ); + onSelect({ + key: field, + value: [`${renderDateFormat(date1)};after`, `${renderDateFormat(date2)};before`], + }); } else { const filteredArray = (filters?.[field] as string[])?.filter((item) => { if (item?.includes(filterType)) return false; @@ -66,17 +66,12 @@ export const DateFilterModal: React.FC = ({ title, field, isOpen, handleC const filterOne = filteredArray && filteredArray?.length > 0 ? filteredArray[0] : null; if (filterOne) - setFilters( - { [field]: [filterOne, `${renderDateFormat(date1)};${filterType}`] }, - !Boolean(viewId) - ); + onSelect({ key: field, value: [filterOne, `${renderDateFormat(date1)};${filterType}`] }); else - setFilters( - { - [field]: [`${renderDateFormat(date1)};${filterType}`], - }, - !Boolean(viewId) - ); + onSelect({ + key: field, + value: [`${renderDateFormat(date1)};${filterType}`], + }); } handleClose(); }; diff --git a/web/components/issues/my-issues/my-issues-select-filters.tsx b/web/components/issues/my-issues/my-issues-select-filters.tsx index 58cc63679..a453abb14 100644 --- a/web/components/issues/my-issues/my-issues-select-filters.tsx +++ b/web/components/issues/my-issues/my-issues-select-filters.tsx @@ -61,8 +61,10 @@ export const MyIssuesSelectFilters: React.FC = ({ setIsDateFilterModalOpen(false)} + isOpen={isDateFilterModalOpen} + onSelect={onSelect} /> )} = ({ setIsDateFilterModalOpen(false)} + isOpen={isDateFilterModalOpen} + onSelect={onSelect} /> )} Date: Fri, 8 Sep 2023 13:29:06 +0530 Subject: [PATCH 02/45] fix: handleClose function of the export modal (#2124) --- web/components/exporter/guide.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/exporter/guide.tsx b/web/components/exporter/guide.tsx index dd6fab9dc..67b7c6d4d 100644 --- a/web/components/exporter/guide.tsx +++ b/web/components/exporter/guide.tsx @@ -41,7 +41,7 @@ const IntegrationGuide = () => { ); const handleCsvClose = () => { - router.replace(`/plane/settings/exports`); + router.replace(`/${workspaceSlug?.toString()}/settings/exports`); }; return ( From ad8a011bb9ff7938e787c3024ac5d93b5f4bd446 Mon Sep 17 00:00:00 2001 From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:44:16 +0530 Subject: [PATCH 03/45] fix: issue activity (#2127) --- web/components/web-view/activity-message.tsx | 419 ++++++++++++++++++ web/components/web-view/index.ts | 1 + web/components/web-view/issue-activity.tsx | 21 +- .../web-view/issue-web-view-form.tsx | 2 +- web/components/web-view/web-view-modal.tsx | 2 +- web/layouts/web-view-layout/index.tsx | 5 +- 6 files changed, 435 insertions(+), 15 deletions(-) create mode 100644 web/components/web-view/activity-message.tsx diff --git a/web/components/web-view/activity-message.tsx b/web/components/web-view/activity-message.tsx new file mode 100644 index 000000000..956dfb904 --- /dev/null +++ b/web/components/web-view/activity-message.tsx @@ -0,0 +1,419 @@ +import { useRouter } from "next/router"; + +// icons +import { Icon, Tooltip } from "components/ui"; +import { Squares2X2Icon } from "@heroicons/react/24/outline"; +import { BlockedIcon, BlockerIcon } from "components/icons"; +// helpers +import { renderShortDateWithYearFormat } from "helpers/date-time.helper"; +import { capitalizeFirstLetter } from "helpers/string.helper"; +// types +import { IIssueActivity } from "types"; + +const IssueLink = ({ activity }: { activity: IIssueActivity }) => ( + + + +); + +const UserLink = ({ activity }: { activity: IIssueActivity }) => ( + +); + +const activityDetails: { + [key: string]: { + message: ( + activity: IIssueActivity, + showIssue: boolean, + workspaceSlug: string + ) => React.ReactNode; + icon: React.ReactNode; + }; +} = { + assignees: { + message: (activity, showIssue) => ( + <> + {activity.old_value === "" ? "added a new assignee " : "removed the assignee "} + + {showIssue && ( + <> + {" "} + to + + )} + . + + ), + icon: