-
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
[navigation]feat: add home icon in left bottom #7802
Merged
SuZhou-Joe
merged 9 commits into
opensearch-project:main
from
SuZhou-Joe:feature/add-home-icon
Aug 23, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5c4590f
feat: add home icon in left bottom
SuZhou-Joe a846e47
feat: remove useless padding
SuZhou-Joe b8f8cd8
Changeset file for PR #7802 created/updated
opensearch-changeset-bot[bot] 2101eac
fix: update snapshot
SuZhou-Joe 1e9b70e
feat: use flush
SuZhou-Joe d9e54e7
feat: optimize style
SuZhou-Joe c7b6c35
feat: move features around in nav group
SuZhou-Joe 1baa672
fix: typo
SuZhou-Joe 65c38c5
fix: unit test
SuZhou-Joe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Add home icon in left bottom ([#7802](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7802)) |
8 changes: 4 additions & 4 deletions
8
src/core/public/chrome/ui/header/__snapshots__/collapsible_nav_group_enabled.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/plugins/home/public/application/components/home_icon.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { fireEvent, render } from '@testing-library/react'; | ||
import { HomeIcon } from './home_icon'; | ||
import { coreMock } from '../../../../../core/public/mocks'; | ||
|
||
describe('<HomeIcon />', () => { | ||
it('should call chrome.navGroup.setCurrentNavGroup and application.navigateToApp methods from core service when click', () => { | ||
const coreStartMock = coreMock.createStart(); | ||
const { container } = render(<HomeIcon core={coreStartMock} appId="foo" />); | ||
const component = container.children[0]; | ||
fireEvent.click(component); | ||
expect(coreStartMock.application.navigateToApp).toBeCalledWith('foo'); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
src/plugins/home/public/application/components/home_icon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiButtonIcon } from '@elastic/eui'; | ||
import { CoreStart } from 'opensearch-dashboards/public'; | ||
|
||
export function HomeIcon({ core, appId }: { core: CoreStart; appId: string }) { | ||
return ( | ||
<EuiButtonIcon | ||
aria-label="go-to-home" | ||
SuZhou-Joe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
iconType="home" | ||
onClick={() => { | ||
core.application.navigateToApp(appId); | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How will this look on browser-OS combos that show a scrollbar?
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.
I get your point, I thought the class will help to hide the scrollbar, but if not, let me find if there is any pattern code I can follow in OSD.
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.
Seem behavior of adding the utility css class follows the OS settings. Was the intention to hide the scrollbar but allow user to scroll?
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.
I added
-ms-overflow-style: -ms-autohiding-scrollbar;
to the bottom container to make the behavior of scrollbar consistent. Do you think that's good enough?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.
I'm fine with it, UX need to figure out how to fit those overflow icons, I think we can optimize this afterwards.