Skip to content

Commit

Permalink
Append group_names when filtering by group
Browse files Browse the repository at this point in the history
  • Loading branch information
gkarat committed Aug 31, 2023
1 parent 45f81a6 commit 73a5c35
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@redhat-cloud-services/frontend-components-translations": "^3.2.4",
"@redhat-cloud-services/frontend-components-utilities": "^3.7.0",
"@redhat-cloud-services/host-inventory-client": "^1.0.116",
"@redhat-cloud-services/vulnerabilities-client": "^1.2.5",
"@redhat-cloud-services/vulnerabilities-client": "^1.2.7",
"@scalprum/react-core": "^0.1.9",
"@unleash/proxy-client-react": "^3.6.0",
"axios": "^1.4.0",
Expand Down Expand Up @@ -237,4 +237,4 @@
"src/**/*.cy.js"
]
}
}
}
3 changes: 2 additions & 1 deletion src/Helpers/APIHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ export function getSystems(apiProps) {
...systemsParams,
'report',
'ansible',
'mssql'
'mssql',
'group_names'
];
let parameterArray = constructParameters(apiProps, parameterNames);
let result = api.getSystemsList(...parameterArray);
Expand Down
7 changes: 5 additions & 2 deletions src/Helpers/Hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@ export const useGetEntities = (fetchApi, { id, setUrlParams, createRows }) => {

const getEntities = async (
_items,
{ orderBy, orderDirection, page, per_page: perPage, vulnerabilityParams }
{ orderBy, orderDirection, page, per_page: perPage, vulnerabilityParams, filters }
) => {
const sort = `${orderDirection === 'ASC' ? '' : '-'}${orderBy}`;

const params = {
...vulnerabilityParams,
page,
page_size: perPage,
sort
sort,
...filters?.hostGroupFilter ? {
group_names: filters.hostGroupFilter.join(',')
} : {}
};

setUrlParams?.({ ...params });
Expand Down

0 comments on commit 73a5c35

Please sign in to comment.