Skip to content

Commit

Permalink
Merge pull request #1191 from akto-api-security/fix/fix_ui_bugs_for_t…
Browse files Browse the repository at this point in the history
…esting

Made changes for testing and issues
  • Loading branch information
notshivansh authored Jun 14, 2024
2 parents f4433f3 + 96c1054 commit 8d67bc7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function DonutChart({data, title, size,type,navUrl}) {
let seriesData = []
if(data && Object.keys(data).length > 0){
seriesData = Object.keys(data).map((ele)=>{

return {...data[ele], y: data[ele].text, name: ele }
})
}
Expand Down Expand Up @@ -68,7 +67,6 @@ function DonutChart({data, title, size,type,navUrl}) {
}
else if( navUrl && navUrl==='/dashboard/issues/'){
const filterUrl = '/dashboard/issues'

let updatedFiltersMap = { ...filtersMap };
updatedFiltersMap[filterUrl] = {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ function GithubServerTable(props) {
tempData ? setData([...tempData.value]) : setData([])
tempData ? setTotal(tempData.total) : setTotal(0)
applyFilter(tempData.total)
if(!performance.getEntriesByType('navigation')[0].type === 'reload'){
setTableInitialState({
...tableInitialState,
[currentPageKey]: tempData.total
})
}
setTableInitialState({
...tableInitialState,
[currentPageKey]: tempData.total
})
}

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ function ActivityTracker({latestActivity, onLoadMore, showLoadMore, collections

let updatedFiltersMap = { ...filtersMap };

const filterkey = '/dashboard/issues'
const filterKey = '/dashboard/issues'

const filterarray = [{
const filterArray = [{
key: "severity",
label: "High",
value: ["HIGH"],
Expand All @@ -65,7 +65,7 @@ function ActivityTracker({latestActivity, onLoadMore, showLoadMore, collections
value: [timestamp-10000],
}]

updatedFiltersMap[filterkey] = {filters: filterarray, sort : []};
updatedFiltersMap[filterKey] = {filters: filterArray, sort : []};


setFiltersMap(updatedFiltersMap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function TestRunsPage() {

filters = func.getCollectionFilters(filters)

const [currDateRange, dispatchCurrDateRange] = useReducer(produce((draft, action) => func.dateRangeReducer(draft, action)), values.ranges[3]);
const [currDateRange, dispatchCurrDateRange] = useReducer(produce((draft, action) => func.dateRangeReducer(draft, action)), values.ranges[4]);
const getTimeEpoch = (key) => {
return Math.floor(Date.parse(currDateRange.period[key]) / 1000)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,14 +681,14 @@ convertSubIntoSubcategory(resp){
obj[objectKey] = {
text: resp[key],
color: func.getColorForCharts(key),
filterkey: objectKeyName
filterKey: objectKeyName
}
countObj.HIGH+=resp[key]
}else{
obj[objectKey] = {
text: resp[key],
color: func.getColorForCharts(subCategoryMap[key].superCategory.name),
filterkey: objectKeyName
filterKey: objectKeyName
}
countObj[subCategoryMap[key].superCategory.severity._name]+=resp[key]
}
Expand Down
15 changes: 15 additions & 0 deletions apps/dashboard/web/polaris_web/web/src/util/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ const ranges = [
),
until: todayDayEnd,
}
},
{
title: 'Last 1 year',
alias: "lastYear",
period:{
since: new Date(
new Date(new Date().setDate(today.getDate() - 365)).setHours(
0,
0,
0,
0
)
),
until: todayDayEnd,
}
}
];

Expand Down

0 comments on commit 8d67bc7

Please sign in to comment.