mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 23:35:31 +02:00
feat(ui): restrict views by role [EE-6595] (#11010)
This commit is contained in:
parent
437831fa80
commit
f5f84c5fa4
22 changed files with 338 additions and 83 deletions
|
@ -4,7 +4,6 @@ import _ from 'lodash';
|
|||
import { Wand2 } from 'lucide-react';
|
||||
|
||||
import { useAnalytics } from '@/react/hooks/useAnalytics';
|
||||
import { useAdminOnlyRedirect } from '@/react/hooks/useAdminOnlyRedirect';
|
||||
|
||||
import { Button } from '@@/buttons';
|
||||
import { PageHeader } from '@@/PageHeader';
|
||||
|
@ -19,8 +18,6 @@ import {
|
|||
} from './environment-types';
|
||||
|
||||
export function EnvironmentTypeSelectView() {
|
||||
// TODO: move this redirect logic to the router when migrating the router to react
|
||||
useAdminOnlyRedirect();
|
||||
const [types, setTypes] = useState<EnvironmentOptionValue[]>([]);
|
||||
const { trackEvent } = useAnalytics();
|
||||
const router = useRouter();
|
||||
|
|
|
@ -10,7 +10,6 @@ import {
|
|||
EnvironmentId,
|
||||
} from '@/react/portainer/environments/types';
|
||||
import { useAnalytics } from '@/react/hooks/useAnalytics';
|
||||
import { useAdminOnlyRedirect } from '@/react/hooks/useAdminOnlyRedirect';
|
||||
|
||||
import { Stepper } from '@@/Stepper';
|
||||
import { Widget, WidgetBody, WidgetTitle } from '@@/Widget';
|
||||
|
@ -33,8 +32,6 @@ import styles from './EnvironmentsCreationView.module.css';
|
|||
import { WizardEndpointsList } from './WizardEndpointsList';
|
||||
|
||||
export function EnvironmentCreationView() {
|
||||
// TODO: move this redirect logic to the router when migrating the router to react
|
||||
useAdminOnlyRedirect();
|
||||
const {
|
||||
params: { localEndpointId: localEndpointIdParam },
|
||||
} = useCurrentStateAndParams();
|
||||
|
|
|
@ -4,7 +4,6 @@ import { EnvironmentType } from '@/react/portainer/environments/types';
|
|||
import { useAnalytics } from '@/react/hooks/useAnalytics';
|
||||
import DockerIcon from '@/assets/ico/vendor/docker-icon.svg?c';
|
||||
import Kube from '@/assets/ico/kube.svg?c';
|
||||
import { useAdminOnlyRedirect } from '@/react/hooks/useAdminOnlyRedirect';
|
||||
|
||||
import { PageHeader } from '@@/PageHeader';
|
||||
import { Widget, WidgetBody, WidgetTitle } from '@@/Widget';
|
||||
|
@ -16,8 +15,6 @@ import { useConnectLocalEnvironment } from './useFetchOrCreateLocalEnvironment';
|
|||
import styles from './HomeView.module.css';
|
||||
|
||||
export function HomeView() {
|
||||
// TODO: move this redirect logic to the router when migrating the router to react
|
||||
useAdminOnlyRedirect();
|
||||
const localEnvironmentAdded = useConnectLocalEnvironment();
|
||||
const { trackEvent } = useAnalytics();
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue