Skip to content

Commit

Permalink
feat: Support AAP & MSSQL workloads (#1668)
Browse files Browse the repository at this point in the history
  • Loading branch information
leSamo authored May 19, 2022
1 parent f4bf0ca commit 4f4682c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 23 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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@redhat-cloud-services/frontend-components-pdf-generator": "2.6.7",
"@redhat-cloud-services/frontend-components-translations": "3.2.3",
"@redhat-cloud-services/frontend-components-utilities": "3.2.14",
"@redhat-cloud-services/vulnerabilities-client": "1.0.107",
"@redhat-cloud-services/vulnerabilities-client": "1.0.108",
"axios": "^0.27.2",
"classnames": "^2.2.5",
"dot": "^1.1.3",
Expand Down
31 changes: 20 additions & 11 deletions src/Helpers/APIHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export function getExecutiveReport() {
}

/**
* /cves
* /cves/ids
* /vulnerabilities/cves
* /vulnerabilities/cves/ids
*/
let cveParams = [
'cvss_from',
Expand All @@ -76,7 +76,9 @@ export function getCveListByAccount(apiProps) {
...defaultParams,
...cveParams,
'report',
'advanced_report'
'advanced_report',
'ansible',
'mssql'
];
let parameterArray = constructParameters(apiProps, parameterNames);
let result = api.getCveList(...parameterArray);
Expand All @@ -86,7 +88,9 @@ export function getCveListByAccount(apiProps) {
export function getCveIdsList(apiProps) {
let parameterNames = [
...defaultParams,
...cveParams
...cveParams,
'ansible',
'mssql'
];

let parameterArray = constructParameters(apiProps, parameterNames);
Expand All @@ -95,8 +99,7 @@ export function getCveIdsList(apiProps) {
}

/**
* /cve/ID/affected_systems
* /cve/ID/affected_systems/ids
* /cves/ID/affected_systems
*/
let systemsByCVEparams = [
'status_id',
Expand All @@ -121,7 +124,9 @@ export function getAffectedSystemsByCVE({ id, ...apiProps }) {
let parameterNames = [
...defaultParams,
...systemsByCVEparams,
'report'
'report',
'ansible',
'mssql'
];

let parameterArray = constructParameters(apiProps, parameterNames);
Expand All @@ -141,8 +146,8 @@ export function getAffectedSystemsIdsByCve({ id, ...apiProps }) {
}

/**
* /system/ID/cves
* /system/ID/cves/ids
* /systems/ID/cves
* /systems/ID/cves/ids
*/
let cveBySystemParams = [
'cvss_from',
Expand Down Expand Up @@ -219,7 +224,9 @@ export function getSystems(apiProps) {
let parameterNames = [
...defaultParams,
...systemsParams,
'report'
'report',
'ansible',
'mssql'
];
let parameterArray = constructParameters(apiProps, parameterNames);
let result = api.getSystemsList(...parameterArray);
Expand All @@ -245,7 +252,9 @@ export function getDashbar(apiProps) {
let parameterNames = [
'tags',
'sap_sids',
'sap_system'
'sap_system',
'ansible',
'mssql'
];
let parameterArray = constructParameters(apiProps, parameterNames);
let result = api.getDashbar(...parameterArray);
Expand Down
12 changes: 9 additions & 3 deletions src/Helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,9 @@ export const CVES_ALLOWED_PARAMS = [
'tags',
'sap_sids',
'sap_system',
'remediation'
'remediation',
'ansible',
'mssql'
];

export const SYSTEMS_EXPOSED_ALLOWED_PARAMS = [
Expand All @@ -891,7 +893,9 @@ export const SYSTEMS_EXPOSED_ALLOWED_PARAMS = [
'advisory',
'rhel_version',
'advisory_available',
'remediation'
'remediation',
'ansible',
'mssql'
];

export const SYSTEMS_ALLOWED_PARAMS = [
Expand All @@ -904,7 +908,9 @@ export const SYSTEMS_ALLOWED_PARAMS = [
'sap_sids',
'sap_system',
'excluded',
'rhel_version'
'rhel_version',
'ansible',
'mssql'
];

export const CVES_DEFAULT_FILTERS = {
Expand Down
6 changes: 5 additions & 1 deletion src/Store/Reducers/reducersHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export const applyGlobalFilter = (state, { workloads, SIDs, tags }) => {
} else {
state = {
...state,
...workloads && { sap_system: workloads?.SAP?.isSelected === true ? true : undefined },
...workloads && {
sap_system: (workloads?.SAP?.isSelected === true) || undefined,
ansible: (workloads?.['Ansible Automation Platform']?.isSelected === true) || undefined,
mssql: (workloads?.['Microsoft SQL']?.isSelected === true) || undefined
},
...SIDs && { sap_sids: SIDs },
...tags && { tags },
page: 1
Expand Down

0 comments on commit 4f4682c

Please sign in to comment.