mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Fix Insights display time saved from minutes (#14622)
This commit is contained in:
committed by
GitHub
parent
46d9b60049
commit
6dd7756191
@@ -12,7 +12,7 @@ export const INSIGHTS_UNIT_MAPPING: Record<InsightsSummaryType, (value: number)
|
||||
total: () => '',
|
||||
failed: () => '',
|
||||
failureRate: () => '%',
|
||||
timeSaved: (value: number) => (Math.abs(value) < 3600 ? 'm' : 'h'),
|
||||
timeSaved: (value: number) => (Math.abs(value) < 60 ? 'm' : 'h'),
|
||||
averageRunTime: () => 's',
|
||||
} as const;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const INSIGHTS_DEVIATION_UNIT_MAPPING: Record<
|
||||
total: () => '%',
|
||||
failed: () => '%',
|
||||
failureRate: () => 'pp',
|
||||
timeSaved: (deviation: number) => (Math.abs(deviation) < 3600 ? 'm' : 'h'),
|
||||
timeSaved: (deviation: number) => (Math.abs(deviation) < 60 ? 'm' : 'h'),
|
||||
averageRunTime: () => 's',
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import {
|
||||
INSIGHTS_DEVIATION_UNIT_MAPPING,
|
||||
} from '@/features/insights/insights.constants';
|
||||
|
||||
export const transformInsightsTimeSaved = (seconds: number): number =>
|
||||
Math.round(seconds / (Math.abs(seconds) < 3600 ? 60 : 3600)); // we want to show saved time in minutes or hours
|
||||
export const transformInsightsTimeSaved = (minutes: number): number =>
|
||||
Math.round(minutes / (Math.abs(minutes) < 60 ? 1 : 60)); // we want to show saved time in minutes or hours
|
||||
export const transformInsightsAverageRunTime = (ms: number): number => ms / 1000; // we want to show average run time in seconds
|
||||
export const transformInsightsFailureRate = (value: number): number => value * 100; // we want to show failure rate in percentage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user