-
Notifications
You must be signed in to change notification settings - Fork 482
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
Remove 'Create a Behavior/Function' buttons from the toolbox WYSIWYG levelbuilder page #32533
Conversation
@@ -2682,7 +2682,8 @@ StudioApp.prototype.handleUsingBlockly_ = function(config) { | |||
false | |||
), | |||
useModalFunctionEditor: utils.valueOr( | |||
config.level.useModalFunctionEditor, | |||
config.level.edit_blocks !== TOOLBOX_EDIT_MODE && |
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.
This seems overcomplicated? Is config.level.useModalFunctionEditor
a boolean? If so, then isn't this equivalent to just useModalFunctionEditor: config.level.edit_blocks !== TOOLBOX_EDIT_MODE && config.level.useModalFunctionEditor
(no need for utils.valueOr
)?
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.
I believe the reason for using utils.valueOr
is that config.level.useModalFunctionEditor can be undefined whereas we always want useModalFunctionEditor to be T/F.
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.
Then I think you want like, edit_blocks !== TOOLBOX && !!useModalFunctionEditor
To me it seems like a little bit of a code smell to use valueOr
with a boolean as the default value, because the boolean expression can almost certainly be simplified.
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.
👍 (thanks for the offline conversation) Also added a jira ticket with more details about future plans! https://codedotorg.atlassian.net/browse/STAR-944
apps/src/StudioApp.js
Outdated
@@ -2707,7 +2708,8 @@ StudioApp.prototype.handleUsingBlockly_ = function(config) { | |||
// Never show unused blocks or disable autopopulate in edit mode |
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.
Nit: can you update this comment now that we are sometimes disabling autopopulate?
be69cf2
to
0d36d1b
Compare
Description
Currently, the 'Create a Function/Behavior' buttons in /edit_blocks/toolbox_blocks do not work. This is intentional - levelbuilders should not be able to add a custom behavior or function in /edit_blocks/toolbox_blocks mode. This PR removes the buttons from /edit_blocks/toolbox_blocks page.
Links
This is the button removed as part of this change:
![image](https://user-images.githubusercontent.com/8324574/71843491-e1c1ba80-3078-11ea-955c-763103facc5d.png)
Testing story
Reviewer Checklist: