2018-05-09 12:01:36 +05:30
|
|
|
<script>
|
2021-01-29 00:20:46 +05:30
|
|
|
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
|
2019-09-30 21:07:59 +05:30
|
|
|
import { __, sprintf } from '~/locale';
|
2018-05-09 12:01:36 +05:30
|
|
|
import '~/lib/utils/datetime_utility';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2020-11-24 15:15:51 +05:30
|
|
|
GlIcon,
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
directives: {
|
2021-01-29 00:20:46 +05:30
|
|
|
GlTooltip: GlTooltipDirective,
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
props: {
|
|
|
|
file: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
lockTooltip() {
|
2019-09-30 21:07:59 +05:30
|
|
|
return sprintf(__(`Locked by %{fileLockUserName}`), {
|
|
|
|
fileLockUserName: this.file.file_lock.user.name,
|
|
|
|
});
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2021-01-29 00:20:46 +05:30
|
|
|
<span v-if="file.file_lock" v-gl-tooltip :title="lockTooltip" data-container="body">
|
2020-11-24 15:15:51 +05:30
|
|
|
<gl-icon name="lock" class="file-status-icon" />
|
2018-05-09 12:01:36 +05:30
|
|
|
</span>
|
|
|
|
</template>
|