Skip to content

Commit

Permalink
[Workspace]feat: add collaborator table to workspace detail page (#8501)
Browse files Browse the repository at this point in the history
* feat: add collaborator table

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

* Changeset file for PR #8501 created/updated

* Changeset file for PR #8501 created/updated

* remove extra comment and add test for button

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

* combine onChange

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

* update table

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

* test: add tests for table

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

* address comments

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

---------

Signed-off-by: tygao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 98df4dd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 6730e0b commit 1e8272d
Show file tree
Hide file tree
Showing 23 changed files with 2,260 additions and 128 deletions.
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';

// 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

0 comments on commit 1e8272d

Please sign in to comment.