diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2019-06-12 18:58:48 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-06-12 18:58:48 +0300 |
commit | 185999615962bd09dc410997a813ebe981a6f01e (patch) | |
tree | 34987523d6bf70eb258bd77e4d8c2498ec6d6ceb /app/assets/javascripts/ide | |
parent | 1e970f629a704e4ad32af9317bd5db62f3c01ff4 (diff) |
Extract ide_status_list from ide_status_bar
**Why?**
The ide_status_list will be used and extended in EE.
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r-- | app/assets/javascripts/ide/components/ide.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/ide/components/ide_status_bar.vue | 16 | ||||
-rw-r--r-- | app/assets/javascripts/ide/components/ide_status_list.vue | 23 |
3 files changed, 27 insertions, 14 deletions
diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue index e41b1530226..363a8f43033 100644 --- a/app/assets/javascripts/ide/components/ide.vue +++ b/app/assets/javascripts/ide/components/ide.vue @@ -146,7 +146,7 @@ export default { </div> <component :is="rightPaneComponent" v-if="currentProjectId" /> </div> - <ide-status-bar :file="activeFile" /> + <ide-status-bar /> <new-modal /> </article> </template> diff --git a/app/assets/javascripts/ide/components/ide_status_bar.vue b/app/assets/javascripts/ide/components/ide_status_bar.vue index ce577ae85b0..206b8341aad 100644 --- a/app/assets/javascripts/ide/components/ide_status_bar.vue +++ b/app/assets/javascripts/ide/components/ide_status_bar.vue @@ -1,5 +1,6 @@ <script> import { mapActions, mapState, mapGetters } from 'vuex'; +import IdeStatusList from 'ee_else_ce/ide/components/ide_status_list.vue'; import icon from '~/vue_shared/components/icon.vue'; import tooltip from '~/vue_shared/directives/tooltip'; import timeAgoMixin from '~/vue_shared/mixins/timeago'; @@ -12,18 +13,12 @@ export default { icon, userAvatarImage, CiIcon, + IdeStatusList, }, directives: { tooltip, }, mixins: [timeAgoMixin], - props: { - file: { - type: Object, - required: false, - default: null, - }, - }, data() { return { lastCommitFormatedAge: null, @@ -125,11 +120,6 @@ export default { >{{ lastCommitFormatedAge }}</time > </div> - <div v-if="file" class="ide-status-file">{{ file.name }}</div> - <div v-if="file" class="ide-status-file">{{ file.eol }}</div> - <div v-if="file && !file.binary" class="ide-status-file"> - {{ file.editorRow }}:{{ file.editorColumn }} - </div> - <div v-if="file" class="ide-status-file">{{ file.fileLanguage }}</div> + <ide-status-list class="ml-auto" /> </footer> </template> diff --git a/app/assets/javascripts/ide/components/ide_status_list.vue b/app/assets/javascripts/ide/components/ide_status_list.vue new file mode 100644 index 00000000000..364e3f081a1 --- /dev/null +++ b/app/assets/javascripts/ide/components/ide_status_list.vue @@ -0,0 +1,23 @@ +<script> +import { mapGetters } from 'vuex'; + +export default { + computed: { + ...mapGetters(['activeFile']), + }, +}; +</script> + +<template> + <div class="ide-status-list d-flex"> + <template v-if="activeFile"> + <div class="ide-status-file">{{ activeFile.name }}</div> + <div class="ide-status-file">{{ activeFile.eol }}</div> + <div v-if="!activeFile.binary" class="ide-status-file"> + {{ activeFile.editorRow }}:{{ activeFile.editorColumn }} + </div> + <div class="ide-status-file">{{ activeFile.fileLanguage }}</div> + </template> + <slot></slot> + </div> +</template> |