2018-11-08 19:23:39 +05:30
|
|
|
<script>
|
2020-03-13 15:44:24 +05:30
|
|
|
import { mapGetters, mapState } from 'vuex';
|
2018-12-05 23:21:45 +05:30
|
|
|
import { __ } from '~/locale';
|
2020-03-13 15:44:24 +05:30
|
|
|
import CollapsibleSidebar from './collapsible_sidebar.vue';
|
2018-11-08 19:23:39 +05:30
|
|
|
import { rightSidebarViews } from '../../constants';
|
|
|
|
import PipelinesList from '../pipelines/list.vue';
|
|
|
|
import JobsDetail from '../jobs/detail.vue';
|
2018-11-18 11:00:15 +05:30
|
|
|
import Clientside from '../preview/clientside.vue';
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
export default {
|
2020-03-13 15:44:24 +05:30
|
|
|
name: 'RightPane',
|
2018-11-08 19:23:39 +05:30
|
|
|
components: {
|
2020-03-13 15:44:24 +05:30
|
|
|
CollapsibleSidebar,
|
2018-11-08 19:23:39 +05:30
|
|
|
},
|
2018-12-05 23:21:45 +05:30
|
|
|
props: {
|
|
|
|
extensionTabs: {
|
|
|
|
type: Array,
|
|
|
|
required: false,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
},
|
2018-11-08 19:23:39 +05:30
|
|
|
computed: {
|
2018-12-05 23:21:45 +05:30
|
|
|
...mapState(['currentMergeRequestId', 'clientsidePreviewEnabled']),
|
2018-11-18 11:00:15 +05:30
|
|
|
...mapGetters(['packageJson']),
|
|
|
|
showLivePreview() {
|
|
|
|
return this.packageJson && this.clientsidePreviewEnabled;
|
|
|
|
},
|
2020-03-13 15:44:24 +05:30
|
|
|
rightExtensionTabs() {
|
2018-12-05 23:21:45 +05:30
|
|
|
return [
|
|
|
|
{
|
|
|
|
show: true,
|
|
|
|
title: __('Pipelines'),
|
2020-03-13 15:44:24 +05:30
|
|
|
views: [
|
|
|
|
{ component: PipelinesList, ...rightSidebarViews.pipelines },
|
|
|
|
{ component: JobsDetail, ...rightSidebarViews.jobsDetail },
|
|
|
|
],
|
2018-12-05 23:21:45 +05:30
|
|
|
icon: 'rocket',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
show: this.showLivePreview,
|
|
|
|
title: __('Live preview'),
|
2020-03-13 15:44:24 +05:30
|
|
|
views: [{ component: Clientside, ...rightSidebarViews.clientSidePreview }],
|
2018-12-05 23:21:45 +05:30
|
|
|
icon: 'live-preview',
|
|
|
|
},
|
2020-03-13 15:44:24 +05:30
|
|
|
...this.extensionTabs,
|
2018-12-05 23:21:45 +05:30
|
|
|
];
|
|
|
|
},
|
2018-11-08 19:23:39 +05:30
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2020-03-13 15:44:24 +05:30
|
|
|
<collapsible-sidebar :extension-tabs="rightExtensionTabs" side="right" :width="350" />
|
2018-11-08 19:23:39 +05:30
|
|
|
</template>
|