From 85f4108355f0397ea184a80bfe5da22fb8c6c943 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 28 Nov 2024 12:39:34 +0100 Subject: [PATCH 1/6] define details with null lists on errors --- .../StatusDashboard/current_migrations.jsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/StatusDashboard/current_migrations.jsx b/src/components/StatusDashboard/current_migrations.jsx index 3425be528c..b76dd55100 100644 --- a/src/components/StatusDashboard/current_migrations.jsx +++ b/src/components/StatusDashboard/current_migrations.jsx @@ -277,15 +277,24 @@ function fetchContent(onLoad, setState) { for (const { name } of fetched[status]) { promises.push( (async (index) => { + let details; try { const url = urls.migrations.details.replace("", name); const response = await fetch(url); - const details = await response.json(); - fetched[status][index].details = details; - fetched[status][index].progress = measureProgress(details); + details = await response.json(); } catch (error) { console.warn(`error loading migration: ${name}`, error); + details = { + "done": [], + "in-pr": [], + "awaiting-pr": [], + "awaiting-parents": [], + "not-solvable": [], + "bot-error": [], + } } + fetched[status][index].details = details; + fetched[status][index].progress = measureProgress(details); })(count++) ); } @@ -301,6 +310,7 @@ function fetchContent(onLoad, setState) { regular: patch.sort?.regular || prev.sort.regular, paused: patch.sort?.paused || prev.sort.paused }; + console.log(fetched); const result = { ...prev, ...patch, From 957092ddf2bbdb75958ddbc6f9759c6c4925a33d Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 28 Nov 2024 13:06:30 +0100 Subject: [PATCH 2/6] do not link if details failed to load --- .../StatusDashboard/current_migrations.jsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/StatusDashboard/current_migrations.jsx b/src/components/StatusDashboard/current_migrations.jsx index b76dd55100..b93208078f 100644 --- a/src/components/StatusDashboard/current_migrations.jsx +++ b/src/components/StatusDashboard/current_migrations.jsx @@ -192,12 +192,18 @@ function TableContent({ collapsed, name, resort, rows, select, sort, fetched }) return ( - { - event.preventDefault(); - setState(href); - }}>{row.name} + {progress.details ? + { + event.preventDefault(); + setState(href); + }}>{row.name} + : <> + ⚠️ + {" "}{row.name} + + }