2018-03-20 14:12:48 +00:00
|
|
|
<script>
|
2020-08-24 15:10:11 +00:00
|
|
|
import { GlIcon } from '@gitlab/ui';
|
2019-06-24 05:30:35 +00:00
|
|
|
import { __, sprintf } from '~/locale';
|
2018-03-27 14:56:22 +00:00
|
|
|
import tooltip from '~/vue_shared/directives/tooltip';
|
|
|
|
import '~/lib/utils/datetime_utility';
|
2018-03-20 14:12:48 +00:00
|
|
|
|
2018-03-27 14:56:22 +00:00
|
|
|
export default {
|
|
|
|
components: {
|
2020-08-24 15:10:11 +00:00
|
|
|
GlIcon,
|
2018-03-27 14:56:22 +00:00
|
|
|
},
|
|
|
|
directives: {
|
|
|
|
tooltip,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
file: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2018-03-20 14:12:48 +00:00
|
|
|
},
|
2018-03-27 14:56:22 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
lockTooltip() {
|
2019-06-24 05:30:35 +00:00
|
|
|
return sprintf(__(`Locked by %{fileLockUserName}`), {
|
|
|
|
fileLockUserName: this.file.file_lock.user.name,
|
|
|
|
});
|
2018-03-20 14:12:48 +00:00
|
|
|
},
|
2018-03-27 14:56:22 +00:00
|
|
|
},
|
|
|
|
};
|
2018-03-20 14:12:48 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2018-11-16 20:07:38 +00:00
|
|
|
<span v-if="file.file_lock" v-tooltip :title="lockTooltip" data-container="body">
|
2020-08-24 15:10:11 +00:00
|
|
|
<gl-icon name="lock" class="file-status-icon" />
|
2018-03-20 14:12:48 +00:00
|
|
|
</span>
|
|
|
|
</template>
|