Repository navigation
MenuItem decomposition - wrapperStyle-only MenuItemWithTopDescription rows
#105621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7aaf76d
3806b78
74dc287
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ import AmountForm from '@components/AmountForm'; | |
| import FormProvider from '@components/Form/FormProvider'; | ||
| import InputWrapper from '@components/Form/InputWrapper'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; | ||
| import MenuItemField from '@components/MenuItem/presets/MenuItemField'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
| import Text from '@components/Text'; | ||
|
|
||
|
|
@@ -111,13 +111,13 @@ function DynamicCategoryFlagAmountsOverPage({ | |
| /> | ||
| <Text style={[styles.mutedTextLabel, styles.mt2]}>{translate('workspace.rules.categoryRules.flagAmountsOverSubtitle')}</Text> | ||
| </View> | ||
| <MenuItemWithTopDescription | ||
| shouldShowRightIcon | ||
| title={translate(`workspace.rules.categoryRules.expenseLimitTypes.${expenseLimitType}`)} | ||
| description={translate('common.type')} | ||
| onPress={() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.EXPENSE_LIMIT_TYPE_SELECTOR.path))} | ||
| wrapperStyle={[styles.ph5, styles.mt3]} | ||
| /> | ||
| <View style={styles.mt3}> | ||
| <MenuItemField | ||
| name={translate('common.type')} | ||
| value={translate(`workspace.rules.categoryRules.expenseLimitTypes.${expenseLimitType}`)} | ||
| onPress={() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.EXPENSE_LIMIT_TYPE_SELECTOR.path))} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an administrator opens the expense-limit type selector, this modified interactive AGENTS.md reference: AGENTS.md:L76-L77 Useful? React with 👍 / 👎. |
||
| /> | ||
| </View> | ||
| </FormProvider> | ||
| </ScreenWrapper> | ||
| </AccessOrNotFoundWrapper> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import FullPageOfflineBlockingView from '@components/BlockingViews/FullPageOfflineBlockingView'; | ||
| import CustomUnitDefaultCategorySelector from '@components/CustomUnitDefaultCategorySelector'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; | ||
| import MenuItemField from '@components/MenuItem/presets/MenuItemField'; | ||
| import OfflineWithFeedback from '@components/OfflineWithFeedback'; | ||
| import RenderHTML from '@components/RenderHTML'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
|
|
@@ -227,15 +227,14 @@ function PolicyDistanceRatesSettingsPage({route}: PolicyDistanceRatesSettingsPag | |
| errorRowStyles={styles.mh5} | ||
| onClose={() => clearErrorFields('attributes')} | ||
| > | ||
| <MenuItemWithTopDescription | ||
| shouldShowRightIcon={canWriteDistanceRates} | ||
| title={defaultUnit ? Str.recapitalize(translate(getUnitTranslationKey(defaultUnit))) : ''} | ||
| description={translate('workspace.distanceRates.unit')} | ||
| onPress={() => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES_UNIT.getRoute(policyID))} | ||
| interactive={canWriteDistanceRates} | ||
| wrapperStyle={[styles.ph5, styles.mt3]} | ||
| sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.DISTANCE_RATES.UNIT_SELECTOR} | ||
| /> | ||
| <View style={styles.mt3}> | ||
| <MenuItemField | ||
| name={translate('workspace.distanceRates.unit')} | ||
| value={defaultUnit ? Str.recapitalize(translate(getUnitTranslationKey(defaultUnit))) : ''} | ||
| onPress={canWriteDistanceRates ? () => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES_UNIT.getRoute(policyID)) : undefined} | ||
| sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.DISTANCE_RATES.UNIT_SELECTOR} | ||
| /> | ||
| </View> | ||
| </OfflineWithFeedback> | ||
| )} | ||
| {!!policy?.areCategoriesEnabled && hasEnabledOptions(policyCategories ?? {}) && !!customUnit?.customUnitID && ( | ||
|
|
@@ -298,13 +297,10 @@ function PolicyDistanceRatesSettingsPage({route}: PolicyDistanceRatesSettingsPag | |
| errorRowStyles={[styles.mh5, styles.gap3]} | ||
| onClose={() => clearWorkspaceDistanceAutoUpdateErrors(policyID)} | ||
| > | ||
| <MenuItemWithTopDescription | ||
| shouldShowRightIcon={canWriteDistanceRates} | ||
| title={autoUpdateCountry ? translate(`allCountries.${autoUpdateCountry}`) : ''} | ||
| description={translate('common.country')} | ||
| onPress={() => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES_GOVERNMENT_RATE_COUNTRY.getRoute(policyID))} | ||
| interactive={canWriteDistanceRates} | ||
| wrapperStyle={[styles.ph5]} | ||
| <MenuItemField | ||
| name={translate('common.country')} | ||
| value={autoUpdateCountry ? translate(`allCountries.${autoUpdateCountry}`) : ''} | ||
| onPress={canWriteDistanceRates ? () => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES_GOVERNMENT_RATE_COUNTRY.getRoute(policyID)) : undefined} | ||
| sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.DISTANCE_RATES.COUNTRY_SELECTOR} | ||
| /> | ||
| </OfflineWithFeedback> | ||
|
|
@@ -333,13 +329,13 @@ function PolicyDistanceRatesSettingsPage({route}: PolicyDistanceRatesSettingsPag | |
| errorRowStyles={styles.mh5} | ||
| onClose={() => clearPolicyCommuterExclusionsErrors(policyID)} | ||
| > | ||
| <MenuItemWithTopDescription | ||
| shouldShowRightIcon | ||
| title={getCommuterExclusionsSummary(policy?.commuterExclusions, defaultUnit, translate)} | ||
| description={translate('workspace.distanceRates.commuterExclusions.title')} | ||
| onPress={() => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES_COMMUTER_EXCLUSIONS.getRoute(policyID))} | ||
| wrapperStyle={[styles.ph5, styles.mt3]} | ||
| /> | ||
| <View style={styles.mt3}> | ||
| <MenuItemField | ||
| name={translate('workspace.distanceRates.commuterExclusions.title')} | ||
| value={getCommuterExclusionsSummary(policy?.commuterExclusions, defaultUnit, translate)} | ||
| onPress={() => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES_COMMUTER_EXCLUSIONS.getRoute(policyID))} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an administrator opens the commuter-exclusions page, this modified interactive AGENTS.md reference: AGENTS.md:L76-L77 Useful? React with 👍 / 👎. |
||
| /> | ||
| </View> | ||
| </OfflineWithFeedback> | ||
| )} | ||
| <OfflineWithFeedback | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ import ActivityIndicator from '@components/ActivityIndicator'; | |
| import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu'; | ||
| import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; | ||
| import MenuItemField from '@components/MenuItem/presets/MenuItemField'; | ||
| import {ModalActions} from '@components/Modal/Global/ModalContext'; | ||
| import OfflineWithFeedback from '@components/OfflineWithFeedback'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
|
|
@@ -323,14 +323,13 @@ function DynamicWorkspaceViewTagsPage({route}: DynamicWorkspaceViewTagsProps) { | |
| pendingAction={currentPolicyTag.pendingAction} | ||
| errorRowStyles={styles.mh5} | ||
| > | ||
| <MenuItemWithTopDescription | ||
| title={getCleanedTagName(currentPolicyTag.name)} | ||
| description={translate(`workspace.tags.customTagName`)} | ||
| onPress={navigateToEditTag} | ||
| shouldShowRightIcon={canWriteTags} | ||
| interactive={canWriteTags} | ||
| wrapperStyle={styles.mb5} | ||
| /> | ||
| <View style={styles.mb5}> | ||
| <MenuItemField | ||
| name={translate(`workspace.tags.customTagName`)} | ||
| value={getCleanedTagName(currentPolicyTag.name)} | ||
| onPress={canWriteTags ? navigateToEditTag : undefined} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user with tag write access opens the tag-name editor, this modified interactive AGENTS.md reference: AGENTS.md:L76-L77 Useful? React with 👍 / 👎. |
||
| /> | ||
| </View> | ||
| </OfflineWithFeedback> | ||
| </> | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an administrator opens the FX expense-account selector, this modified interactive
MenuItemFieldhas nosentryLabel, so its web interaction cannot be identified by the required Sentry/FullStory label. Add a stable entry fromCONST.SENTRY_LABELfor this action.AGENTS.md reference: AGENTS.md:L76-L77
Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sentryLabel is configured for this item in the main