diff options
Diffstat (limited to 'app/assets/javascripts')
5 files changed, 38 insertions, 49 deletions
diff --git a/app/assets/javascripts/ide/components/ide_status_bar.vue b/app/assets/javascripts/ide/components/ide_status_bar.vue index 6eaf08e8033..4da417a37ce 100644 --- a/app/assets/javascripts/ide/components/ide_status_bar.vue +++ b/app/assets/javascripts/ide/components/ide_status_bar.vue @@ -2,6 +2,7 @@ /* eslint-disable @gitlab/vue-i18n/no-bare-strings */ import { mapActions, mapState, mapGetters } from 'vuex'; import IdeStatusList from 'ee_else_ce/ide/components/ide_status_list.vue'; +import IdeStatusMr from './ide_status_mr.vue'; import icon from '~/vue_shared/components/icon.vue'; import tooltip from '~/vue_shared/directives/tooltip'; import timeAgoMixin from '~/vue_shared/mixins/timeago'; @@ -15,6 +16,7 @@ export default { userAvatarImage, CiIcon, IdeStatusList, + IdeStatusMr, }, directives: { tooltip, @@ -27,7 +29,7 @@ export default { }, computed: { ...mapState(['currentBranchId', 'currentProjectId']), - ...mapGetters(['currentProject', 'lastCommit']), + ...mapGetters(['currentProject', 'lastCommit', 'currentMergeRequest']), ...mapState('pipelines', ['latestPipeline']), }, watch: { @@ -121,6 +123,12 @@ export default { >{{ lastCommitFormattedAge }}</time > </div> + <ide-status-mr + v-if="currentMergeRequest" + class="mx-3" + :url="currentMergeRequest.web_url" + :text="currentMergeRequest.references.short" + /> <ide-status-list class="ml-auto" /> </footer> </template> diff --git a/app/assets/javascripts/ide/components/ide_status_mr.vue b/app/assets/javascripts/ide/components/ide_status_mr.vue new file mode 100644 index 00000000000..a3b26d23a17 --- /dev/null +++ b/app/assets/javascripts/ide/components/ide_status_mr.vue @@ -0,0 +1,28 @@ +<script> +import { GlIcon, GlLink } from '@gitlab/ui'; + +export default { + components: { + GlIcon, + GlLink, + }, + props: { + text: { + type: String, + required: true, + }, + url: { + type: String, + required: true, + }, + }, +}; +</script> + +<template> + <div class="d-flex-center flex-nowrap text-nowrap js-ide-status-mr"> + <gl-icon name="merge-request" /> + <span class="ml-1 d-none d-sm-block">{{ s__('WebIDE|Merge request') }}</span> + <gl-link class="ml-1" :href="url">{{ text }}</gl-link> + </div> +</template> diff --git a/app/assets/javascripts/ide/components/merge_requests/info.vue b/app/assets/javascripts/ide/components/merge_requests/info.vue deleted file mode 100644 index 73ec992466c..00000000000 --- a/app/assets/javascripts/ide/components/merge_requests/info.vue +++ /dev/null @@ -1,38 +0,0 @@ -<script> -import { mapGetters } from 'vuex'; -import Icon from '../../../vue_shared/components/icon.vue'; -import TitleComponent from '../../../issue_show/components/title.vue'; -import DescriptionComponent from '../../../issue_show/components/description.vue'; - -export default { - components: { - Icon, - TitleComponent, - DescriptionComponent, - }, - computed: { - ...mapGetters(['currentMergeRequest']), - }, -}; -</script> - -<template> - <div class="ide-merge-request-info h-100 d-flex flex-column"> - <div class="detail-page-header"> - <icon name="git-merge" class="align-self-center append-right-8" /> - <strong> !{{ currentMergeRequest.iid }} </strong> - </div> - <div class="issuable-details"> - <title-component - :issuable-ref="currentMergeRequest.iid" - :title-html="currentMergeRequest.title_html" - :title-text="currentMergeRequest.title" - /> - <description-component - :description-html="currentMergeRequest.description_html" - :description-text="currentMergeRequest.description" - :can-update="false" - /> - </div> - </div> -</template> diff --git a/app/assets/javascripts/ide/components/panes/right.vue b/app/assets/javascripts/ide/components/panes/right.vue index 40ed7d9c422..4a9de9e0c03 100644 --- a/app/assets/javascripts/ide/components/panes/right.vue +++ b/app/assets/javascripts/ide/components/panes/right.vue @@ -3,7 +3,6 @@ import { mapGetters, mapState } from 'vuex'; import { __ } from '~/locale'; import CollapsibleSidebar from './collapsible_sidebar.vue'; import { rightSidebarViews } from '../../constants'; -import MergeRequestInfo from '../merge_requests/info.vue'; import PipelinesList from '../pipelines/list.vue'; import JobsDetail from '../jobs/detail.vue'; import Clientside from '../preview/clientside.vue'; @@ -29,12 +28,6 @@ export default { rightExtensionTabs() { return [ { - show: Boolean(this.currentMergeRequestId), - title: __('Merge Request'), - views: [{ component: MergeRequestInfo, ...rightSidebarViews.mergeRequestInfo }], - icon: 'text-description', - }, - { show: true, title: __('Pipelines'), views: [ diff --git a/app/assets/javascripts/ide/stores/actions/merge_request.js b/app/assets/javascripts/ide/stores/actions/merge_request.js index 6144452c80b..aa44067edf8 100644 --- a/app/assets/javascripts/ide/stores/actions/merge_request.js +++ b/app/assets/javascripts/ide/stores/actions/merge_request.js @@ -44,9 +44,7 @@ export const getMergeRequestData = ( new Promise((resolve, reject) => { if (!state.projects[projectId].mergeRequests[mergeRequestId] || force) { service - .getProjectMergeRequestData(targetProjectId || projectId, mergeRequestId, { - render_html: true, - }) + .getProjectMergeRequestData(targetProjectId || projectId, mergeRequestId) .then(({ data }) => { commit(types.SET_MERGE_REQUEST, { projectPath: projectId, |