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

repo.vue « components « repo « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 159c1e6a453cc5eddae0f6bcf176ebf9f3f26f13 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<script>
import RepoSidebar from './repo_sidebar.vue';
import RepoCommitSection from './repo_commit_section.vue';
import RepoTabs from './repo_tabs.vue';
import RepoFileButtons from './repo_file_buttons.vue';
import RepoPreview from './repo_preview.vue';
import RepoMixin from '../mixins/repo_mixin';
import PopupDialog from '../../vue_shared/components/popup_dialog.vue';
import Store from '../stores/repo_store';
import Helper from '../helpers/repo_helper';
import MonacoLoaderHelper from '../helpers/monaco_loader_helper';

export default {
  data: () => Store,
  mixins: [RepoMixin],
  components: {
    'repo-sidebar': RepoSidebar,
    'repo-tabs': RepoTabs,
    'repo-file-buttons': RepoFileButtons,
    'repo-editor': MonacoLoaderHelper.repoEditorLoader,
    'repo-commit-section': RepoCommitSection,
    'popup-dialog': PopupDialog,
    'repo-preview': RepoPreview,
  },

  mounted() {
    Helper.getContent().catch(Helper.loadingError);
  },

  methods: {
    dialogToggled(toggle) {
      this.dialog.open = toggle;
    },

    dialogSubmitted(status) {
      this.dialog.open = false;
      this.dialog.status = status;
    },

    toggleBlobView: Store.toggleBlobView,
  },
};
</script>

<template>
  <div class="repository-view tree-content-holder">
    <!-- Purposely place both elements side by side to prevent whitespace -->
    <repo-sidebar /><div class="panel-right" :class="{'edit-mode': editMode}">
      <repo-tabs />
      <component :is="currentBlobView" class="blob-viewer-container" />
      <repo-file-buttons />
    </div>
    <repo-commit-section />
    <popup-dialog
      :primary-button-label="__('Discard changes')"
      :open="dialog.open"
      kind="warning"
      :title="__('Are you sure?')"
      :body="__('Are you sure you want to discard your changes?')"
      @toggle="dialogToggled"
      @submit="dialogSubmitted"
    />
  </div>
</template>