-
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] Use the new internal users API in the UI #150432
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
0052783
Create endpoint
cnasikas dc76d81
Add integration tests
cnasikas da0b433
Fix types
cnasikas 9e32bbf
Merge branch 'main' into user_actions_users_api
cnasikas c80ca5f
Fix SO test
cnasikas 3cedccf
Change response structure
cnasikas 1327690
Merge branch 'main' into user_actions_users_api
cnasikas 1479e88
Fix imports
cnasikas 1b2804e
Improvements
cnasikas 74a1b5b
Tests for basic license
cnasikas 5765a73
Merge branch 'main' into user_actions_users_api
cnasikas 8d042ac
Merge branch 'main' into user_actions_users_api
cnasikas b69eb79
PR feedback
cnasikas 68802de
Better structure
cnasikas 8cf7876
PR feedback
cnasikas c02905d
Fix tests
cnasikas 2163590
Merge branch 'main' into user_actions_users_api
cnasikas 36d5548
Better naming
cnasikas 39217c2
Create useGetCaseUsers hook
cnasikas 4f1ffbb
Rename ElasticUser to CaseUser
cnasikas f1f1f1c
Merge branch 'main' into use_users_api_ui
cnasikas b3a9716
Merge branch 'main' into use_users_api_ui
cnasikas ca455b6
Change to the new API
cnasikas d943837
Fix tests & types
cnasikas d73d7fe
Merge branch 'main' into use_users_api_ui
cnasikas f8e07f9
Merge branch 'main' into use_users_api_ui
cnasikas e8193ff
Fix display name when rendering users
cnasikas 377cd88
Add assignees as participants
cnasikas 83331e4
Fallback reporter
cnasikas d8e94d8
Add unit tests
cnasikas a2ca4c6
Fix tests
cnasikas c9be240
Fix types
cnasikas 1854fd8
PR feedback
cnasikas b7d8711
Sort user list
cnasikas e439622
Merge branch 'main' into use_users_api_ui
cnasikas 3475370
Fix tests
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,16 @@ type SnakeToCamelCaseString<S extends string> = S extends `${infer T}_${infer U} | |
? `${T}${Capitalize<SnakeToCamelCaseString<U>>}` | ||
: S; | ||
|
||
type SnakeToCamelCaseArray<T> = T extends Array<infer ArrayItem> | ||
? Array<SnakeToCamelCase<ArrayItem>> | ||
: T; | ||
|
||
export type SnakeToCamelCase<T> = T extends Record<string, unknown> | ||
? { | ||
[K in keyof T as SnakeToCamelCaseString<K & string>]: SnakeToCamelCase<T[K]>; | ||
} | ||
: T extends unknown[] | ||
? SnakeToCamelCaseArray<T> | ||
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. extends the utility function to support arrays. |
||
: T; | ||
|
||
export enum CASE_VIEW_PAGE_TABS { | ||
|
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
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 wonder if there's a way we can tie this implementation with the security plugin 🤔 My concern is that if they make a breaking change to the response structure and make the changes throughout the code base, this won't show up as needing to be changed and it will break the UI.
Here's an idea, how about we add an integration test that does a bulk get using the security API and then does a decode using this schema? Or something like that, that way if there's a breaking change at least we'll get a failing test.
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.
Amazing idea! I was thinking about the same but I could not find a good way to do it.