-
Notifications
You must be signed in to change notification settings - Fork 972
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13563 +/- ##
==========================================
+ Coverage 56.45% 56.49% +0.03%
==========================================
Files 284 284
Lines 29361 29380 +19
Branches 4877 4879 +2
==========================================
+ Hits 16576 16597 +21
+ Misses 12785 12783 -2
|
@AlexRobinson- what a small world... I started on this implementation last night and our approaches are very close! Really solid job! I'm excited to see this get implemented :D |
Oh no, I'm sorry for stealing this from you @ryanml ! Are there any parts of your implementation you prefer over mine you would like to see go into the PR? |
Oh no not at all @AlexRobinson- ! I didn't call it any way, just was a coincidence :) And honestly aside from naming we did just about the same thing |
@AlexRobinson- Do you happen to have any example pages where this is used in Chrome? I'm wondering if there are any standards to guide the layout of the dialog. Of not, then please just enlarge the dialog enough to allow for a larger input field, input text size (min 13px) and some margin around the text. thanks! |
app/browser/tabMessageBox.js
Outdated
const detail = { | ||
message, | ||
title, | ||
buttons: ['ok', 'cancel'], |
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.
Don't forget to add translation for this two buttons
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 do! Did you want me to replace the other locations this text appears 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.
@AlexRobinson- that would be great 😄 👍
@bradleyrichter An example page I have been using that was mentioned in the original issue #94 is https://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt Chrome has the prompt as a full width input which is what I am planning to do. However I'll also make sure to increase the size of the text field as you said |
@bradleyrichter What are your thoughts on this? |
Perfection!
Cc @bclifton
… On Mar 23, 2018, at 5:50 PM, Alex Robinson ***@***.***> wrote:
@bradleyrichter What are your thoughts on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@AlexRobinson- anything else required (is this ready for review)? 😄 Wanted to check as the initial checkboxes in top post haven't been updated |
Hey @bsclifton Only thing left to do is add some tests :) I struggled with them a bit on my first attempt and unfortunately I have been a bit busy lately, so haven't quite had time to finish these up. Hopefully I'll have some time this weekend to have another go, but I may need some help with the tests. Am on mobile so having a hard time linking files, but I tried to copy the tests for other functions (window.confirm) that use HTML files to load up and test the whole flow. Any advice/help with writing the window.prompt tests are appreciated! |
Please somebody help @AlexRobinson- to write those tests to finally merge these changes, the missing |
@AlexRobinson- I would suggest that you extract anonymous function from here https://github.com/brave/browser-laptop/pull/13563/files#diff-70ff57a707bad6ba56cd9cf8373d0e3aR48 into another function. This way you can add uni tests for this function without needing to mock |
Sorry everyone to hold you all up on this, haven't quite had much time to come back to this. I have added some unit tests to the For the actual flow though I have been trying to copy the tests for the confirm dialog here But your way @NejcZdovc sounds a bit easier |
Alright, so I moved the |
19c787c
to
2885c19
Compare
@bsclifton do you think this is ok to be merged in now? |
@AlexRobinson- checking it out now... 😄 |
This is a first pass at implementing the JavaScript function window.prompt. closes brave#94 - Add translations for message box 'ok' and 'cancel' - Introduce PromptTextbox and use it in messageBox for window.prompt
…s allowed Extract out and export onWindowPrompt function and unit test it
d5bdc36
to
a2873fa
Compare
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.
@AlexRobinson- this is great! I rebased your commits and squashed them down to two (the feature and the tests)
The only thing missing is that the textbox shown in the prompt should be highlighted when it's shown. So in your example, you should be able to click Try it
and then type without having to manually focus the textbox. Could you please add this?
I added some manual test steps which you can check out here 😄 (basically what I ran through)
#94
Awesome job with this 😻
Completely fair point! I'll implement this tomorrow night |
@bsclifton All done! I have updated the PR description with a new gif showing this functionality |
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.
Works great! Awesome job on this one, @AlexRobinson- 😄 👍
@cezaraugusto @petemill would either of you like to give this a review before I merge? |
Uplifted to 0.23.x with 88befe4 |
Fixes #94
What it looks like
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
See #94
Automated test plan
npm run unittest -- --grep="onWindowPrompt"
npm run unittest -- --grep="MessageBox component unit tests"
Reviewer Checklist:
Tests