Skip to content

Commit

Permalink
Remove jsonpath@1.1.1 (CVE-2023-26115)
Browse files Browse the repository at this point in the history
  • Loading branch information
pefernan committed Sep 14, 2023
1 parent cb9f921 commit 5d73010
Show file tree
Hide file tree
Showing 4 changed files with 9,447 additions and 3,249 deletions.
1 change: 0 additions & 1 deletion ui-packages/packages/components-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@patternfly/react-table": "^4.113.0",
"ajv": "^6.12.6",
"apollo-boost": "^0.4.9",
"jsonpath": "^1.1.1",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import isEmpty from 'lodash/isEmpty';
import filter from 'lodash/filter';
import sample from 'lodash/sample';
import keys from 'lodash/keys';
import get from 'lodash/get';
import reduce from 'lodash/reduce';
import isFunction from 'lodash/isFunction';
import uuidv4 from 'uuid';
import jp from 'jsonpath';
import {
OUIAProps,
componentOuiaProps
Expand Down Expand Up @@ -64,7 +64,7 @@ interface IOwnProps {

const getCellData = (dataObj: Record<string, unknown>, path: string) => {
if (dataObj && path) {
return !isEmpty(jp.value(dataObj, path)) ? jp.value(dataObj, path) : 'N/A';
return get(dataObj, path) ?? 'N/A';
} else {
return 'N/A';
}
Expand Down Expand Up @@ -94,7 +94,7 @@ const getColumns = (data: any[], columns: DataTableColumn[]) => {
} as ICell;
})
: filter(keys(sample(data)), (key) => key !== '__typename').map(
(key) => ({ title: key, data: `$.${key}` } as ICell)
(key) => ({ title: key, data: key } as ICell)
);
} else if (columns) {
return filter(columns, (column) => !isEmpty(column.path)).map((column) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,24 @@ const stateColumnTransformer = (value) => {
const columns: DataTableColumn[] = [
{
label: 'ProcessId',
path: '$.processId'
path: 'processId'
},
{
label: 'Name',
path: '$.name',
path: 'name',
isSortable: true
},
{
label: 'Priority',
path: '$.priority'
path: 'priority'
},
{
label: 'ProcessInstanceId',
path: '$.processInstanceId'
path: 'processInstanceId'
},
{
label: 'State',
path: '$.state',
path: 'state',
bodyCellTransformer: stateColumnTransformer,
isSortable: true
}
Expand Down
Loading

0 comments on commit 5d73010

Please sign in to comment.