debian-mirror-gitlab/app/assets/javascripts/ide/components/ide_side_bar.vue

67 lines
2 KiB
Vue
Raw Normal View History

2018-05-09 12:01:36 +05:30
<script>
2018-10-15 14:42:47 +05:30
import { mapState, mapGetters } from 'vuex';
2019-02-15 15:39:39 +05:30
import { GlSkeletonLoading } from '@gitlab/ui';
2018-10-15 14:42:47 +05:30
import IdeTree from './ide_tree.vue';
import ResizablePanel from './resizable_panel.vue';
import ActivityBar from './activity_bar.vue';
2020-03-13 15:44:24 +05:30
import RepoCommitSection from './repo_commit_section.vue';
2018-10-15 14:42:47 +05:30
import CommitForm from './commit_sidebar/form.vue';
import IdeReview from './ide_review.vue';
import SuccessMessage from './commit_sidebar/success_message.vue';
2018-11-18 11:00:15 +05:30
import IdeProjectHeader from './ide_project_header.vue';
2020-06-23 00:09:42 +05:30
import { leftSidebarViews, SIDEBAR_INIT_WIDTH } from '../constants';
2018-05-09 12:01:36 +05:30
2018-10-15 14:42:47 +05:30
export default {
components: {
2018-12-13 13:39:08 +05:30
GlSkeletonLoading,
2018-10-15 14:42:47 +05:30
ResizablePanel,
ActivityBar,
2020-03-13 15:44:24 +05:30
RepoCommitSection,
2018-10-15 14:42:47 +05:30
IdeTree,
CommitForm,
IdeReview,
SuccessMessage,
2018-11-18 11:00:15 +05:30
IdeProjectHeader,
2018-10-15 14:42:47 +05:30
},
computed: {
2018-12-13 13:39:08 +05:30
...mapState(['loading', 'currentActivityView', 'changedFiles', 'stagedFiles', 'lastCommitMsg']),
...mapGetters(['currentProject', 'someUncommittedChanges']),
2018-10-15 14:42:47 +05:30
showSuccessMessage() {
return (
2020-03-13 15:44:24 +05:30
this.currentActivityView === leftSidebarViews.edit.name &&
2018-12-13 13:39:08 +05:30
(this.lastCommitMsg && !this.someUncommittedChanges)
2018-10-15 14:42:47 +05:30
);
2018-05-09 12:01:36 +05:30
},
2018-10-15 14:42:47 +05:30
},
2020-06-23 00:09:42 +05:30
SIDEBAR_INIT_WIDTH,
2018-10-15 14:42:47 +05:30
};
2018-05-09 12:01:36 +05:30
</script>
<template>
2020-06-23 00:09:42 +05:30
<resizable-panel
:initial-width="$options.SIDEBAR_INIT_WIDTH"
side="left"
class="multi-file-commit-panel flex-column"
>
2018-11-18 11:00:15 +05:30
<template v-if="loading">
<div class="multi-file-commit-panel-inner">
2019-02-15 15:39:39 +05:30
<div v-for="n in 3" :key="n" class="multi-file-loading-container">
2018-12-13 13:39:08 +05:30
<gl-skeleton-loading />
2018-05-09 12:01:36 +05:30
</div>
2018-11-18 11:00:15 +05:30
</div>
</template>
<template v-else>
2019-02-15 15:39:39 +05:30
<ide-project-header :project="currentProject" />
2018-11-18 11:00:15 +05:30
<div class="ide-context-body d-flex flex-fill">
<activity-bar />
<div class="multi-file-commit-panel-inner">
<div class="multi-file-commit-panel-inner-content">
2019-02-15 15:39:39 +05:30
<component :is="currentActivityView" />
2018-11-18 11:00:15 +05:30
</div>
<commit-form />
2018-10-15 14:42:47 +05:30
</div>
2018-11-18 11:00:15 +05:30
</div>
</template>
2018-05-09 12:01:36 +05:30
</resizable-panel>
</template>