Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use smaller and compressed varients of buttons and form components #2068

Merged
merged 16 commits into from
Aug 19, 2024

Conversation

AMoo-Miki
Copy link
Contributor

Description

Replace instances of EuiButton that don't have an explicit sizing attribute to EuiSmallButton*.
Replace instances of Eui<form elements> that don't have density attributes to EuiCompressed<form elements>.

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@derek-ho
Copy link
Collaborator

@ps48 @mengweieric can one of you folks review this and help get it merged?

@@ -14,7 +14,7 @@ interface EUISwitch {
}
export const ConfigSwitch: React.FC<EUISwitch> = ({ label, disabled, checked, handleChange }) => (
<Fragment key={`config-switch-${label}`}>
<EuiFormRow label={label}>
<EuiCompressedFormRow label={label}>
<EuiSwitch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be changed to a compressed switch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah; it already has the compressed attrib.

@@ -50,7 +50,7 @@ export const ConfigTreemapParentFields = ({
{obj.label !== '' ? obj.label : `Parent ${index + 1}`}
</EuiLink>
</EuiText>
<EuiButtonIcon
<EuiSmallButtonIcon
color="subdued"
iconType="cross"
aria-label="clear-field"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should icon size prop be removed on line 57?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. EuiSmallButtonIcon only imposes the size prop and iconSize should be maintained.

@@ -64,7 +64,7 @@ export const ConfigTreemapParentFields = ({
<EuiSpacer size="s" />
<EuiPanel className="panelItem_button" grow>
<EuiText size="s">{addButtonText}</EuiText>
<EuiButtonIcon
<EuiSmallButtonIcon
iconType="plusInCircle"
aria-label="clear-field"
iconSize="s"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EuiSmallButtonIcon only imposes the size prop and iconSize should be maintained.

@@ -85,15 +85,15 @@ export const GridHeader = ({
/>
</EuiFlexItem>
<EuiFlexItem style={{ maxWidth: GRID_HEADER_COLUMN_MAX_WIDTH }}>
<EuiButtonEmpty
<EuiSmallButtonEmpty
iconSize="s"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove icon size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.

@@ -45,7 +45,7 @@ export function LatencyTrendCell({
<EuiText size="s">{traceGroupName}</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import should be changed?

Copy link
Collaborator

@derek-ho derek-ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

@ps48
Copy link
Member

ps48 commented Aug 19, 2024

@AMoo-Miki Can you please update the 4 snapshots that are failing.

@TackAdam
Copy link
Collaborator

Can we wait on merging this until #2063 gets approved/merged?

@ps48 ps48 merged commit 69d12ce into opensearch-project:main Aug 19, 2024
9 of 18 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-observability/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-observability/backport-2.x
# Create a new branch
git switch --create backport/backport-2068-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 69d12cee1b0e43869d078e30cc996e9d685e44a9
# Push it to GitHub
git push --set-upstream origin backport/backport-2068-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-observability/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-2068-to-2.x.

TackAdam pushed a commit to TackAdam/dashboards-observability that referenced this pull request Aug 20, 2024
…pensearch-project#2068)

* Use EuiSmallButton

Signed-off-by: Miki <[email protected]>

* Use EuiSmallButtonIcon

Signed-off-by: Miki <[email protected]>

* Use EuiSmallButtonEmpty

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedFormRow

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedField*

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedSelect and EuiCompressedSuperSelect

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedFilePicker

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedRadio and EuiCompressedRadioGroup

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedSwitch

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedEuiTextArea

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedComboBox

Signed-off-by: Miki <[email protected]>

* Use EuiSmallFilterButton

Signed-off-by: Miki <[email protected]>

* Undo unnecessary EuiSmallButton* uses

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedSuperDatePicker

Signed-off-by: Miki <[email protected]>

* Fix tests and snapshots

Signed-off-by: Miki <[email protected]>

* Fix tests and snapshots

Signed-off-by: Miki <[email protected]>

---------

Signed-off-by: Miki <[email protected]>
Signed-off-by: Adam Tackett <[email protected]>
AMoo-Miki added a commit to AMoo-Miki/dashboards-observability that referenced this pull request Aug 21, 2024
…pensearch-project#2068)

* Use EuiSmallButton

Signed-off-by: Miki <[email protected]>

* Use EuiSmallButtonIcon

Signed-off-by: Miki <[email protected]>

* Use EuiSmallButtonEmpty

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedFormRow

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedField*

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedSelect and EuiCompressedSuperSelect

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedFilePicker

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedRadio and EuiCompressedRadioGroup

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedSwitch

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedEuiTextArea

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedComboBox

Signed-off-by: Miki <[email protected]>

* Use EuiSmallFilterButton

Signed-off-by: Miki <[email protected]>

* Undo unnecessary EuiSmallButton* uses

Signed-off-by: Miki <[email protected]>

* Use EuiCompressedSuperDatePicker

Signed-off-by: Miki <[email protected]>

* Fix tests and snapshots

Signed-off-by: Miki <[email protected]>

* Fix tests and snapshots

Signed-off-by: Miki <[email protected]>

---------

cherry-picked 69d12ce

Signed-off-by: Miki <[email protected]>
ps48 pushed a commit that referenced this pull request Aug 21, 2024
…2068) (#2080)

* Use EuiSmallButton



* Use EuiSmallButtonIcon



* Use EuiSmallButtonEmpty



* Use EuiCompressedFormRow



* Use EuiCompressedField*



* Use EuiCompressedSelect and EuiCompressedSuperSelect



* Use EuiCompressedFilePicker



* Use EuiCompressedRadio and EuiCompressedRadioGroup



* Use EuiCompressedSwitch



* Use EuiCompressedEuiTextArea



* Use EuiCompressedComboBox



* Use EuiSmallFilterButton



* Undo unnecessary EuiSmallButton* uses



* Use EuiCompressedSuperDatePicker



* Fix tests and snapshots



* Fix tests and snapshots



---------

cherry-picked 69d12ce

Signed-off-by: Miki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants