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]feat: add collaborator table to workspace detail page #8501

Merged
merged 8 commits into from
Oct 9, 2024
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/8501.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add collaborator table to workspace detail page ([#8501](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8501))
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ describe('WorkspaceFormSummaryPanel', () => {
expect(screen.getByText('Data Source 2')).toBeInTheDocument();
expect(screen.getByText('Data Source 3')).toBeInTheDocument();
expect(screen.getByText('user1')).toBeInTheDocument();
expect(screen.getByText('Owner')).toBeInTheDocument();
expect(screen.getByText('Admin')).toBeInTheDocument();
expect(screen.getByText('group1')).toBeInTheDocument();
expect(screen.getByText('Read')).toBeInTheDocument();
expect(screen.getByText('Read only')).toBeInTheDocument();
expect(screen.getByText('+1 more')).toBeInTheDocument();
expect(screen.queryByText('user2')).toBeNull();
expect(screen.getByText('Cancel')).toBeInTheDocument();
Expand Down

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 @@ -16,6 +16,7 @@ import { WorkspaceFormProvider, WorkspaceOperationType } from '../workspace_form
import { DataSourceConnectionType } from '../../../common/types';
import * as utilsExports from '../../utils';
import { IntlProvider } from 'react-intl';
import { of } from 'rxjs';
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's keep the empty line

Suggested change
import { of } from 'rxjs';
import { of } from 'rxjs';


// all applications
const PublicAPPInfoMap = new Map([
Expand Down Expand Up @@ -131,6 +132,9 @@ const WorkspaceDetailPage = (props: any) => {
return null;
},
},
collaboratorTypes: {
getTypes$: jest.fn().mockReturnValue(of([])),
},
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const WorkspaceDetailApp = (props: WorkspaceDetailPropsWithOnAppLeave) =>
}, [currentWorkspace, savedObjects, http, notifications]);

const handleWorkspaceFormSubmit = useCallback(
async (data: WorkspaceFormSubmitData) => {
async (data: WorkspaceFormSubmitData, refresh?: boolean) => {
let result;
if (isFormSubmitting) {
return;
Expand Down Expand Up @@ -127,7 +127,8 @@ export const WorkspaceDetailApp = (props: WorkspaceDetailPropsWithOnAppLeave) =>
defaultMessage: 'Update workspace successfully',
}),
});
if (application && http) {
setIsFormSubmitting(false);
if (application && http && refresh) {
// Redirect page after one second, leave one second time to show update successful toast.
window.setTimeout(() => {
window.location.href = formatUrlWithWorkspaceId(
Expand Down

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

Loading
Loading