Skip to content

Commit

Permalink
create review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
geotab-data-platform committed Dec 10, 2024
1 parent 395125e commit 38401c8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function rebaseForecastDatum(
}

// For Confidence Bands, forecast series on mixed charts require the series sent in the following sortOrder:
export function reorderForecastSeries(row: any[]): any[] {
export function reorderForecastSeries(row: { id: string }[]): { id: string }[] {
// Define the order for sorting using ForecastSeriesEnum
const sortOrder = {
[ForecastSeriesEnum.ForecastLower]: 1,
Expand All @@ -175,9 +175,10 @@ export function reorderForecastSeries(row: any[]): any[] {
const aContext = extractForecastSeriesContext(a.id);
const bContext = extractForecastSeriesContext(b.id);

const aOrder = sortOrder[aContext.type] || Number.MAX_SAFE_INTEGER; // Put other metrics at the end
const bOrder = sortOrder[bContext.type] || Number.MAX_SAFE_INTEGER; // Put other metrics at the end
// Use optional chaining and the nullish coalescing operator for safer access
const aOrder = (aContext?.type && sortOrder[aContext.type]) ?? Number.MAX_SAFE_INTEGER;

Check failure on line 179 in superset-frontend/plugins/plugin-chart-echarts/src/utils/forecast.ts

View workflow job for this annotation

GitHub Actions / frontend-build

Replace `·(aContext?.type·&&·sortOrder[aContext.type])·??·Number.MAX_SAFE_INTEGER;·` with `⏎······(aContext?.type·&&·sortOrder[aContext.type])·??·Number.MAX_SAFE_INTEGER;`
const bOrder = (bContext?.type && sortOrder[bContext.type]) ?? Number.MAX_SAFE_INTEGER;

Check failure on line 180 in superset-frontend/plugins/plugin-chart-echarts/src/utils/forecast.ts

View workflow job for this annotation

GitHub Actions / frontend-build

Replace `·(bContext?.type·&&·sortOrder[bContext.type])·??·Number.MAX_SAFE_INTEGER;·` with `⏎······(bContext?.type·&&·sortOrder[bContext.type])·??·Number.MAX_SAFE_INTEGER;`

return aOrder - bOrder;
});
}
}

Check failure on line 184 in superset-frontend/plugins/plugin-chart-echarts/src/utils/forecast.ts

View workflow job for this annotation

GitHub Actions / frontend-build

Insert `⏎`

0 comments on commit 38401c8

Please sign in to comment.