Commit f23fab9f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'sh-fix-inline-javascript-haml-lint' into 'master'

Fix inline JavaScript HAML linter not working

See merge request gitlab-org/gitlab!71798
parents 05d66c27 11eb352b
#js-authenticate-token-2fa #js-authenticate-token-2fa
%a.gl-button.btn.btn-block.btn-confirm#js-login-2fa-device{ href: '#' }= _("Sign in via 2FA code") %a.gl-button.btn.btn-block.btn-confirm#js-login-2fa-device{ href: '#' }= _("Sign in via 2FA code")
-# haml-lint:disable InlineJavaScript
%script#js-authenticate-token-2fa-in-progress{ type: "text/template" } %script#js-authenticate-token-2fa-in-progress{ type: "text/template" }
%p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.")
-# haml-lint:disable InlineJavaScript
%script#js-authenticate-token-2fa-error{ type: "text/template" } %script#js-authenticate-token-2fa-error{ type: "text/template" }
%div %div
%p <%= error_message %> (<%= error_name %>) %p <%= error_message %> (<%= error_name %>)
%a.btn.btn-default.gl-button.btn-block#js-token-2fa-try-again= _("Try again?") %a.btn.btn-default.gl-button.btn-block#js-token-2fa-try-again= _("Try again?")
-# haml-lint:disable InlineJavaScript
%script#js-authenticate-token-2fa-authenticated{ type: "text/template" } %script#js-authenticate-token-2fa-authenticated{ type: "text/template" }
%div %div
%p= _("We heard back from your device. You have been authenticated.") %p= _("We heard back from your device. You have been authenticated.")
......
#js-register-token-2fa #js-register-token-2fa
-# haml-lint:disable InlineJavaScript
%script#js-register-2fa-message{ type: "text/template" } %script#js-register-2fa-message{ type: "text/template" }
%p <%= message %> %p <%= message %>
-# haml-lint:disable InlineJavaScript
%script#js-register-token-2fa-setup{ type: "text/template" } %script#js-register-token-2fa-setup{ type: "text/template" }
- if current_user.two_factor_otp_enabled? - if current_user.two_factor_otp_enabled?
.row.gl-mb-3 .row.gl-mb-3
...@@ -17,12 +19,14 @@ ...@@ -17,12 +19,14 @@
.col-md-8 .col-md-8
%p= _("You need to register a two-factor authentication app before you can set up a device.") %p= _("You need to register a two-factor authentication app before you can set up a device.")
-# haml-lint:disable InlineJavaScript
%script#js-register-token-2fa-error{ type: "text/template" } %script#js-register-token-2fa-error{ type: "text/template" }
%div %div
%p %p
%span <%= error_message %> (<%= error_name %>) %span <%= error_message %> (<%= error_name %>)
%a.btn.btn-default.gl-button#js-token-2fa-try-again= _("Try again?") %a.btn.btn-default.gl-button#js-token-2fa-try-again= _("Try again?")
-# haml-lint:disable InlineJavaScript
%script#js-register-token-2fa-registered{ type: "text/template" } %script#js-register-token-2fa-registered{ type: "text/template" }
.row.gl-mb-3 .row.gl-mb-3
.col-md-12 .col-md-12
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
%li %li
%h2.breadcrumbs-sub-title{ data: { qa_selector: 'breadcrumb_sub_title_content' } } %h2.breadcrumbs-sub-title{ data: { qa_selector: 'breadcrumb_sub_title_content' } }
= link_to @breadcrumb_title, breadcrumb_title_link = link_to @breadcrumb_title, breadcrumb_title_link
-# haml-lint:disable InlineJavaScript
%script{ type: 'application/ld+json' } %script{ type: 'application/ld+json' }
:plain :plain
#{schema_breadcrumb_json} #{schema_breadcrumb_json}
......
...@@ -31,4 +31,5 @@ ...@@ -31,4 +31,5 @@
.form-actions .form-actions
= button_tag 'Create branch', class: 'gl-button btn btn-confirm' = button_tag 'Create branch', class: 'gl-button btn btn-confirm'
= link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel' = link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel'
-# haml-lint:disable InlineJavaScript
%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
= render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do = render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do
.row .row
%section.col-md-12 %section.col-md-12
-# haml-lint:disable InlineJavaScript
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe %script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
.issuable-discussion.js-vue-notes-event .issuable-discussion.js-vue-notes-event
- if @merge_request.description.present? - if @merge_request.description.present?
......
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
%code %code
= @event.as_json_wo_empty = @event.as_json_wo_empty
-# haml-lint:disable InlineJavaScript
:javascript :javascript
#{render 'tracker'} #{render 'tracker'}
...@@ -54,4 +54,5 @@ ...@@ -54,4 +54,5 @@
.form-actions.gl-display-flex .form-actions.gl-display-flex
= button_tag s_('TagsPage|Create tag'), class: 'gl-button btn btn-confirm gl-mr-3', data: { qa_selector: "create_tag_button" } = button_tag s_('TagsPage|Create tag'), class: 'gl-button btn btn-confirm gl-mr-3', data: { qa_selector: "create_tag_button" }
= link_to s_('TagsPage|Cancel'), project_tags_path(@project), class: 'gl-button btn btn-default btn-cancel' = link_to s_('TagsPage|Cancel'), project_tags_path(@project), class: 'gl-button btn btn-default btn-cancel'
-# haml-lint:disable InlineJavaScript
%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe
...@@ -55,11 +55,13 @@ ...@@ -55,11 +55,13 @@
.js-sidebar-status-entry-point{ data: sidebar_status_data(issuable_sidebar, @project) } .js-sidebar-status-entry-point{ data: sidebar_status_data(issuable_sidebar, @project) }
- if issuable_sidebar.has_key?(:confidential) - if issuable_sidebar.has_key?(:confidential)
-# haml-lint:disable InlineJavaScript
%script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: issuable_sidebar[:confidential], is_editable: can_edit_issuable }.to_json.html_safe %script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: issuable_sidebar[:confidential], is_editable: can_edit_issuable }.to_json.html_safe
#js-confidential-entry-point #js-confidential-entry-point
= render_if_exists 'shared/issuable/sidebar_cve_id_request', issuable_sidebar: issuable_sidebar = render_if_exists 'shared/issuable/sidebar_cve_id_request', issuable_sidebar: issuable_sidebar
-# haml-lint:disable InlineJavaScript
%script#js-lock-issue-data{ type: "application/json" }= { is_locked: !!issuable_sidebar[:discussion_locked], is_editable: can_edit_issuable }.to_json.html_safe %script#js-lock-issue-data{ type: "application/json" }= { is_locked: !!issuable_sidebar[:discussion_locked], is_editable: can_edit_issuable }.to_json.html_safe
#js-lock-entry-point #js-lock-entry-point
......
...@@ -25,4 +25,5 @@ ...@@ -25,4 +25,5 @@
= sprite_icon('lock', css_class: 'icon') = sprite_icon('lock', css_class: 'icon')
%span %span
= html_escape(_("This %{issuable} is locked. Only %{strong_open}project members%{strong_close} can comment.")) % { issuable: issuable.class.to_s.titleize.downcase, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } = html_escape(_("This %{issuable} is locked. Only %{strong_open}project members%{strong_close} can comment.")) % { issuable: issuable.class.to_s.titleize.downcase, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
-# haml-lint:disable InlineJavaScript
%script.js-notes-data{ type: "application/json" }= initial_notes_data(autocomplete).to_json.html_safe %script.js-notes-data{ type: "application/json" }= initial_notes_data(autocomplete).to_json.html_safe
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
#js_issues_chart_vue #js_issues_chart_vue
#js-group-member-contributions{ data: { member_contributions_path: group_contribution_analytics_path(@group, { start_date: @start_date, format: :json }) } } #js-group-member-contributions{ data: { member_contributions_path: group_contribution_analytics_path(@group, { start_date: @start_date, format: :json }) } }
-# haml-lint:disable InlineJavaScript
%script#js-analytics-data{ type: "application/json" } %script#js-analytics-data{ type: "application/json" }
= @data_collector.group_member_contributions_table_data.to_json.html_safe = @data_collector.group_member_contributions_table_data.to_json.html_safe
- elsif show_promotions? - elsif show_promotions?
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
notes_filters: UserPreference.notes_filters.to_json } } notes_filters: UserPreference.notes_filters.to_json } }
.row .row
%section.col-md-12 %section.col-md-12
-# haml-lint:disable InlineJavaScript
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe %script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
.issuable-discussion .issuable-discussion
= render 'discussion' = render 'discussion'
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
- return unless project.feature_available?(:file_locks) - return unless project.feature_available?(:file_locks)
-# haml-lint:disable InlineJavaScript
%script#js-file-lock{ type: "application/json" } %script#js-file-lock{ type: "application/json" }
- data = { path: path, toggle_path: toggle_project_path_locks_path(project) } - data = { path: path, toggle_path: toggle_project_path_locks_path(project) }
= data.to_json.html_safe = data.to_json.html_safe
# frozen_string_literal: true # frozen_string_literal: true
unless Rails.env.production? unless Rails.env.production?
require_dependency 'haml_lint/haml_visitor' require 'haml_lint/haml_visitor'
require_dependency 'haml_lint/linter' require 'haml_lint/linter'
require_dependency 'haml_lint/linter_registry' require 'haml_lint/linter_registry'
module HamlLint module HamlLint
class Linter::InlineJavaScript < Linter class Linter::InlineJavaScript < Linter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment