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

[Workspace] Add workspaceAvailability field into application #6427

Merged
merged 15 commits into from
Apr 23, 2024

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Apr 12, 2024

Description

Home page, as well as workspace create page / workspace list page, which is supposed to be only visited out of any workspace, now is enabled to be accessed by clicking the home icon or enter the url manually in the browser.

This PR introduces a new field workspaceAvailability inside App, which indicates the availability of the application based on workspace. This field can bring two benefits:

  1. When navigate between apps, plugins and core application are using the navigateToApp method. By using the workspaceAvailability field, workspace is able to do the hard navigation in a central place.
  2. The workspaceAvailability field can be used in workspace create page to filter applications that should not be visible inside workspace. For now we filter out home overview page and all the pages under management section by hard code, which is not elegant and not extensible.

Issues Resolved

closes #6362

Screenshot

1. Clicking home icon will exist workspace.

20240407094009141

2. Apps with workspaceAvailability.outOfWorkspace is inaccessible within workspace

image

Testing the changes

  • Using the branch to bootstrap
  • enabled workspace.enabled to true
  • Start OSD by using yarn start --no-base-path to make sure no random base path will be appended
  • Navigate to devTools
  • Insert test workspaces by calling
PUT .kibana/_doc/workspace:foo
{
  "type": "workspace",
  "workspace": {
    "name": "foo"
  }
}
  • Visit the homepage inside workspace: http://localhost:5601/w/foo/app/home
  • You will find an error page will be found saying the application can not be found.
  • Go into a page within workspace http://localhost:5601/w/foo/app/workspace_update
  • Clicking the home icon in the top navigation
  • You will you being navigated to home page out of workspace.

Changelog

  • feat: [Workspace] Allow making apps available in workspaces using workspaceAvailability

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

CHANGELOG.md Outdated Show resolved Hide resolved
@SuZhou-Joe
Copy link
Member Author

@AMoo-Miki Would you mind taking a look on this PR?

@SuZhou-Joe SuZhou-Joe changed the title [Workspace] Add workspaceAccessibility field into application [Workspace] Add workspaceAvailability field into application Apr 16, 2024
@SuZhou-Joe SuZhou-Joe force-pushed the workspace-accessiblity branch 2 times, most recently from 21de853 to a91d020 Compare April 18, 2024 01:51
@opensearch-project opensearch-project deleted a comment from github-actions bot Apr 18, 2024
opensearch-changeset-bot bot added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Apr 18, 2024
AMoo-Miki
AMoo-Miki previously approved these changes Apr 23, 2024
ruanyl
ruanyl previously approved these changes Apr 23, 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.

LGTM, just please make sure it works as expected when workspace is turned off.

Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe SuZhou-Joe dismissed stale reviews from ruanyl and AMoo-Miki via 766143a April 23, 2024 01:08
AMoo-Miki
AMoo-Miki previously approved these changes Apr 23, 2024
Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit 104ee42 into opensearch-project:main Apr 23, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 24, 2024
* [Workspace] Jump to non-workspace url when clicking home icon (#316)

* temp: save

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

* feat: complete the feature

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

* feat: remove useless code

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

* fix: bootstrap error

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

* fix: bootstrap error

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

* fix: page not found error

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

* fix: anchor href

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

* feat: update toNavLink to comply with workspace

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

* feat: change to workspaceless

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

* feat: change to workspaceless

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

* feat: change to workspaceless

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

* feat: register list and create page as workspaceless

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

* feat: optimize code

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

* feat: update to WorkspaceVisibility

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

* feat: add unit test

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

* feat: optimize the jump logic

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

* fix: unit test

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

* feat: make app inaccessible if workspaceAccessibility is No

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

---------

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

* refactor: using WorkspaceAvailability

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

* feat: change test name

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

* feat: update wording

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

* feat: update test

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

* feat: add unit test

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

* feat: remove CHANGELOG change

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

* Changeset file for PR #6427 created/updated

* Apply suggestions from code review

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

* Update src/plugins/workspace/public/utils.test.ts

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

* Lint src/plugins/workspace/public/utils.test.ts

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

* Lint src/plugins/workspace/public/utils.test.ts

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

* Lint src/plugins/workspace/public/utils.test.ts

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

* fix: lint error

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

* fix: unit test

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

---------

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: Miki <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Yulong Ruan <[email protected]>
Co-authored-by: Miki <[email protected]>
(cherry picked from commit 104ee42)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Apr 25, 2024
…6628)

* [Workspace] Jump to non-workspace url when clicking home icon (#316)

* temp: save



* feat: complete the feature



* feat: remove useless code



* fix: bootstrap error



* fix: bootstrap error



* fix: page not found error



* fix: anchor href



* feat: update toNavLink to comply with workspace



* feat: change to workspaceless



* feat: change to workspaceless



* feat: change to workspaceless



* feat: register list and create page as workspaceless



* feat: optimize code



* feat: update to WorkspaceVisibility



* feat: add unit test



* feat: optimize the jump logic



* fix: unit test



* feat: make app inaccessible if workspaceAccessibility is No



---------



* refactor: using WorkspaceAvailability



* feat: change test name



* feat: update wording



* feat: update test



* feat: add unit test



* feat: remove CHANGELOG change



* Changeset file for PR #6427 created/updated

* Apply suggestions from code review




* Update src/plugins/workspace/public/utils.test.ts




* Lint src/plugins/workspace/public/utils.test.ts



* Lint src/plugins/workspace/public/utils.test.ts



* Lint src/plugins/workspace/public/utils.test.ts



* fix: lint error



* fix: unit test



---------






(cherry picked from commit 104ee42)

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: Miki <[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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Yulong Ruan <[email protected]>
Co-authored-by: Miki <[email protected]>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
…rch-project#6427)

* [Workspace] Jump to non-workspace url when clicking home icon (opensearch-project#316)

* temp: save

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

* feat: complete the feature

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

* feat: remove useless code

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

* fix: bootstrap error

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

* fix: bootstrap error

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

* fix: page not found error

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

* fix: anchor href

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

* feat: update toNavLink to comply with workspace

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

* feat: change to workspaceless

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

* feat: change to workspaceless

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

* feat: change to workspaceless

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

* feat: register list and create page as workspaceless

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

* feat: optimize code

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

* feat: update to WorkspaceVisibility

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

* feat: add unit test

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

* feat: optimize the jump logic

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

* fix: unit test

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

* feat: make app inaccessible if workspaceAccessibility is No

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

---------

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

* refactor: using WorkspaceAvailability

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

* feat: change test name

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

* feat: update wording

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

* feat: update test

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

* feat: add unit test

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

* feat: remove CHANGELOG change

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

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

* Apply suggestions from code review

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

* Update src/plugins/workspace/public/utils.test.ts

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

* Lint src/plugins/workspace/public/utils.test.ts

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

* Lint src/plugins/workspace/public/utils.test.ts

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

* Lint src/plugins/workspace/public/utils.test.ts

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

* fix: lint error

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

* fix: unit test

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

---------

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

[Workspace] Extending App to indicate the visibility of the app based on Workspace
3 participants