Commit f43c5ef4 authored by Thomas Randolph's avatar Thomas Randolph

Bring the metadata endpoint into the MR Notes app

parent 433ae04f
......@@ -25,6 +25,9 @@ export default () => {
return {
noteableData,
endpoints: {
metadata: notesDataset.endpointMetadata,
},
currentUserData: JSON.parse(notesDataset.currentUserData),
notesData: JSON.parse(notesDataset.notesData),
helpPagePath: notesDataset.helpPagePath,
......@@ -54,6 +57,7 @@ export default () => {
},
created() {
this.setActiveTab(window.mrTabs.getCurrentAction());
this.setEndpoints(this.endpoints);
},
mounted() {
this.notesCountBadge = $('.issuable-details').find('.notes-tab .badge');
......@@ -65,7 +69,7 @@ export default () => {
window.mrTabs.eventHub.$off('MergeRequestTabChange', this.setActiveTab);
},
methods: {
...mapActions(['setActiveTab']),
...mapActions(['setActiveTab', 'setEndpoints']),
updateDiscussionTabCounter() {
this.notesCountBadge.text(this.discussionTabCounter);
},
......
......@@ -63,6 +63,7 @@
- add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json)
- add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json)
#js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json,
endpoint_metadata: @endpoint_metadata_url,
noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
noteable_type: 'MergeRequest',
target_type: 'merge_request',
......
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