Merging main #92127
Merged
Merged
Conversation
- Updated ROUTES to include dynamic query parameters for adding agents in workflows. - Modified SCREENS to add a new screen for adding agents. - Enhanced ApprovalWorkflowSection to support adding agents with a new button. - Updated multiple language files to include translations for new actions. - Adjusted navigation and linking configurations to accommodate new agent routes. - Implemented optimistic UI updates for agent creation in workflows. - Added tests for new functionalities in ApprovalWorkflowSection and AddAgentPage.
- Introduced a mechanism to capture and manage the creation of new agents within workflows. - Added functions to set, get, and clear a pending post-create seed for newly created agents. - Updated AddAgentPage to record known agent account IDs before API submission. - Enhanced WorkspaceWorkflowsPage to identify and wire the new agent as an approver once the CREATE_AGENT response is received. - Improved navigation to direct users to the Edit Approval Workflow page with the new agent pre-seeded.
- Refactored the route for adding agents to use a utility function for better parameter handling. - Introduced a new function to replace approvers in the approval workflow, allowing for seamless updates after agent creation. - Updated the AddAgentPage to ensure a default agent name is used for better user experience. - Enhanced the WorkspaceWorkflowsPage to manage optimistic updates for agent approvals, ensuring the correct agent is displayed post-creation. - Added functionality to track pending agent approver swaps to maintain workflow integrity during agent creation.
- Updated ROUTES to support an optional seed approver email for improved agent management in workflows. - Modified the AddAgentPage to track known agent account IDs and handle new agent creation more effectively. - Enhanced WorkspaceWorkflowsApprovalsEditPage to utilize the seed approver email, ensuring the correct agent is displayed as an approver. - Removed the pending agent approver store to streamline the workflow and reduce complexity. - Improved navigation logic in WorkspaceWorkflowsPage to accommodate the new agent approval flow.
- Updated the ROUTES configuration to utilize a utility function for generating URLs with optional parameters, specifically for the seed approver email in the approval workflow. - This change enhances code readability and maintainability by centralizing URL parameter management.
- Eliminated the isCustomAgentBetaEnabled flag from the WorkspaceWorkflowsPage, simplifying the agent addition logic. - Updated the canAddAgent condition to remove dependency on the custom agent beta, streamlining the approval workflow process.
…ponents - Updated comments in Agent.ts to clarify the purpose of optimistic personal details during agent creation. - Removed redundant comments in AddAgentPage and WorkspaceWorkflowsApprovalsEditPage to streamline the code and improve readability. - Enhanced the description of the seed approver email handling in the approval workflow for better understanding.
…pprovalWorkflowSectionTest - Replaced the static translations object with a mockTranslate function to improve flexibility and maintainability in unit tests. - Updated the jest mock for useLocalize to utilize the new mockTranslate function for better clarity in translation handling.
- Introduced a new return route management system in the AddAgentPage and AddAgentAvatarPage to improve navigation after agent creation. - Updated the pendingAgentAvatarStore to include functions for setting and getting the return route. - Modified navigation logic to utilize the return route, ensuring users are directed to the correct page after saving agent details. - Enhanced unit tests to validate the new return route functionality and ensure proper navigation behavior.
…ent addition - Introduced a new custom hook, useAddAgentToApprovalWorkflow, to manage the addition of agents to approval workflows. - The hook handles the logic for seeding an approval workflow with owned agents and navigates to the appropriate screens based on the current state. - Updated WorkspaceWorkflowsPage to utilize the new hook, simplifying the agent addition process and improving code maintainability.
…rocess - Introduced a mechanism to handle workflow saves for agents created during the approval process while their email is still pending. - Added new ONYXKEYS and types to manage deferred agent workflow saves, allowing for a smoother user experience when saving workflows with newly created agents. - Updated the ApprovalWorkflowSection to visually indicate pending agents and ensure proper reconciliation once the agent's email is confirmed. - Enhanced WorkspaceWorkflowsPage to overlay deferred saves on top of existing workflows, maintaining workflow integrity during agent creation. - Improved navigation and state management in the AddAgentPage and WorkspaceWorkflowsApprovalsEditPage to accommodate the new deferred save functionality.
…flowsPage - Introduced a useRef hook to track reconciled deferred-save keys, preventing duplicate updates during intermediate renders. - Updated the reconciliation logic to clear tracked keys when Onyx entries are removed, allowing for proper handling of reappearing keys. - Enhanced the logic for upgrading workflow members to ensure new agents are correctly integrated as default approvers in the approval workflow. - Improved overall state management and clarity in the handling of deferred agent workflow saves.
- Modified the test for agent creation to verify that the pending/error states are correctly mirrored onto the policy, ensuring accurate UI indicators. - Added a new test case to confirm that no changes occur to the policy when no policyID is provided, enhancing test coverage for agent creation scenarios.
…iliation - Introduced a new ONYXKEY for mapping optimistic agent account IDs to real server-assigned IDs, enhancing the reconciliation process in the approval workflow. - Updated the CreateAgentParams to include optimisticAccountID, allowing the server to echo the mapping in responses. - Enhanced the createAgent function to write optimistic account ID mappings, ensuring proper handling during agent creation. - Modified WorkspaceWorkflowsPage and WorkspaceWorkflowsApprovalsEditPage to utilize the new mapping for resolving agent details, improving accuracy in email resolution and agent identification. - Added unit tests to verify the optimistic account ID handling and ensure correct mapping behavior during agent creation and reconciliation.
…havior - Modified the test case to accurately describe the navigation to the Edit Approval Workflow when policyID and workflowApproverEmail are set, utilizing the optimistic accountID for immediate redirection. - Enhanced assertions to verify the correct navigation path and parameters, ensuring the test aligns with the updated agent creation workflow.
…ents - Added a new prop `onDismissApproverError` to the ApprovalWorkflowSection to handle dismissing errors for optimistic agents. - Introduced a new hook `useDeferredAgentWorkflowReconciliation` to manage the reconciliation of deferred agent workflows, ensuring proper integration of pending agents. - Implemented a function `clearPendingAgentFromApprovalWorkflow` to discard failed optimistic agents from the approval workflow, improving error management. - Updated the ApprovalWorkflow type to include transient errors for optimistic agents, enhancing the user experience during the approval process.
- Introduced a new function `openProfilePage` to facilitate navigation to the profile page, enhancing user experience in the agent management workflow.
…number and ensure correct handling of accountID in optimistic personal detail entries.
…kflows - Refactored `useAddAgentToApprovalWorkflow` to utilize detailed user information from `useCurrentUserPersonalDetails`. - Updated the `addMembersToWorkspace` function to accept a user object for improved clarity. - Added translations for 'Agent' and related phrases in multiple languages, enhancing the user experience in agent management. - Improved descriptions for creating new agents across various language files.
- Introduced `resolveOptimisticAgent` utility to enhance the resolution of pending agent approvers after CREATE_AGENT. - Refactored `useDeferredAgentWorkflowReconciliation` to utilize the new resolution logic, improving accuracy in agent email and account ID retrieval. - Updated `WorkspaceWorkflowsApprovalsEditPage` to leverage the `resolveOptimisticAgent` function, streamlining the handling of optimistic agent scenarios.
- Changed the return type of `getOptimisticAccountID` from string to number for better type consistency. - Updated related test assertions to reflect the new return type, ensuring that the optimistic account ID is validated as a number.
…to-workflow-approval Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
…flow-approval feat: [91244] add agent to workflow approval
0e46240
into
helpsite-custom-agents
182 of 183 checks passed
|
@Beamanator Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Contributor
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 69a77bc5c1c..e98bd37ea9c 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2978,7 +2978,7 @@ ${amount} pour ${merchant} - ${date}`,
phoneOrEmail: 'Téléphone ou e-mail',
error: {
agentSignInBlocked:
- 'Les comptes d\u2019agent ne permettent pas de se connecter directement. Pour utiliser un agent, connectez-vous avec votre propre compte et accédez-y via Copilot.',
+ 'Les comptes d’agent ne permettent pas de se connecter directement. Pour utiliser un agent, connectez-vous avec votre propre compte et accédez-y via Copilot.',
invalidFormatEmailLogin: 'L’adresse e-mail saisie est invalide. Veuillez corriger le format et réessayer.',
},
cannotGetAccountDetails: 'Impossible de récupérer les détails du compte. Veuillez essayer de vous reconnecter.',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
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.
Explanation of Change
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
// 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.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari