From 96d32fbfa1c0dcda85db3d06edaff36267023cfa Mon Sep 17 00:00:00 2001 From: Aijana Schumann 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 Change-Id: I1c3922c1d195727265882d3e3362607ab558d603 --- sdnr/wt/odlux/framework/pom.xml | 2 +- sdnr/wt/odlux/framework/src/app.tsx | 1 - .../framework/src/components/errorDisplay.tsx | 1 + .../src/components/material-table/index.tsx | 4 +-- .../src/components/material-table/tableToolbar.tsx | 12 +++---- .../framework/src/components/navigationMenu.tsx | 38 +++++++++++++--------- .../src/handlers/applicationStateHandler.ts | 5 ++- .../framework/src/models/applicationConfig.ts | 3 +- sdnr/wt/odlux/framework/src/views/home.tsx | 12 +++++++ 9 files changed, 50 insertions(+), 28 deletions(-) (limited to 'sdnr/wt/odlux/framework') diff --git a/sdnr/wt/odlux/framework/pom.xml b/sdnr/wt/odlux/framework/pom.xml index 3e947539f..0e6b3cf7f 100644 --- a/sdnr/wt/odlux/framework/pom.xml +++ b/sdnr/wt/odlux/framework/pom.xml @@ -46,7 +46,7 @@ ${maven.build.timestamp} ONAP Frankfurt (Neon, mdsal ${odl.mdsal.version}) - 110.0d5d064(21/07/05) + 115.f8b3b3c(21/07/30) ONAP SDN-R | ONF Wireless for ${distversion} - Build: ${buildtime} ${buildno} ${project.version} diff --git a/sdnr/wt/odlux/framework/src/app.tsx b/sdnr/wt/odlux/framework/src/app.tsx index 7e162cd51..ada78b90f 100644 --- a/sdnr/wt/odlux/framework/src/app.tsx +++ b/sdnr/wt/odlux/framework/src/app.tsx @@ -105,4 +105,3 @@ export const runApplication = () => { }; - diff --git a/sdnr/wt/odlux/framework/src/components/errorDisplay.tsx b/sdnr/wt/odlux/framework/src/components/errorDisplay.tsx index 1060d4b6d..b2a1f1f20 100644 --- a/sdnr/wt/odlux/framework/src/components/errorDisplay.tsx +++ b/sdnr/wt/odlux/framework/src/components/errorDisplay.tsx @@ -82,6 +82,7 @@ class ErrorDisplayComponent extends React.Component { render(): JSX.Element { const { classes, state } = this.props; const errorInfo = state.framework.applicationState.errors.length && state.framework.applicationState.errors[state.framework.applicationState.errors.length - 1]; + return ( = WithStyles & { enableSelection?: boolean; disableSorting?: boolean; disableFilter?: boolean; - customActionButtons?: { icon: React.ComponentType, tooltip?: string, onClick: () => void, disabled?: boolean }[]; + customActionButtons?: { icon: React.ComponentType, tooltip?: string, ariaLabel: string, onClick: () => void, disabled?: boolean }[]; onHandleClick?(event: React.MouseEvent, rowData: TData): void; createContextMenu?: (row: TData) => React.ReactElement, React.ComponentType>>[]; }; @@ -253,8 +253,8 @@ class MaterialTableComponent extends React.Component { const entryId = getId(entry); - const isSelected = this.isSelected(entryId); const contextMenu = (this.props.createContextMenu && this.state.contextMenuInfo.index === index && this.props.createContextMenu(entry)) || null; + const isSelected = this.isSelected(entryId) || this.state.contextMenuInfo.index === index; return ( { numSelected: number | null; title?: string; tableId?: string; - customActionButtons?: { icon: React.ComponentType, tooltip?: string, onClick: () => void, disabled?: boolean }[]; + customActionButtons?: { icon: React.ComponentType, tooltip?: string, ariaLabel: string, onClick: () => void, disabled?: boolean }[]; onToggleFilter: () => void; onExportToCsv: () => void; } @@ -91,7 +91,7 @@ class TableToolbarComponent extends React.Component 0 ? classes.highlight : ''} `} >
@@ -110,7 +110,7 @@ class TableToolbarComponent extends React.Component ( - action.onClick()}> + action.onClick()}> @@ -118,20 +118,20 @@ class TableToolbarComponent extends React.Component 0 ? ( - + ) : ( - { this.props.onToggleFilter && this.props.onToggleFilter() }}> + { this.props.onToggleFilter && this.props.onToggleFilter() }}> )} 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 & 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 = } - 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 = } + 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 ( { applicationStateInit.authentication = config.authentication === "oauth" ? "oauth" : "basic"; applicationStateInit.enablePolicy = config.enablePolicy ? true : false; + applicationStateInit.transportpceUrl=config.transportpceUrl == undefined ? "" : config.transportpceUrl; } export const applicationStateHandler: IActionHandler = (state = applicationStateInit, action) => { diff --git a/sdnr/wt/odlux/framework/src/models/applicationConfig.ts b/sdnr/wt/odlux/framework/src/models/applicationConfig.ts index 5224840eb..0ae9c266b 100644 --- a/sdnr/wt/odlux/framework/src/models/applicationConfig.ts +++ b/sdnr/wt/odlux/framework/src/models/applicationConfig.ts @@ -1,4 +1,5 @@ export type ApplicationConfig = { authentication: "basic"|"oauth", // basic - enablePolicy: false // false + enablePolicy: false, // false + transportpceUrl? : string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/framework/src/views/home.tsx b/sdnr/wt/odlux/framework/src/views/home.tsx index b5df0526f..0e1d487e3 100644 --- a/sdnr/wt/odlux/framework/src/views/home.tsx +++ b/sdnr/wt/odlux/framework/src/views/home.tsx @@ -91,6 +91,9 @@ class Home extends React.Component { const connectionStatusOptions = { responsive: true, maintainAspectRatio: false, + animation: { + duration: 0 + }, plugins: { legend: { display: true, @@ -109,6 +112,9 @@ class Home extends React.Component { const connectionStatusUnavailableOptions = { responsive: true, maintainAspectRatio: false, + animation: { + duration: 0 + }, plugins: { legend: { display: true, @@ -178,6 +184,9 @@ class Home extends React.Component { const alarmStatusOptions = { responsive: true, maintainAspectRatio: false, + animation: { + duration: 0 + }, plugins: { legend: { display: true, @@ -196,6 +205,9 @@ class Home extends React.Component { const alarmStatusUnavailableOptions = { responsive: true, maintainAspectRatio: false, + animation: { + duration: 0 + }, plugins: { legend: { display: true, -- cgit 1.2.3-korg