From df766e97fc0c7fe78e662ac6fcd170bdbb860978 Mon Sep 17 00:00:00 2001 From: Nada Makram Date: Tue, 24 Jun 2025 19:41:04 +0000 Subject: [PATCH 1/2] fix: add queued label and queue position to Simulations page (#2104) --- src/pages/Simulations.jsx | 42 +++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/pages/Simulations.jsx b/src/pages/Simulations.jsx index a73707493..efb7b197f 100644 --- a/src/pages/Simulations.jsx +++ b/src/pages/Simulations.jsx @@ -92,6 +92,15 @@ export default function SimulationsPage() { key: "reform_policy_id", }, { title: "Status", dataIndex: "status", key: "status" }, + { + title: "Queue Position", + dataIndex: "queue_position", + key: "queue_position", + render: (pos) => + pos === undefined || pos === null + ? + : 0 ? "orange" : "blue"}>{pos}, + }, { title: "Comment", dataIndex: "message", key: "message" }, //{ title: 'Options Hash', dataIndex: 'options_hash', key: 'options_hash' }, { title: "Options", dataIndex: "options_json", key: "options_json" }, @@ -158,17 +167,28 @@ function formatRow(row) { )); - row.status = - { - ok: OK, - computing: ( - - - COMPUTING - - ), - error: ERROR, - }[row.status] || row.status; + + // Show queue position if present and > 0 + if (row.status === "computing" && row.queue_position > 0) { + row.status = ( + + POSITION IN QUEUE: {row.queue_position} + + ); + } else { + row.status = + { + ok: OK, + computing: ( + + + CALCULATING + + ), + error: ERROR, + }[row.status] || row.status; + } + const CODE_FIELDS = [ "country_id", "baseline_policy_id", From 928617d2fe46f0ee7c088bea32a343029ba2704b Mon Sep 17 00:00:00 2001 From: Nada Makram Date: Sun, 10 Aug 2025 00:12:36 +0000 Subject: [PATCH 2/2] fix: linting --- src/pages/Simulations.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/Simulations.jsx b/src/pages/Simulations.jsx index efb7b197f..2baec8738 100644 --- a/src/pages/Simulations.jsx +++ b/src/pages/Simulations.jsx @@ -97,9 +97,11 @@ export default function SimulationsPage() { dataIndex: "queue_position", key: "queue_position", render: (pos) => - pos === undefined || pos === null - ? - : 0 ? "orange" : "blue"}>{pos}, + pos === undefined || pos === null ? ( + + ) : ( + 0 ? "orange" : "blue"}>{pos} + ), }, { title: "Comment", dataIndex: "message", key: "message" }, //{ title: 'Options Hash', dataIndex: 'options_hash', key: 'options_hash' }, @@ -171,9 +173,7 @@ function formatRow(row) { // Show queue position if present and > 0 if (row.status === "computing" && row.queue_position > 0) { row.status = ( - - POSITION IN QUEUE: {row.queue_position} - + POSITION IN QUEUE: {row.queue_position} ); } else { row.status =