diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 66bc670a01469a45b930d42c1f3445932e95130a..3dc6311026327e5ce3f2e412efc1113c9fe93075 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -254,7 +254,6 @@ def issuable_initial_data(issuable) updateEndpoint: "#{issuable_path(issuable)}.json", canUpdate: can?(current_user, :"update_#{issuable.to_ability_name}", issuable), canDestroy: can?(current_user, :"destroy_#{issuable.to_ability_name}", issuable), - canAdmin: can?(current_user, :"admin_#{issuable.to_ability_name}", issuable), issuableRef: issuable.to_reference, markdownPreviewPath: preview_markdown_path(parent), markdownDocsPath: help_page_path('user/markdown'), @@ -269,7 +268,6 @@ def issuable_initial_data(issuable) if parent.is_a?(Group) data[:groupPath] = parent.path - data[:issueLinksEndpoint] = group_epic_issues_path(parent, issuable) else data.merge!(projectPath: ref_project.path, projectNamespace: ref_project.namespace.full_path) end diff --git a/app/helpers/system_note_helper.rb b/app/helpers/system_note_helper.rb index e56e4b8afec363dbf5586c7fefa9bcefaac7165f..05dffd639d142502ef5c90e845c0b9c20c8bcb62 100644 --- a/app/helpers/system_note_helper.rb +++ b/app/helpers/system_note_helper.rb @@ -22,10 +22,6 @@ module SystemNoteHelper 'moved' => 'arrow-right', 'outdated' => 'pencil-square', 'duplicate' => 'issue-duplicate', - 'approved' => 'approval', - 'unapproved' => 'unapproval', - 'relate' => 'link', - 'unrelate' => 'unlink', 'locked' => 'lock', 'unlocked' => 'lock-open' }.freeze diff --git a/ee/app/helpers/ee/issuables_helper.rb b/ee/app/helpers/ee/issuables_helper.rb index fb9d17c0d0b6066580adf37f51998a4e4515b5a8..84cc1b17a954062f77d0541dbd5d898c0b94b3e8 100644 --- a/ee/app/helpers/ee/issuables_helper.rb +++ b/ee/app/helpers/ee/issuables_helper.rb @@ -9,5 +9,18 @@ def issuable_sidebar_options(issuable, can_edit_issuable) weightNoneValue: ::Issue::WEIGHT_NONE ) end + + override :issuable_initial_data + def issuable_initial_data(issuable) + data = super.merge( + canAdmin: can?(current_user, :"admin_#{issuable.to_ability_name}", issuable) + ) + + if parent.is_a?(Group) + data[:issueLinksEndpoint] = group_epic_issues_path(parent, issuable) + end + + data + end end end diff --git a/ee/app/helpers/ee/system_note_helper.rb b/ee/app/helpers/ee/system_note_helper.rb index 82fadab6e9db3399f5456573eaa2dd124ed86d1a..488eb478c2defa04ce68f73438a805a8b946fd10 100644 --- a/ee/app/helpers/ee/system_note_helper.rb +++ b/ee/app/helpers/ee/system_note_helper.rb @@ -3,6 +3,10 @@ module SystemNoteHelper extend ::Gitlab::Utils::Override EE_ICON_NAMES_BY_ACTION = { + 'approved' => 'approval', + 'unapproved' => 'unapproval', + 'relate' => 'link', + 'unrelate' => 'unlink', 'epic_issue_added' => 'issues', 'epic_issue_removed' => 'issues', 'epic_issue_moved' => 'issues',