diff options
Diffstat (limited to 'app/assets/javascripts/issues/related_merge_requests')
-rw-r--r-- | app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue | 9 | ||||
-rw-r--r-- | app/assets/javascripts/issues/related_merge_requests/index.js | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue b/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue index d819a371c69..5e81f7ad4f6 100644 --- a/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue +++ b/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue @@ -4,7 +4,6 @@ import { GlLink, GlLoadingIcon, GlIcon } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; import { sprintf, __, n__ } from '~/locale'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue'; -import { parseIssuableData } from '~/issues/show/utils/parse_data'; export default { name: 'RelatedMergeRequests', @@ -19,6 +18,11 @@ export default { type: String, required: true, }, + hasClosingMergeRequest: { + type: Boolean, + required: false, + default: false, + }, projectNamespace: { type: String, required: true, @@ -48,9 +52,6 @@ export default { this.setInitialState({ apiEndpoint: this.endpoint }); this.fetchMergeRequests(); }, - created() { - this.hasClosingMergeRequest = parseIssuableData().hasClosingMergeRequest; - }, methods: { ...mapActions(['setInitialState', 'fetchMergeRequests']), getAssignees(mr) { diff --git a/app/assets/javascripts/issues/related_merge_requests/index.js b/app/assets/javascripts/issues/related_merge_requests/index.js index 196084093c8..413b48b9720 100644 --- a/app/assets/javascripts/issues/related_merge_requests/index.js +++ b/app/assets/javascripts/issues/related_merge_requests/index.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; import RelatedMergeRequests from './components/related_merge_requests.vue'; import createStore from './store'; @@ -9,7 +10,7 @@ export function initRelatedMergeRequests() { return undefined; } - const { endpoint, projectPath, projectNamespace } = el.dataset; + const { endpoint, hasClosingMergeRequest, projectPath, projectNamespace } = el.dataset; return new Vue({ el, @@ -17,7 +18,12 @@ export function initRelatedMergeRequests() { store: createStore(), render: (createElement) => createElement(RelatedMergeRequests, { - props: { endpoint, projectNamespace, projectPath }, + props: { + endpoint, + hasClosingMergeRequest: parseBoolean(hasClosingMergeRequest), + projectNamespace, + projectPath, + }, }), }); } |