-
Notifications
You must be signed in to change notification settings - Fork 916
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
Conversation
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: tygao <[email protected]>
{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} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx
Outdated
Show resolved
Hide resolved
LGTM, thanks for the amazing changes. Now it looks consistent across multiple pages and steps. |
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
The backport to
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 |
…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>
The backport to
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 |
…page opensearch-project#7744 Signed-off-by: tygao <[email protected]>
…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]>
…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>
…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>
…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>
Description
update page header for settings, objects and index pattern page
Screenshot
Settings
before
after
Assets
before
after
Index patterns
before
after
before
after
before
after
before
after
before
after
Testing the changes
Go to settings page, enable/disable useNewHomePage and visit settings, objects and index pattern page to test header.
Changelog
Check List
yarn test:jest
yarn test:jest_integration