fix(edge): EE-3092 hide the ability to add edge agents in Docker Desktop extension (#7090)

pull/7168/head
congs 2022-07-01 17:22:40 +12:00 committed by GitHub
parent 6fe26a52dd
commit 975dc9c1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 11 deletions

View File

@ -20,7 +20,8 @@ export function BoxSelector<T extends number | string>({
}: Props<T>) { }: Props<T>) {
return ( return (
<div className={clsx('boxselector_wrapper', styles.root)} role="radiogroup"> <div className={clsx('boxselector_wrapper', styles.root)} role="radiogroup">
{options.map((option) => ( {options.map((option) =>
option.hide ? null : (
<BoxSelectorItem <BoxSelectorItem
key={option.id} key={option.id}
radioName={radioName} radioName={radioName}
@ -30,7 +31,8 @@ export function BoxSelector<T extends number | string>({
disabled={option.disabled && option.disabled()} disabled={option.disabled && option.disabled()}
tooltip={option.tooltip && option.tooltip()} tooltip={option.tooltip && option.tooltip()}
/> />
))} )
)}
</div> </div>
); );
} }

View File

@ -10,4 +10,5 @@ export interface BoxSelectorOption<T> extends IconProps {
disabled?: () => boolean; disabled?: () => boolean;
tooltip?: () => string; tooltip?: () => string;
feature?: FeatureId; feature?: FeatureId;
hide?: boolean;
} }

View File

@ -44,6 +44,7 @@ const options: BoxSelectorOption<'agent' | 'api' | 'socket' | 'edgeAgent'>[] = [
label: 'Edge Agent', label: 'Edge Agent',
description: '', description: '',
value: 'edgeAgent', value: 'edgeAgent',
hide: window.ddExtension,
}, },
]; ];

View File

@ -39,6 +39,7 @@ const options: BoxSelectorOption<
label: 'Edge Agent', label: 'Edge Agent',
description: '', description: '',
value: EnvironmentCreationTypes.EdgeAgentEnvironment, value: EnvironmentCreationTypes.EdgeAgentEnvironment,
hide: window.ddExtension,
}, },
{ {
id: 'kubeconfig_endpoint', id: 'kubeconfig_endpoint',