-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Graph] Switch to SavedObjectClient.resolve #109617
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
Merged
mbondyra
merged 9 commits into
elastic:master
from
mbondyra:graph/savedObjectClientResolve
Sep 10, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8a83041
use resolve instead of get
mbondyra fcdaff4
graph step 3 (tests missing)
mbondyra 2203f6b
tests
mbondyra 8508c8a
moving the functionality to workspace_route
mbondyra 0d63e9c
removing unnecessary mock
mbondyra 60fba05
make spaces optional & add negative test
mbondyra 66bb543
Merge branch 'master' into graph/savedObjectClientResolve
kibanamachine e1d2a46
Merge commit '334f129bcbffb1502d408f8be1c6c13a60c68635' into graph/sa…
mbondyra 889b608
feedback from cr
mbondyra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
63 changes: 63 additions & 0 deletions
63
x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.test.tsx
This file contains hidden or 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,63 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { shallow } from 'enzyme'; | ||
| import { WorkspaceLayoutComponent } from '.'; | ||
| import { coreMock } from 'src/core/public/mocks'; | ||
| import { spacesPluginMock } from '../../../../spaces/public/mocks'; | ||
| import { NavigationPublicPluginStart as NavigationStart } from '../../../../../../src/plugins/navigation/public'; | ||
| import { GraphSavePolicy, GraphWorkspaceSavedObject, IndexPatternProvider } from '../../types'; | ||
| import { OverlayStart, Capabilities } from 'kibana/public'; | ||
| import { SharingSavedObjectProps } from '../../helpers/use_workspace_loader'; | ||
|
|
||
| jest.mock('react-router-dom', () => { | ||
| const useLocation = () => ({ | ||
| search: '?query={}', | ||
| }); | ||
| return { | ||
| useLocation, | ||
| }; | ||
| }); | ||
|
|
||
| describe('workspace_layout', () => { | ||
| const defaultProps = { | ||
| renderCounter: 1, | ||
| loading: false, | ||
| savedWorkspace: { id: 'test' } as GraphWorkspaceSavedObject, | ||
| hasFields: true, | ||
| overlays: {} as OverlayStart, | ||
| workspaceInitialized: true, | ||
| indexPatterns: [], | ||
| indexPatternProvider: {} as IndexPatternProvider, | ||
| capabilities: {} as Capabilities, | ||
| coreStart: coreMock.createStart(), | ||
| graphSavePolicy: 'configAndDataWithConsent' as GraphSavePolicy, | ||
| navigation: {} as NavigationStart, | ||
| canEditDrillDownUrls: true, | ||
| setHeaderActionMenu: jest.fn(), | ||
| sharingSavedObjectProps: { | ||
| outcome: 'exactMatch', | ||
| aliasTargetId: '', | ||
| } as SharingSavedObjectProps, | ||
| spaces: spacesPluginMock.createStartContract(), | ||
| }; | ||
| it('should display conflict notification if outcome is conflict', () => { | ||
| shallow( | ||
| <WorkspaceLayoutComponent | ||
| {...defaultProps} | ||
| sharingSavedObjectProps={{ outcome: 'conflict', aliasTargetId: 'conflictId' }} | ||
| /> | ||
| ); | ||
| expect(defaultProps.spaces.ui.components.getLegacyUrlConflict).toHaveBeenCalledWith({ | ||
| currentObjectId: 'test', | ||
| objectNoun: 'Graph', | ||
| otherObjectId: 'conflictId', | ||
| otherObjectPath: '#/workspace/conflictId?query={}', | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.