-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResponseOps][Cases] User assignment (#140208)
* [ResponseOps][Cases] Assign users on cases sidebar section (#138108) * Add reusable user profile selector component * Refactoring services, auth * Adding suggest api and tests * Move to package and add examples * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Working integration tests * Switching suggest api tags * Adding assignees field * Adding tests for size and owner * Add server side example * CI Fixes * Adding assignee integration tests * fix tests * Addd tests * Starting user actions changes * Adding api tag tests * Addressing feedback * Using lodash for array comparison logic and tests * Fixing type error * Create suggest query * Adding assignees user action * [ResponseOps][Cases] Refactoring client args and authentication (#137345) * Refactoring services, auth * Fixing type errors * Adding assignees migration and tests * Fixing types and added more tests * Fixing cypress test * Fixing test * Add tests * Add security as dependency and fix types * Add bulk get profiles query * Rename folder * Addressed suggestions from code review * Fix types * Adding migration for assignees field and tests * Adding comments and a few more tests * Updating comments and spelling * Revert security solution optional * PR feedback * Updated user avatar component * Reduce size * Make security required * Fix tests * Addressing feedback * Do not retry suggestions * Assign users to a case * Restructure components * Move assignees to case view * Show assigned users * Refactoring bulk get and display name * Adding tests for user tooltip * Adding tests * Hovering and tests * Fixing errors * Some pr clean up * Fixing tests and adding more * Adding functional tests * Fixing jest test failure * Passing in current user profile * Refactoring assignment with useEffect * Fixing icon alignment and removal render bug * Fixing type errors * Fixing test errors * Adding bulk get privs and tests * Fixing popover tests * Handling unknown users * Adding tests for unknown users * Adding wait for popover calls * Addressing design feedback * Addressing remaining feedback * Refactoring css and name prop * Refactoring popover * Refactoring search component * Addressing some feedback * Adjusting sorting * Fixing tests * Fixing type error * Fixing test error * Fixing test errors * Removing display name Co-authored-by: Thom Heymann <[email protected]> Co-authored-by: Jonathan Buttner <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Thom Heymann <[email protected]> Co-authored-by: Jonathan Buttner <[email protected]> * [ResponseOps][Cases] Add assignee user actions (#139392) * Adding user actions for assignees * Fixing merge issues * Fixing test mock errors * Fixing display name errors and themselves * Fixing test for time being * Addressing feedback * Addressing comma and uniq feedback * Using core getUserDisplayName * Fixing import and removing flickering * Fixing tests Co-authored-by: Kibana Machine <[email protected]> * Detect when user is typing * Use select to tranform data * [Cases] Assign users when creating a case (#139754) * Init * Render users * Assign yourself * Add tests * Fix tests * PR feedback * [ResponseOps][Cases] Filter by assignees (#139441) * Starting the filtering * Rough draft working for assignees filtering * Adding integration tests for new route * Starting to write tests * Fixing tests * Cleaning up more tests * Removing duplicate call for current user * Fixing type errors and tests * Adding tests for filtering * Adding rbac tests * Fixing translations * Fixing api integration tests * Fixing severity tests * Really fixing arrays equal * Fixing ml tests and refactoring find assignees * Fixing cypress tests * Fixing types * Fix tests * Addressing first round of feedback * Reverting the recent cases changes * Fixing tests * Fixing more tests and types * Allowing multi select * Fixing attachment framework issue * Addressing feedback * Fixing type error * Fixing tests * Sort users and improve loading * Fix ml security dependecies * Fix permissions when fetching suggestions * Fixing read permissions and suggest api * Hiding assignee delete icon * Hiding the assign yourself text when undefined * Create page fixes Co-authored-by: Christos Nasikas <[email protected]> Co-authored-by: Thom Heymann <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Thom Heymann <[email protected]>
- Loading branch information
1 parent
31f337d
commit e5cc558
Showing
137 changed files
with
5,000 additions
and
1,184 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
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
18 changes: 0 additions & 18 deletions
18
x-pack/plugins/cases/common/api/cases/suggest_user_profiles.ts
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*/ | ||
|
||
export * from './test_providers'; | ||
export * from './permissions'; |
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,69 @@ | ||
/* | ||
* 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 { CasesCapabilities, CasesPermissions } from '../../containers/types'; | ||
|
||
export const allCasesPermissions = () => buildCasesPermissions(); | ||
export const noCasesPermissions = () => | ||
buildCasesPermissions({ read: false, create: false, update: false, delete: false, push: false }); | ||
export const readCasesPermissions = () => | ||
buildCasesPermissions({ read: true, create: false, update: false, delete: false, push: false }); | ||
export const noCreateCasesPermissions = () => buildCasesPermissions({ create: false }); | ||
export const noUpdateCasesPermissions = () => buildCasesPermissions({ update: false }); | ||
export const noPushCasesPermissions = () => buildCasesPermissions({ push: false }); | ||
export const noDeleteCasesPermissions = () => buildCasesPermissions({ delete: false }); | ||
export const writeCasesPermissions = () => buildCasesPermissions({ read: false }); | ||
|
||
export const buildCasesPermissions = (overrides: Partial<Omit<CasesPermissions, 'all'>> = {}) => { | ||
const create = overrides.create ?? true; | ||
const read = overrides.read ?? true; | ||
const update = overrides.update ?? true; | ||
const deletePermissions = overrides.delete ?? true; | ||
const push = overrides.push ?? true; | ||
const all = create && read && update && deletePermissions && push; | ||
|
||
return { | ||
all, | ||
create, | ||
read, | ||
update, | ||
delete: deletePermissions, | ||
push, | ||
}; | ||
}; | ||
|
||
export const allCasesCapabilities = () => buildCasesCapabilities(); | ||
export const noCasesCapabilities = () => | ||
buildCasesCapabilities({ | ||
create_cases: false, | ||
read_cases: false, | ||
update_cases: false, | ||
delete_cases: false, | ||
push_cases: false, | ||
}); | ||
export const readCasesCapabilities = () => | ||
buildCasesCapabilities({ | ||
create_cases: false, | ||
update_cases: false, | ||
delete_cases: false, | ||
push_cases: false, | ||
}); | ||
export const writeCasesCapabilities = () => { | ||
return buildCasesCapabilities({ | ||
read_cases: false, | ||
}); | ||
}; | ||
|
||
export const buildCasesCapabilities = (overrides?: Partial<CasesCapabilities>) => { | ||
return { | ||
create_cases: overrides?.create_cases ?? true, | ||
read_cases: overrides?.read_cases ?? true, | ||
update_cases: overrides?.update_cases ?? true, | ||
delete_cases: overrides?.delete_cases ?? true, | ||
push_cases: overrides?.push_cases ?? true, | ||
}; | ||
}; |
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.