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

[Backport 2.x] [Workspace] Add privacy levels to the workspace #9162

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/8907.yml
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))
4 changes: 4 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ export class DocLinksService {
// https://opensearch.org/docs/latest/dashboards/management/advanced-settings/
advancedSettings: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}management/advanced-settings/`,
},
workspace: {
// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/
acl: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/`,
},
},
noDocumentation: {
auditbeat: `${OPENSEARCH_WEBSITE_DOCS}tools/index/#downloads`,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,14 @@ describe('AddCollaboratorsModal', () => {
expect(addCollaboratorsButton).not.toBeDisabled();
});
});

it('should show "Invalid Collaborator ID format" for "*" collaborator id', async () => {
render(<AddCollaboratorsModal {...defaultProps} />);
const collaboratorInput = screen.getByLabelText(defaultProps.inputLabel);
fireEvent.change(collaboratorInput, { target: { value: '*' } });

expect(screen.queryByText('Invalid Collaborator ID format')).toBeNull();
fireEvent.click(screen.getByRole('button', { name: 'Add collaborators' }));
expect(screen.getByText('Invalid Collaborator ID format')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ export const AddCollaboratorsModal = ({
const [isAdding, setIsAdding] = useState(false);

const handleAddCollaborators = async () => {
const singleStarIds = validInnerCollaborators.flatMap(({ id, collaboratorId }) =>
collaboratorId.trim() === '*' ? id : []
);
if (singleStarIds.length > 0) {
setErrors(
singleStarIds.reduce(
(previousErrors, id) => ({
...previousErrors,
[id]: i18n.translate('workspace.addCollaboratorsModal.errors.invalidUserFormat', {
defaultMessage: 'Invalid {inputLabel} format',
values: {
inputLabel,
},
}),
}),
{}
)
);
return;
}
const collaboratorId2IdsMap = validInnerCollaborators.reduce<{
[key: string]: number[];
}>((previousValue, collaborator) => {
Expand Down
Loading
Loading