Skip to content
8 changes: 7 additions & 1 deletion src/components/ImportSpreadsheetColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ function ImportSpreadsheetColumns({
</Text>
{shouldShowColumnHeader && (
<View style={[styles.mt7, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter]}>
<Text style={[styles.flex1, styles.mr2]}>{translate('spreadsheet.fileContainsHeader')}</Text>
<Text
style={[styles.flex1, styles.mr2]}
accessible={false}
aria-hidden
>
{translate('spreadsheet.fileContainsHeader')}
</Text>
<Switch
accessibilityLabel={translate('spreadsheet.fileContainsHeader')}
isOn={containsHeader}
Expand Down
14 changes: 12 additions & 2 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,12 @@ function MoneyRequestView({
contentContainerStyle={[styles.flexRow, styles.optionRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}
>
<View>
<Text>{Str.UCFirst(translate('iou.reimbursable'))}</Text>
<Text
accessible={false}
aria-hidden
>
{Str.UCFirst(translate('iou.reimbursable'))}
</Text>
</View>
<Switch
accessibilityLabel={Str.UCFirst(translate('iou.reimbursable'))}
Expand All @@ -1100,7 +1105,12 @@ function MoneyRequestView({
contentContainerStyle={[styles.flexRow, styles.optionRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}
>
<View>
<Text>{translate('common.billable')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('common.billable')}
</Text>
{!!getErrorForField('billable') && (
<ViolationMessages
violations={getViolationsForField('billable')}
Expand Down
25 changes: 20 additions & 5 deletions src/components/TestToolMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ function TestToolMenu() {
{isAuthenticated && (
<>
{/* When toggled the app will be put into debug mode. */}
<TestToolRow title={translate('initialSettingsPage.troubleshoot.debugMode')}>
<TestToolRow
title={translate('initialSettingsPage.troubleshoot.debugMode')}
isTitleAccessible={false}
>
<Switch
accessibilityLabel={translate('initialSettingsPage.troubleshoot.debugMode')}
isOn={isDebugModeEnabled}
Expand Down Expand Up @@ -137,7 +140,10 @@ function TestToolMenu() {
This enables QA, internal testers and external devs to take advantage of sandbox environments for 3rd party services like Plaid and Onfido.
This toggle is not rendered for internal devs as they make environment changes directly to the .env file. */}
{!CONFIG.IS_USING_LOCAL_WEB && (
<TestToolRow title={translate('initialSettingsPage.troubleshoot.useStagingServer')}>
<TestToolRow
title={translate('initialSettingsPage.troubleshoot.useStagingServer')}
isTitleAccessible={false}
>
<Switch
accessibilityLabel="Use Staging Server"
isOn={shouldUseStagingServer}
Expand All @@ -147,7 +153,10 @@ function TestToolMenu() {
)}

{/* When toggled the app will be forced offline. */}
<TestToolRow title={translate('initialSettingsPage.troubleshoot.forceOffline')}>
<TestToolRow
title={translate('initialSettingsPage.troubleshoot.forceOffline')}
isTitleAccessible={false}
>
<Switch
accessibilityLabel="Force offline"
isOn={!!network?.shouldForceOffline}
Expand All @@ -157,7 +166,10 @@ function TestToolMenu() {
</TestToolRow>

{/* When toggled the app will randomly change internet connection every 2-5 seconds */}
<TestToolRow title={translate('initialSettingsPage.troubleshoot.simulatePoorConnection')}>
<TestToolRow
title={translate('initialSettingsPage.troubleshoot.simulatePoorConnection')}
isTitleAccessible={false}
>
<Switch
accessibilityLabel="Simulate poor internet connection"
isOn={!!network?.shouldSimulatePoorConnection}
Expand All @@ -167,7 +179,10 @@ function TestToolMenu() {
</TestToolRow>

{/* When toggled all network requests will fail. */}
<TestToolRow title={translate('initialSettingsPage.troubleshoot.simulateFailingNetworkRequests')}>
<TestToolRow
title={translate('initialSettingsPage.troubleshoot.simulateFailingNetworkRequests')}
isTitleAccessible={false}
>
<Switch
accessibilityLabel="Simulate failing network requests"
isOn={!!network?.shouldFailAllRequests}
Expand Down
12 changes: 10 additions & 2 deletions src/components/TestToolRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ type TestToolRowProps = {

/** Control component jsx */
children: React.ReactNode;

/** Whether the title should be accessible to screen readers */
isTitleAccessible?: boolean;
};

function TestToolRow({title, children}: TestToolRowProps) {
function TestToolRow({title, children, isTitleAccessible = true}: TestToolRowProps) {
const styles = useThemeStyles();
return (
<View style={styles.testRowContainer}>
<View style={[styles.flexGrow1, styles.flexShrink1]}>
<Text>{title}</Text>
<Text
accessible={isTitleAccessible}
aria-hidden={!isTitleAccessible}
>
{title}
</Text>
</View>
<View style={[styles.flexGrow0, styles.flexShrink0, styles.alignItemsEnd]}>{children}</View>
</View>
Expand Down
14 changes: 12 additions & 2 deletions src/pages/domain/Saml/SamlLoginSectionContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ function SamlLoginSectionContent({accountID, domainName, isSamlEnabled, isSamlRe
>
<View style={styles.sectionMenuItemTopDescription}>
<View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.gap3, styles.pv1]}>
<Text>{translate('domain.samlLogin.enableSamlLogin')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('domain.samlLogin.enableSamlLogin')}
</Text>

<Switch
accessibilityLabel={translate('domain.samlLogin.enableSamlLogin')}
Expand Down Expand Up @@ -95,7 +100,12 @@ function SamlLoginSectionContent({accountID, domainName, isSamlEnabled, isSamlRe
>
<View style={styles.sectionMenuItemTopDescription}>
<View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.gap3, styles.pv1]}>
<Text>{translate('domain.samlLogin.requireSamlLogin')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('domain.samlLogin.requireSamlLogin')}
</Text>
<Switch
accessibilityLabel={translate('domain.samlLogin.requireSamlLogin')}
isOn={isSamlRequired}
Expand Down
14 changes: 12 additions & 2 deletions src/pages/settings/Preferences/PreferencesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ function PreferencesPage() {
<View style={[styles.flex1, styles.mt5]}>
<View style={[styles.flexRow, styles.mb4, styles.justifyContentBetween, styles.sectionMenuItemTopDescription]}>
<View style={styles.flex4}>
<Text>{translate('preferencesPage.receiveRelevantFeatureUpdatesAndExpensifyNews')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('preferencesPage.receiveRelevantFeatureUpdatesAndExpensifyNews')}
</Text>
</View>
<View style={[styles.flex1, styles.alignItemsEnd]}>
<Switch
Expand All @@ -91,7 +96,12 @@ function PreferencesPage() {
</View>
<View style={[styles.flexRow, styles.mb4, styles.justifyContentBetween]}>
<View style={styles.flex4}>
<Text>{translate('preferencesPage.muteAllSounds')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('preferencesPage.muteAllSounds')}
</Text>
</View>
<View style={[styles.flex1, styles.alignItemsEnd]}>
<Switch
Expand Down
8 changes: 7 additions & 1 deletion src/pages/settings/Profile/TimezoneInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ function TimezoneInitialPage({currentUserPersonalDetails}: TimezoneInitialPagePr
<View style={[styles.ph5]}>
<Text style={[styles.mb5]}>{translate('timezonePage.isShownOnProfile')}</Text>
<View style={[styles.flexRow, styles.mb5, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.flexShrink1, styles.mr2]}>{translate('timezonePage.getLocationAutomatically')}</Text>
<Text
style={[styles.flexShrink1, styles.mr2]}
accessible={false}
aria-hidden
>
{translate('timezonePage.getLocationAutomatically')}
</Text>
<Switch
accessibilityLabel={translate('timezonePage.getLocationAutomatically')}
isOn={!!timezone.automatic}
Expand Down
16 changes: 14 additions & 2 deletions src/pages/workspace/categories/CategoryRequiredFieldsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ function CategoryRequiredFieldsPage({
<OfflineWithFeedback pendingAction={policyCategory?.pendingFields?.areCommentsRequired}>
<View style={[styles.mt2, styles.mh5]}>
<View style={[styles.flexRow, styles.mb5, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.flexShrink1, styles.mr2]}>{translate('workspace.rules.categoryRules.requireDescription')}</Text>
<Text
style={[styles.flexShrink1, styles.mr2]}
accessible={false}
aria-hidden
>
{translate('workspace.rules.categoryRules.requireDescription')}
</Text>
<Switch
isOn={areCommentsRequired}
accessibilityLabel={translate('workspace.rules.categoryRules.requireDescription')}
Expand All @@ -80,7 +86,13 @@ function CategoryRequiredFieldsPage({
<OfflineWithFeedback pendingAction={policyCategory?.pendingFields?.areAttendeesRequired}>
<View style={[styles.mh5]}>
<View style={[styles.flexRow, styles.mv5, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.flexShrink1, styles.mr2]}>{translate('workspace.rules.categoryRules.requireAttendees')}</Text>
<Text
style={[styles.flexShrink1, styles.mr2]}
accessible={false}
aria-hidden
>
{translate('workspace.rules.categoryRules.requireAttendees')}
</Text>
<Switch
isOn={areAttendeesRequired}
accessibilityLabel={translate('workspace.rules.categoryRules.requireAttendees')}
Expand Down
8 changes: 7 additions & 1 deletion src/pages/workspace/categories/CategorySettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,13 @@ function CategorySettingsPage({
>
<View style={[styles.mt2, styles.mh5]}>
<View style={[styles.flexRow, styles.mb5, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.flexShrink1, styles.mr2]}>{translate('workspace.categories.enableCategory')}</Text>
<Text
style={[styles.flexShrink1, styles.mr2]}
accessible={false}
aria-hidden
>
{translate('workspace.categories.enableCategory')}
</Text>
<Switch
isOn={policyCategory.enabled}
accessibilityLabel={translate('workspace.categories.enableCategory')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ function PolicyDistanceRateDetailsPage({route}: PolicyDistanceRateDetailsPagePro
onClose={() => clearErrorFields('enabled')}
>
<View style={[styles.flexRow, styles.justifyContentBetween, styles.p5]}>
<Text>{translate('workspace.distanceRates.enableRate')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('workspace.distanceRates.enableRate')}
</Text>
<Switch
isOn={rate?.enabled ?? false}
onToggle={toggleRate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ function PolicyDistanceRatesSettingsPage({route}: PolicyDistanceRatesSettingsPag
>
<View style={[styles.mt2, styles.mh5]}>
<View style={[styles.flexRow, styles.mb2, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.distanceRates.trackTax')}</Text>
<Text
style={[styles.textNormal, styles.colorMuted]}
accessible={false}
aria-hidden
>
{translate('workspace.distanceRates.trackTax')}
</Text>
<Switch
isOn={isDistanceTrackTaxEnabled && isPolicyTrackTaxEnabled}
accessibilityLabel={translate('workspace.distanceRates.trackTax')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ function ReportFieldsValueSettingsPage({
<View style={styles.flexGrow1}>
<View style={[styles.mt2, styles.mh5]}>
<View style={[styles.flexRow, styles.mb5, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text>{translate('workspace.reportFields.enableValue')}</Text>
<Text
accessible={false}
aria-hidden
>
{translate('workspace.reportFields.enableValue')}
</Text>
<Switch
isOn={!currentValueDisabled}
accessibilityLabel={translate('workspace.reportFields.enableValue')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,13 @@ function MerchantRulePageBase({policyID, ruleID, titleKey, testID}: MerchantRule
footerContent={
<>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween, styles.mb4]}>
<Text style={[styles.textNormal]}>{translate('workspace.rules.merchantRules.applyToExistingUnsubmittedExpenses')}</Text>
<Text
style={[styles.textNormal]}
accessible={false}
aria-hidden
>
{translate('workspace.rules.merchantRules.applyToExistingUnsubmittedExpenses')}
</Text>
<Switch
accessibilityLabel={translate('workspace.rules.merchantRules.applyToExistingUnsubmittedExpenses')}
isOn={shouldUpdateMatchingTransactions}
Expand Down
8 changes: 7 additions & 1 deletion src/pages/workspace/rules/RulesProhibitedDefaultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ function RulesProhibitedDefaultPage({
key={translate(`workspace.rules.individualExpenseRules.${prohibitedExpense}`)}
>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween, styles.mt3, styles.mh5, styles.mb5]}>
<Text style={[styles.flex1, styles.mr2]}>{translate(`workspace.rules.individualExpenseRules.${prohibitedExpense}`)}</Text>
<Text
style={[styles.flex1, styles.mr2]}
accessible={false}
aria-hidden
>
{translate(`workspace.rules.individualExpenseRules.${prohibitedExpense}`)}
</Text>
<Switch
isOn={policy?.prohibitedExpenses?.[prohibitedExpense] ?? false}
accessibilityLabel={translate(`workspace.rules.individualExpenseRules.${prohibitedExpense}`)}
Expand Down
Loading
Loading