From 21b318623abf9051f6b08a05296bf06af9cf9c19 Mon Sep 17 00:00:00 2001 From: EMaksy Date: Thu, 25 Jul 2024 16:45:51 +0200 Subject: [PATCH] Refactor render of sap system type --- .../SapSystemsOverviewPage/SapSystemsOverview.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/assets/js/pages/SapSystemsOverviewPage/SapSystemsOverview.jsx b/assets/js/pages/SapSystemsOverviewPage/SapSystemsOverview.jsx index 36a523f620..7c4bbfc722 100644 --- a/assets/js/pages/SapSystemsOverviewPage/SapSystemsOverview.jsx +++ b/assets/js/pages/SapSystemsOverviewPage/SapSystemsOverview.jsx @@ -86,13 +86,12 @@ function SapSystemsOverview({ ) .filter((item) => item === 'J2EE' || item === 'ABAP') .map((item) => (item === 'J2EE' ? 'JAVA' : item)); - // Join the results in a fixed order - const systemHasABAP = instanceTypes.includes('ABAP'); - const systemHasJAVA = instanceTypes.includes('JAVA'); - const sapSystemType = []; - if (systemHasABAP) sapSystemType.push('ABAP'); - if (systemHasJAVA) sapSystemType.push('JAVA'); - return sapSystemType.join('/'); + // Join the results in a fixed order ABAP, JAVA, ABAP/JAVA or '' + const sapSystemType = ['ABAP', 'JAVA'] + .filter((type) => instanceTypes.includes(type)) + .join('/'); + + return sapSystemType; }, },