Skip to content

Commit

Permalink
Use small button, small padding and compressed. (opensearch-project#7878
Browse files Browse the repository at this point in the history
)

Signed-off-by: yubonluo <[email protected]>
  • Loading branch information
yubonluo authored Aug 28, 2024
1 parent 23fbaf1 commit f64a270
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 50 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7842.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- [Workspace] Use small button, small padding and compressed. ([#7842](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7842))
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
EuiPanel,
EuiAvatar,
EuiSpacer,
EuiButton,
EuiPopover,
EuiFlexItem,
EuiModalBody,
Expand All @@ -20,6 +19,7 @@ import {
EuiModalHeader,
EuiContextMenu,
EuiModalHeaderTitle,
EuiSmallButton,
} from '@elastic/eui';
import React, { useMemo, useState } from 'react';
import { i18n } from '@osd/i18n';
Expand Down Expand Up @@ -88,15 +88,15 @@ export const UseCaseFooter = ({

return (
<>
<EuiButton
<EuiSmallButton
iconType="plus"
onClick={showModal}
data-test-subj="useCase.footer.createWorkspace.button"
>
{i18n.translate('workspace.useCase.footer.createWorkspace', {
defaultMessage: 'Create workspace',
})}
</EuiButton>
</EuiSmallButton>
{isModalVisible && (
<EuiModal onClose={closeModal} style={{ width: '450px' }}>
<EuiModalHeader>
Expand All @@ -108,21 +108,24 @@ export const UseCaseFooter = ({
</EuiModalBody>

<EuiModalFooter>
<EuiButton onClick={closeModal} data-test-subj="useCase.footer.modal.close.button">
<EuiSmallButton
onClick={closeModal}
data-test-subj="useCase.footer.modal.close.button"
>
{i18n.translate('workspace.useCase.footer.modal.close', {
defaultMessage: 'Close',
})}
</EuiButton>
</EuiSmallButton>
{isDashboardAdmin && (
<EuiButton
<EuiSmallButton
href={core.application.getUrlForApp('workspace_create', { absolute: false })}
data-test-subj="useCase.footer.modal.create.button"
fill
>
{i18n.translate('workspace.useCase.footer.modal.create', {
defaultMessage: 'Create workspace',
})}
</EuiButton>
</EuiSmallButton>
)}
</EuiModalFooter>
</EuiModal>
Expand All @@ -138,9 +141,9 @@ export const UseCaseFooter = ({
basePath
);
return (
<EuiButton href={useCaseURL} data-test-subj="useCase.footer.openWorkspace.button">
<EuiSmallButton href={useCaseURL} data-test-subj="useCase.footer.openWorkspace.button">
{i18n.translate('workspace.useCase.footer.openWorkspace', { defaultMessage: 'Open' })}
</EuiButton>
</EuiSmallButton>
);
}

Expand Down Expand Up @@ -176,11 +179,11 @@ export const UseCaseFooter = ({
};

const button = (
<EuiButton iconType="arrowDown" iconSide="right" onClick={onButtonClick}>
<EuiSmallButton iconType="arrowDown" iconSide="right" onClick={onButtonClick}>
{i18n.translate('workspace.useCase.footer.selectWorkspace', {
defaultMessage: 'Select workspace',
})}
</EuiButton>
</EuiSmallButton>
);
const panels = [
{
Expand All @@ -195,7 +198,7 @@ export const UseCaseFooter = ({
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
panelPaddingSize="none"
panelPaddingSize="s"
anchorPosition="downCenter"
>
<EuiPanel hasBorder={false} color="transparent" paddingSize="s">
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react';
import {
EuiText,
EuiModal,
EuiButton,
EuiSmallButton,
EuiModalBody,
EuiSelectable,
EuiModalFooter,
Expand Down Expand Up @@ -99,13 +99,13 @@ export const AssociationDataSourceModal = ({
</EuiModalBody>

<EuiModalFooter>
<EuiButton onClick={closeModal} fill>
<EuiSmallButton onClick={closeModal} fill>
<FormattedMessage
id="workspace.detail.dataSources.associateModal.close.button"
defaultMessage="Close"
/>
</EuiButton>
<EuiButton
</EuiSmallButton>
<EuiSmallButton
onClick={() => handleAssignDataSources(selectedDataSources)}
isDisabled={!selectedDataSources || selectedDataSources.length === 0}
fill
Expand All @@ -114,7 +114,7 @@ export const AssociationDataSourceModal = ({
id="workspace.detail.dataSources.associateModal.save.button"
defaultMessage="Save changes"
/>
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React, { useMemo, useState } from 'react';
import {
EuiSpacer,
EuiButton,
EuiSmallButton,
EuiFlexItem,
EuiFlexGroup,
EuiFieldSearch,
Expand Down Expand Up @@ -160,7 +160,7 @@ export const OpenSearchConnectionTable = ({
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
{selectedItems.length > 0 && !modalVisible && (
<EuiFlexItem grow={false}>
<EuiButton
<EuiSmallButton
color="danger"
onClick={() => setModalVisible(true)}
data-test-subj="workspace-detail-dataSources-table-bulkRemove"
Expand All @@ -169,7 +169,7 @@ export const OpenSearchConnectionTable = ({
defaultMessage: 'Remove {numberOfSelect} association(s)',
values: { numberOfSelect: selectedItems.length },
})}
</EuiButton>
</EuiSmallButton>
</EuiFlexItem>
)}
<EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

import {
EuiSuperSelect,
EuiColorPicker,
EuiCompressedSuperSelect,
EuiCompressedColorPicker,
EuiCompressedFormRow,
EuiDescribedFormGroup,
} from '@elastic/eui';
Expand Down Expand Up @@ -104,7 +104,7 @@ export const WorkspaceDetailFormDetails = ({
error={formErrors.features?.message}
helpText={detailsUseCaseHelpText}
>
<EuiSuperSelect
<EuiCompressedSuperSelect
options={options}
valueOfSelected={value}
onChange={(id) => {
Expand All @@ -125,7 +125,7 @@ export const WorkspaceDetailFormDetails = ({
isInvalid={!!formErrors.color}
error={formErrors.color?.message}
>
<EuiColorPicker
<EuiCompressedColorPicker
color={formData.color}
onChange={handleColorChange}
readOnly={!isEditing}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import {
EuiPageBody,
EuiFlexItem,
EuiFlexGroup,
EuiButtonEmpty,
EuiPageContent,
EuiSmallButton,
EuiToolTip,
EuiSmallButtonEmpty,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import BackgroundLightSVG from '../../assets/background_light.svg';
Expand Down Expand Up @@ -169,7 +169,7 @@ export const WorkspaceInitial = () => {
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false} className="eui-displayInline">
<EuiButtonEmpty
<EuiSmallButtonEmpty
href="https://www.opensearch.org/"
iconType="popout"
iconSide="right"
Expand All @@ -181,7 +181,7 @@ export const WorkspaceInitial = () => {
defaultMessage: 'Learn more from documentation and more.',
})}
</EuiText>
</EuiButtonEmpty>
</EuiSmallButtonEmpty>
</EuiFlexItem>

<EuiFlexItem grow={false} style={{ maxWidth: '540px' }}>
Expand Down Expand Up @@ -216,7 +216,7 @@ export const WorkspaceInitial = () => {
>
{content}
</EuiPageContent>
<EuiButtonEmpty
<EuiSmallButtonEmpty
iconType="gear"
iconSide="left"
flush="left"
Expand All @@ -228,7 +228,7 @@ export const WorkspaceInitial = () => {
defaultMessage: 'Settings and setup',
})}
</EuiText>
</EuiButtonEmpty>
</EuiSmallButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageBody>
Expand Down
Loading

0 comments on commit f64a270

Please sign in to comment.