Skip to content

Bugfix/1600 - #1605

Merged
rachel-fenichel merged 3 commits into
RaspberryPiFoundation:developfrom
rachel-fenichel:bugfix/1600
Feb 13, 2018
Merged

Bugfix/1600#1605
rachel-fenichel merged 3 commits into
RaspberryPiFoundation:developfrom
rachel-fenichel:bugfix/1600

Conversation

@rachel-fenichel

Copy link
Copy Markdown
Collaborator

The basics

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

The details

Resolves

Fix #1600

Proposed Changes

Add a new option to the "simple/categories" toolbox dropdown in the playground. The options are now "Categories (typed variables)", "Categories (untyped variables)", and "Simple".

I did this by adding a new chunk of XML because I want to keep the sample XML in the playground as simple as possible, such that someone can just copy the sample XML to get started. A shorter way would have been to dynamically change the XML, but that would have spread the construction of the toolbox XML more than I want.

I added some comments to explain what each chunk of XML means, and links to the documentation for first-time developers who are looking through the playground code as a starting point.

Reason for Changes

Mixing the typed and untyped variable blocks in the playground was confusing.

Test Coverage

The playground still works. I can open all three types of toolbox, by using the dropdown or by changing the URL. The variable categories both open.

Tested on:

  • Desktop Chrome

Additional Information

In the second commit I cleaned up some indentation in the toolbox options struct.

@AnmAtAnm AnmAtAnm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve after minor corrections.

Comment thread tests/playground.html Outdated
<category name="Functions" colour="290" custom="PROCEDURE"></category>
</xml>

<!-- toolbox-categories-untyped-variables has a category menu and an

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

untyped -> typed

Comment thread tests/playground.html
return document.getElementById('toolbox-' + (match ? match[1] : 'categories'));
// Default to the basic toolbox with categories and untyped variables,
// but override that if the toolbox type is set in the URL.
var toolboxSuffix = (match ? match[1] : 'categories');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

'categories' should be 'toolbox-categories', right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, because it's a suffix. It's added to 'toolbox-' on line 150.

@rachel-fenichel
rachel-fenichel merged commit 6aa06e9 into RaspberryPiFoundation:develop Feb 13, 2018
@rachel-fenichel
rachel-fenichel deleted the bugfix/1600 branch February 13, 2018 18:46
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.

2 participants