Skip to content

Conversation

@nausharipov
Copy link
Contributor

@nausharipov nausharipov commented Feb 6, 2023

Resolves #25255
Resolves #25116
Resolves #25284


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

Comment on lines 138 to 144
onContinue: () {
authNotifier.deleteAccount().then(
(_) {
Navigator.pop(context);
},
);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. async / await.
  2. Show progress?

Copy link
Contributor Author

@nausharipov nausharipov Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Linter is against using context in async functions.
  2. Do you mean showing an overlaying loading animation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Oh, by the way this is just the same problem, but the linter cannot spot it. One solution is to let the dialog close itself by passing a callback to onContinue, but this is ugly. Try to think of better ideas. Also this is exactly why in app_state we have states pushing themselves out without a context.
  2. Yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplest solution is to first pop the dialog and then to delete the account.

Comment on lines 48 to 52
showDialog(
context: context,
builder: (context) => Dialog(
backgroundColor: Colors.transparent,
child: BeamAlertDialog(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate code.
BeamAlertDialog.show(context, ...); ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved Dialog into BeamAlertDialog, because future users of the widget might not know about the

Future<void> show(BuildContext context) async {
    await showDialog(
      context: context,
      builder: build,
    );
 }

function and use showDialog.

Comment on lines 30 to 33
this.body,
required this.continueLabel,
required this.onContinue,
required this.title,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put required parameters first.

import '../../../playground_components.dart';

class BeamAlertDialog extends StatelessWidget {
final String? body;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final String? body;
final String? text;

?

onPressed: () {
Navigator.pop(context);
},
// TODO(nausharipov): review: translate in PGC?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have easy_localization there already and slowly migrating strings there.

* See the License for the specific language governing permissions and
* limitations under the License.
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which of these two files is used?

Copy link
Contributor Author

@nausharipov nausharipov Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted /popups.

required BuildContext context,
required PublicNotifier closeNotifier,
required Positioned positioned,
bool isDismissible = true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current users of overlay (LoginButton and Avatar) expect it to be dismissible. Also, it is consistent with showDialog's bool barrierDismissible = true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to barrierDismissible then?
I would prefer this to be required though because there is actually no good reason to prefer one over another.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the function to showOverlay and the parameter to barrierDismissible for consistency, still assuming that true is the preferable setting.

Comment on lines 27 to 29
required this.close,
required this.child,
required this.isDismissible,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort.

Comment on lines 22 to 24
final VoidCallback close;
final Positioned child;
final bool isDismissible;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort.

Comment on lines 24 to 25
// TODO(nausharipov) review: add label?
// TODO(nausharipov) review: add grey-ish background?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. No.
  2. Yes.

Copy link
Contributor

@alexeyinkin alexeyinkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (internal review).

@nausharipov nausharipov changed the title [Tour of Beam] [Frontend] Delete account [Tour of Beam] [Frontend] Delete account, GitHub auth, solution warning Feb 9, 2023
@nausharipov nausharipov marked this pull request as ready for review February 9, 2023 15:25
@nausharipov
Copy link
Contributor Author

R: @damondouglas

@nausharipov
Copy link
Contributor Author

nausharipov commented Feb 9, 2023

Switching between assignment and solution is done in #25298.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control


import '../../../playground_components.dart';

class BeamAlertDialog extends StatelessWidget {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you comment what this Widget does and why it exists? It's somewhat obvious that it is a general purpose dialog Widget but it would be helpful to others needing to change it in the future at least one sentence describing it.

Copy link
Contributor Author

@nausharipov nausharipov Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the widget.

import '../../../playground_components.dart';

class BeamAlertDialog extends StatelessWidget {
final String? text;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment that (I'm assuming) test lands in the body of the dialog widget? Why is it optional?

Copy link
Contributor Author

@nausharipov nausharipov Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed text to subtitle. It is optional, because some dialogs might not need body text.


class BeamAlertDialog extends StatelessWidget {
final String? text;
final String continueLabel;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does continueLabel do? Can you add a comment?

Copy link
Contributor Author

@nausharipov nausharipov Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the parameter.

final String? text;
final String continueLabel;
final VoidCallback onContinue;
final String title;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a character limit?

Copy link
Contributor Author

@nausharipov nausharipov Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapped the dialog content in SingleChildScrollView to avoid overflow.

class BeamAlertDialog extends StatelessWidget {
final String? text;
final String continueLabel;
final VoidCallback onContinue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment perhaps that the route is popped, etc.

Copy link
Contributor Author

@nausharipov nausharipov Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the parameter.


import '../../../playground_components.dart';

class BeamOverlays {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that it is plural stages future types of overlay widgets? Could you comment on the purpose of this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

import '../../../playground_components.dart';

class BeamOverlays {
static Future<void> showProgressOverlay(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming the purpose of this is to simply overlay a CircularProgressIndicator? Could you add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

@nausharipov nausharipov removed the request for review from alexeyinkin February 10, 2023 15:46
@nausharipov
Copy link
Contributor Author

R: @damondouglas

Copy link
Contributor

@damondouglas damondouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olehborysevych Are you able to update the tour of beam readme backend instructions so I can review this as an actual running application?

import 'package:flutter/material.dart';

import '../../../playground_components.dart';
class ProgressDialog extends StatelessWidget {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the comment from the overlay.

@nausharipov nausharipov deleted the issue25255-delete-account branch May 15, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants