From f01dc8b6dd9bd173899ea808db7b2f9c6d4e5f56 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Tue, 25 Mar 2025 20:31:03 +0530 Subject: [PATCH] [RANTS-74] fix: hide disabled features from work item bulk operations toolbar (#2799) --- .../components/issues/bulk-operations/properties.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/ee/components/issues/bulk-operations/properties.tsx b/web/ee/components/issues/bulk-operations/properties.tsx index 9369410c50..56c1c67eaa 100644 --- a/web/ee/components/issues/bulk-operations/properties.tsx +++ b/web/ee/components/issues/bulk-operations/properties.tsx @@ -27,7 +27,7 @@ import { CreateLabelModal } from "@/components/labels"; // helpers import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper"; // hooks -import { useProjectEstimates } from "@/hooks/store"; +import { useProject, useProjectEstimates } from "@/hooks/store"; import { useIssuesStore } from "@/hooks/use-issue-layout-store"; import { TSelectionHelper, TSelectionSnapshot } from "@/hooks/use-multiple-select"; import { IssueTypeDropdown, TIssueTypeOptionTooltip } from "@/plane-web/components/issue-types/dropdowns"; @@ -63,12 +63,16 @@ export const IssueBulkOperationsProperties: React.FC = observer((props) = // plane imports const { t } = useTranslation(); // store hooks + const { getProjectById } = useProject(); const { issues: { bulkUpdateProperties }, } = useIssuesStore(); const { currentActiveEstimateId, areEstimateEnabledByProjectId } = useProjectEstimates(); const { isWorkItemTypeEnabledForProject, getIssueTypeIdsWithMandatoryProperties } = useIssueTypes(); // derived values + const projectDetails = projectId ? getProjectById(projectId.toString()) : undefined; + const isCyclesEnabled = !!projectDetails?.cycle_view; + const isModulesEnabled = !!projectDetails?.module_view; const isAdvancedBulkOpsEnabled = useFlag(workspaceSlug?.toString(), "BULK_OPS_PRO"); const isWorkItemTypeEnabled = isWorkItemTypeEnabledForProject(workspaceSlug?.toString(), projectId?.toString()); // Get issue types with mandatory properties @@ -264,7 +268,7 @@ export const IssueBulkOperationsProperties: React.FC = observer((props) = )} {isAdvancedBulkOpsEnabled && ( <> - {projectId && ( + {projectId && isCyclesEnabled && ( = observer((props) = )} /> )} - {projectId && ( + {projectId && isModulesEnabled && (