Skip to content

Commit

Permalink
Merge branch 'demo-fixes' into 'main'
Browse files Browse the repository at this point in the history
Demo fixes

See merge request wallet/nl-wallet!868
  • Loading branch information
Rob committed May 2, 2024
2 parents 3eaeccd + 070dac4 commit 260966d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
6 changes: 3 additions & 3 deletions wallet_app/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@@locale": "en",
"@@last_modified": "2024-04-25T11:06:00+02:00",
"@@last_modified": "2024-04-30T09:41:14+02:00",
"aboutScreenDescription": "This demo is realized by a collaboration of multiple organizations and was commissioned by the dutch government. For more information please refer to the website {url}.",
"aboutScreenDescriptionLink": "edi.pleio.nl",
"@aboutScreenDescriptionLink": {
Expand Down Expand Up @@ -953,7 +953,7 @@
"organizationDetailScreenTitle": "About {name}",
"organizationDetailScreenViewTerms": "View the general",
"organizationDetailScreenWebsiteInfo": "Website",
"pageIndicatorSemanticsLabel": "Step {current} of {total}",
"pageIndicatorSemanticsLabel": "Step {current} out of {total}",
"pidAddressCardTitle": "Residential address",
"pidIdCardTitle": "Personal data",
"pinBlockedScreenDescription": "You have entered your PIN code incorrectly too many times.\n\nDo you want to use the Wallet again? Then you have to start again. Clear the Wallet and choose a new PIN code.",
Expand All @@ -972,7 +972,7 @@
}
}
},
"pinErrorDialogForgotCodeCta": "FOTGOT PIN CODE?",
"pinErrorDialogForgotCodeCta": "FORGOT PIN CODE?",
"pinErrorDialogNonFinalRoundFinalAttempt": "You can try 1 more time. If the following PIN code is invalid, the app will be temporary blocked.",
"pinErrorDialogNonFinalRoundInitialAttempt": "PIN code incorrect, try again.",
"pinErrorDialogNonFinalRoundNonFinalAttempt": "You can try {count} more times.",
Expand Down
6 changes: 3 additions & 3 deletions wallet_app/lib/l10n/intl_nl.arb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@@locale": "nl",
"@@last_modified": "2024-04-25T11:06:00+02:00",
"@@last_modified": "2024-04-30T09:41:14+02:00",
"aboutScreenDescription": "Deze demo app is tot stand gekomen door een samenwerking van verschillende organisaties in opdracht van de Nederlandse Overheid. Voor meer informatie over deze app verwijzen we naar de website {url}.",
"aboutScreenPrivacyCta": "Privacybeleid",
"aboutScreenTermsCta": "Gebruiksvoorwaarden",
Expand Down Expand Up @@ -565,7 +565,7 @@
"generalWCAGOpenLink": "Open link",
"generalWCAGQr": "Scan QR code",
"generalWCAGSeeAllActivities": "Bekijk alle activiteiten",
"generalWCAGStepper": "Stap {current} of {total}.",
"generalWCAGStepper": "Stap {current} van {total}.",
"helpSheetCloseCta": "Sluiten",
"helpSheetDescription": "Neem contact op met de helpdesk. De volgende gegevens kunnen nodig zijn.",
"helpSheetErrorCode": "Foutcode: {code}",
Expand Down Expand Up @@ -997,7 +997,7 @@
},
"pinKeyboardWCAGBackspaceLabel": "Verwijder",
"pinKeyboardWCAGBackspaceLongPressHint": "Alles te verwijderen",
"pinKeyboardWCAGDigitKeyTapHint": "invoer",
"pinKeyboardWCAGDigitKeyTapHint": "kiezen",
"pinScreenAboutAppTooltip": "Over de app",
"pinScreenAttemptsCount": "{count, plural, one {Je hebt nog {count} poging} other {Je hebt nog {count} pogingen}}",
"@pinScreenAttemptsCount": {
Expand Down
4 changes: 2 additions & 2 deletions wallet_app/lib/src/util/helper/semantics_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ class SemanticsHelper {
SemanticsHelper._();

/// If the input solely consists of positive digits, this method
/// will return a comma separated list of those digits. Useful to
/// will return a space separated list of those digits. Useful to
/// make a screen-reader read out the digits separately.
/// Otherwise it returns the original input.
static String splitNumberString(String input) {
if (input.trim().length != input.length) return input;
final isPositiveInt = int.tryParse(input)?.isNegative == false;
if (isPositiveInt) return input.split('').join(',');
if (isPositiveInt) return input.split('').join(' ');
return input;
}
}
11 changes: 6 additions & 5 deletions wallet_app/lib/src/wallet_core/typed/typed_wallet_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ class TypedWalletCore {
}

void _setupCardsStream() async {
_cards.onListen = () async {
await _isInitialized.future;
_walletCore.setCardsStream().listen((event) => _cards.add(event));
};
_cards.onCancel = () => _walletCore.clearCardsStream();
//FIXME: Ideally we don't set the card stream until we start observing it (i.e. in onListen())
//FIXME: but since the cards are not persisted yet that means we might miss events, so observing
//FIXME: the wallet_core cards stream through the complete lifecycle of the app for now.
//To reproduce issue: 1. Start clean, 2. Setup Wallet, 3. Kill app, 4. Continue Setup, 5. Cards don't show up on success page
await _isInitialized.future;
_walletCore.setCardsStream().listen((event) => _cards.add(event));
}

void _setupRecentHistoryStream() {
Expand Down
10 changes: 5 additions & 5 deletions wallet_app/test/src/util/helper/semantics_helper_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ void main() {
group('valid number strings', () {
test('number starting with 0 is split correctly', () {
String input = '01234';
String expectedOutput = '0,1,2,3,4';
String expectedOutput = '0 1 2 3 4';
expect(SemanticsHelper.splitNumberString(input), expectedOutput);
});
test('number starting with 1 is split correctly', () {
String input = '1234';
String expectedOutput = '1,2,3,4';
String expectedOutput = '1 2 3 4';
expect(SemanticsHelper.splitNumberString(input), expectedOutput);
});
test('single digit number is split correctly', () {
Expand All @@ -20,17 +20,17 @@ void main() {
});
test('two digit number is split correctly', () {
String input = '34';
String expectedOutput = '3,4';
String expectedOutput = '3 4';
expect(SemanticsHelper.splitNumberString(input), expectedOutput);
});
test('8 digit number is split correctly', () {
String input = '12345678';
String expectedOutput = '1,2,3,4,5,6,7,8';
String expectedOutput = '1 2 3 4 5 6 7 8';
expect(SemanticsHelper.splitNumberString(input), expectedOutput);
});
test('9 digit number is split correctly', () {
String input = '123456789';
String expectedOutput = '1,2,3,4,5,6,7,8,9';
String expectedOutput = '1 2 3 4 5 6 7 8 9';
expect(SemanticsHelper.splitNumberString(input), expectedOutput);
});
});
Expand Down

0 comments on commit 260966d

Please sign in to comment.