mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ui.git
				synced 2025-10-30 18:27:58 +00:00 
			
		
		
		
	Merge pull request #58 from Telecominfraproject/hotfix/WIFI-708
Hotfix/wifi 708: Added default values to the Access Points table
This commit is contained in:
		| @@ -11,18 +11,21 @@ import { FILTER_EQUIPMENT } from 'graphql/queries'; | |||||||
|  |  | ||||||
| import styles from './index.module.scss'; | import styles from './index.module.scss'; | ||||||
|  |  | ||||||
| const renderTableCell = tabCell => { | const renderTableCell = (text, _record, _index, defaultValue = 'N/A') => { | ||||||
|   if (Array.isArray(tabCell)) { |   if (Array.isArray(text)) { | ||||||
|  |     if (text.length < 1) { | ||||||
|  |       return defaultValue; | ||||||
|  |     } | ||||||
|     return ( |     return ( | ||||||
|       <div className={styles.tabColumn}> |       <div className={styles.tabColumn}> | ||||||
|         {tabCell.map((i, key) => ( |         {text.map((i, key) => ( | ||||||
|           // eslint-disable-next-line react/no-array-index-key |           // eslint-disable-next-line react/no-array-index-key | ||||||
|           <span key={key}>{i}</span> |           <span key={key}>{i}</span> | ||||||
|         ))} |         ))} | ||||||
|       </div> |       </div> | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|   return tabCell; |   return text !== null ? text : defaultValue; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const durationToString = duration => | const durationToString = duration => | ||||||
| @@ -96,7 +99,7 @@ const accessPointsTableColumns = [ | |||||||
|   { |   { | ||||||
|     title: 'DEVICES', |     title: 'DEVICES', | ||||||
|     dataIndex: ['status', 'clientDetails', 'details', 'numClientsPerRadio'], |     dataIndex: ['status', 'clientDetails', 'details', 'numClientsPerRadio'], | ||||||
|     render: renderTableCell, |     render: (text, record, index) => renderTableCell(text, record, index, 0), | ||||||
|   }, |   }, | ||||||
| ]; | ]; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| .tabColumn { | .tabColumn { | ||||||
|   display: flex; |   display: flex; | ||||||
|   flex-direction: column; |   flex-direction: column; | ||||||
|   padding: 0 30px; |  | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sean Macfarlane
					Sean Macfarlane