Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ide_tree.vue « components « ide « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8fc4ebe6ca6553c19e0897a6ba25316c4314a661 (plain)
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
<script>
import { mapState, mapGetters, mapActions } from 'vuex';
import NewDropdown from './new_dropdown/index.vue';
import IdeTreeList from './ide_tree_list.vue';

export default {
  components: {
    NewDropdown,
    IdeTreeList,
  },
  computed: {
    ...mapState(['currentBranchId']),
    ...mapGetters(['currentProject', 'currentTree', 'activeFile']),
  },
  mounted() {
    if (this.activeFile && this.activeFile.pending) {
      this.$router.push(`/project${this.activeFile.url}`, () => {
        this.updateViewer('editor');
      });
    }
  },
  methods: {
    ...mapActions(['updateViewer']),
  },
};
</script>

<template>
  <ide-tree-list
    viewer-type="editor"
  >
    <template
      slot="header"
    >
      {{ __('Edit') }}
      <new-dropdown
        :project-id="currentProject.name_with_namespace"
        :branch="currentBranchId"
      />
    </template>
  </ide-tree-list>
</template>