From c763d7a358bb554684035bd6ff7312e4956f16b8 Mon Sep 17 00:00:00 2001 From: Ashley McEntee <123661468+ashley-o0o@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:55:17 -0500 Subject: [PATCH] Hide enable button if user isn't an admin --- frontend/src/pages/exploreApplication/GetStartedPanel.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/exploreApplication/GetStartedPanel.tsx b/frontend/src/pages/exploreApplication/GetStartedPanel.tsx index 6f9da12fa0..5fe67b0738 100644 --- a/frontend/src/pages/exploreApplication/GetStartedPanel.tsx +++ b/frontend/src/pages/exploreApplication/GetStartedPanel.tsx @@ -22,6 +22,7 @@ import { markdownConverter } from '~/utilities/markdown'; import { useAppContext } from '~/app/AppContext'; import { fireMiscTrackingEvent } from '~/concepts/analyticsTracking/segmentIOUtils'; import { useIntegratedAppStatus } from '~/pages/exploreApplication/useIntegratedAppStatus'; +import { useUser } from '~/redux/selectors'; const DEFAULT_BETA_TEXT = 'This application is available for early access prior to official ' + @@ -38,13 +39,14 @@ const GetStartedPanel: React.FC = ({ selectedApp, onClose, const { dashboardConfig } = useAppContext(); const { enablement } = dashboardConfig.spec.dashboardConfig; const [{ isInstalled, canInstall, error }, loaded] = useIntegratedAppStatus(selectedApp); + const { isAdmin } = useUser(); if (!selectedApp) { return null; } const renderEnableButton = () => { - if (!selectedApp.spec.enable || selectedApp.spec.isEnabled || isInstalled) { + if (!selectedApp.spec.enable || selectedApp.spec.isEnabled || isInstalled || !isAdmin) { return null; } const button = (