From a4753db4171e6d4570aa9cb7929b10d654038171 Mon Sep 17 00:00:00 2001 From: Miki Date: Sun, 11 Aug 2024 18:36:34 -0700 Subject: [PATCH] Use smaller and compressed varients of buttons and form components (#349) * Use EuiSmallButton Signed-off-by: Miki * Use EuiSmallButtonIcon 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 EuiSmallFilterButton Signed-off-by: Miki --------- Signed-off-by: Miki (cherry picked from commit 6c280ae18e914908bb18f695feb6170fccb68dfe) --- public/components/common/copyable_text.tsx | 4 +-- .../common/options_filter/options_filter.tsx | 6 ++-- public/components/common/refresh_interval.tsx | 30 +++++++++---------- .../monitoring/model_deployment_table.tsx | 6 ++-- public/components/monitoring/search_bar.tsx | 4 +-- public/components/status_filter/index.tsx | 6 ++-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/public/components/common/copyable_text.tsx b/public/components/common/copyable_text.tsx index abc9301a..2945df28 100644 --- a/public/components/common/copyable_text.tsx +++ b/public/components/common/copyable_text.tsx @@ -4,7 +4,7 @@ */ import React, { useCallback, useState, useRef } from 'react'; -import { EuiButtonIcon, copyToClipboard, EuiToolTip } from '@elastic/eui'; +import { EuiSmallButtonIcon, copyToClipboard, EuiToolTip } from '@elastic/eui'; interface Props { text: string; @@ -33,7 +33,7 @@ export const CopyableText = ({
{iconLeft ? null : text} - ({ return ( 0 ? { hasActiveFilters: true, numActiveFilters: value.length } : {})} > {name} - + } isOpen={isPopoverOpen} closePopover={closePopover} diff --git a/public/components/common/refresh_interval.tsx b/public/components/common/refresh_interval.tsx index d0f37557..68df681e 100644 --- a/public/components/common/refresh_interval.tsx +++ b/public/components/common/refresh_interval.tsx @@ -5,15 +5,15 @@ import { EuiIcon, - EuiButtonEmpty, - EuiFieldText, + EuiSmallButtonEmpty, + EuiCompressedFieldText, EuiPopover, EuiFlexGroup, - EuiFieldNumber, - EuiSelect, - EuiButton, + EuiCompressedFieldNumber, + EuiCompressedSelect, + EuiSmallButton, EuiFlexItem, - EuiFormRow, + EuiCompressedFormRow, } from '@elastic/eui'; import React, { useEffect, useState, useCallback, useMemo } from 'react'; @@ -116,14 +116,14 @@ export const RefreshInterval = ({ }, [interval, isPaused, onRefresh, onRefreshChange]); const intervalButton = ( - setIsPopoverOpen(!isPopoverOpen)} aria-label="set refresh interval" > - + ); let errors: string[] = []; @@ -132,7 +132,7 @@ export const RefreshInterval = ({ } return ( - setIsPopoverOpen(false)} > - 0 ? '' : 'Enter an auto-refresh rate greater than 10 seconds.' @@ -152,7 +152,7 @@ export const RefreshInterval = ({ > - - - setIsPaused(!isPaused)} > {isPaused ? 'Start' : 'Stop'} - + - + } /> diff --git a/public/components/monitoring/model_deployment_table.tsx b/public/components/monitoring/model_deployment_table.tsx index 231eff05..28841d61 100644 --- a/public/components/monitoring/model_deployment_table.tsx +++ b/public/components/monitoring/model_deployment_table.tsx @@ -11,7 +11,7 @@ import { Direction, EuiBasicTable, EuiButton, - EuiButtonIcon, + EuiSmallButtonIcon, EuiEmptyPrompt, EuiHealth, EuiSpacer, @@ -154,7 +154,7 @@ export const ModelDeploymentTable = ({ anchorClassName="ml-modelModelIdCell" > {(copy) => ( - { return ( - { onViewDetail?.(modelDeploymentItem); }} diff --git a/public/components/monitoring/search_bar.tsx b/public/components/monitoring/search_bar.tsx index 6319918d..39eec9d6 100644 --- a/public/components/monitoring/search_bar.tsx +++ b/public/components/monitoring/search_bar.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ import React, { useMemo, useCallback } from 'react'; -import { EuiFieldSearch } from '@elastic/eui'; +import { EuiCompressedFieldSearch } from '@elastic/eui'; import { debounce } from 'lodash'; interface SearchBarProps { onSearch: (value: string) => void; @@ -20,7 +20,7 @@ export const SearchBar = ({ onSearch, inputRef }: SearchBarProps) => { ); return ( - { ); const button = ( - { isLoading={loading} > Status - + ); return (