From 96c10547f7a1cc6a378ff627ab56a63663716caf Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Fri, 14 Jun 2024 08:38:21 +0530 Subject: [PATCH] made changes for testing and issues --- .../dashboard/components/shared/DonutChart.jsx | 2 -- .../components/tables/GithubServerTable.js | 10 ++++------ .../dashboard/components/ActivityTracker.jsx | 6 +++--- .../pages/testing/TestRunsPage/TestRunsPage.js | 2 +- .../src/apps/dashboard/pages/testing/transform.js | 4 ++-- .../web/polaris_web/web/src/util/values.js | 15 +++++++++++++++ 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/DonutChart.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/DonutChart.jsx index 596aabaeae..0de8931517 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/DonutChart.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/DonutChart.jsx @@ -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 } }) } @@ -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] = {} diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js index ed21fcb5b0..47179f9835 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/tables/GithubServerTable.js @@ -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(() => { diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard/components/ActivityTracker.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard/components/ActivityTracker.jsx index 21b2846356..691832479b 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard/components/ActivityTracker.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard/components/ActivityTracker.jsx @@ -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"], @@ -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) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunsPage/TestRunsPage.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunsPage/TestRunsPage.js index ead58e5628..c8e54e5ba7 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunsPage/TestRunsPage.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunsPage/TestRunsPage.js @@ -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) } diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js index d52dbdb303..c3c41b39d2 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js @@ -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] } diff --git a/apps/dashboard/web/polaris_web/web/src/util/values.js b/apps/dashboard/web/polaris_web/web/src/util/values.js index badfc363c6..07f8761798 100644 --- a/apps/dashboard/web/polaris_web/web/src/util/values.js +++ b/apps/dashboard/web/polaris_web/web/src/util/values.js @@ -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, + } } ];