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

Revert "Revert "Prep final clean"" #35222

Merged
merged 2 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions dashboard/app/views/levels/editors/_dsl.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
- if @level.supports_markdown?
- content_for(:head) do
%script{src: webpack_asset_path('js/levels/editors/_dsl.js')}
Comment on lines +1 to +3
Copy link
Member

Choose a reason for hiding this comment

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

this is fine to get unblocked, but, ideally we want to keep these kind of conditional partials simple, with a haml file unconditionally including the corresponding js file when possible. in this particular case, the js file could simply recover gracefully if the DOM element it is looking for doesn't load.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like the only DSL defined level that does not have supports_markdown? is LevelGroup. I could just pull out Level Group as its own partial to solve this. I won't do it here but if you think thats the right move I can do it in a follow up


= render partial: 'levels/editors/fields/dsl_editors', locals: {f: f}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
.script_text
= text_area_tag('level[dsl_text]', @level.dsl_text || (@level.dsl_default))

- if @level.supports_markdown?
- content_for(:head) do
%script{src: webpack_asset_path('js/levels/editors/_dsl.js')}

.markdown
%p Edit Markdown:

Expand Down