= (props) => {
Are you sure you want to delete issue{" "}
- {data?.project_detail.identifier}-{data?.sequence_id}
+ {data?.project_detail?.identifier}-{data?.sequence_id}
{""}? All of the data related to the issue will be permanently removed. This action cannot be
undone.
diff --git a/web/components/issues/form.tsx b/web/components/issues/form.tsx
index 86972a024..eff3b6193 100644
--- a/web/components/issues/form.tsx
+++ b/web/components/issues/form.tsx
@@ -228,7 +228,7 @@ export const IssueForm: FC = observer((props) => {
...defaultValues,
...initialData,
});
- }, [setFocus, initialData, reset]);
+ }, [setFocus, reset]);
// update projectId in form when projectId changes
useEffect(() => {
diff --git a/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx b/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx
index 756a8489b..d2b93910c 100644
--- a/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx
+++ b/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx
@@ -7,14 +7,28 @@ import { useMobxStore } from "lib/mobx/store-provider";
import { CalendarChart } from "components/issues";
// types
import { IIssue } from "types";
-import { ICycleIssuesStore, IModuleIssuesStore, IProjectIssuesStore, IViewIssuesStore } from "store/issues";
-import { IIssueCalendarViewStore, IssueStore } from "store/issue";
+import {
+ ICycleIssuesFilterStore,
+ ICycleIssuesStore,
+ IModuleIssuesFilterStore,
+ IModuleIssuesStore,
+ IProjectIssuesFilterStore,
+ IProjectIssuesStore,
+ IViewIssuesFilterStore,
+ IViewIssuesStore,
+} from "store/issues";
+import { IIssueCalendarViewStore } from "store/issue";
import { IQuickActionProps } from "../list/list-view-types";
import { EIssueActions } from "../types";
import { IGroupedIssues } from "store/issues/types";
interface IBaseCalendarRoot {
issueStore: IProjectIssuesStore | IModuleIssuesStore | ICycleIssuesStore | IViewIssuesStore;
+ issuesFilterStore:
+ | IProjectIssuesFilterStore
+ | IModuleIssuesFilterStore
+ | ICycleIssuesFilterStore
+ | IViewIssuesFilterStore;
calendarViewStore: IIssueCalendarViewStore;
QuickActions: FC;
issueActions: {
@@ -26,10 +40,9 @@ interface IBaseCalendarRoot {
}
export const BaseCalendarRoot = observer((props: IBaseCalendarRoot) => {
- const { issueStore, calendarViewStore, QuickActions, issueActions, viewId } = props;
- const { projectIssuesFilter: issueFilterStore } = useMobxStore();
+ const { issueStore, issuesFilterStore, calendarViewStore, QuickActions, issueActions, viewId } = props;
- const displayFilters = issueFilterStore.issueFilters?.displayFilters;
+ const displayFilters = issuesFilterStore.issueFilters?.displayFilters;
const issues = issueStore.getIssues;
const groupedIssueIds = (issueStore.getIssuesIds ?? {}) as IGroupedIssues;
@@ -75,7 +88,7 @@ export const BaseCalendarRoot = observer((props: IBaseCalendarRoot) => {
}
handleRemoveFromView={
issueActions[EIssueActions.REMOVE]
- ? async () => handleIssues(issue.target_date ?? "", issue, EIssueActions.UPDATE)
+ ? async () => handleIssues(issue.target_date ?? "", issue, EIssueActions.REMOVE)
: undefined
}
/>
diff --git a/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx b/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx
index 7dff4533e..60339acf8 100644
--- a/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx
+++ b/web/components/issues/issue-layouts/calendar/roots/cycle-root.tsx
@@ -10,7 +10,11 @@ import { EIssueActions } from "../../types";
import { BaseCalendarRoot } from "../base-calendar-root";
export const CycleCalendarLayout: React.FC = observer(() => {
- const { cycleIssues: cycleIssueStore, cycleIssueCalendarView: cycleIssueCalendarViewStore } = useMobxStore();
+ const {
+ cycleIssues: cycleIssueStore,
+ cycleIssuesFilter: cycleIssueFilterStore,
+ cycleIssueCalendarView: cycleIssueCalendarViewStore,
+ } = useMobxStore();
const router = useRouter();
const { workspaceSlug, cycleId } = router.query as { workspaceSlug: string; cycleId: string };
@@ -34,6 +38,7 @@ export const CycleCalendarLayout: React.FC = observer(() => {
return (
{
- const { moduleIssues: moduleIssueStore, moduleIssueCalendarView: moduleIssueCalendarViewStore } = useMobxStore();
+ const {
+ moduleIssues: moduleIssueStore,
+ moduleIssuesFilter: moduleIssueFilterStore,
+ moduleIssueCalendarView: moduleIssueCalendarViewStore,
+ } = useMobxStore();
const router = useRouter();
const { workspaceSlug, moduleId } = router.query as { workspaceSlug: string; moduleId: string };
@@ -33,6 +37,7 @@ export const ModuleCalendarLayout: React.FC = observer(() => {
return (
{
const {
projectIssues: issueStore,
issueCalendarView: issueCalendarViewStore,
- issueDetail: issueDetailStore,
+ projectIssuesFilter: projectIssueFiltersStore,
} = useMobxStore();
const issueActions = {
[EIssueActions.UPDATE]: async (issue: IIssue) => {
if (!workspaceSlug) return;
- issueDetailStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue);
+ issueStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue);
},
[EIssueActions.DELETE]: async (issue: IIssue) => {
if (!workspaceSlug) return;
- issueDetailStore.deleteIssue(workspaceSlug.toString(), issue.project, issue.id);
+ issueStore.removeIssue(workspaceSlug.toString(), issue.project, issue.id);
},
};
return (
{
const {
viewIssues: projectViewIssuesStore,
- issueDetail: issueDetailStore,
+ viewIssuesFilter: projectIssueViewFiltersStore,
projectViewIssueCalendarView: projectViewIssueCalendarViewStore,
} = useMobxStore();
@@ -25,18 +23,19 @@ export const ProjectViewCalendarLayout: React.FC = observer(() => {
[EIssueActions.UPDATE]: async (issue: IIssue) => {
if (!workspaceSlug) return;
- issueDetailStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue);
+ projectViewIssuesStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue);
},
[EIssueActions.DELETE]: async (issue: IIssue) => {
if (!workspaceSlug) return;
- issueDetailStore.deleteIssue(workspaceSlug.toString(), issue.project, issue.id);
+ projectViewIssuesStore.removeIssue(workspaceSlug.toString(), issue.project, issue.id);
},
};
return (
= observer((props) => {
// states
const [cycleIssuesListModal, setCycleIssuesListModal] = useState(false);
- const { cycleIssue: cycleIssueStore, commandPalette: commandPaletteStore, trackEvent: { setTrackElement } } = useMobxStore();
+ const {
+ cycleIssue: cycleIssueStore,
+ commandPalette: commandPaletteStore,
+ trackEvent: { setTrackElement },
+ } = useMobxStore();
const { setToastAlert } = useToast();
@@ -63,9 +68,9 @@ export const CycleEmptyState: React.FC = observer((props) => {
text: "New issue",
icon: ,
onClick: () => {
- setTrackElement("CYCLE_EMPTY_STATE")
- commandPaletteStore.toggleCreateIssueModal(true)
- }
+ setTrackElement("CYCLE_EMPTY_STATE");
+ commandPaletteStore.toggleCreateIssueModal(true, EProjectStore.CYCLE);
+ },
}}
secondaryButton={