-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cases] Update UI to use the new connector's API #149276
Merged
cnasikas
merged 38 commits into
elastic:main
from
cnasikas:get_connectors_info_from_server
Jan 31, 2023
Merged
Changes from 22 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
8edad49
Create getCaseConnectors hook
cnasikas 816e8e1
Show push info
cnasikas c906ce4
Get fields from the new API
cnasikas c2eaf8c
Remove button & callout components from usePushToService
cnasikas 71e543d
Move isValid and connectorName to edit connector component
cnasikas fe1d996
Reset form based on key
cnasikas 2e6a8c6
Remove spacer on last item in CasesCallouts
cnasikas f9ce0d4
Move push button and callouts to seperate files
cnasikas 085f86f
Improve styles
cnasikas 865accf
Contruct connector on submit inside edit connector component
cnasikas a46c8c3
Fixes
cnasikas dad1ec6
Silent errors from actions client
cnasikas 75c3c57
Minor fixes
cnasikas a482321
Adding oldest push timestamp
jonathan-buttner 5d57d65
Fix tests and types
cnasikas db30357
Merge branch 'main' into get_connectors_info_from_server
cnasikas f5f4913
Merge branch 'cases-first-push-info' into get_connectors_info_from_se…
cnasikas 7f9d189
Improve tests
cnasikas 39162ce
Fix i18n
cnasikas ec5e1c7
Add more tests
cnasikas c50cde7
Fix bug
cnasikas 304c450
Fix tests
cnasikas fb62ecc
Adding new external services field
jonathan-buttner d6e8fe2
Clarifying date field names
jonathan-buttner 7296f8a
Merge branch 'main' into get_connectors_info_from_server
cnasikas 965d17d
Merge branch 'cases-latest-push-info' into get_connectors_info_from_s…
cnasikas 54963b3
Get external service from case connectors
cnasikas c31815f
Add API unit test
cnasikas 8aee8e0
PR feedback
cnasikas b5b626b
Merge branch 'main' into get_connectors_info_from_server
cnasikas fc04401
PR feedback
cnasikas 183a915
Fix types
cnasikas 56611dc
Fix tests
cnasikas 908ca2d
Merge branch 'main' into get_connectors_info_from_server
cnasikas 5cbd246
Fix conflicts
cnasikas 9b00d2a
Rename action connectors apis
cnasikas 50554fe
PR feedback
cnasikas 45eeba9
Merge branch 'main' into get_connectors_info_from_server
cnasikas 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 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
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 |
---|---|---|
|
@@ -29,8 +29,6 @@ const useGetCaseUserActionsMock = useGetCaseUserActions as jest.Mock; | |
const defaultUseGetCaseUserActions = { | ||
data: { | ||
caseUserActions: [...caseUserActions, getAlertUserAction()], | ||
caseServices: {}, | ||
hasDataToPush: false, | ||
participants: [basicCase.createdBy], | ||
}, | ||
isLoading: false, | ||
|
@@ -70,21 +68,6 @@ describe('CaseActionBar', () => { | |
expect(wrapper.find(`[data-test-subj="sync-alerts-switch"]`).exists()).toBeTruthy(); | ||
expect(wrapper.find(`[data-test-subj="case-refresh"]`).exists()).toBeTruthy(); | ||
expect(wrapper.find(`[data-test-subj="case-view-actions"]`).exists()).toBeTruthy(); | ||
// no loading bar | ||
expect(wrapper.find(`[data-test-subj="case-view-action-bar-spinner"]`).exists()).toBeFalsy(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Imo, there is no need to show the loading spinner in the action bar only for the "View " button. |
||
}); | ||
|
||
it('shows a loading bar when user actions are loaded', async () => { | ||
useGetCaseUserActionsMock.mockReturnValue({ | ||
data: undefined, | ||
isLoading: true, | ||
}); | ||
const wrapper = mount( | ||
<TestProviders> | ||
<CaseActionBar {...defaultProps} /> | ||
</TestProviders> | ||
); | ||
expect(wrapper.find(`[data-test-subj="case-view-action-bar-spinner"]`).exists()).toBeTruthy(); | ||
}); | ||
|
||
it('should show correct status', () => { | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the names to be sure that the tests find the correct connector in the DOM.
My Connector
was the name of thenone
connector.