Closed lanitochka17 closed 2 months ago
Triggered auto assignment to @stephanieelliott (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
When the API call begins, we should keep the modal open and show a loading state. If the API call is successful, we can then close the modal. If it fails, we should display an error message above the CTA button:
When calling API in there and there, add a onyxData
:
const optimisticData: OnyxUpdate[] = [
{
key: ONYXKEYS.FORMS.ISSUE_NEW_CARD_FORM, // Can use existed ONYXKEYS.ISSUE_NEW_EXPENSIFY_CARD
onyxMethod: Onyx.METHOD.MERGE,
value: {
isLoading: true,
},
},
];
const successData: OnyxUpdate[] = [
{
key: ONYXKEYS.FORMS.ISSUE_NEW_CARD_FORM,
onyxMethod: Onyx.METHOD.MERGE,
value: {
isLoading: false,
},
},
];
const failureData: OnyxUpdate[] = [
{
key: ONYXKEYS.FORMS.ISSUE_NEW_CARD_FORM,
onyxMethod: Onyx.METHOD.MERGE,
value: {
isLoading: false,
error: 'There is an error',
},
},
];
Create a logic to close modal and display error:
const [formData] = useOnyx(ONYXKEYS.FORMS.ISSUE_NEW_CARD_FORM);
const isLoading = formData ? formData.isLoading : false;
const error = formData ? formData.error : undefined;
const prevIsLoading = usePrevious(isLoading);
// Close the modal when API is called successfully.
useEffect(() => {
if (isLoading === false && prevIsLoading === true && !error) {
Navigation.goBack();
Card.clearIssueNewCardFlow();
}
}, [isLoading, prevIsLoading, error]);
// Clear the form error when focusing.
useFocusEffect(
useCallback(() => {
Onyx.merge(ONYXKEYS.FORMS.ISSUE_NEW_CARD_FORM, {error: ''});
}, []),
);
Update button component so that it can display the loading and error state: https://github.com/Expensify/App/blob/0c8455280c738a5db596f34409a0a3177e682e7f/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx#L107
<FormAlertWithSubmitButton
buttonText={translate('workspace.card.issueCard')}
enabledWhenOffline={false}
isAlertVisible={!!error}
isLoading={!!isLoading}
message={error}
onSubmit={submit}
enterKeyEventListenerPriority={1}
@stephanieelliott Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Job added to Upwork: https://www.upwork.com/jobs/~014b6a6971e6ae4d8c
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External
)
@koko57 @mountiny @DylanDylann @allgandalf is this one known? 🤔
@trjExpensify no it wasn't known before - earlier we navigated back to the Expensify Crad page. Looks like there's some problem with creating the card, bc the card doesn't appear in the section even after some time. @mountiny we should think of the best way to handle errors here and where we want to show the error - in the flow or in the Card Section after the flow is closed
Looks like there's some problem with creating the card, bc the card doesn't appear in the section even after some time
I also see that
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
What I see in the logs for this applause user is that the business is not provisioned. So something must have gone wrong during the setup for them.
@koko57 @DylanDylann are you able to repro this issue?
https://github.com/user-attachments/assets/0d5333fb-8dca-4152-9b72-9cf9f2757a96
I kinda think we can close this because on latest main we take you to the expensify cards page so this is not really valid. It was failing for the due to wrong setup which is hopefully fixed now
@mountiny actually it shouldn't take to the Expensify Card page - it was changed in https://github.com/Expensify/App/pull/47844 (it fixes https://github.com/Expensify/App/issues/46305) so was this change mistakenly reverted?
@koko57 I could not find this in the design doc, I will ask in Slack
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.24-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): applausetester+en@applause.expensifail.com Issue reported by: Applause - Internal Team
Issue found when executing PR https://github.com/Expensify/App/pull/47396
Action Performed:
Expected Result:
User expects that after the flow is completed, that the card shows up in that member section
Actual Result:
After completing the flow, the card does not show up in member section
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/5d93af64-bac1-406a-ad80-8fbcbc08cb75
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mananjadhav