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

Fix Issue #19910: Changed InputMode for float editor to decimal #20007

Merged
merged 14 commits into from
Apr 3, 2024

Conversation

Ahmed-Bhouri
Copy link
Contributor

@Ahmed-Bhouri Ahmed-Bhouri commented Mar 20, 2024

Overview

  1. This PR fixes Issues with inputting Decimal point in Lesson 4 of Financial Literacy #19910.
  2. This PR does the following: Changes the input mode from numeric to decimal so that the decimal point appears on the IOS keyboard. and updates input to accept the keyboard's default decimal point depending on the course language.

Essential Checklist

  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have followed the instructions for making a code change.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I don't have permissions to assign reviewers directly).
  • The linter/Karma presubmit checks pass on my local machine, and my PR follows the coding style guide).
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)

Proof that changes are correct

after the changes the comma finally appears on the keyboard while using the input:

keyboard

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-03-23.at.14.26.56.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-03-24.at.20.22.14.mp4
Simulator.Screen.Recording.-.iPhone.15.-.2024-03-26.at.11.36.19.mp4

PR Pointers

@Ahmed-Bhouri Ahmed-Bhouri requested a review from a team as a code owner March 20, 2024 22:58
Copy link

oppiabot bot commented Mar 20, 2024

Hi @Ahmed-Bhouri, can you complete the following:

  1. The body of this PR is missing the checklist section, please update it to include the checklist.
  2. The proof that changes are correct has not been provided, please make sure to upload a image/video showing that the changes are correct. Or include a sentence saying "No proof of changes needed because" and the reason why proof of changes cannot be provided.
    Thanks!

Copy link

oppiabot bot commented Mar 20, 2024

Hi @Ahmed-Bhouri please assign the required reviewer(s) for this PR. Thanks!

@Ahmed-Bhouri
Copy link
Contributor Author

@seanlip PTAL

@oppiabot oppiabot bot assigned seanlip and unassigned Ahmed-Bhouri Mar 20, 2024
Copy link

oppiabot bot commented Mar 20, 2024

Unassigning @Ahmed-Bhouri since a re-review was requested. @Ahmed-Bhouri, please make sure you have addressed all review comments. Thanks!

@seanlip seanlip assigned Ahmed-Bhouri and unassigned seanlip Mar 22, 2024
@seanlip
Copy link
Member

seanlip commented Mar 22, 2024

@Ahmed-Bhouri Please reassign me once the discussion on the issue is completed and we are clear on the path forward. Thanks!

@Ahmed-Bhouri
Copy link
Contributor Author

@seanlip PTAL

I have finally solved the issue as we discussed.

Sorry for the delay ( I had issues with pushing my code that turned out to be caused by my setup ( This is my first PR and I am running my dev environment on a codespaces instance) )

@oppiabot oppiabot bot assigned seanlip and unassigned Ahmed-Bhouri Mar 24, 2024
Copy link

oppiabot bot commented Mar 24, 2024

Unassigning @Ahmed-Bhouri since a re-review was requested. @Ahmed-Bhouri, please make sure you have addressed all review comments. Thanks!

@seanlip
Copy link
Member

seanlip commented Mar 24, 2024

@Ahmed-Bhouri Thanks -- could you please show the full flow, including submission of the answer? Ideally demonstrate it for both the "." and "," cases. Thanks!

(Also, just a question -- I'm not familiar with Codespaces, but does it run the pre-push hook? Just wanted to check since that can help avoid CI errors in the PR.)

@seanlip seanlip assigned Ahmed-Bhouri and unassigned seanlip Mar 24, 2024
@Ahmed-Bhouri
Copy link
Contributor Author

@seanlip PTAL -- Thank you for mentioning the submission part ( I had to fix a small error there )
I think I am done now I added the video.

I only use codespace to create a separate environment from my machine in the cloud ( I ran into a lot of problems with my 16Gb of ram on a MacBook M1 ). This way I can use better resources.

@oppiabot oppiabot bot assigned seanlip and unassigned Ahmed-Bhouri Mar 24, 2024
Copy link

oppiabot bot commented Mar 24, 2024

Unassigning @Ahmed-Bhouri since a re-review was requested. @Ahmed-Bhouri, please make sure you have addressed all review comments. Thanks!

@seanlip
Copy link
Member

seanlip commented Mar 25, 2024

@Ahmed-Bhouri Thanks, just a question. In your video I don't see the language/region change or the keyboard used to type "2.5". Can you display this too?

);
if (error !== undefined) {
this.localValue = null;
this.errorStringI18nKey = error || null;
} else {
// Parse number if the string is in proper format.
this.localValue = this.numberConversionService.convertToEnglishDecimal(
this.localStringValue
this.localStringValue.replace(/\.|,/g, currentDecimalSeparator)
Copy link
Member

Choose a reason for hiding this comment

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

A question: Instead of doing localStringValue.replace() in multiple places, should we just be storing the right thing in there from the outset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for this!
I have improved it in the commit i am pushing now

@seanlip seanlip added this pull request to the merge queue Mar 30, 2024
Copy link

oppiabot bot commented Mar 30, 2024

Unassigning @Lawful2002 since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label Mar 30, 2024
Copy link

oppiabot bot commented Mar 30, 2024

Hi @Ahmed-Bhouri, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks!

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 30, 2024
@seanlip
Copy link
Member

seanlip commented Mar 30, 2024

@Ahmed-Bhouri The flake in the last merge attempt seems to be related to your changes. Could you PTAL and analyze the root cause so that we can be sure that this PR does not result in a flake in develop?

https://github.com/oppia/oppia/actions/runs/8491174975/job/23262916789

Chrome Headless 123.0.6312.58 (Linux x86_64) Schema based float editor component should not show error for different decimal points FAILED
	Error: Expected null to equal 12.5.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13368:38)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
	Error: Expected 'I18N_INTERACTIONS_NUMERIC_INPUT_NO_INVALID_CHARS' to equal null.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13369:46)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
	Error: Expected null to equal 12.5.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13372:38)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
	Error: Expected 'I18N_INTERACTIONS_NUMERIC_INPUT_NO_INVALID_CHARS' to equal null.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13373:46)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
Chrome Headless 123.0.6312.58 (Linux x86_64): Executed 319 of 8968 (1 FAILED) (0 secs / 2.741 secs)
Chrome Headless 123.0.6312.58 (Linux x86_64) Schema based float editor component should not show error for different decimal points FAILED
	Error: Expected null to equal 12.5.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13368:38)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
	Error: Expected 'I18N_INTERACTIONS_NUMERIC_INPUT_NO_INVALID_CHARS' to equal null.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13369:46)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
	Error: Expected null to equal 12.5.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13372:38)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)
	Error: Expected 'I18N_INTERACTIONS_NUMERIC_INPUT_NO_INVALID_CHARS' to equal null.
	    at <Jasmine>
	    at UserContext.<anonymous> (core/templates/combined-tests.spec.js:13373:46)
	    at ./node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (core/templates/combined-tests.spec.js:789599:30)
	    at ./node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (core/templates/combined-tests.spec.js:789084:43)

@Ahmed-Bhouri Ahmed-Bhouri requested a review from a team as a code owner March 31, 2024 02:09
@Ahmed-Bhouri
Copy link
Contributor Author

@seanlip PTAL

To solve this I started by locking the test seed to 505 (the one that fails) to be able to debug the tests easily.
I discovered that my test needs more details to test all possible combinations so I fixed that. That made me understand the origin of the test failing. It turns out the flakes are caused by the NumericInputValidationService where any number with commas is considered to be a non valid number so I added it to the valid characters list solving the issue in the test flake and for all cases.

I am pretty positive now that there will be no more flakes in testing.

Thank you,

@oppiabot oppiabot bot assigned seanlip and unassigned Ahmed-Bhouri Mar 31, 2024
Copy link

oppiabot bot commented Mar 31, 2024

Unassigning @Ahmed-Bhouri since a re-review was requested. @Ahmed-Bhouri, please make sure you have addressed all review comments. Thanks!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Thanks @Ahmed-Bhouri! LGTM :)

@seanlip seanlip enabled auto-merge March 31, 2024 17:59
@seanlip
Copy link
Member

seanlip commented Mar 31, 2024

@lkbhitesh07 PTAL as codeowner. Thanks!

@seanlip seanlip assigned lkbhitesh07 and unassigned seanlip Mar 31, 2024
Copy link
Member

@lkbhitesh07 lkbhitesh07 left a comment

Choose a reason for hiding this comment

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

LGTM for the code owner file.
Thanks

@seanlip seanlip added this pull request to the merge queue Apr 3, 2024
Copy link

oppiabot bot commented Apr 3, 2024

Unassigning @lkbhitesh07 since they have already approved the PR.

Copy link

oppiabot bot commented Apr 3, 2024

Hi @Ahmed-Bhouri, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks!

Merged via the queue into oppia:develop with commit 3c3e5fa Apr 3, 2024
75 checks passed
@Ahmed-Bhouri Ahmed-Bhouri deleted the inputmode-decimal branch April 11, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with inputting Decimal point in Lesson 4 of Financial Literacy
4 participants