From f13ec4546523c55f042ec5a2e974bc8130a46433 Mon Sep 17 00:00:00 2001 From: chris-cosentino Date: Sat, 12 Dec 2020 17:50:35 -0500 Subject: [PATCH 1/2] added radioTypes constant --- app/constants/index.js | 9 +++++++-- app/containers/App/index.js | 10 ++++++++-- app/containers/Dashboard/index.js | 8 +------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/constants/index.js b/app/constants/index.js index e3a1010..13d11b0 100644 --- a/app/constants/index.js +++ b/app/constants/index.js @@ -1,7 +1,12 @@ export const AUTH_TOKEN = 'tip-auth-token'; export const COMPANY = 'Telecom Infra Project'; -export const IS_RADIO_TYPE_5GHZ = 'is5GHz'; -export const IS_RADIO_TYPE_2DOT4GHZ = 'is2dot4GHz'; + +export const USER_FRIENDLY_RADIOS = { + is2dot4GHz: '2.4GHz', + is5GHzL: '5GHz (L)', + is5GHzU: '5GHz (U)', + is5GHz: '5GHz', +}; export const ROUTES = { root: '/', diff --git a/app/containers/App/index.js b/app/containers/App/index.js index 129f83d..f5a5125 100644 --- a/app/containers/App/index.js +++ b/app/containers/App/index.js @@ -7,7 +7,7 @@ import { ThemeProvider, GenericNotFound } from '@tip-wlan/wlan-cloud-ui-library' import logo from 'images/tip-logo.png'; import logoMobile from 'images/tip-logo-mobile.png'; -import { AUTH_TOKEN, COMPANY, ROUTES } from 'constants/index'; +import { AUTH_TOKEN, COMPANY, ROUTES, USER_FRIENDLY_RADIOS } from 'constants/index'; import Login from 'containers/Login'; import Network from 'containers/Network'; @@ -65,7 +65,13 @@ const App = () => { updateUser={updateUser} updateToken={updateToken} > - + diff --git a/app/containers/Dashboard/index.js b/app/containers/Dashboard/index.js index a87ccc6..545e174 100644 --- a/app/containers/Dashboard/index.js +++ b/app/containers/Dashboard/index.js @@ -5,6 +5,7 @@ import { useQuery } from '@apollo/client'; import { Dashboard as DashboardPage, Loading } from '@tip-wlan/wlan-cloud-ui-library'; import UserContext from 'contexts/UserContext'; import { FILTER_SYSTEM_EVENTS, GET_ALL_STATUS } from 'graphql/queries'; +import { USER_FRIENDLY_RADIOS } from 'constants/index'; function formatBytes(bytes, decimals = 2) { if (bytes === 0) return '0 Bytes'; @@ -29,13 +30,6 @@ function trafficTooltipFormatter() { )}
`; } -const USER_FRIENDLY_RADIOS = { - is2dot4GHz: '2.4GHz', - is5GHzL: '5GHz (L)', - is5GHzU: '5GHz (U)', - is5GHz: '5GHz', -}; - const lineChartConfig = [ { key: 'inservicesAPs', title: 'Inservice APs (24 hours)' }, { key: 'clientDevices', title: 'Client Devices (24 hours)' }, From 2bf34a62e3aef6f720c41efa5661b4d319d1af26 Mon Sep 17 00:00:00 2001 From: chris-cosentino Date: Sat, 12 Dec 2020 20:49:18 -0500 Subject: [PATCH 2/2] additional user friendly radio label fixes --- app/containers/Network/containers/ClientDevices/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/containers/Network/containers/ClientDevices/index.js b/app/containers/Network/containers/ClientDevices/index.js index ef758ad..0f2361f 100644 --- a/app/containers/Network/containers/ClientDevices/index.js +++ b/app/containers/Network/containers/ClientDevices/index.js @@ -5,7 +5,7 @@ import { notification } from 'antd'; import { NetworkTableContainer } from '@tip-wlan/wlan-cloud-ui-library'; -import { ROUTES } from 'constants/index'; +import { ROUTES, USER_FRIENDLY_RADIOS } from 'constants/index'; import UserContext from 'contexts/UserContext'; import { FILTER_CLIENT_SESSIONS } from 'graphql/queries'; @@ -23,7 +23,11 @@ const clientDevicesTableColumns = [ { title: 'HOST NAME', dataIndex: 'hostname' }, { title: 'ACCESS POINT', dataIndex: ['equipment', 'name'] }, { title: 'SSID', dataIndex: 'ssid' }, - { title: 'BAND', dataIndex: 'radioType' }, + { + title: 'BAND', + dataIndex: 'radioType', + render: band => USER_FRIENDLY_RADIOS[band], + }, { title: 'SIGNAL', dataIndex: 'signal' }, { title: 'STATUS',