diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-12-08 20:21:31 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-12-08 20:21:31 +0300 |
commit | 20ddfd9c5992a23ad394a690d194a1009ec3fd26 (patch) | |
tree | df1a917ad9cf7ef6678bb95034214e58946f5abd | |
parent | 1fb49ccd7bb37d5d6bde12397f32e1c04fc009ba (diff) |
Add js prefix for issuable-edit
-rw-r--r-- | app/assets/javascripts/issue_show/index.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/shortcuts_issuable.js | 2 | ||||
-rw-r--r-- | app/views/projects/issues/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_mr_title.html.haml | 4 | ||||
-rw-r--r-- | features/steps/shared/issuable.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/gfm_autocomplete_spec.rb | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/issue_show/index.js b/app/assets/javascripts/issue_show/index.js index a21ce41e65e..7b762496ba5 100644 --- a/app/assets/javascripts/issue_show/index.js +++ b/app/assets/javascripts/issue_show/index.js @@ -7,7 +7,7 @@ document.addEventListener('DOMContentLoaded', () => { const initialDataEl = document.getElementById('js-issuable-app-initial-data'); const props = JSON.parse(initialDataEl.innerHTML.replace(/"/g, '"')); - $('.issuable-edit').on('click', (e) => { + $('.js-issuable-edit').on('click', (e) => { e.preventDefault(); eventHub.$emit('open.form'); diff --git a/app/assets/javascripts/shortcuts_issuable.js b/app/assets/javascripts/shortcuts_issuable.js index 4f4f606d293..305f97b010e 100644 --- a/app/assets/javascripts/shortcuts_issuable.js +++ b/app/assets/javascripts/shortcuts_issuable.js @@ -11,7 +11,7 @@ export default class ShortcutsIssuable extends ShortcutsNavigation { super(); this.$replyField = isMergeRequest ? $('.js-main-target-form #note_note') : $('.js-main-target-form .js-vue-comment-form'); - this.editBtn = document.querySelector('.issuable-edit'); + this.editBtn = document.querySelector('.js-issuable-edit'); Mousetrap.bind('a', () => ShortcutsIssuable.openSidebarDropdown('assignee')); Mousetrap.bind('m', () => ShortcutsIssuable.openSidebarDropdown('milestone')); diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 2f7aece7440..d260aaee2d3 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -40,7 +40,7 @@ .dropdown-menu.dropdown-menu-align-right.hidden-lg %ul - if can_update_issue - %li= link_to 'Edit', edit_project_issue_path(@project, @issue), class: 'issuable-edit' + %li= link_to 'Edit', edit_project_issue_path(@project, @issue), class: 'js-issuable-edit' - unless current_user == @issue.author %li= link_to 'Report abuse', new_abuse_report_path(user_id: @issue.author.id, ref_url: issue_url(@issue)) - if can_update_issue @@ -53,7 +53,7 @@ %li= link_to 'New issue', new_project_issue_path(@project), title: 'New issue', id: 'new_issue_link' - if can_update_issue - = link_to 'Edit', edit_project_issue_path(@project, @issue), class: 'hidden-xs hidden-sm btn btn-grouped issuable-edit' + = link_to 'Edit', edit_project_issue_path(@project, @issue), class: 'hidden-xs hidden-sm btn btn-grouped js-issuable-edit' = render 'shared/issuable/close_reopen_button', issuable: @issue, can_update: can_update_issue diff --git a/app/views/projects/merge_requests/_mr_title.html.haml b/app/views/projects/merge_requests/_mr_title.html.haml index 135f9ab0aff..9df14265737 100644 --- a/app/views/projects/merge_requests/_mr_title.html.haml +++ b/app/views/projects/merge_requests/_mr_title.html.haml @@ -27,7 +27,7 @@ .dropdown-menu.dropdown-menu-align-right.hidden-lg %ul - if can_update_merge_request - %li= link_to 'Edit', edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'issuable-edit' + %li= link_to 'Edit', edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'js-issuable-edit' - unless current_user == @merge_request.author %li= link_to 'Report abuse', new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request)) - if can_update_merge_request @@ -37,6 +37,6 @@ = link_to 'Reopen', merge_request_path(@merge_request, merge_request: { state_event: :reopen }), method: :put, class: 'reopen-mr-link', title: 'Reopen merge request' - if can_update_merge_request - = link_to 'Edit', edit_project_merge_request_path(@project, @merge_request), class: "hidden-xs hidden-sm btn btn-grouped issuable-edit" + = link_to 'Edit', edit_project_merge_request_path(@project, @merge_request), class: "hidden-xs hidden-sm btn btn-grouped js-issuable-edit" = render 'shared/issuable/close_reopen_button', issuable: @merge_request, can_update: can_update_merge_request diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb index 714985f2051..f90247c3fe8 100644 --- a/features/steps/shared/issuable.rb +++ b/features/steps/shared/issuable.rb @@ -2,7 +2,7 @@ module SharedIssuable include Spinach::DSL def edit_issuable - find('.issuable-edit', visible: true).click + find('.js-issuable-edit', visible: true).click end step 'project "Community" has "Community issue" open issue' do diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index c31b636d67f..6a9a80235c1 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -15,7 +15,7 @@ feature 'GFM autocomplete', :js do end it 'updates issue descripton with GFM reference' do - find('.issuable-edit').click + find('.js-issuable-edit').click simulate_input('#issue-description', "@#{user.name[0...3]}") |