Skip to content

Commit

Permalink
Hide enable button if user isn't an admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ashley-o0o committed Dec 13, 2024
1 parent d20dcee commit c763d7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/pages/exploreApplication/GetStartedPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' +
Expand All @@ -38,13 +39,14 @@ const GetStartedPanel: React.FC<GetStartedPanelProps> = ({ 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 = (
Expand Down

0 comments on commit c763d7a

Please sign in to comment.