-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[$250] Contact method - There is no feature to delete unverified contact methods. #54626
Comments
Triggered auto assignment to @laurenreidexpensify ( |
Edited by proposal-police: This proposal was edited at 2024-12-30 19:29:21 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.User is not able to remove an unverified contact method What is the root cause of that problem?New feature What changes do you think we should make in order to solve the problem?We can accept the <View style={[themeStyles.borderTop, themeStyles.mv4]} />
{children} Then, we simply pass the "Remove" button to it in the <ValidateCodeActionModal
title={formattedContactMethod}
onModalHide={() => {}}
hasMagicCodeBeenSent={hasMagicCodeBeenSent}
isVisible={isValidateCodeActionModalVisible && !loginData.validatedDate && !!loginData}
validatePendingAction={loginData.pendingFields?.validateCodeSent}
handleSubmitForm={(validateCode) => User.validateSecondaryLogin(loginList, contactMethod, validateCode)}
validateError={!isEmptyObject(validateLoginError) ? validateLoginError : ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent')}
clearError={() => User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')}
onClose={() => {
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo));
setIsValidateCodeActionModalVisible(false);
}}
sendValidateCode={() => User.requestContactMethodValidateCode(contactMethod)}
descriptionPrimary={translate('contacts.enterMagicCode', {contactMethod: formattedContactMethod})}
>
+ <OfflineWithFeedback
+ pendingAction={loginData.pendingFields?.deletedLogin}
+ errors={ErrorUtils.getLatestErrorField(loginData, 'deletedLogin')}
+ errorRowStyles={[themeStyles.mt6, themeStyles.ph5]}
+ onClose={() => User.clearContactMethodErrors(contactMethod, 'deletedLogin')}
+ >
+ <MenuItem
+ title={translate('common.remove')}
+ icon={Expensicons.Trashcan}
+ iconFill={theme.danger}
+ onPress={() => toggleDeleteModal(true)}
+ />
+ </OfflineWithFeedback>
</ValidateCodeActionModal> What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional)We can pass the ThreeDotsMenu as Screen.Recording.2024-12-31.at.12.58.16.AM.movScreen.Recording.2024-12-28.at.12.15.37.AM.mov |
Edited by proposal-police: This proposal was edited at 2024-12-29 08:39:48 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.There is no feature to delete unverified contact methods. What is the root cause of that problem?We are able to remove the contact method when it is verified and not the default contact.
And in the case of this ticket, the contact method is unable to be removed. This is a new feature What changes do you think we should make in order to solve the problem?If we want to remove the contact method when it is not yet verified, we need to add 1 update
update to: <ValidateCodeActionModal
title={formattedContactMethod}
onModalHide={() => {}}
hasMagicCodeBeenSent={hasMagicCodeBeenSent}
isVisible={isValidateCodeActionModalVisible && !loginData.validatedDate && !!loginData}
validatePendingAction={loginData.pendingFields?.validateCodeSent}
handleSubmitForm={(validateCode) => User.validateSecondaryLogin(loginList, contactMethod, validateCode)}
validateError={!isEmptyObject(validateLoginError) ? validateLoginError : ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent')}
clearError={() => User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')}
onClose={() => {
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo));
setIsValidateCodeActionModalVisible(false);
}}
sendValidateCode={() => User.requestContactMethodValidateCode(contactMethod)}
descriptionPrimary={translate('contacts.enterMagicCode', {contactMethod: formattedContactMethod})}
footer={() => getMenuItems(true)} // Add this line
/> 2 update
const getMenuItems = (onlyRemove = false) => {
if (onlyRemove) { // Add this block
if (isDefaultContactMethod) {
return <View />;
}
return (
<>
<OfflineWithFeedback
pendingAction={loginData.pendingFields?.deletedLogin}
errors={ErrorUtils.getLatestErrorField(loginData, 'deletedLogin')}
errorRowStyles={[themeStyles.mt6, themeStyles.ph5]}
onClose={() => User.clearContactMethodErrors(contactMethod, 'deletedLogin')}
>
<MenuItem
title={translate('common.remove')}
icon={Expensicons.Trashcan}
iconFill={theme.danger}
onPress={() => toggleDeleteModal(true)}
/>
</OfflineWithFeedback>
<ConfirmModal
title={translate('contacts.removeContactMethod')}
onConfirm={confirmDeleteAndHideModal}
onCancel={() => toggleDeleteModal(false)}
onModalHide={() => {
InteractionManager.runAfterInteractions(() => {
validateCodeFormRef.current?.focusLastSelected?.();
});
}}
prompt={translate('contacts.removeAreYouSure')}
confirmText={translate('common.yesContinue')}
cancelText={translate('common.cancel')}
isVisible={isDeleteModalOpen && !isDefaultContactMethod}
danger
/>
</>
);
}
...
}; POCScreen.Recording.2024-12-29.at.15.47.31.movNote: I will test the other case and optimize the code during the pull request phase Test branchWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?This issue updates the logic to allow removing the contact method when it is not verified, so I think we don’t need to test here What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
I'm not sure I fully follow the last repro steps:
It sounds like we're verifying the contact, but then looking to remove an unverified contact? |
The first code we paste from the email is sent to the main email of the current user. The secondary email we are trying to add remains unverified until we enter the second code sent to that secondary email. So, until the code is entered for the secondary email, it is still considered unverified. |
Ok, it looks like a valid issue. I can see that it was caused by #51882. |
@Shahidullah-Muffakir I don't see how your proposal will open the Delete Modal. |
@parasharrajat Do you mean in the alternative method?" |
No, on the main solution. |
Oh, okay. Since we're passing the Remove button as a child, clicking on it triggers the |
But where are we rendering the modal? |
@laurenreidexpensify I can help review the proposals here as I have the context of the problem. |
We're already rendering the Confirmation modal here: App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx Lines 220 to 233 in a5feee8
It’s on the same page, and the isVisible prop becomes true when isDeleteModalOpen && !isDefaultContactMethod is true, which happens when you press the button.
|
Job added to Upwork: https://www.upwork.com/jobs/~021874053836834663264 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
@Shahidullah-Muffakir But that Modal is rendered conditionally. It will be rendered when the ValidateCode modal is not rendered on the UI. About your proposal, you chose to add the remove option via the children prop. Why didn't you use a footer prop for that? |
@parasharrajat I included it in my proposal |
I saw that, just trying to understand the proposal. |
No, I think it can still be displayed even if the ValidateCode modal is rendered, as I showed in the video. This is because we're only checking
The footer prop would place the Remove button at the bottom of the screen, but the design team hasn't confirmed where the Remove button should go yet. Using the children prop allows us to display the Remove button anywhere we need." |
But if you look at the code the Modal is mounted at
I was expecting a slightly different motive so I asked. Thanks. |
Here, we can't use the footer prop as it will force the verify button to float above the screen, which is against our design guidelines. That's why it was removed in #51882. But the remove button should not have been removed from here. The correct location to show the Remove button would be the empty area like we have done in status page for clear status. |
Oh, sorry, I missed that. We can move the |
After reviewing both proposals I can say that both lack some details. But following the reason in #54626 (comment), we can't use footer prop. We need a new prop or use Let's go with @Shahidullah-Muffakir proposal for this one. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @tgolen, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@parasharrajat If the design team wants the button for unverified contact methods to be located at the bottom and under the save button, then my proposal is valid. |
That's a valid point @huult. Let me tag @Expensify/design team to suggest the placement of the delete button. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.0.79-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5288103
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: macOS Sequoia 15.1.1 / Web
App Component: undefined
Action Performed:
Expected Result:
The user should be able to delete the contact method as long as it is unverified
Actual Result:
It is not possible to delete a univerified contact methods because there is no feature for that
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6682518_1733188311399.There_is_no_feature_for_delete_unverified_contact_methods.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @parasharrajatThe text was updated successfully, but these errors were encountered: