summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 09:09:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 09:09:43 +0000
commitf5050253469fc0961c02deec0e698ad62bdd9de5 (patch)
tree30bbd8f8b556fd5b730f0123921138ee1d6bdaa2 /app/assets/javascripts/vue_shared
parentf6cdec670b9b757fc2225a2c6627ab79765e5b8a (diff)
downloadgitlab-ce-f5050253469fc0961c02deec0e698ad62bdd9de5.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-rw-r--r--app/assets/javascripts/vue_shared/components/file_icon.vue24
1 files changed, 15 insertions, 9 deletions
diff --git a/app/assets/javascripts/vue_shared/components/file_icon.vue b/app/assets/javascripts/vue_shared/components/file_icon.vue
index 952ffa1fa0e..b084ebdf774 100644
--- a/app/assets/javascripts/vue_shared/components/file_icon.vue
+++ b/app/assets/javascripts/vue_shared/components/file_icon.vue
@@ -1,7 +1,6 @@
<script>
-import { GlLoadingIcon } from '@gitlab/ui';
+import { GlLoadingIcon, GlIcon } from '@gitlab/ui';
import getIconForFile from './file_icon/file_icon_map';
-import icon from '../../vue_shared/components/icon.vue';
/* This is a re-usable vue component for rendering a svg sprite
icon
@@ -17,8 +16,8 @@ import icon from '../../vue_shared/components/icon.vue';
*/
export default {
components: {
- icon,
GlLoadingIcon,
+ GlIcon,
},
props: {
fileName: {
@@ -31,7 +30,11 @@ export default {
required: false,
default: false,
},
-
+ submodule: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
opened: {
type: Boolean,
required: false,
@@ -58,7 +61,7 @@ export default {
},
computed: {
spriteHref() {
- const iconName = getIconForFile(this.fileName) || 'file';
+ const iconName = this.submodule ? 'folder-git' : getIconForFile(this.fileName) || 'file';
return `${gon.sprite_file_icons}#${iconName}`;
},
folderIconName() {
@@ -73,9 +76,12 @@ export default {
<template>
<span>
<svg v-if="!loading && !folder" :class="[iconSizeClass, cssClasses]">
- <use v-bind="{ 'xlink:href': spriteHref }" />
- </svg>
- <icon v-if="!loading && folder" :name="folderIconName" :size="size" class="folder-icon" />
- <gl-loading-icon v-if="loading" :inline="true" />
+ <use v-bind="{ 'xlink:href': spriteHref }" /></svg
+ ><gl-icon
+ v-if="!loading && folder"
+ :name="folderIconName"
+ :size="size"
+ class="folder-icon"
+ /><gl-loading-icon v-if="loading" :inline="true" />
</span>
</template>