-
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
Levelbuilder Clean Up: Code Area Editors #35037
Merged
Merged
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e91ccd4
Move the audit log to the bottom of the level edit page
dmcavoy 2f675be
Move levelbuilder documentation to top of page
dmcavoy 685dbff
Group help and tips tab content and move next to instructions editing
dmcavoy a6abd05
Group together Design Mode controls for applab
dmcavoy 727f286
Group together Data controls
dmcavoy 2efb5d0
Group everything related to the instructions area together and move t…
dmcavoy b6f4066
Move notes to deprecated area
dmcavoy 8b84674
Merge branch 'levelbuilder-clean-up-1' into help-tips-levelbuilder
dmcavoy f126a7a
Merge branch 'help-tips-levelbuilder' into applab-edit-org
dmcavoy 11b8c5c
Group together debugger controls
dmcavoy de8db6a
Put all instructions area stuff inside one header
dmcavoy 09160e9
Merge branch 'help-tips-levelbuilder' into applab-edit-org
dmcavoy bd2491e
Make a separate area for editing the code part of level
dmcavoy 09b313c
Use the same debugger file for applab as is used for gamelab, dance, …
dmcavoy 0dc742b
Merge branch 'applab-edit-org' into code-area-edit
dmcavoy 528334a
Organize code area into sub groups and bring in applab specific controls
dmcavoy 953ad8c
Merge branch 'staging' into code-area-edit
dmcavoy 688d733
Merge branch 'staging' into levelbuilder-clean-up-1
dmcavoy dda202d
Merge branch 'levelbuilder-clean-up-1' into help-tips-levelbuilder
dmcavoy cd95a2e
Merge branch 'help-tips-levelbuilder' into applab-edit-org
dmcavoy 628e1a2
Merge branch 'applab-edit-org' into code-area-edit
dmcavoy 1b23439
Merge branch 'staging' into levelbuilder-clean-up-1
dmcavoy 59dfbcb
Merge branch 'levelbuilder-clean-up-1' into help-tips-levelbuilder
dmcavoy b2f463b
Merge branch 'help-tips-levelbuilder' into applab-edit-org
dmcavoy 7522373
Merge branch 'applab-edit-org' into code-area-edit
dmcavoy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%legend.control-legend.collapsed{data: {toggle: "collapse", target: "#instructions_area"}} | ||
Code Area | ||
|
||
#instructions_area.in.collapse | ||
= render partial: 'levels/editors/droplet', locals: {f: f} if @level.uses_droplet? | ||
= render partial: 'levels/editors/blockly', locals: {f: f} if !(@level.uses_droplet?) && @level.is_a?(Blockly) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
dashboard/app/views/levels/editors/_instructions_area.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
%legend.control-legend.collapsed{data: {toggle: "collapse", target: "#instructions_area"}} | ||
Instructions Area | ||
|
||
#instructions_area.in.collapse | ||
= render partial: 'levels/editors/fields/instructions', locals: {f: f} unless @level.is_a?(DSLDefined) || @level.is_a?(Unplugged) | ||
= render partial: 'levels/editors/fields/help_and_tips', locals: {f: f} | ||
// Note that many DSL levels also use this partial. See _dsl.html.haml | ||
= render partial: 'levels/editors/fields/teacher_only_markdown', locals: {f: f} if (@level.include_teacher_only_markdown_editor?) | ||
= render partial: 'levels/editors/fields/mini_rubric', locals: {f: f} if (@level.uses_droplet?) || @level.is_a?(Blockly) || @level.is_a?(Weblab) |
26 changes: 26 additions & 0 deletions
26
dashboard/app/views/levels/editors/fields/_applab_data.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
%legend.control-legend{data: {toggle: "collapse", target: "#data"}} | ||
Data | ||
#data.in.collapse | ||
.field | ||
= f.label 'Table Data' | ||
Step 1: Create a project at studio.code.org/p/applab and edit the data for a table in the data browser. Step 2: Copy the data via the debug area at the bottom of the table. Step 3: Paste the data below in the format { "tablename": <paste> } | ||
%pre | ||
= preserve do | ||
:escaped | ||
Example: | ||
{ | ||
"table_name": [{ "name": "Trevor", "age": 30 }, { "name": "Hadi", "age": 72}], | ||
"table_name2": [{ "city": "Seattle", "state": "WA" }, { "city": "Chicago", "state": "IL"}] | ||
} | ||
= f.text_area 'data_tables', placeholder: 'Insert JSON Data', rows: 4, value: @level.data_tables or '' | ||
:javascript | ||
levelbuilder.initializeCodeMirror('level_data_tables', 'javascript'); | ||
|
||
= render partial: 'levels/editors/fields/key_value_data', locals: {f: f} | ||
|
||
.field | ||
= f.label :data_library_tables,'Dataset Libraries' | ||
= f.text_area :data_library_tables, value: @level.data_library_tables, readonly: true | ||
|
||
.field | ||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :hide_view_data_button, description: "Hide Data Button"} |
22 changes: 22 additions & 0 deletions
22
dashboard/app/views/levels/editors/fields/_applab_design_mode.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
%legend.control-legend{data: {toggle: "collapse", target: "#design_mode"}} | ||
Design Mode | ||
#design_mode.in.collapse | ||
|
||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :design_mode_at_start, description: "Start in Design Mode"} | ||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :hide_design_mode, description: "Hide Design Mode"} | ||
|
||
.field | ||
= f.label :start_html, 'Starting design mode html' | ||
%p | ||
This should be equivalent to the level html created by design mode. Learn how to how to make them | ||
=link_to 'here', 'https://github.com/code-dot-org/code-dot-org/wiki/%5BLevelbuilder%5D-Adding-Preloaded-Design-Elements-in-App-Lab', target: '_blank' | ||
|
||
%p | ||
IMPORTANT WARNING: If you have referenced images in the HTML and/or CODE, then you need to get fully-qualified | ||
code.org https URLS for these assets and update the HTML and the code to reflect these. You can quickly get full | ||
image urls by drag-dropping the image into the markdown section of a dummy level in levelbuilder. | ||
Copy the result and paste it here (it should start with something like | ||
#{html_escape("<div xmlns='http://www.w3.org/1999/xhtml' id='divApplab'")}...) | ||
= f.text_area :start_html, placeholder: 'Start html', rows: 4, value: @level.start_html | ||
:javascript | ||
levelbuilder.initializeCodeMirror('level_start_html', 'html'); |
34 changes: 19 additions & 15 deletions
34
dashboard/app/views/levels/editors/fields/_audit_log.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
%table.audit_log | ||
%tr | ||
%th Date | ||
%th What Was Changed | ||
%th Who Changed It | ||
- if(@level.audit_log != nil) | ||
- aud_log = JSON.parse(@level.audit_log) | ||
- aud_log.last(10).reverse_each do |log| | ||
%tr | ||
%td.aud_date= DateTime.parse(log["changed_at"]).strftime("%v at: %r") | ||
%td.aud_changes | ||
%ul | ||
-log["changed"].each_with_index do |change, i| | ||
%li= change | ||
%td.aud_person= log["changed_by_email"] | ||
%legend.control-legend.collapsed{data: {toggle: "collapse", target: "#audit_log_info"}} | ||
Audit Log | ||
%p A log of the people who most recently edited this level (up to the last 10 people) | ||
#audit_log_info.collapse | ||
%table.audit_log | ||
%tr | ||
%th Date | ||
%th What Was Changed | ||
%th Who Changed It | ||
- if(@level.audit_log != nil) | ||
- aud_log = JSON.parse(@level.audit_log) | ||
- aud_log.last(10).reverse_each do |log| | ||
%tr | ||
%td.aud_date= DateTime.parse(log["changed_at"]).strftime("%v at: %r") | ||
%td.aud_changes | ||
%ul | ||
-log["changed"].each_with_index do |change, i| | ||
%li= change | ||
%td.aud_person= log["changed_by_email"] |
10 changes: 3 additions & 7 deletions
10
dashboard/app/views/levels/editors/fields/_debugger.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
%legend.control-legend.collapsed{data: {toggle: "collapse", target: "#debuggingTools"}} | ||
Debugging | ||
Debugger | ||
|
||
#debuggingTools.collapse | ||
#debuggingTools.in.collapse | ||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :expand_debugger, description: "Expand Debugger by Default"} | ||
|
||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :debugger_disabled, description: "Disable code debugger (Console is still enabled)"} | ||
= render partial: 'levels/editors/fields/watchers_ui', locals: {f: f} | ||
|
||
.field.aligned-input-group | ||
= boolean_check_box f, :debugger_disabled | ||
=f.label 'Disable code debugger (Console is still enabled)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
it's a little weird to see fields pulled out of an applab-specific partial, only to be put behind an applab conditional. but it's more important to arrange the fields the way that the curriculum team wants than it is to keep conditionals out of our code, so this still seems like an improvement to me.
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 agree. I'm kinda trying to organize in small chunks that make sense and I think there will be some moving things to possibly move them again in order to get this right. The mistake I made last time was trying to make it right on the first go and that was too hard to follow for reviews.
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.
No worries, makes sense! FWIW the most vocal feedback I recall receiving last time was from Elizabeth objecting to having things being hidden by default, since that broke her flow of doing a text search to find the field that she was looking for. I think you're doing a fine job of avoiding that here by making all the expand/collapse controls be expanded by default.