From 7bd6a5d811aa6cce2d702418fa502dc3e90f9509 Mon Sep 17 00:00:00 2001 From: Pei Chi Huang Date: Tue, 24 Oct 2023 11:52:45 +0200 Subject: [PATCH] fix(UI): reaction list display break when reaction status not standard Rendering of Overlay component break UI when a reaction status goes to the switch default case. For example on shared reaction with limited permission (reaction.status = "***") Refs: #1592 --- .../elements/list/ElementsTableEntries.js | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/app/packs/src/apps/mydb/elements/list/ElementsTableEntries.js b/app/packs/src/apps/mydb/elements/list/ElementsTableEntries.js index 4868b6137b..7a252eba80 100644 --- a/app/packs/src/apps/mydb/elements/list/ElementsTableEntries.js +++ b/app/packs/src/apps/mydb/elements/list/ElementsTableEntries.js @@ -106,13 +106,17 @@ export function reactionStatus(element) { ); - let icon = null; + const overlay = (_icons) => ( + + {_icons} + + ); + switch (element.status) { case 'Planned': - icon = ; - break; - case 'Running': - icon = ( + return overlay(); + case 'Running': { + const icon = ( ); - break; + return overlay(icon); + } case 'Done': - icon = ; - break; + return overlay(); case 'Analyses Pending': - icon = ; - break; + return overlay(); case 'Successful': - icon = ; - break; + return overlay(); case 'Not Successful': - icon = ; - break; + return overlay(); default: - break; + return null; } - - return ( - - {icon} - - ); } return null;