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
Added a Test Block for a Dynamic Dropdown #2252
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
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.
Minor comments and one bug (I believe; haven't run it)
tests/blocks/test_blocks.js
Outdated
|
||
/** | ||
* Handles "remove option" button in the field test category. This will prompt | ||
* the user for an option to remove. |
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.
Add "May remove multiple options with the same name."
tests/blocks/test_blocks.js
Outdated
* @package | ||
*/ | ||
Blockly.TestBlocks.addDynamicDropdownOption_ = function() { | ||
Blockly.prompt('Add an option?', '', function(text) { |
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.
Suggestion for default: "option " + Blockly.TestBlocks.dynamicDropdownOptions_.length
Or something more complicated to prevent duplicates.
tests/blocks/test_blocks.js
Outdated
* @package | ||
*/ | ||
Blockly.TestBlocks.removeDynamicDropdownOption_ = function() { | ||
Blockly.prompt('Remove an option?', '', function(text) { |
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.
Suggestion for default: Blockly.TestBlocks.dynamicDropdownOptions_[0][0]
Combined with the above suggestion, this should put the cursor just after the unique number; easy to edit.
Signed. Confirming approval. (Googlebot should really ignore repo admins. Or at least treat review approval as confirmation.) |
As always, thanks Beks!! |
The basics
The details
Resolves
N/A
Proposed Changes
Adds a test block to the playground for testing dynamic dropdowns. The dynamic dropdown is populated through two toolbox-button-prompts similar to the "create variable..." button.
Reason for Changes
I was helping someone with their dynamic dropdown and wrote a little thing to help me test. I thought it might be useful to you, if not that's cool too =)
Test Coverage
N/A This is a test!
Additional Information
N/A