From 975dc9c1da24ce7609021b3e7f5dd8d929d236d6 Mon Sep 17 00:00:00 2001 From: congs Date: Fri, 1 Jul 2022 17:22:40 +1200 Subject: [PATCH] fix(edge): EE-3092 hide the ability to add edge agents in Docker Desktop extension (#7090) --- .../components/BoxSelector/BoxSelector.tsx | 24 ++++++++++--------- app/react/components/BoxSelector/types.ts | 1 + .../WizardDocker/WizardDocker.tsx | 1 + .../WizardKubernetes/WizardKubernetes.tsx | 1 + 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/react/components/BoxSelector/BoxSelector.tsx b/app/react/components/BoxSelector/BoxSelector.tsx index 19f8590d5..4e3b40c31 100644 --- a/app/react/components/BoxSelector/BoxSelector.tsx +++ b/app/react/components/BoxSelector/BoxSelector.tsx @@ -20,17 +20,19 @@ export function BoxSelector({ }: Props) { return (
- {options.map((option) => ( - - ))} + {options.map((option) => + option.hide ? null : ( + + ) + )}
); } diff --git a/app/react/components/BoxSelector/types.ts b/app/react/components/BoxSelector/types.ts index 1fd3f7f9b..e224be53c 100644 --- a/app/react/components/BoxSelector/types.ts +++ b/app/react/components/BoxSelector/types.ts @@ -10,4 +10,5 @@ export interface BoxSelectorOption extends IconProps { disabled?: () => boolean; tooltip?: () => string; feature?: FeatureId; + hide?: boolean; } diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx index a07340c2c..bdaf917c3 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx @@ -44,6 +44,7 @@ const options: BoxSelectorOption<'agent' | 'api' | 'socket' | 'edgeAgent'>[] = [ label: 'Edge Agent', description: '', value: 'edgeAgent', + hide: window.ddExtension, }, ]; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx index c69aa4331..c83cc7692 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx @@ -39,6 +39,7 @@ const options: BoxSelectorOption< label: 'Edge Agent', description: '', value: EnvironmentCreationTypes.EdgeAgentEnvironment, + hide: window.ddExtension, }, { id: 'kubeconfig_endpoint',