-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 4.4-7.16] Redesign the SCA table from agent's dashboard (#4748
) Redesign the SCA table from agent's dashboard (#4512) * SCA table: Latest scans * redirect and states * params url * the tables are working properly * styles * inventory test * styles euiFlexGroup * SCA test, back button and parameter renaming * load for tables * Added new policies table for reuse in agent welcome and sca * Fixed table redirection on row clicked * Solved review comments * Fixed policy row redirect, renaming and remove it unused code * Updated CHANGELOG * Added pagination * Updated snapshots to fix unit tests * Updated CHANGELOG * Fixed lastest scan navigation Co-authored-by: Maximiliano Ibarra <maximilianoaibarra@gmail.com> (cherry picked from commit 138893d) Co-authored-by: Chantal Belén kelm <99441266+chantal-kelm@users.noreply.github.com>
- Loading branch information
1 parent
22490ce
commit af92d95
Showing
12 changed files
with
277 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { MainSca } from './main'; | ||
export { Inventory } from './inventory'; | ||
export { Inventory } from './inventory'; | ||
export * from './inventory/index' |
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
33 changes: 33 additions & 0 deletions
33
public/components/agents/sca/inventory/agent-policies-table.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,33 @@ | ||
import React from 'react'; | ||
import { TableWzAPI } from '../../../common/tables/table-wz-api'; | ||
|
||
type Props = { | ||
columns: any[]; | ||
rowProps?: any; | ||
agent: { [key in string]: any }; | ||
tableProps?: any; | ||
}; | ||
|
||
export default function SCAPoliciesTable(props: Props) { | ||
const { columns, rowProps, agent, tableProps } = props; | ||
|
||
const getPoliciesRowProps = (item: any, idx: string) => { | ||
return { | ||
'data-test-subj': `sca-row-${idx}`, | ||
className: 'customRowClass', | ||
onClick: rowProps ? () => rowProps(item) : null | ||
} | ||
} | ||
|
||
return ( | ||
<> | ||
<TableWzAPI | ||
tableInitialSortingField="policy_id" | ||
endpoint={`/sca/${agent.id}`} | ||
tableColumns={columns} | ||
rowProps={getPoliciesRowProps} | ||
{ ...tableProps} | ||
/> | ||
</> | ||
); | ||
} |
Oops, something went wrong.