-
Notifications
You must be signed in to change notification settings - Fork 0
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] Jump to non-workspace url when clicking home icon #316
[Workspace] Jump to non-workspace url when clicking home icon #316
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## workspace-pr-integr #316 +/- ##
=======================================================
+ Coverage 35.17% 44.41% +9.24%
=======================================================
Files 1885 2741 +856
Lines 36421 54278 +17857
Branches 6672 8543 +1871
=======================================================
+ Hits 12810 24109 +11299
- Misses 22761 28796 +6035
- Partials 850 1373 +523
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
0026219
to
5602f14
Compare
@SuZhou-Joe I'm getting "Not Found" page when server base path is enabled |
Sorry for the mistake. Fix for that. |
How do you like the idea of adding a new field visibility on @wanglam @ruanyl @gaobinlong @Hailong-am @raintygao @xluo-aws |
src/core/public/application/types.ts
Outdated
* Defaulting to `both` | ||
* See {@link AppVisibility} | ||
*/ | ||
visibility?: AppVisibility; |
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.
Since this property only be used for workspace. Shall we change to a boolean property, and renaming to something like workspaceVisible
?
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.
There should be 3 states: both, homeOnly and workspaceOnly. I have some concern that regarding undefined
as both would introduce some confusion.
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.
Though actually a link should be either homeOnly or workspaceOnly, I am afraid we can not force plugins to change the registration by 2.14 .
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.
Just a little concerned about there are too many visibility related property (status, navLinkStatus, chromeless) in the interface. Or we can just renaming to workspaceLess
, then we just mark home plugin to true.
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, agree on that there are too many similar property. So I think maybe we could extend the status field by adding inaccessible-in-workspace
and inaccessible-in-home
, what do you think?
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.
an app can only be accessed within a workspace
workspace update/overview page are two examples
I mean only two state is not enough, if using workspaceless
which is boolean, it can only represent two state above.
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.
Is it necessary to mark the application as "an app can only be accessed within a workspace"? It will a little bit confused when workspace not enabled. For these pages, I think we still need to be displayed when workspace is turn 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.
I mean only two state is not enough
I see. do you think undefined/null, true, false will be three states and enough for our case? undefined/null
same as current.
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.
If we need to represent 3 states in a single field, an enum would be better instead of regarding undefined/null
as a different state to false
. This is a draft PR and we can adjust that.
What about:
workspaceAccessibility.withinWorkspace
-> only accessible in workspace, should be filter out from home in the future when workspace enabled, which means user won't be enable to create visualizations and dashboards out of workspace.workspaceAccessibility.outOfWorkspace
-> only accessible out of workspace, can be used for pages like home/workspace list/workspace create page. Should be used in workspace-create/workspace-update pages to filter out inaccessible features.- undefined -> as current to keep backward capability.
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.
Is it necessary to mark the application as "an app can only be accessed within a workspace"? It will a little bit confused when workspace not enabled. For these pages, I think we still need to be displayed when workspace is turn off.
That's a good point. One way that I can think of is to check the workspace flag when plugin register the app, for example, via capabilities service. If workspace is turned off, plugin should not use this flag
Shall we filter out features in workspace create and update page by the new field in this PR? |
Will be raised in a following PR. |
do we need to add |
c20b2d8
to
764d168
Compare
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
ef97b45
to
dec7c4f
Compare
Signed-off-by: SuZhou-Joe <[email protected]>
…rch-project#6427) * [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 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]>
…rch-project#6427) (opensearch-project#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 opensearch-project#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]>
Description
Home page, which is supposed to be only visited without 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
workspaceAccessibility
inside App, which indicates the accessibility of the application based on workspace. This field can bring two benefits:navigateToApp
method. By using the workspaceAccessibility field, workspace is able to do the hard navigation in a central place.Issues Resolved
opensearch-project#6362
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration