mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Preserve translation strings when duplicating a field (#21648)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
committed by
GitHub
parent
001ec2e8d5
commit
7209df3501
5
.changeset/tough-hotels-reflect.md
Normal file
5
.changeset/tough-hotels-reflect.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@directus/app': patch
|
||||
---
|
||||
|
||||
Ensured that translation strings are preserved when duplicating a field
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useFieldsStore } from '@/stores/fields';
|
||||
import { hideDragImage } from '@/utils/hide-drag-image';
|
||||
import { useCollection } from '@directus/composables';
|
||||
import { Field, LocalType } from '@directus/types';
|
||||
import { isNil, orderBy } from 'lodash';
|
||||
import { computed, toRefs } from 'vue';
|
||||
@@ -16,8 +15,10 @@ const props = defineProps<{
|
||||
const { t } = useI18n();
|
||||
|
||||
const { collection } = toRefs(props);
|
||||
const { fields } = useCollection(collection);
|
||||
const fieldsStore = useFieldsStore();
|
||||
fieldsStore.hydrate({ skipTranslation: true });
|
||||
|
||||
const fields = computed(() => fieldsStore.getFieldsForCollectionSorted(collection.value));
|
||||
|
||||
const parsedFields = computed(() => {
|
||||
return orderBy(fields.value, [(o) => (o.meta?.sort ? Number(o.meta?.sort) : null), (o) => o.meta?.id]).filter(
|
||||
|
||||
Reference in New Issue
Block a user