Skip to content

[Insights: Violations][R1] App - Expanding group & Suggested search #95859

Description

@neil-marcellini

(Neil's AI agent)

Part of the [Tracking] [Insights Violations] Release 1 issue: Expensify/Expensify#656401

Phase 5 of the Release 1 implementation order. Depends on Phase 4: #95858 (filter display + empty state - App).

These two App sections are combined so the feature launches in a complete state.

Suggested search (App)

Add the "Violations by submitter" suggested search to the Spend page.

  • Add a VIOLATIONS_BY_SUBMITTER constant under SEARCH_KEYS and the translation key search.tabs.violationsBySubmitter.
  • Add the has:submitted-violation filter to CONST.SEARCH.HAS_VALUES.
  • Build the searchQuery with buildQueryStringFromFilterFormValues (type EXPENSE, group-by:from, date:last-month, has:submitted-violation, view:table, limit:10, sorted by group-expenses descending), and define the TopSearchMenuItem in getSuggestedSearches (icon UserEye).
  • Ensure the UserEye icon is loaded (add to SearchTypeMenuItem and the useMemoizedLazyExpensifyIcons calls).
  • Add visibility logic in getSuggestedSearchesVisibility (admins/auditors on a Rules-enabled workspace with more than one member), add the key to insightsSearchKeys in createTypeMenuSections, and to eligibleSearchKeys in useSearchShouldCalculateTotals.

Expanding a Violations by submitter group (App)

Add a Violations column showing which rules each expense broke at submission time.

  • Rename exportedReportActions in TransactionGroupListExpanded to a generic reportActions.
  • Add VIOLATIONS = 'violations' under CONST.SEARCH.TABLE_COLUMNS, an optional violations field on OriginalMessageSubmitted, and a common.violations translation key.
  • Add getSubmittedViolationsForTransaction in SearchUIUtils that aggregates violations across every SUBMITTED / SUBMITTED_AND_CLOSED action for a transaction, deduped by name.
  • Show the column via getColumnsToShow/updateColumns when report actions contain violation data, register it in getExpenseHeaders, and render the cell in renderColumn (wide + narrow rows) as a TextCell.

Repo: App (frontend).

Full details

Issue OwnerCurrent Issue Owner: @nkdengineer

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions