From 96d32fbfa1c0dcda85db3d06edaff36267023cfa Mon Sep 17 00:00:00 2001
From: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Date: Tue, 3 Aug 2021 11:08:00 +0200
Subject: Add aria-labels to odlux tables

Add aria-labels to all table action buttons

Issue-ID: CCSDK-3396
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: I1c3922c1d195727265882d3e3362607ab558d603
---
 .../framework/src/components/navigationMenu.tsx    | 38 +++++++++++++---------
 1 file changed, 22 insertions(+), 16 deletions(-)

(limited to 'sdnr/wt/odlux/framework/src/components/navigationMenu.tsx')

diff --git a/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx b/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx
index 437ba1b3a..b65eb29e2 100644
--- a/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx
+++ b/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx
@@ -87,9 +87,10 @@ const styles = (theme: Theme) => createStyles({
 const tabletWidthBreakpoint = 768;
 
 export const NavigationMenu = withStyles(styles)(connect()(({ classes, state, dispatch }: WithStyles<typeof styles> & Connect & Connect) => {
-  const { user } = state.framework.authenticationState
-  const isOpen = state.framework.applicationState.isMenuOpen
-  const closedByUser = state.framework.applicationState.isMenuClosedByUser
+  const { user } = state.framework.authenticationState;
+  const isOpen = state.framework.applicationState.isMenuOpen;
+  const closedByUser = state.framework.applicationState.isMenuClosedByUser;
+  const transportUrl = state.framework.applicationState.transportpceUrl;
 
   const [responsive, setResponsive] = React.useState(false);
 
@@ -139,20 +140,25 @@ export const NavigationMenu = withStyles(styles)(connect()(({ classes, state, di
     ) || null;
   }) || null;
 
-  const transportPCELink = <ListItemLink
-    key={"transportPCE"}
-    to={window.localStorage.getItem(transportPCEUrl)!}
-    primary={"TransportPCE"}
-    icon={<FontAwesomeIcon icon={faProjectDiagram}/>} 
-    external/>;
-
-  const linkFound = menuItems.find(obj=>obj.key === "linkCalculation");
-  if(linkFound){
-    const index = menuItems.indexOf(linkFound);
-    menuItems.splice(index+1,0,transportPCELink);
-  }else{
-    menuItems.push(transportPCELink);
+  if(transportUrl.length>0){
+
+    const transportPCELink = <ListItemLink
+      key={"transportPCE"}
+      to={transportUrl}
+      primary={"TransportPCE"}
+      icon={<FontAwesomeIcon icon={faProjectDiagram} />}
+      external />;
+
+    const linkFound = menuItems.find(obj => obj.key === "linkCalculation");
+    
+    if (linkFound) {
+      const index = menuItems.indexOf(linkFound);
+      menuItems.splice(index + 1, 0, transportPCELink);
+    } else {
+      menuItems.push(transportPCELink);
+    }
   }
+  
 
   return (
     <Drawer
-- 
cgit 1.2.3-korg

