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

62 lines
1.9 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';
import CommitSection from './repo_commit_section.vue';
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';
2018-10-15 14:42:47 +05:30
import { activityBarViews } 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,
CommitSection,
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 (
this.currentActivityView === activityBarViews.edit &&
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
},
};
2018-05-09 12:01:36 +05:30
</script>
<template>
2019-02-15 15:39:39 +05:30
<resizable-panel :collapsible="false" :initial-width="340" side="left" class="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>