Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

chore: Active cycle muatation when current cycle creation when current_date is in between start_date and end_date (#5050)

guru_sainath156f1011f319
diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx
index 9cebd29ce9..5c046d95c1 100644
--- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx
+++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx
@@ -98,4 +98,4 @@ const ProjectCyclesPage = observer(() => {
);
});
-export default ProjectCyclesPage;
\ No newline at end of file
+export default ProjectCyclesPage;
diff --git a/web/core/components/cycles/modal.tsx b/web/core/components/cycles/modal.tsx
index c6f78a2567..ab01104670 100644
--- a/web/core/components/cycles/modal.tsx
+++ b/web/core/components/cycles/modal.tsx
@@ -1,6 +1,7 @@
"use client";
import React, { useEffect, useState } from "react";
+import { mutate } from "swr";
// types
import type { CycleDateCheckData, ICycle, TCycleTabOptions } from "@plane/types";
// ui
@@ -43,6 +44,16 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
const selectedProjectId = payload.project_id ?? projectId.toString();
await createCycle(workspaceSlug, selectedProjectId, payload)
.then((res) => {
+ // mutate when the current cycle creation is active
+ if (payload.start_date && payload.end_date) {
+ const currentDate = new Date();
+ const cycleStartDate = new Date(payload.start_date);
+ const cycleEndDate = new Date(payload.end_date);
+ if (currentDate >= cycleStartDate && currentDate <= cycleEndDate) {
+ mutate(`PROJECT_ACTIVE_CYCLE_${selectedProjectId}`);
+ }
+ }
+
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",