fix: Action button shows "Draft" for offline expense when approvals/payments are disabled#2
Open
RanuK12 wants to merge 653 commits into
Open
fix: Action button shows "Draft" for offline expense when approvals/payments are disabled#2RanuK12 wants to merge 653 commits into
RanuK12 wants to merge 653 commits into
Conversation
…GroupPolicy-submit # Conflicts: # src/libs/ReportUtils.ts # src/libs/TransactionPreviewUtils.ts # src/libs/actions/IOU/MoneyRequestBuilder.ts
…/vendor Onyx applies updates with shouldRemoveNestedNulls=true, so the optimistic oldVendor: null (when adding a vendor with no prior) or vendor: null (when clearing a vendor) was getting stripped on merge. The hasModifiedVendor guard required BOTH keys to be present, so add/remove cases fell through to the generic 'changed the expense' fallback instead of rendering 'set the vendor to X' / 'removed the vendor (previously X)'. Loosen the guard to accept either key, and add tests covering add, change, remove, and the QBO-deleted-vendor fallback, plus four optimistic-action shape tests in UpdateMoneyRequestVendorTest.ts.
…tor rows Allows users to remove themselves as a copilot from a delegator's account. Adds RemoveDelegator write command, a confirmation modal, and replaces the Switch button on delegator rows with a three-dot popover menu containing Switch and Remove copilot access options. Ref: Expensify/Expensify#638847 Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
- Run Prettier on Delegate.ts to fix formatting - Convert delegatorMenuItems from useMemo to inline computation to fix React Compiler 'Cannot access refs during render' error. The compiler flags two useMemo hooks capturing callbacks that mutate the same ref. React Compiler auto-memoizes the inline computation, so manual useMemo is unnecessary. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
- Add removeDelegator field to DelegateErrors type - Add removeCopilotAccess/removeCopilotAccessConfirmation translations to de, fr, it, ja, nl, pl, pt-BR, zh-hans - Update CopilotPageTest to expect three-dot menu instead of Switch button in delegator rows - Add removeDelegator to Delegate action mock Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
- Update translations for remove copilot access in multiple languages (de, en, es, fr, it, ja, nl, pl, pt-BR, zh-hans) to include personalized confirmation messages. - Modify CopilotPage to utilize new confirmation modal structure, including delegator name in prompts. - Adjust icon usage in the delegator popover menu for improved UX.
- Add 'connect' and 'removeDelegator' fields to WithFieldName type for improved error tracking. - Update error handling in removeDelegator function to provide more informative error messages. - Modify CopilotPage to handle errors for both 'connect' and 'removeDelegator' actions, ensuring proper dismissal of errors on pending actions.
…ator row - Convert showRemoveDelegatorModal and showDelegatorPopoverMenu to plain functions (React Compiler auto-memoizes) - Remove role: CONST.ROLE.LINK from delegator row since it now opens a popover instead of navigating Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…belt baseline Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
…r delegator type additions Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
…py-For-Track-intent-users
…r delegator type additions Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
…utput Co-authored-by: Christina Dobrzynski <Christinadobrzyn@users.noreply.github.com>
…ted summaries and update prompt display logic in AIRulesSection. This change allows for a more descriptive title to be shown, improving clarity for users.
…ule.title ?? rule.prompt` to ensure a fallback to prompt when title is not available, enhancing user clarity.
Cover title/prompt fallback, whitespace normalization, sort order, pending-delete visibility online vs offline, and rule item / add button navigation paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix: Long tag names don't wrap in tag selection list
[Payment due @parasharrajat] Inbox filters
…zybowski/review-x-expenses [Home Page] Add Review X expenses action to For you to surface expenses against company expense policy
…sh-window SequentialQueue: await Onyx persist before allowing flush
…p-onyx-3.0.83 Bump Onyx to 3.0.83
…xtract-inbox-tab-button refactor: extract InboxTabButton with colocated last report subs
…k-fix-another-debugmode-db Fix fullScreenBlockingView bleeding over navigationTabBar (deploy blockers after debugTabView update)
…oup-headers Add sticky group headers to Spend table (two-phase approach)
…ails-in-share-bank-recipients Fix - BA - Share button is visible for business bank account without workspace members
…fix-rock-fingerprint [No QA] fix: add `patches` dirs to Rock fingerprint
…ek/app-8bm-sentry-crash-fix-nil-blobHandler [No QA] Fix [Sentry: APP-8BM] HybridApp iOS NSInvalidArgumentException nil object in RCTNetworking prioritizedHandlers
Add Card Admin workspace access
fix Search - User in Recent chats section is not highlighted
…nnect-without-view Move deleteReport to a separate file and use Onyx.connectWithoutView
…countCopy [Payment due @dmkt9] Update Report suspicious activity copy to clarify when to lock an account
…fline submit [ranukita:f5e7e7]
Owner
Author
|
/claim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
When submitting an expense offline from the Search view (Reports > Expenses), the action button shows "Draft" instead of "Done" on workspaces with approvals and payments disabled. This happens because
submitMoneyRequestOnSearchdoes not include an optimistic update for the report state (stateNum/statusNum).Fixed Issues
Closes Expensify#93371
Tests
QA Steps
Same as tests above.
Root Cause
submitMoneyRequestOnSearchcalls API.write(SUBMIT_REPORT) without an optimistic update for the report state. When offline, the report remains OPEN/OPEN ("Draft") instead of transitioning to APPROVED/CLOSED ("Done") for submit-and-close policies.Fix
Added optimistic data entries in
submitMoneyRequestOnSearchthat update each report'sstateNumandstatusNumto APPROVED/CLOSED (or SUBMITTED/SUBMITTED for non-submit-and-close policies) immediately in Onyx, before the API call completes.