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

feat: Add rightNavigationButton component in chrome service for applications to register and add dev tool to top right navigation #6553

Merged
merged 17 commits into from
Apr 30, 2024

Conversation

raintygao
Copy link
Contributor

@raintygao raintygao commented Apr 19, 2024

Description

  1. Update chrome service and define functions and components internally to register top right navigation for applications to call.
  2. Register top right navigation in dev tool app.

Issues Resolved

#6330

Screenshot

image
image

Testing the changes

Changelog

  • skip

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
Contributor

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

Copy link
Contributor

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

Copy link
Contributor

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

@github-actions github-actions bot added Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry and removed failed changeset labels Apr 19, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
@raintygao raintygao changed the title feat: add dev tool to top right navigation feat: introduce registerRightNavigation in chrome service to reigster standard top right navigation and add dev tool to top right navigation Apr 22, 2024
@raintygao raintygao changed the title feat: introduce registerRightNavigation in chrome service to reigster standard top right navigation and add dev tool to top right navigation feat: introduce registerRightNavigation in chrome service to register standard top right navigation and add dev tool to top right navigation Apr 22, 2024
@ashwin-pc
Copy link
Member

How is this different from registerRight?

raintygao and others added 12 commits April 29, 2024 10:11
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: tygao <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
…ons to register and add dev tool to top right navigation.

Signed-off-by: tygao <[email protected]>
@raintygao raintygao force-pushed the feat-add-navigation branch from 1c0da2a to 64051a6 Compare April 29, 2024 02:12
SuZhou-Joe
SuZhou-Joe previously approved these changes Apr 29, 2024
Comment on lines +148 to +149
application: core.application,
http: core.http,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: perhaps CoreStart will be better for backward-capability.

export enum RightNavigationOrder {
// order of dev tool should be after advance settings
Settings = 1,
DevTool = 2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: the value could be 10, 20 and leave some gaps between them so that we can add more between settings and devtool without change the value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. Updated.

ruanyl
ruanyl previously approved these changes Apr 29, 2024
Copy link
Member

@ruanyl ruanyl left a comment

Choose a reason for hiding this comment

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

Approved with a minor comment

const navigateToApp = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
/* Use href and onClick to support "open in new tab" and SPA navigation in the same link */
if (
event.button === 0 && // ignore everything but left clicks
Copy link
Member

Choose a reason for hiding this comment

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

Nit: consider to extract to a function for better readability

const isLeftClickEvent = (event) => event.button === 0;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Contributor Author

@raintygao raintygao Apr 29, 2024

Choose a reason for hiding this comment

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

Seems your guys approvals were dismissed because of commits to address comments. Could you guys help add 2.x label and approve again?

@raintygao raintygao dismissed stale reviews from ruanyl and SuZhou-Joe via 57881d7 April 29, 2024 13:48
@SuZhou-Joe SuZhou-Joe merged commit cfe7cd1 into opensearch-project:main Apr 30, 2024
70 of 71 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 30, 2024
…lications to register and add dev tool to top right navigation (#6553)

* feat: add dev tool to top right navigation

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

* doc: update changelog

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

* test: update component props snapshot

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

* update nav_controls_service.ts

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

* update dependency props and constants

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

* update nav control test

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

* Update CHANGELOG.md

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

* test: update snapshots

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

* doc: update changelog

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

* update click handle

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

* update click handle

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

* doc: add doc for registerRightNavigation

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

* Add `rightNavigationButton` component in chrome service for applications to register and add dev tool to top right navigation.

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

* test: update core start type

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

* update RightNavigationOrder value

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

* extract left click function

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

---------

Signed-off-by: tygao <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit cfe7cd1)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
kavilla pushed a commit that referenced this pull request Apr 30, 2024
…lications to register and add dev tool to top right navigation (#6553) (#6684)

* feat: add dev tool to top right navigation

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

* doc: update changelog

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

* test: update component props snapshot

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

* update nav_controls_service.ts

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

* update dependency props and constants

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

* update nav control test

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

* Update CHANGELOG.md

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

* test: update snapshots

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

* doc: update changelog

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

* update click handle

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

* update click handle

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

* doc: add doc for registerRightNavigation

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

* Add `rightNavigationButton` component in chrome service for applications to register and add dev tool to top right navigation.

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

* test: update core start type

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

* update RightNavigationOrder value

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

* extract left click function

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

---------

Signed-off-by: tygao <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit cfe7cd1)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
…lications to register and add dev tool to top right navigation (opensearch-project#6553)

* feat: add dev tool to top right navigation

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

* doc: update changelog

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

* test: update component props snapshot

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

* update nav_controls_service.ts

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

* update dependency props and constants

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

* update nav control test

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

* Update CHANGELOG.md

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

* test: update snapshots

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

* doc: update changelog

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

* update click handle

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

* update click handle

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

* doc: add doc for registerRightNavigation

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

* Add `rightNavigationButton` component in chrome service for applications to register and add dev tool to top right navigation.

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

* test: update core start type

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

* update RightNavigationOrder value

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

* extract left click function

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

---------

Signed-off-by: tygao <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x repeat-contributor Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry v2.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants