File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
packages/react-sdk-components/src/components
SimpleTable/SimpleTableManual Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1- /* eslint-disable import/prefer-default-export */
21export function isEmptyObject ( obj : Object ) : boolean {
32 return Object . keys ( obj ) . length === 0 ;
43}
4+
5+ export function getLocalizedNoRecordsMessage ( ) : string {
6+ const GENERIC_BUNDLE_KEY = PCore . getLocaleUtils ( ) . GENERIC_BUNDLE_KEY ;
7+ return PCore . getLocaleUtils ( ) . localeStore [ GENERIC_BUNDLE_KEY ] ?. CosmosFields ?. fields ?. lists ?. [ 'No records found.' ] || 'No records found.' ;
8+ }
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import { filterData } from '../../helpers/simpleTableHelpers';
4343import './ListView.css' ;
4444import { getDateFormatInfo } from '../../helpers/date-format-utils' ;
4545import { getCurrencyOptions } from '../../field/Currency/currency-utils' ;
46+ import { getLocalizedNoRecordsMessage } from '../../helpers/common-utils' ;
4647import { format } from '../../helpers/formatters' ;
4748
4849import useInit from './hooks' ;
@@ -1129,7 +1130,7 @@ export default function ListView(props: ListViewProps) {
11291130 } ) }
11301131 </ TableBody >
11311132 </ Table >
1132- { arRows && arRows . length === 0 && < div className = 'no-records' > No records found. </ div > }
1133+ { arRows && arRows . length === 0 && < div className = 'no-records' > { getLocalizedNoRecordsMessage ( ) } </ div > }
11331134 </ TableContainer >
11341135 ) }
11351136 </ >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import createPConnectComponent from '../../../../bridge/react_pconnect';
2727import { Utils } from '../../../helpers/utils' ;
2828import { getReferenceList } from '../../../helpers/field-group-utils' ;
2929import { getDataPage } from '../../../helpers/data_page' ;
30+ import { getLocalizedNoRecordsMessage } from '../../../helpers/common-utils' ;
3031import { buildFieldsForTable , filterData , getContext } from '../../../helpers/simpleTableHelpers' ;
3132import { PConnProps } from '../../../../types/PConnProps' ;
3233import { format } from '../../../helpers/formatters' ;
@@ -711,7 +712,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
711712 </ Table >
712713 { ( ( readOnlyMode && ( ! rowData || rowData ?. length === 0 ) ) || ( editableMode && ( ! referenceList || referenceList ?. length === 0 ) ) ) && (
713714 < div className = 'no-records' id = 'no-records' >
714- No records found.
715+ { getLocalizedNoRecordsMessage ( ) }
715716 </ div >
716717 ) }
717718 </ TableContainer >
You can’t perform that action at this time.
0 commit comments