Skip to content

Commit

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

* feat: add collaborator table

Signed-off-by: tygao <tygao@amazon.com>

* Changeset file for PR opensearch-project#8501 created/updated

* Changeset file for PR opensearch-project#8501 created/updated

* remove extra comment and add test for button

Signed-off-by: tygao <tygao@amazon.com>

* combine onChange

Signed-off-by: tygao <tygao@amazon.com>

* update table

Signed-off-by: tygao <tygao@amazon.com>

* test: add tests for table

Signed-off-by: tygao <tygao@amazon.com>

* address comments

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
1 parent dd67d96 commit 98df4dd
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 98df4dd

Please sign in to comment.