feat: add IS export templates in Exported to filter options#85885
feat: add IS export templates in Exported to filter options#85885samranahm wants to merge 5 commits intoExpensify:mainfrom
Conversation
…ation custom templates in filter options
…and exclude in-app templates
There was a problem hiding this comment.
Pull request overview
Adds Integration Server (IS) export templates to the Search → Advanced Filters → Exported to options so users can filter results by the specific export template name (while excluding in-app/OldDot CSV layouts that can’t be reliably identified by this filter).
Changes:
- Updated exported-to option building to include integration custom templates and exclude in-app export templates.
- Adjusted exported-to picker item values to use standard template labels and integration template display names.
- Updated unit tests to cover inclusion/exclusion behavior by export template type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/hooks/useExportedToFilterOptions.ts |
Builds exported-to autocomplete/options from connected integrations + integration templates; filters out in-app templates and dedupes options. |
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersExportedToPage.tsx |
Updates the RHP picker list to include integration custom templates and exclude in-app templates. |
tests/unit/hooks/useExportedToFilterOptions.test.ts |
Updates/adds unit coverage for integration vs in-app export template handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const displayName = template.name ?? template.templateName ?? ''; | ||
| const filterValue = STANDARD_EXPORT_TEMPLATE_ID_TO_DISPLAY_LABEL[template.templateName] ?? template.templateName; | ||
| standardExportTemplatePickerItems.push({ | ||
| const filterValue = STANDARD_EXPORT_TEMPLATE_ID_TO_DISPLAY_LABEL[template.templateName] ?? displayName; | ||
| standardAndIntegrationCustomTemplatePickerItems.push({ | ||
| name: displayName, | ||
| value: filterValue, |
There was a problem hiding this comment.
filterValue is computed using a local STANDARD_EXPORT_TEMPLATE_ID_TO_DISPLAY_LABEL mapping, while other parts of the codebase (e.g. AccountingUtils.getStandardExportTemplateDisplayName) already own this standard-template mapping logic. Duplicating the mapping here risks drift if template IDs/labels change; consider reusing the shared helper (or exporting a single mapping) so all exported-to option builders stay consistent.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46230cf951
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| return [...connectedIntegrationPickerItems, ...standardExportTemplatePickerItems]; | ||
| return [...connectedIntegrationPickerItems, ...standardAndIntegrationCustomTemplatePickerItems]; |
There was a problem hiding this comment.
Deduplicate exported-to picker values before returning
This concatenates integration items with template items without deduping by value, so a custom IS template named the same as an integration display name or standard export label will produce duplicate picker rows with identical IDs. SearchMultipleSelectionPicker tracks selection by value.toString(), so duplicates are toggled together and applyChanges can emit repeated values, creating confusing UI behavior and unstable saved selections.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid concern. Even though this is an edge case, but we should handle it to keep picker selection stable and avoid duplicate IDs. Implementing the fix
| const filterValue = standardExportTemplateDisplayName !== template.templateName ? standardExportTemplateDisplayName : (template.name ?? template.templateName); | ||
| standardAndCustomExportTemplates.push(filterValue); |
There was a problem hiding this comment.
Exclude connection-key templates from hook options
The hook now includes every non-IN_APP template value, but the advanced filter picker explicitly skips templates whose templateName matches an integration connection key. If an IS template name equals a key like quickbooksOnline/xero, autocomplete and query validation will treat that value as valid while the picker cannot present it, causing inconsistent exported-to behavior across search entry points.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Makes sense to apply the same exclusion rule in hook as well.
🔍 PR ReviewSummary: This PR adds Integration Server (IS) custom export templates to the "Exported to" search filter options. Previously, only standard templates (report-level/expense-level exports) appeared; now IS custom templates are also shown, while classic in-app (CSV) templates remain excluded. CI StatusAll meaningful checks pass (tests, lint, typecheck, prettier, etc.). The only failing check is Code ReviewOverall: This is a clean, well-structured change. The approach is sound — using the Positives:
Minor observations (non-blocking):
No issues found with:
LGTM ✅ — the changes correctly implement the feature described in the linked issue. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaridemo.mov |
| } | ||
|
|
||
| return [...connectedIntegrationPickerItems, ...standardExportTemplatePickerItems]; | ||
| return [...connectedIntegrationPickerItems, ...standardAndIntegrationCustomTemplatePickerItems]; |
|
@JS00001 please take a look. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
@JS00001 All your 🙌 |
Explanation of Change
Fixed Issues
$ #80005
PROPOSAL:
Tests
Offline tests
QA Steps
Same as test
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.macOS.chrome.mp4
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari