debian-mirror-gitlab/app/assets/javascripts/ide/components/ide_file_row.vue

49 lines
1,013 B
Vue
Raw Normal View History

2020-03-13 15:44:24 +05:30
<script>
/**
* This component is an iterative step towards refactoring and simplifying `vue_shared/components/file_row.vue`
* https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23720
*/
2020-11-24 15:15:51 +05:30
import { mapGetters } from 'vuex';
2020-03-13 15:44:24 +05:30
import FileRow from '~/vue_shared/components/file_row.vue';
import FileRowExtra from './file_row_extra.vue';
export default {
name: 'IdeFileRow',
components: {
FileRow,
FileRowExtra,
},
props: {
file: {
type: Object,
required: true,
},
},
data() {
return {
dropdownOpen: false,
};
},
2020-11-24 15:15:51 +05:30
computed: {
...mapGetters(['getUrlForPath']),
},
2020-03-13 15:44:24 +05:30
methods: {
toggleDropdown(val) {
this.dropdownOpen = val;
},
},
};
</script>
<template>
2020-11-24 15:15:51 +05:30
<file-row
:file="file"
:file-url="getUrlForPath(file.path)"
v-bind="$attrs"
@mouseleave="toggleDropdown(false)"
v-on="$listeners"
>
2020-03-13 15:44:24 +05:30
<file-row-extra :file="file" :dropdown-open="dropdownOpen" @toggle="toggleDropdown($event)" />
</file-row>
</template>