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

Added a Test Block for a Dynamic Dropdown #2252

Merged
merged 4 commits into from Feb 7, 2019

Conversation

BeksOmega
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

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.

dropdowns

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

@googlebot
Copy link

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 cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

Copy link
Contributor

@AnmAtAnm AnmAtAnm left a 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 Show resolved Hide resolved

/**
* Handles "remove option" button in the field test category. This will prompt
* the user for an option to remove.
Copy link
Contributor

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."

* @package
*/
Blockly.TestBlocks.addDynamicDropdownOption_ = function() {
Blockly.prompt('Add an option?', '', function(text) {
Copy link
Contributor

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.

* @package
*/
Blockly.TestBlocks.removeDynamicDropdownOption_ = function() {
Blockly.prompt('Remove an option?', '', function(text) {
Copy link
Contributor

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.

@AnmAtAnm
Copy link
Contributor

AnmAtAnm commented Feb 7, 2019

Signed. Confirming approval.

(Googlebot should really ignore repo admins. Or at least treat review approval as confirmation.)

@AnmAtAnm AnmAtAnm merged commit b61ce94 into google:develop Feb 7, 2019
@AnmAtAnm
Copy link
Contributor

AnmAtAnm commented Feb 7, 2019

As always, thanks Beks!!

@BeksOmega BeksOmega deleted the tests/DynamicDropdown branch February 9, 2019 15:11
@rachel-fenichel rachel-fenichel mentioned this pull request Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants