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
fix: account removal reason issue #2585 #3258
Conversation
Can you attach a screenshot or a video @Akashsri3bi ? |
Yes sure ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few changes @Akashsri3bi
type: TextFieldTypes.PLAIN_TEXT, | ||
textInputType: TextInputType.text, | ||
controller: reasonController, | ||
hintText: 'Reasons'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you add the translations plz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AshAman999 from where can I add ?
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: <Widget>[ | ||
const Text( | ||
'Are you sure you want to delete your account? \n Is there a specific reason share below '), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translations /
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sure !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please remove unused spaces (at the beginning / end of each sentences)
children: <Widget>[ | ||
const Text( | ||
'Are you sure you want to delete your account? \n Is there a specific reason share below '), | ||
const SizedBox( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could avoid the hardcoded 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay I will see to it .
"Sharing the reason why gives us the opportunity to improve Open Food Facts for everyone" |
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: <Widget>[ | ||
const Text( | ||
'Are you sure you want to delete your account? \n Is there a specific reason share below '), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please remove unused spaces (at the beginning / end of each sentences)
final Email email = Email( | ||
body: appLocalizations.email_body_account_deletion(userId), | ||
body: appLocalizations.email_body_account_deletion(userId) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please concatenate the strings using this annotation: "${var1} ${var2}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay @g123k !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone tell from where to add translations ? @AshAman999 @g123k
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app_en.arb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hot reload / hot restart refresh the appLocalizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monsieurtanuki I tried hot reload / restart but still can't access it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess running flutter pub get
should do the trick, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise flutter clean
and then running the app
What I do in some cases is just commiting with it not working locally. When the tests pass this passes as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay @monsieurtanuki @M123-dev !
const SizedBox( | ||
height: 5, | ||
), | ||
SmoothTextFormField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to say that only now, but I don't think a one-line text field is appropriate to give the reason why you want to have your account deleted.
Given that we don't send emails but just open a new email on a mail app with pre-populated fields, I guess we would be better off pre-populating the email body with "Please give us the reason why you want your account to be deleted: ...", and let the user write inside the mail app (instead of a one-line text field).
Just my 2 cents. We can try with that one-line text-field, it's not such a common use case (at least I hope).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What needs to be done on my side ? Is the issue closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you @monsieurtanuki , we open the email app anyways,
What you suggested makes more sense
What needs to be done on my side ? Is the issue closed
Perhaps we will need other pr with the changes that is requested here ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AshAman999 That's why we should exchange about issues at the issues level ("Which solutions make sense?"), and then exchange about the code at the PRs level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Akashsri3bi!
There's a big UX problem here: you've forgotten the "cancel" button.
@@ -305,8 +307,35 @@ class _UserPreferencesPageState extends State<UserPreferencesSection> { | |||
_getListTile( | |||
appLocalizations.account_delete, | |||
() async { | |||
await showDialog<SmoothAlertDialog>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be final String? reason = await showDialog<String>(
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monsieurtanuki So reason string will be used in email ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monsieurtanuki So reason string will be used in email ?
@Akashsri3bi It is already, isn't it? If we think about something more refined for this "delete account" feature, it will be in another issue and another PR.
positiveAction: SmoothActionButton( | ||
text: appLocalizations.okay, | ||
onPressed: () => Navigator.maybePop(context), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a cancel
button.
In this specific case, the labels should be not confusing at all, like an obvious "Delete account" button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monsieurtanuki @AshAman999 listing fixes I need to work on for this issue :
- Cancel button for ux
- Should be
final String? reason = await showDialog<String>(
- Is there something I left here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Akashsri3bi Also:
- replacing that lazy "Okay" button with something more aggressive, like
account_delete
- probably rendering
account_delete
andcancel
buttons as vertical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay @monsieurtanuki !
Codecov Report
@@ Coverage Diff @@
## develop #3258 +/- ##
===========================================
- Coverage 10.51% 10.46% -0.06%
===========================================
Files 249 252 +3
Lines 12283 12351 +68
===========================================
Hits 1292 1292
- Misses 10991 11059 +68
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Akashsri3bi!
I think await showDialog<SmoothAlertDialog>
does not make any sense; it should be something like
final String? reason = await showDialog<String>(
//...
positiveAction: SmoothActionButton(
text: appLocalizations.account_delete,
onPressed: () async => Navigator.pop(context, reasonController.text),
),
negativeAction: SmoothActionButton(
text: appLocalizations.cancel,
onPressed: () async => Navigator.pop(context),
),
// ...
);
if (reason != null) {
sendEmail(reason);
}
But it's (maybe) a matter of taste.
What is more problematic is that you don't close the dialog window when you click "delete account".
okay I will try to make it like that ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Akashsri3bi, that's good!
Welcome @monsieurtanuki ! |
What
When user delete an account it should be asked the reason why it needs to be deleted.
###Fix
When user deletes an account a dialog asking the reason to delete the account that reason will then be pushed to mail that be sent .