diff --git a/src/plugins/presentation_util/public/components/controls/control_group/control_group_strings.ts b/src/plugins/presentation_util/public/components/controls/control_group/control_group_strings.ts index 37930fba593cc0..78e50d8651931c 100644 --- a/src/plugins/presentation_util/public/components/controls/control_group/control_group_strings.ts +++ b/src/plugins/presentation_util/public/components/controls/control_group/control_group_strings.ts @@ -52,6 +52,10 @@ export const ControlGroupStrings = { i18n.translate('presentationUtil.inputControls.controlGroup.management.designTitle', { defaultMessage: 'Design', }), + getWidthTitle: () => + i18n.translate('presentationUtil.inputControls.controlGroup.management.widthTitle', { + defaultMessage: 'Width', + }), getLayoutTitle: () => i18n.translate('presentationUtil.inputControls.controlGroup.management.layoutTitle', { defaultMessage: 'Layout', diff --git a/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control.tsx b/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control.tsx index b1384d6a4ac3d5..6d80a6e0b31f67 100644 --- a/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control.tsx +++ b/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control.tsx @@ -86,7 +86,7 @@ export const ManageControlComponent = ({ {removeControl && ( - { onCancel(); @@ -112,7 +113,7 @@ export const ManageControlComponent = ({ }} > {ControlGroupStrings.management.getDeleteButtonTitle()} - + )} diff --git a/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control_group_component.tsx b/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control_group_component.tsx index 26320b5f0ef53b..f3ba93d80fe8c5 100644 --- a/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control_group_component.tsx +++ b/src/plugins/presentation_util/public/components/controls/control_group/editor/manage_control_group_component.tsx @@ -13,11 +13,12 @@ import { EuiFlexGroup, EuiFlexItem, EuiButtonGroup, - EuiFormLabel, + EuiFormRow, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody, EuiSpacer, + EuiSwitch, } from '@elastic/eui'; import { ControlsPanels } from '../types'; @@ -29,6 +30,7 @@ interface ManageControlGroupProps { panels: ControlsPanels; controlStyle: ControlStyle; deleteAllEmbeddables: () => void; + onClose: () => void; setControlStyle: (style: ControlStyle) => void; setAllPanelWidths: (newWidth: ControlWidth) => void; } @@ -37,11 +39,13 @@ export const ManageControlGroup = ({ panels, controlStyle, setControlStyle, + onClose, setAllPanelWidths, deleteAllEmbeddables, }: ManageControlGroupProps) => { const [currentControlStyle, setCurrentControlStyle] = useState(controlStyle); const [selectedWidth, setSelectedWidth] = useState(); + const [selectionDisplay, setSelectionDisplay] = useState(false); useMount(() => { if (!panels || Object.keys(panels).length === 0) return; @@ -59,35 +63,32 @@ export const ManageControlGroup = ({ - -

{ControlGroupStrings.management.getDesignTitle()}

-
- - { - setControlStyle(newControlStyle as ControlStyle); - setCurrentControlStyle(newControlStyle as ControlStyle); - }} - /> + + { + setControlStyle(newControlStyle as ControlStyle); + setCurrentControlStyle(newControlStyle as ControlStyle); + }} + /> + - -

{ControlGroupStrings.management.getLayoutTitle()}

-
- - - - - - {ControlGroupStrings.management.controlWidth.getChangeAllControlWidthsTitle()} - - - + + setSelectionDisplay(!selectionDisplay)} + /> + + {selectionDisplay ? ( + <> + { @@ -95,19 +96,21 @@ export const ManageControlGroup = ({ setSelectedWidth(newWidth as ControlWidth); }} /> - - - - {ControlGroupStrings.management.getDeleteAllButtonTitle()} - - - + + ) : undefined} + + + + + {ControlGroupStrings.management.getDeleteAllButtonTitle()} +
);