-
Notifications
You must be signed in to change notification settings - Fork 898
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 privacy levels to the workspace #8907
Open
Kapian1234
wants to merge
22
commits into
opensearch-project:main
Choose a base branch
from
Kapian1234:workspace_privacy_settings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,362
−1,185
Open
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
9050233
Add privacy selector UI at create page
Kapian1234 1265b85
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
Kapian1234 4def508
Add privacy settings UI at collaborstors page
Kapian1234 4e07afd
Changeset file for PR #8907 created/updated
opensearch-changeset-bot[bot] 3f68926
Add privacy settings panel at collaborstors page
Kapian1234 b78909d
Merge branch 'workspace_privacy_settings' of github.com:Kapian1234/Op…
Kapian1234 19503d3
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
Kapian1234 609c9df
Fix the height of cards at workspace create page
Kapian1234 c363739
Refactor workspace creator form with privacyType and setPrivacyType
wanglam 1ef6afe
Resolve some issues
Kapian1234 b73a75f
Resolve conflicts
Kapian1234 72fa00f
Add privacy settings control at details page
Kapian1234 b0eec18
Add single star user check for add collaborators modal
wanglam 2655936
Disable save button if the selected privay type remains unchanged at …
Kapian1234 f772a0d
Fix workspace creator UT
wanglam 1a96f10
Fix failed snapshots
wanglam 6e4084c
Add missing UT for workspace form utils
wanglam 50f1fac
Update UT for useWorkspaceForm
wanglam ba1e995
Add unit tests for privacy settings at workspace create and details
Kapian1234 37c9c36
Merge branch 'workspace_privacy_settings' of github.com:Kapian1234/Op…
Kapian1234 e0fa159
/
Kapian1234 07a9c7b
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
Kapian1234 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 privacy levels to the workspace ([#8907](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8907)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,12 @@ export enum WorkspacePermissionItemType { | |
Group = 'group', | ||
} | ||
|
||
export enum WorkspacePrivacyItemType { | ||
PrivateToCollaborators = 'privat-to-collaborators', | ||
AnyoneCanView = 'anyone-can-view', | ||
AnyoneCanEdit = 'anyone-can-edit', | ||
} | ||
|
||
export const optionIdToWorkspacePermissionModesMap: { | ||
[key: string]: WorkspacePermissionMode[]; | ||
} = { | ||
|
@@ -102,6 +108,42 @@ export const detailsColorHelpText = i18n.translate( | |
} | ||
); | ||
|
||
export const privacyTypePrivateTitle = i18n.translate( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm prefer to add a privacy type map to organize all these copy. Such as const privacyType2CopyMap = {
[WorkspacePrivacyItemType. PrivateToCollaborators]: {
title: i18n.translate('workspace.privacy.anyoneCanView.title', {
defaultMessage: 'Anyone can view',
}),
description: i18n.translate('workspace.privacy.privateToCollaborators.description', {
defaultMessage: 'Only collaborators can access the workspace.',
}),
},
}; |
||
'workspace.privacy.privateToCollaborators.title', | ||
{ | ||
defaultMessage: 'Private to collaborators', | ||
} | ||
); | ||
|
||
export const privacyTypeViewTitle = i18n.translate('workspace.privacy.anyoneCanView.title', { | ||
defaultMessage: 'Anyone can view', | ||
}); | ||
|
||
export const privacyTypeEditTitle = i18n.translate('workspace.privacy.anyoneCanEdit.title', { | ||
defaultMessage: 'Anyone can edit', | ||
}); | ||
|
||
export const privacyTypePrivateDescription = i18n.translate( | ||
'workspace.privacy.privateToCollaborators.description', | ||
{ | ||
defaultMessage: 'Only collaborators can access the workspace.', | ||
} | ||
); | ||
|
||
export const privacyTypeViewDescription = i18n.translate( | ||
'workspace.privacy.anyoneCanView.description', | ||
{ | ||
defaultMessage: 'Anyone can view workspace assets.', | ||
} | ||
); | ||
|
||
export const privacyTypeEditDescription = i18n.translate( | ||
'workspace.privacy.anyoneCanEdit.description', | ||
{ | ||
defaultMessage: 'Anyone can view and edit workspace assets.', | ||
} | ||
); | ||
|
||
export const PERMISSION_TYPE_LABEL_ID = 'workspace-form-permission-type-label'; | ||
export const PERMISSION_COLLABORATOR_LABEL_ID = 'workspace-form-permission-collaborator-label'; | ||
export const PERMISSION_ACCESS_LEVEL_LABEL_ID = 'workspace-form-permission-access-level-label'; | ||
|
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.
Any reason to use flex item here? I think can be replaced with
EuiSpacer
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.
it would be like this if not using flex
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.
Try to wrap with a regular div.
It won't using a horizontal layout.
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.
BTW, the Edit button seems not aligned with "Workspace privacy" title. Shall we fix it?
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.
alignItems="baseline"
would fix it. Thanks for reminder!