From ad8b8399c487a360fca5a3a8827536d4bd0d499c Mon Sep 17 00:00:00 2001
From: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Date: Mon, 8 Aug 2022 16:43:31 +1200
Subject: [PATCH] fix(ui): remove right label for switch toggle EE-3786 (#7349)
* remove right label for switch toggle
---
app/portainer/react/components/switch-field.ts | 1 -
.../form-components/SwitchField/SwitchField.tsx | 15 ---------------
.../EdgeScriptForm/EdgeScriptSettingsFieldset.tsx | 1 -
3 files changed, 17 deletions(-)
diff --git a/app/portainer/react/components/switch-field.ts b/app/portainer/react/components/switch-field.ts
index aa33f278c..e27260fcf 100644
--- a/app/portainer/react/components/switch-field.ts
+++ b/app/portainer/react/components/switch-field.ts
@@ -13,6 +13,5 @@ export const switchField = r2a(SwitchField, [
'disabled',
'onChange',
'featureId',
- 'switchValues',
'switchClass',
]);
diff --git a/app/react/components/form-components/SwitchField/SwitchField.tsx b/app/react/components/form-components/SwitchField/SwitchField.tsx
index 9b07133a3..a45aa8d3d 100644
--- a/app/react/components/form-components/SwitchField/SwitchField.tsx
+++ b/app/react/components/form-components/SwitchField/SwitchField.tsx
@@ -20,10 +20,6 @@ export interface Props {
dataCy?: string;
disabled?: boolean;
featureId?: FeatureId;
- switchValues?: {
- on: string;
- off: string;
- };
}
export function SwitchField({
@@ -37,7 +33,6 @@ export function SwitchField({
disabled,
onChange,
featureId,
- switchValues,
switchClass,
}: Props) {
const toggleName = name ? `toggle_${name}` : '';
@@ -64,16 +59,6 @@ export function SwitchField({
featureId={featureId}
dataCy={dataCy}
/>
- {switchValues && checked && (
-
- {switchValues.on}
-
- )}
- {switchValues && !checked && (
-
- {switchValues.off}
-
- )}
);
}
diff --git a/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx b/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx
index b5b8b4e17..aaf369029 100644
--- a/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx
+++ b/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx
@@ -71,7 +71,6 @@ export function EdgeScriptSettingsFieldset({
}
label="Allow self-signed certs"
labelClass="col-sm-3 col-lg-2"
- switchValues={{ on: 'Yes', off: 'No' }}
tooltip="When allowing self-signed certificates the edge agent will ignore the domain validation when connecting to Portainer via HTTPS"
/>