@@ -12,15 +12,15 @@ import useThemeStyles from '@hooks/useThemeStyles';
1212import localeCompare from '@libs/LocaleCompare' ;
1313import Navigation from '@libs/Navigation/Navigation' ;
1414import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
15- import * as PolicyUtils from '@libs/PolicyUtils' ;
16- import * as ReportUtils from '@libs/ReportUtils' ;
17- import * as WorkspaceReportFieldUtils from '@libs/WorkspaceReportFieldUtils' ;
15+ import { hasAccountingConnections as hasAccountingConnectionsPolicyUtils } from '@libs/PolicyUtils' ;
16+ import { getReportFieldKey } from '@libs/ReportUtils' ;
17+ import { getReportFieldInitialValue , getReportFieldTypeTranslationKey } from '@libs/WorkspaceReportFieldUtils' ;
1818import type { SettingsNavigatorParamList } from '@navigation/types' ;
1919import NotFoundPage from '@pages/ErrorPage/NotFoundPage' ;
2020import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper' ;
2121import type { WithPolicyAndFullscreenLoadingProps } from '@pages/workspace/withPolicyAndFullscreenLoading' ;
2222import withPolicyAndFullscreenLoading from '@pages/workspace/withPolicyAndFullscreenLoading' ;
23- import * as ReportField from '@userActions/Policy/ReportField' ;
23+ import { deleteReportFields } from '@userActions/Policy/ReportField' ;
2424import CONST from '@src/CONST' ;
2525import ROUTES from '@src/ROUTES' ;
2626import type SCREENS from '@src/SCREENS' ;
@@ -37,8 +37,8 @@ function ReportFieldsSettingsPage({
3737 const { translate} = useLocalize ( ) ;
3838 const [ isDeleteModalVisible , setIsDeleteModalVisible ] = useState ( false ) ;
3939
40- const hasAccountingConnections = PolicyUtils . hasAccountingConnections ( policy ) ;
41- const reportFieldKey = ReportUtils . getReportFieldKey ( reportFieldID ) ;
40+ const hasAccountingConnections = hasAccountingConnectionsPolicyUtils ( policy ) ;
41+ const reportFieldKey = getReportFieldKey ( reportFieldID ) ;
4242 const reportField = policy ?. fieldList ?. [ reportFieldKey ] ?? null ;
4343
4444 if ( ! reportField ) {
@@ -51,7 +51,7 @@ function ReportFieldsSettingsPage({
5151 const listValues = Object . values ( policy ?. fieldList ?. [ reportFieldKey ] ?. values ?? { } ) ?. sort ( localeCompare ) ;
5252
5353 const deleteReportFieldAndHideModal = ( ) => {
54- ReportField . deleteReportFields ( policyID , [ reportFieldKey ] ) ;
54+ deleteReportFields ( policyID , [ reportFieldKey ] ) ;
5555 setIsDeleteModalVisible ( false ) ;
5656 Navigation . goBack ( ) ;
5757 } ;
@@ -93,7 +93,7 @@ function ReportFieldsSettingsPage({
9393 < MenuItemWithTopDescription
9494 style = { [ styles . moneyRequestMenuItem ] }
9595 titleStyle = { styles . flex1 }
96- title = { Str . recapitalize ( translate ( WorkspaceReportFieldUtils . getReportFieldTypeTranslationKey ( reportField . type ) ) ) }
96+ title = { Str . recapitalize ( translate ( getReportFieldTypeTranslationKey ( reportField . type ) ) ) }
9797 description = { translate ( 'common.type' ) }
9898 interactive = { false }
9999 />
@@ -112,8 +112,8 @@ function ReportFieldsSettingsPage({
112112 < MenuItemWithTopDescription
113113 style = { [ styles . moneyRequestMenuItem ] }
114114 titleStyle = { styles . flex1 }
115- title = { WorkspaceReportFieldUtils . getReportFieldInitialValue ( reportField ) }
116- description = { isDateFieldType ? translate ( 'common.date' ) : translate ( 'common.initialValue' ) }
115+ title = { getReportFieldInitialValue ( reportField ) }
116+ description = { translate ( 'common.initialValue' ) }
117117 shouldShowRightIcon = { ! isDateFieldType && ! hasAccountingConnections }
118118 interactive = { ! isDateFieldType && ! hasAccountingConnections }
119119 onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_EDIT_REPORT_FIELDS_INITIAL_VALUE . getRoute ( policyID , reportFieldID ) ) }
0 commit comments