Commit b3b4272c authored by Phil Hughes's avatar Phil Hughes

tidy up component

added api spec
parent c1322ab9
<script>
import { mapGetters } from 'vuex';
import Icon from '../../../vue_shared/components/icon.vue';
import timeago from '../../../vue_shared/mixins/timeago';
import tooltip from '../../../vue_shared/directives/tooltip';
import TitleComponent from '../../../issue_show/components/title.vue';
import DescriptionComponent from '../../../issue_show/components/description.vue';
const states = {
open: 'open',
closed: 'closed',
};
export default {
directives: {
tooltip,
},
components: {
Icon,
TitleComponent,
DescriptionComponent,
},
mixins: [timeago],
computed: {
...mapGetters(['currentMergeRequest']),
isOpen() {
return this.currentMergeRequest.state === states.open;
},
isClosed() {
return this.currentMergeRequest.state === states.closed;
},
authorUsername() {
return `@${this.currentMergeRequest.author.username}`;
},
iconName() {
return this.isOpen ? 'issue-open-m' : 'close';
},
},
};
</script>
<template>
<div class="ide-merge-request-info">
<div class="detail-page-header">
<div class="detail-page-header sticky-top bg-white">
<icon
name="git-merge"
class="align-self-center append-right-8"
......@@ -64,13 +41,3 @@ export default {
</div>
</div>
</template>
<style scoped>
.ide-merge-request-info {
overflow: auto;
}
.detail-page-header {
line-height: initial;
}
</style>
......@@ -1329,3 +1329,11 @@
line-height: 16px;
color: $gl-text-color-secondary;
}
.ide-merge-request-info {
overflow: auto;
.detail-page-header {
line-height: initial;
}
}
......@@ -306,6 +306,14 @@ describe API::MergeRequests do
expect(json_response['changes_count']).to eq(merge_request.merge_request_diff.real_size)
end
it 'exposes description and title html' do
get api("/projects/#{project.id}/merge_requests/#{merge_request.iid}?render_html=true", user)
expect(response).to have_gitlab_http_status(200)
expect(json_response).to include(['title_html', 'description_html'])
end
context 'merge_request_metrics' do
before do
merge_request.metrics.update!(merged_by: user,
......
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