Skip to content
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

Improved disclosure permission close dialog #319

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ android/irmagobridge/irmagobridge-sources.jar
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
devtools_options.yaml
6 changes: 3 additions & 3 deletions assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@
"decline_signature": "Don't sign"
},
"confirm_close_dialog": {
"title": "Cancel data sharing",
"title": "Are you sure?",
Copy link

Choose a reason for hiding this comment

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

The buttons were a bit misleading but I think the original title was more descriptive about the action the user is about to take.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I was kind of debating this change, as "Cancel sharing data" is not really a question that can be answered with "yes" or "no". But it's true that "Are you sure?" is not really descriptive.

"explanation": "Are you sure you don't want to share your data?",
"confirm": "Close",
"decline": "Continue"
"confirm": "Yes",
"decline": "No"
},
"wrong_credentials_added": {
"title": "Error",
Expand Down
6 changes: 3 additions & 3 deletions assets/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@
"decline_signature": "Niet ondertekenen"
},
"confirm_close_dialog": {
"title": "Gegevens delen stoppen",
"title": "Weet je het zeker?",
"explanation": "Weet je zeker dat je je gegevens niet wilt delen?",
"confirm": "Sluiten",
"decline": "Doorgaan"
"confirm": "Ja",
"decline": "Nee"
},
"wrong_credentials_added": {
"title": "Foutmelding",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Future<void> declineDisclosure(WidgetTester tester, IntegrationTestIrmaBinding i
expect(disclosureCloseDialogFinder, findsOneWidget);

// Press close and dialog should disappear
await tester.tapAndSettle(find.text('Close'));
await tester.tapAndSettle(find.text('Yes'));
expect(disclosureCloseDialogFinder, findsNothing);

// Finally, expect to be back on the home screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:irmamobile/src/screens/data/credentials_detail_screen.dart';
import 'package:irmamobile/src/screens/notifications/widgets/notification_bell.dart';
import 'package:irmamobile/src/screens/notifications/widgets/notification_card.dart';

import 'package:irmamobile/src/screens/session/disclosure/widgets/disclosure_permission_choices_screen.dart';
import 'package:irmamobile/src/widgets/credential_card/irma_credential_card.dart';
import 'package:irmamobile/src/widgets/credential_card/irma_credential_card_options_bottom_sheet.dart';
Expand Down Expand Up @@ -74,9 +73,7 @@ Future<void> revocationTest(WidgetTester tester, IntegrationTestIrmaBinding irma
await tester.tapAndSettle(find.byType(IrmaCloseButton));

// Confirm the close dialog
await tester.tapAndSettle(
find.text('Close'),
);
await tester.tapAndSettle(find.text('Yes'));

// The NotificationBell should be findable in the app bar
final notificationBellFinder = find.byType(NotificationBell);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ class DisclosurePermissionCloseDialog extends StatelessWidget {
}

@override
Widget build(BuildContext context) => const IrmaConfirmationDialog(
titleTranslationKey: 'disclosure_permission.confirm_close_dialog.title',
contentTranslationKey: 'disclosure_permission.confirm_close_dialog.explanation',
confirmTranslationKey: 'disclosure_permission.confirm_close_dialog.confirm',
cancelTranslationKey: 'disclosure_permission.confirm_close_dialog.decline',
nudgeCancel: true,
);
Widget build(BuildContext context) {
return const IrmaConfirmationDialog(
titleTranslationKey: 'disclosure_permission.confirm_close_dialog.title',
contentTranslationKey: 'disclosure_permission.confirm_close_dialog.explanation',
confirmTranslationKey: 'disclosure_permission.confirm_close_dialog.confirm',
cancelTranslationKey: 'disclosure_permission.confirm_close_dialog.decline',
);
}
}