All files / app/assets/javascripts/ide/components ide_side_bar.vue

100% Statements 11/11
100% Branches 2/2
100% Functions 3/3
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61  2x 2x 2x 2x 2x 2x 2x 2x               2x   2x                         51x                                                          
<script>
import { GlDeprecatedSkeletonLoading as GlSkeletonLoading } from '@gitlab/ui';
import { mapState, mapGetters } from 'vuex';
import { SIDEBAR_INIT_WIDTH, leftSidebarViews } from '../constants';
import ActivityBar from './activity_bar.vue';
import CommitForm from './commit_sidebar/form.vue';
import IdeProjectHeader from './ide_project_header.vue';
import IdeTree from './ide_tree.vue';
import ResizablePanel from './resizable_panel.vue';
 
export default {
  components: {
    GlSkeletonLoading,
    ResizablePanel,
    ActivityBar,
    IdeTree,
    [leftSidebarViews.review.name]: () =>
      import(/* webpackChunkName: 'ide_runtime' */ './ide_review.vue'),
    [leftSidebarViews.commit.name]: () =>
      import(/* webpackChunkName: 'ide_runtime' */ './repo_commit_section.vue'),
    CommitForm,
    IdeProjectHeader,
  },
  computed: {
    ...mapState(['loading', 'currentActivityView', 'changedFiles', 'stagedFiles', 'lastCommitMsg']),
    ...mapGetters(['currentProject', 'someUncommittedChanges']),
  },
  SIDEBAR_INIT_WIDTH,
};
</script>
 
<template>
  <resizable-panel
    :initial-width="$options.SIDEBAR_INIT_WIDTH"
    side="left"
    class="multi-file-commit-panel flex-column"
  >
    <template v-if="loading">
      <div class="multi-file-commit-panel-inner" data-testid="ide-side-bar-inner">
        <div v-for="n in 3" :key="n" class="multi-file-loading-container">
          <gl-skeleton-loading />
        </div>
      </div>
    </template>
    <template v-else>
      <ide-project-header :project="currentProject" />
      <div class="ide-context-body d-flex flex-fill">
        <activity-bar />
        <div class="multi-file-commit-panel-inner" data-testid="ide-side-bar-inner">
          <div class="multi-file-commit-panel-inner-content">
            <keep-alive>
              <component :is="currentActivityView" @tree-ready="$emit('tree-ready')" />
            </keep-alive>
          </div>
          <commit-form />
        </div>
      </div>
    </template>
  </resizable-panel>
</template>