From 544b70988bb28438b5892ad15fe785a2b8d74adf Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Thu, 2 May 2024 16:24:54 -0400 Subject: [PATCH] DEVPROD-4665 Disable performance plugin selection at repo level (#98) --- .../src/pages/projectSettings/tabs/PluginsTab/PluginsTab.tsx | 1 + .../pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/PluginsTab.tsx b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/PluginsTab.tsx index e2d24fbec..39ad41e05 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/PluginsTab.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/PluginsTab.tsx @@ -21,6 +21,7 @@ export const PluginsTab: React.FC = ({ const formSchema = useMemo( () => getFormSchema( + projectType === ProjectType.Repo, jiraEmail, projectType === ProjectType.AttachedProject ? repoData : null, ), diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx index 61417d3d5..8702c3f8b 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx @@ -32,6 +32,7 @@ const requesters = [ ]; export const getFormSchema = ( + isRepo: boolean, jiraEmail?: string, repoData?: PluginsFormState, ): ReturnType => ({ @@ -225,8 +226,8 @@ export const getFormSchema = ( "ui:ObjectFieldTemplate": CardFieldTemplate, perfEnabled: { "ui:widget": widgets.RadioBoxWidget, - "ui:description": - "Enable the performance plugin (this requires the project to have matching ID and identifier).", + "ui:disabled": isRepo, + "ui:description": `Enable the performance plugin (this requires the project to have matching ID and identifier). ${isRepo && "This setting is disabled at the repo level."}`, }, }, buildBaronSettings: {