debian-mirror-gitlab/app/assets/javascripts/alert_management/components/alert_sidebar.vue

83 lines
2 KiB
Vue
Raw Normal View History

2020-06-23 00:09:42 +05:30
<script>
import SidebarHeader from './sidebar/sidebar_header.vue';
import SidebarTodo from './sidebar/sidebar_todo.vue';
import SidebarStatus from './sidebar/sidebar_status.vue';
import SidebarAssignees from './sidebar/sidebar_assignees.vue';
2020-07-28 23:09:34 +05:30
import sidebarStatusQuery from '../graphql/queries/sidebar_status.query.graphql';
2020-06-23 00:09:42 +05:30
export default {
components: {
SidebarAssignees,
SidebarHeader,
SidebarTodo,
SidebarStatus,
},
2020-07-28 23:09:34 +05:30
inject: {
2020-06-23 00:09:42 +05:30
projectPath: {
2020-07-28 23:09:34 +05:30
default: '',
},
projectId: {
default: '',
2020-06-23 00:09:42 +05:30
},
2020-07-28 23:09:34 +05:30
},
props: {
2020-06-23 00:09:42 +05:30
alert: {
type: Object,
required: true,
},
},
2020-07-28 23:09:34 +05:30
apollo: {
sidebarStatus: {
query: sidebarStatusQuery,
},
},
data() {
return {
sidebarStatus: false,
};
},
2020-06-23 00:09:42 +05:30
computed: {
sidebarCollapsedClass() {
2020-07-28 23:09:34 +05:30
return this.sidebarStatus ? 'right-sidebar-collapsed' : 'right-sidebar-expanded';
2020-06-23 00:09:42 +05:30
},
},
};
</script>
<template>
<aside :class="sidebarCollapsedClass" class="right-sidebar alert-sidebar">
<div class="issuable-sidebar js-issuable-update">
<sidebar-header
2020-07-28 23:09:34 +05:30
:sidebar-collapsed="sidebarStatus"
:project-path="projectPath"
:alert="alert"
2020-06-23 00:09:42 +05:30
@toggle-sidebar="$emit('toggle-sidebar')"
2020-07-28 23:09:34 +05:30
@alert-error="$emit('alert-error', $event)"
/>
<sidebar-todo
v-if="sidebarStatus"
:project-path="projectPath"
:alert="alert"
:sidebar-collapsed="sidebarStatus"
@alert-error="$emit('alert-error', $event)"
2020-06-23 00:09:42 +05:30
/>
<sidebar-status
:project-path="projectPath"
:alert="alert"
@toggle-sidebar="$emit('toggle-sidebar')"
2020-07-28 23:09:34 +05:30
@alert-error="$emit('alert-error', $event)"
2020-06-23 00:09:42 +05:30
/>
<sidebar-assignees
:project-path="projectPath"
2020-07-28 23:09:34 +05:30
:project-id="projectId"
2020-06-23 00:09:42 +05:30
:alert="alert"
2020-07-28 23:09:34 +05:30
:sidebar-collapsed="sidebarStatus"
2020-06-23 00:09:42 +05:30
@toggle-sidebar="$emit('toggle-sidebar')"
2020-07-28 23:09:34 +05:30
@alert-error="$emit('alert-error', $event)"
2020-06-23 00:09:42 +05:30
/>
<div class="block"></div>
</div>
</aside>
</template>