From 4e2ca87752da725172809e93d7f8a80c5b3a033a Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Thu, 2 Apr 2026 14:33:46 +0100 Subject: [PATCH] refactor: improve readability of messages and code formatting in various components --- .../src/Components/Profiles/DiffFlamegraph.tsx | 3 ++- .../src/Components/Profiles/ProfileFlamegraph.tsx | 7 +++++-- App/FeatureSet/Dashboard/src/Utils/ProfileUtil.ts | 1 - App/Services/Queue/AppQueueService.ts | 15 ++++++--------- E2E/Tests/Dashboard/CreateMonitor.spec.ts | 6 ++++-- Scripts/TerraformProvider/GenerateProvider.ts | 14 ++++++++------ 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/App/FeatureSet/Dashboard/src/Components/Profiles/DiffFlamegraph.tsx b/App/FeatureSet/Dashboard/src/Components/Profiles/DiffFlamegraph.tsx index 63e3a6b5e4..bdfd6d17d1 100644 --- a/App/FeatureSet/Dashboard/src/Components/Profiles/DiffFlamegraph.tsx +++ b/App/FeatureSet/Dashboard/src/Components/Profiles/DiffFlamegraph.tsx @@ -184,7 +184,8 @@ const DiffFlamegraph: FunctionComponent = ( ) { return (
- No performance data found in the selected time ranges. Try adjusting the time periods. + No performance data found in the selected time ranges. Try adjusting the + time periods.
); } diff --git a/App/FeatureSet/Dashboard/src/Components/Profiles/ProfileFlamegraph.tsx b/App/FeatureSet/Dashboard/src/Components/Profiles/ProfileFlamegraph.tsx index bb8e688000..f8553cb40e 100644 --- a/App/FeatureSet/Dashboard/src/Components/Profiles/ProfileFlamegraph.tsx +++ b/App/FeatureSet/Dashboard/src/Components/Profiles/ProfileFlamegraph.tsx @@ -211,7 +211,8 @@ const ProfileFlamegraph: FunctionComponent = ( if (samples.length === 0) { return (
- No performance data found for this profile. This can happen if the profile was recently captured and data is still being processed. + No performance data found for this profile. This can happen if the + profile was recently captured and data is still being processed.
); } @@ -365,7 +366,9 @@ const ProfileFlamegraph: FunctionComponent = ( {tooltip.fileName && (
{tooltip.fileName}
)} -
Own Time: {tooltip.selfValue.toLocaleString()}
+
+ Own Time: {tooltip.selfValue.toLocaleString()} +
Total Time: {tooltip.totalValue.toLocaleString()}
)} diff --git a/App/FeatureSet/Dashboard/src/Utils/ProfileUtil.ts b/App/FeatureSet/Dashboard/src/Utils/ProfileUtil.ts index fd383d501e..3818b467d2 100644 --- a/App/FeatureSet/Dashboard/src/Utils/ProfileUtil.ts +++ b/App/FeatureSet/Dashboard/src/Utils/ProfileUtil.ts @@ -64,7 +64,6 @@ export default class ProfileUtil { } } - public static getFrameTypeColor(frameType: string): string { const type: string = frameType.toLowerCase(); diff --git a/App/Services/Queue/AppQueueService.ts b/App/Services/Queue/AppQueueService.ts index 733cfb386d..a863e9890d 100644 --- a/App/Services/Queue/AppQueueService.ts +++ b/App/Services/Queue/AppQueueService.ts @@ -2,15 +2,12 @@ import Queue, { QueueName } from "Common/Server/Infrastructure/Queue"; export default class AppQueueService { public static async getQueueSize(): Promise { - const [workerSize, workflowSize, telemetrySize]: [ - number, - number, - number, - ] = await Promise.all([ - Queue.getQueueSize(QueueName.Worker), - Queue.getQueueSize(QueueName.Workflow), - Queue.getQueueSize(QueueName.Telemetry), - ]); + const [workerSize, workflowSize, telemetrySize]: [number, number, number] = + await Promise.all([ + Queue.getQueueSize(QueueName.Worker), + Queue.getQueueSize(QueueName.Workflow), + Queue.getQueueSize(QueueName.Telemetry), + ]); return workerSize + workflowSize + telemetrySize; } } diff --git a/E2E/Tests/Dashboard/CreateMonitor.spec.ts b/E2E/Tests/Dashboard/CreateMonitor.spec.ts index 6fd18c4f14..119ffa6b26 100644 --- a/E2E/Tests/Dashboard/CreateMonitor.spec.ts +++ b/E2E/Tests/Dashboard/CreateMonitor.spec.ts @@ -83,8 +83,10 @@ test.describe("Monitor Creation", () => { timeout: 30000, }); - // Wait for the page to fully settle after project creation - // The app may perform internal redirects after project setup + /* + * Wait for the page to fully settle after project creation + * The app may perform internal redirects after project setup + */ await page.waitForLoadState("networkidle"); // Extract the project ID from the URL diff --git a/Scripts/TerraformProvider/GenerateProvider.ts b/Scripts/TerraformProvider/GenerateProvider.ts index 15f9491650..93bdcf8b77 100644 --- a/Scripts/TerraformProvider/GenerateProvider.ts +++ b/Scripts/TerraformProvider/GenerateProvider.ts @@ -137,15 +137,15 @@ async function main(): Promise { // Use GoReleaser for parallel cross-compilation (build only, no publish) try { await execAsync("which goreleaser"); - await execAsync( - "goreleaser build --snapshot --clean", - ); + await execAsync("goreleaser build --snapshot --clean"); Logger.info( "✅ GoReleaser multi-platform build completed successfully", ); - // Move GoReleaser output to builds/ directory for compatibility - // GoReleaser puts binaries in dist// + /* + * Move GoReleaser output to builds/ directory for compatibility + * GoReleaser puts binaries in dist// + */ await execAsync("mkdir -p ./builds"); const { stdout: distDirs } = await execAsync( "find dist -name 'terraform-provider-oneuptime*' -type f", @@ -173,7 +173,9 @@ async function main(): Promise { await execAsync("make release"); Logger.info("✅ Makefile multi-platform build completed"); } catch { - Logger.warn("⚠️ make not available, building for current platform only..."); + Logger.warn( + "⚠️ make not available, building for current platform only...", + ); await execAsync("go build"); Logger.info("✅ Single-platform build completed"); }