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

Refactor: update page header for settings, objects and index pattern page #7744

Merged
merged 7 commits into from
Aug 19, 2024

Conversation

raintygao
Copy link
Contributor

@raintygao raintygao commented Aug 18, 2024

Description

update page header for settings, objects and index pattern page

Screenshot

Settings
image
before
image
after

Assets
image
before
image
after

Index patterns
image
before
image
after
image
before
image
after
image
before
image
after
image
before
image
after
image
before
image
after

Testing the changes

Go to settings page, enable/disable useNewHomePage and visit settings, objects and index pattern page to test header.

Changelog

  • refactor: update page header for settings, objects and index pattern page

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Aug 18, 2024

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 63.83%. Comparing base (ae7cfa6) to head (1a3ba3c).
Report is 189 commits behind head on main.

Files with missing lines Patch % Lines
...dex_pattern_wizard/create_index_pattern_wizard.tsx 66.66% 2 Missing and 2 partials ⚠️
...gement/public/management_section/mount_section.tsx 0.00% 2 Missing ⚠️
...c/plugins/index_pattern_management/public/mocks.ts 0.00% 1 Missing ⚠️
...gement_section/objects_table/components/header.tsx 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7744   +/-   ##
=======================================
  Coverage   63.82%   63.83%           
=======================================
  Files        3650     3652    +2     
  Lines       80966    81012   +46     
  Branches    12894    12904   +10     
=======================================
+ Hits        51673    51710   +37     
- Misses      26126    26131    +5     
- Partials     3167     3171    +4     
Flag Coverage Δ
Linux_1 30.07% <0.00%> (+0.03%) ⬆️
Linux_2 55.89% <ø> (+0.03%) ⬆️
Linux_3 40.44% <35.29%> (+0.02%) ⬆️
Linux_4 31.32% <68.00%> (+0.03%) ⬆️
Windows_1 30.08% <0.00%> (+0.03%) ⬆️
Windows_2 55.85% <ø> (+0.03%) ⬆️
Windows_3 40.44% <35.29%> (+0.03%) ⬆️
Windows_4 31.32% <68.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raintygao raintygao requested a review from joshuali925 as a code owner August 19, 2024 02:35
Comment on lines +275 to +291
{showTagsSection && renderBadges()}
{renderDescription()}
{conflictedFields.length > 0 && (
<>
<EuiSpacer />
<EuiCallOut title={mappingConflictHeader} color="warning" iconType="alert">
<p>{mappingConflictLabel}</p>
</EuiCallOut>
</>
)}
<Tabs
indexPattern={indexPattern}
saveIndexPattern={data.indexPatterns.updateSavedObject.bind(data.indexPatterns)}
fields={fields}
history={history}
location={location}
/>
Copy link
Member

@SuZhou-Joe SuZhou-Joe Aug 19, 2024

Choose a reason for hiding this comment

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

Suggested change
{showTagsSection && renderBadges()}
{renderDescription()}
{conflictedFields.length > 0 && (
<>
<EuiSpacer />
<EuiCallOut title={mappingConflictHeader} color="warning" iconType="alert">
<p>{mappingConflictLabel}</p>
</EuiCallOut>
</>
)}
<Tabs
indexPattern={indexPattern}
saveIndexPattern={data.indexPatterns.updateSavedObject.bind(data.indexPatterns)}
fields={fields}
history={history}
location={location}
/>
const content = (
<>
{showTagsSection && renderBadges()}
{renderDescription()}
{conflictedFields.length > 0 && (
<>
<EuiSpacer />
<EuiCallOut title={mappingConflictHeader} color="warning" iconType="alert">
<p>{mappingConflictLabel}</p>
</EuiCallOut>
</>
)}
<Tabs
indexPattern={indexPattern}
saveIndexPattern={data.indexPatterns.updateSavedObject.bind(data.indexPatterns)}
fields={fields}
history={history}
location={location}
/>
</>
)

Nit: What about we change it like this? the content part should be the same no matter the toggle is on or off.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, i tried to extract but fount it may be hard to maintain because there are three different spacers between two contents.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps you can move the spacer into the renderDescription and renderBadges method. Then in that case the content will be exactly the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but the spacer between Tabs and EuiCallOut maybe hard to contain.

SuZhou-Joe
SuZhou-Joe previously approved these changes Aug 19, 2024
@SuZhou-Joe
Copy link
Member

LGTM, thanks for the amazing changes. Now it looks consistent across multiple pages and steps.

Signed-off-by: tygao <[email protected]>
@ruanyl ruanyl added the look & feel Look and Feel Improvements label Aug 19, 2024
@ruanyl ruanyl merged commit e490b6b into opensearch-project:main Aug 19, 2024
69 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/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7744-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e490b6b3e458a19daa849d529f80d8a2f588f4eb
# Push it to GitHub
git push --set-upstream origin backport/backport-7744-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

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

Qxisylolo pushed a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Aug 20, 2024
…page (opensearch-project#7744)

* settings header

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

* update all pages header

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

* Changeset file for PR opensearch-project#7744 created/updated

* style: update management style

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

* remove extra spacer

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

* add tests and snapshots

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

---------

Signed-off-by: tygao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@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/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7744-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e490b6b3e458a19daa849d529f80d8a2f588f4eb
# Push it to GitHub
git push --set-upstream origin backport/backport-7744-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

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

raintygao added a commit to raintygao/OpenSearch-Dashboards that referenced this pull request Aug 20, 2024
SuZhou-Joe pushed a commit that referenced this pull request Aug 20, 2024
…cts and index pattern page (#7769)

* Refactor: update page header for settings, objects and index pattern page #7744

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

* test: update snapshots due to component diff

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

---------

Signed-off-by: tygao <[email protected]>
SuZhou-Joe added a commit that referenced this pull request Aug 23, 2024
…dit in Assets page (#7749)

* settings header

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

* update all pages header

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

* Changeset file for PR #7744 created/updated

* style: update management style

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

* remove extra spacer

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

* add tests and snapshots

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

* feat: jump to standard application when the toggle is on

Signed-off-by: SuZhou-Joe <[email protected]>

* Changeset file for PR #7749 created/updated

* feat: improve test coverage

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: tygao <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Co-authored-by: tygao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 23, 2024
…dit in Assets page (#7749)

* settings header

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

* update all pages header

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

* Changeset file for PR #7744 created/updated

* style: update management style

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

* remove extra spacer

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

* add tests and snapshots

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

* feat: jump to standard application when the toggle is on

Signed-off-by: SuZhou-Joe <[email protected]>

* Changeset file for PR #7749 created/updated

* feat: improve test coverage

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: tygao <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Co-authored-by: tygao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 9dd9b14)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Aug 26, 2024
…dit in Assets page (#7749) (#7825)

* settings header



* update all pages header



* Changeset file for PR #7744 created/updated

* style: update management style



* remove extra spacer



* add tests and snapshots



* feat: jump to standard application when the toggle is on



* Changeset file for PR #7749 created/updated

* feat: improve test coverage



---------





(cherry picked from commit 9dd9b14)

Signed-off-by: tygao <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: tygao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
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.

4 participants