From a5066a9afc204421f54879ff8c1c1189fde8e780 Mon Sep 17 00:00:00 2001 From: Miki Date: Mon, 19 Aug 2024 08:21:28 -0700 Subject: [PATCH] Use smaller and compressed varients of buttons and form components (#231) * Use EuiSmallButton Signed-off-by: Miki * Use EuiSmallButtonEmpty Signed-off-by: Miki * Use EuiCompressedFormRow Signed-off-by: Miki * Use EuiCompressedField* Signed-off-by: Miki * Use EuiCompressedSelect and EuiCompressedSuperSelect Signed-off-by: Miki * Use EuiCompressedRadio and EuiCompressedRadioGroup Signed-off-by: Miki * Use EuiCompressedEuiTextArea Signed-off-by: Miki * Use EuiCompressedComboBox Signed-off-by: Miki * Use EuiSmallFilterButton Signed-off-by: Miki * Update snapshots and tests Signed-off-by: Miki --------- Signed-off-by: Miki --- public/pages/Channels/Channels.tsx | 10 +- .../ChannelActions.test.tsx.snap | 8 +- .../ChannelControls.test.tsx.snap | 10 +- .../ChannelDetailsActions.test.tsx.snap | 6 +- .../__snapshots__/Channels.test.tsx.snap | 16 +- .../DetailsListModal.test.tsx.snap | 73 +++++---- .../DetailsTableModal.test.tsx.snap | 146 ++++++++++-------- .../Channels/components/ChannelActions.tsx | 6 +- .../Channels/components/ChannelControls.tsx | 14 +- .../components/details/ChannelDetails.tsx | 5 +- .../details/ChannelDetailsActions.tsx | 6 +- .../components/modals/DeleteChannelModal.tsx | 14 +- .../components/modals/DetailsListModal.tsx | 6 +- .../components/modals/DetailsTableModal.tsx | 6 +- .../components/modals/MuteChannelModal.tsx | 10 +- public/pages/CreateChannel/CreateChannel.tsx | 24 +-- .../ChannelNamePanel.test.tsx.snap | 24 +-- .../__snapshots__/ChimeSettings.test.tsx.snap | 12 +- .../CustomWebhookSettings.test.tsx.snap | 32 ++-- .../MicrosoftTeamsSettings.test.tsx.snap | 12 +- .../__snapshots__/SlackSettings.test.tsx.snap | 12 +- .../components/ChannelNamePanel.tsx | 14 +- .../components/ChimeSettings.tsx | 8 +- .../components/CustomWebhookSettings.tsx | 52 +++---- .../components/EmailSettings.tsx | 56 +++---- .../components/MicrosoftTeamsSettings.tsx | 8 +- .../CreateChannel/components/SNSSettings.tsx | 22 +-- .../components/SlackSettings.tsx | 8 +- .../components/WebhookHeaders.tsx | 30 ++-- .../modals/CreateRecipientGroupModal.tsx | 10 +- .../modals/CreateSESSenderModal.tsx | 10 +- .../components/modals/CreateSenderModal.tsx | 10 +- public/pages/Emails/CreateRecipientGroup.tsx | 12 +- public/pages/Emails/CreateSESSender.tsx | 12 +- public/pages/Emails/CreateSender.tsx | 12 +- .../CreateRecipientGroupForm.test.tsx.snap | 12 +- .../CreateSESSenderForm.test.tsx.snap | 12 +- .../CreateSenderForm.test.tsx.snap | 12 +- .../RecipientGroupsTable.test.tsx.snap | 14 +- .../__snapshots__/SendersTable.test.tsx.snap | 16 +- .../SendersTableControls.test.tsx.snap | 8 +- .../forms/CreateRecipientGroupForm.tsx | 26 ++-- .../components/forms/CreateSESSenderForm.tsx | 28 ++-- .../components/forms/CreateSenderForm.tsx | 38 ++--- .../modals/DeleteRecipientGroupModal.tsx | 14 +- .../components/modals/DeleteSenderModal.tsx | 14 +- .../tables/RecipientGroupsTable.tsx | 22 +-- .../components/tables/SESSendersTable.tsx | 22 +-- .../Emails/components/tables/SendersTable.tsx | 18 +-- .../tables/SendersTableControls.tsx | 10 +- .../__snapshots__/Main.test.tsx.snap | 16 +- 51 files changed, 510 insertions(+), 488 deletions(-) diff --git a/public/pages/Channels/Channels.tsx b/public/pages/Channels/Channels.tsx index f472761a..cea25925 100644 --- a/public/pages/Channels/Channels.tsx +++ b/public/pages/Channels/Channels.tsx @@ -5,7 +5,7 @@ import { EuiBasicTable, - EuiButton, + EuiSmallButton, EuiEmptyPrompt, EuiHealth, EuiHorizontalRule, @@ -238,9 +238,9 @@ export class Channels extends MDSEnabledComponent }, { component: ( - + Create channel - + ), }, ]} @@ -269,9 +269,9 @@ export class Channels extends MDSEnabledComponent title={

No channels to display

} body="To send or receive notifications, you will need to create a notification channel." actions={ - + Create channel - + } /> } diff --git a/public/pages/Channels/__tests__/__snapshots__/ChannelActions.test.tsx.snap b/public/pages/Channels/__tests__/__snapshots__/ChannelActions.test.tsx.snap index 40a3119e..c3a5080a 100644 --- a/public/pages/Channels/__tests__/__snapshots__/ChannelActions.test.tsx.snap +++ b/public/pages/Channels/__tests__/__snapshots__/ChannelActions.test.tsx.snap @@ -8,7 +8,7 @@ exports[` spec clicks in the popover 1`] = ` class="euiPopover__anchor" > - - + + + + + diff --git a/public/pages/Channels/__tests__/__snapshots__/DetailsTableModal.test.tsx.snap b/public/pages/Channels/__tests__/__snapshots__/DetailsTableModal.test.tsx.snap index e5773bb0..5ce7588b 100644 --- a/public/pages/Channels/__tests__/__snapshots__/DetailsTableModal.test.tsx.snap +++ b/public/pages/Channels/__tests__/__snapshots__/DetailsTableModal.test.tsx.snap @@ -230,7 +230,7 @@ exports[` spec renders headers 1`] = ` class="euiModalFooter" > - - + + + + + @@ -2075,7 +2082,7 @@ exports[` spec renders parameters 1`] = ` class="euiModalFooter" > - - + + + + + diff --git a/public/pages/Channels/components/ChannelActions.tsx b/public/pages/Channels/components/ChannelActions.tsx index f74e74b8..b809e537 100644 --- a/public/pages/Channels/components/ChannelActions.tsx +++ b/public/pages/Channels/components/ChannelActions.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiButton, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; +import { EuiSmallButton, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; import React, { useContext, useState } from 'react'; import { SERVER_DELAY } from '../../../../common'; import { ChannelItemType } from '../../../../models/interfaces'; @@ -83,14 +83,14 @@ export function ChannelActions(props: ChannelActionsProps) { setIsPopoverOpen(!isPopoverOpen)} > Actions - + } isOpen={isPopoverOpen} closePopover={() => setIsPopoverOpen(false)} diff --git a/public/pages/Channels/components/ChannelControls.tsx b/public/pages/Channels/components/ChannelControls.tsx index 1405a3a6..8024a88f 100644 --- a/public/pages/Channels/components/ChannelControls.tsx +++ b/public/pages/Channels/components/ChannelControls.tsx @@ -4,8 +4,8 @@ */ import { - EuiFieldSearch, - EuiFilterButton, + EuiCompressedFieldSearch, + EuiSmallFilterButton, EuiFilterGroup, EuiFilterSelectItem, EuiFlexGroup, @@ -98,7 +98,7 @@ export const ChannelControls = (props: ChannelControlsProps) => { return ( - { setIsStatePopoverOpen(!isStatePopoverOpen)} > {isItemSelected(stateItems) ? Status : 'Status'} - + } isOpen={isStatePopoverOpen} closePopover={() => setIsStatePopoverOpen(false)} @@ -138,13 +138,13 @@ export const ChannelControls = (props: ChannelControlsProps) => { setIsTypePopoverOpen(!isTypePopoverOpen)} > {isItemSelected(typeItems) ? Type : 'Type'} - + } isOpen={isTypePopoverOpen} closePopover={() => setIsTypePopoverOpen(false)} diff --git a/public/pages/Channels/components/details/ChannelDetails.tsx b/public/pages/Channels/components/details/ChannelDetails.tsx index e238cec0..27bab75b 100644 --- a/public/pages/Channels/components/details/ChannelDetails.tsx +++ b/public/pages/Channels/components/details/ChannelDetails.tsx @@ -5,6 +5,7 @@ import { EuiButton, + EuiSmallButton, EuiFlexGroup, EuiFlexItem, EuiGlobalToastList, @@ -164,7 +165,7 @@ export function ChannelDetails(props: ChannelDetailsProps) { {channel && ( {({ onShow }) => ( - { @@ -189,7 +190,7 @@ export function ChannelDetails(props: ChannelDetailsProps) { }} > {channel?.is_enabled ? 'Mute channel' : 'Unmute channel'} - + )} )} diff --git a/public/pages/Channels/components/details/ChannelDetailsActions.tsx b/public/pages/Channels/components/details/ChannelDetailsActions.tsx index e7bb7d1e..dcbf94e2 100644 --- a/public/pages/Channels/components/details/ChannelDetailsActions.tsx +++ b/public/pages/Channels/components/details/ChannelDetailsActions.tsx @@ -4,7 +4,7 @@ */ import { - EuiButton, + EuiSmallButton, EuiContextMenuItem, EuiPopover, EuiTextColor, @@ -81,13 +81,13 @@ export function ChannelDetailsActions(props: ChannelDetailsActionsProps) { setIsPopoverOpen(!isPopoverOpen)} > Actions - + } isOpen={isPopoverOpen} closePopover={() => setIsPopoverOpen(false)} diff --git a/public/pages/Channels/components/modals/DeleteChannelModal.tsx b/public/pages/Channels/components/modals/DeleteChannelModal.tsx index 1ab66e7e..636ed1f4 100644 --- a/public/pages/Channels/components/modals/DeleteChannelModal.tsx +++ b/public/pages/Channels/components/modals/DeleteChannelModal.tsx @@ -4,9 +4,9 @@ */ import { - EuiButton, - EuiButtonEmpty, - EuiFieldText, + EuiSmallButton, + EuiSmallButtonEmpty, + EuiCompressedFieldText, EuiFlexGroup, EuiFlexItem, EuiModal, @@ -69,7 +69,7 @@ export const DeleteChannelModal = (props: DeleteChannelModalProps) => { To confirm delete, type delete in the field. - setInput(e.target.value)} @@ -78,10 +78,10 @@ export const DeleteChannelModal = (props: DeleteChannelModalProps) => { - Cancel + Cancel - { disabled={input !== 'delete'} > Delete - + diff --git a/public/pages/Channels/components/modals/DetailsListModal.tsx b/public/pages/Channels/components/modals/DetailsListModal.tsx index fc590001..9a84ca0f 100644 --- a/public/pages/Channels/components/modals/DetailsListModal.tsx +++ b/public/pages/Channels/components/modals/DetailsListModal.tsx @@ -4,7 +4,7 @@ */ import { - EuiButton, + EuiSmallButton, EuiHorizontalRule, EuiModal, EuiModalBody, @@ -46,9 +46,9 @@ export function DetailsListModal(props: DetailsListModalProps) { })} - + Close - + diff --git a/public/pages/Channels/components/modals/DetailsTableModal.tsx b/public/pages/Channels/components/modals/DetailsTableModal.tsx index 11ee09ac..773fe1f3 100644 --- a/public/pages/Channels/components/modals/DetailsTableModal.tsx +++ b/public/pages/Channels/components/modals/DetailsTableModal.tsx @@ -4,7 +4,7 @@ */ import { - EuiButton, + EuiSmallButton, EuiInMemoryTable, EuiModal, EuiModalBody, @@ -55,9 +55,9 @@ export function DetailsTableModal(props: DetailsTableModalProps) { - + Close - + diff --git a/public/pages/Channels/components/modals/MuteChannelModal.tsx b/public/pages/Channels/components/modals/MuteChannelModal.tsx index 3a0d7fce..b1b807f6 100644 --- a/public/pages/Channels/components/modals/MuteChannelModal.tsx +++ b/public/pages/Channels/components/modals/MuteChannelModal.tsx @@ -4,8 +4,8 @@ */ import { - EuiButton, - EuiButtonEmpty, + EuiSmallButton, + EuiSmallButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiModal, @@ -48,10 +48,10 @@ export const MuteChannelModal = (props: MuteChannelModalProps) => { - Cancel + Cancel - { @@ -75,7 +75,7 @@ export const MuteChannelModal = (props: MuteChannelModalProps) => { }} > Mute - + diff --git a/public/pages/CreateChannel/CreateChannel.tsx b/public/pages/CreateChannel/CreateChannel.tsx index f814794c..c6c30e52 100644 --- a/public/pages/CreateChannel/CreateChannel.tsx +++ b/public/pages/CreateChannel/CreateChannel.tsx @@ -4,14 +4,14 @@ */ import { - EuiButton, - EuiButtonEmpty, + EuiSmallButton, + EuiSmallButtonEmpty, EuiComboBoxOptionOption, EuiFlexGroup, EuiFlexItem, - EuiFormRow, + EuiCompressedFormRow, EuiSpacer, - EuiSuperSelect, + EuiCompressedSuperSelect, EuiSuperSelectOption, EuiText, EuiTitle, @@ -383,7 +383,7 @@ export function CreateChannel(props: CreateChannelsProps) { title="Configurations" titleSize="s" > - + {props.edit ? ( {CHANNEL_TYPE[channelType]} ) : ( @@ -391,7 +391,7 @@ export function CreateChannel(props: CreateChannelsProps) { Channel type cannot be changed after the channel is created. - )} - + {channelType === BACKEND_CHANNEL_TYPE.SLACK ? ( - Cancel + Cancel - { if (!isInputValid()) { @@ -478,10 +478,10 @@ export function CreateChannel(props: CreateChannelsProps) { }} > Send test message - + - {props.edit ? 'Save' : 'Create'} - + diff --git a/public/pages/CreateChannel/__tests__/__snapshots__/ChannelNamePanel.test.tsx.snap b/public/pages/CreateChannel/__tests__/__snapshots__/ChannelNamePanel.test.tsx.snap index e1315e05..0e4b7f41 100644 --- a/public/pages/CreateChannel/__tests__/__snapshots__/ChannelNamePanel.test.tsx.snap +++ b/public/pages/CreateChannel/__tests__/__snapshots__/ChannelNamePanel.test.tsx.snap @@ -25,7 +25,7 @@ exports[` spec renders errors 1`] = ` style="padding: initial;" >
spec renders errors 1`] = ` class="euiFormRow__fieldWrapper" >
spec renders errors 1`] = `
spec renders errors 1`] = ` class="euiFormRow__fieldWrapper" >