mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Export Collection button now shows collection name not table name (#7379)
* export collection button to uses name not db name * removed unused var * fixed for review * computed collectionName
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
<div class="field full">
|
||||
<v-button full-width @click="exportData">
|
||||
{{ t('export_collection', { collection }) }}
|
||||
{{ t('export_collection', { collection: collectionName }) }}
|
||||
</v-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,11 +34,12 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, ref, PropType } from 'vue';
|
||||
import { defineComponent, ref, PropType, computed } from 'vue';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import api from '@/api';
|
||||
import { getRootPath } from '@/utils/get-root-path';
|
||||
import filtersToQuery from '@/utils/filters-to-query';
|
||||
import { useCollectionsStore } from '@/stores/';
|
||||
|
||||
type LayoutQuery = {
|
||||
fields?: string[];
|
||||
@@ -65,13 +66,16 @@ export default defineComponent({
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
const { t } = useI18n();
|
||||
|
||||
const format = ref('csv');
|
||||
const useFilters = ref(true);
|
||||
const collectionsStore = useCollectionsStore();
|
||||
const collectionName = computed(() => collectionsStore.getCollection(props.collection).name);
|
||||
|
||||
return { t, format, useFilters, exportData };
|
||||
return { t, format, useFilters, exportData, collectionName };
|
||||
|
||||
function exportData() {
|
||||
const endpoint = props.collection.startsWith('directus_')
|
||||
|
||||
Reference in New Issue
Block a user