forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Workspace] Add workspace column to saved objects page (opensearch-pr…
…oject#6225) * Add workspace column into saved objects page Signed-off-by: Hailong Cui <[email protected]> * fix unit test Signed-off-by: Hailong Cui <[email protected]> * add workspaceStart Signed-off-by: Hailong Cui <[email protected]> * merge main Signed-off-by: Hailong Cui <[email protected]> * add changelog Signed-off-by: Hailong Cui <[email protected]> * address review comments Signed-off-by: Hailong Cui <[email protected]> * address review comments Signed-off-by: Hailong Cui <[email protected]> * address review comments Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]>
- Loading branch information
1 parent
f13537c
commit 7352365
Showing
13 changed files
with
246 additions
and
13 deletions.
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
2 changes: 2 additions & 0 deletions
2
...t/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
6 changes: 6 additions & 0 deletions
6
src/plugins/workspace/public/components/workspace_column/index.ts
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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { getWorkspaceColumn, WorkspaceColumn } from './workspace_column'; |
59 changes: 59 additions & 0 deletions
59
src/plugins/workspace/public/components/workspace_column/workspace_colum.test.tsx
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,59 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import React from 'react'; | ||
import { coreMock } from '../../../../../core/public/mocks'; | ||
import { render } from '@testing-library/react'; | ||
import { WorkspaceColumn } from './workspace_column'; | ||
|
||
describe('workspace column in saved objects page', () => { | ||
const coreSetup = coreMock.createSetup(); | ||
const workspaceList = [ | ||
{ | ||
id: 'ws-1', | ||
name: 'foo', | ||
}, | ||
{ | ||
id: 'ws-2', | ||
name: 'bar', | ||
}, | ||
]; | ||
coreSetup.workspaces.workspaceList$.next(workspaceList); | ||
|
||
it('should show workspace name correctly', () => { | ||
const workspaces = ['ws-1', 'ws-2']; | ||
const { container } = render(<WorkspaceColumn coreSetup={coreSetup} workspaces={workspaces} />); | ||
expect(container).toMatchInlineSnapshot(` | ||
<div> | ||
<div | ||
class="euiText euiText--medium" | ||
> | ||
foo | bar | ||
</div> | ||
</div> | ||
`); | ||
}); | ||
|
||
it('show empty when no workspace', () => { | ||
const { container } = render(<WorkspaceColumn coreSetup={coreSetup} />); | ||
expect(container).toMatchInlineSnapshot(` | ||
<div> | ||
<div | ||
class="euiText euiText--medium" | ||
/> | ||
</div> | ||
`); | ||
}); | ||
|
||
it('show empty when workspace can not found', () => { | ||
const { container } = render(<WorkspaceColumn coreSetup={coreSetup} workspaces={['ws-404']} />); | ||
expect(container).toMatchInlineSnapshot(` | ||
<div> | ||
<div | ||
class="euiText euiText--medium" | ||
/> | ||
</div> | ||
`); | ||
}); | ||
}); |
Oops, something went wrong.