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] fix:Prevent user from visiting dashboards / visualizations when out of a workspace #9024

Conversation

Qxisylolo
Copy link
Contributor

Description

This pr addresses:

  1. Prevent user from visiting dashboards / visualizations when out of a workspace by setting WorkspaceAvailability

Issues Resolved

Screenshot

Testing the changes

Changelog

  • fix: Prevent user from visiting dashboards / visualizations when out of a workspace

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

opensearch-changeset-bot bot added a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 60.93%. Comparing base (40e61c7) to head (77f7f19).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/workspace/public/plugin.ts 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9024   +/-   ##
=======================================
  Coverage   60.93%   60.93%           
=======================================
  Files        3809     3809           
  Lines       91267    91270    +3     
  Branches    14413    14414    +1     
=======================================
+ Hits        55616    55618    +2     
  Misses      32097    32097           
- Partials     3554     3555    +1     
Flag Coverage Δ
Linux_1 28.97% <66.66%> (+<0.01%) ⬆️
Linux_2 56.45% <ø> (ø)
Linux_3 37.96% <ø> (ø)
Linux_4 29.03% <ø> (ø)
Windows_1 28.98% <66.66%> (+<0.01%) ⬆️
Windows_2 56.40% <ø> (ø)
Windows_3 37.97% <ø> (ø)
Windows_4 29.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.

import { UrlForwardingSetup, UrlForwardingStart } from 'src/plugins/url_forwarding/public';
import { isEmpty } from 'lodash';
import { createHashHistory } from 'history';
} from '../../../../src/core/public';
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we can add one more import { WorkspaceAvailability } from '../../../../src/core/public' to avoid re-order

@SuZhou-Joe SuZhou-Joe force-pushed the fix/prevent_user_visit_dashboard_and_vis_when_out_of_workspace branch from 6f5b396 to 77f7f19 Compare January 3, 2025 08:21
@SuZhou-Joe SuZhou-Joe merged commit 15a19fa into opensearch-project:main Jan 6, 2025
75 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 6, 2025
…s when out of a workspace (#9024)

* add workspaceAvailability

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

* Changeset file for PR #9024 created/updated

* add tests

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

* update test

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

* fix test use piple

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

* fix test new

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

---------

Signed-off-by: Qxisylolo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 15a19fa)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
silvaf-dev pushed a commit to silvaf-dev/OpenSearch-Dashboards that referenced this pull request Jan 7, 2025
…s when out of a workspace (opensearch-project#9024)

* add workspaceAvailability

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

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

* add tests

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

* update test

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

* fix test use piple

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

* fix test new

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

---------

Signed-off-by: Qxisylolo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
silvaf-dev pushed a commit to silvaf-dev/OpenSearch-Dashboards that referenced this pull request Jan 7, 2025
…s when out of a workspace (opensearch-project#9024)

* add workspaceAvailability

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

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

* add tests

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

* update test

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

* fix test use piple

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

* fix test new

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

---------

Signed-off-by: Qxisylolo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Signed-off-by: Federico Silva <[email protected]>
SuZhou-Joe pushed a commit that referenced this pull request Jan 9, 2025
…s when out of a workspace (#9024) (#9144)

* add workspaceAvailability



* Changeset file for PR #9024 created/updated

* add tests



* update test



* fix test use piple



* fix test new



---------



(cherry picked from commit 15a19fa)

Signed-off-by: Qxisylolo <[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]>
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