Fix untranslated field meta data (#22263)

This commit is contained in:
Hannes Küttner
2024-04-19 22:07:36 +02:00
committed by GitHub
parent 9e01582268
commit ae37209ace
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Fixed untranslated translation placeholders in field metadata that appear after visiting a collection settings page

View File

@@ -3,7 +3,7 @@ import { useFieldsStore } from '@/stores/fields';
import { hideDragImage } from '@/utils/hide-drag-image';
import { Field, LocalType } from '@directus/types';
import { isNil, orderBy } from 'lodash';
import { computed, toRefs, onBeforeMount } from 'vue';
import { computed, toRefs, onBeforeMount, onBeforeUnmount } from 'vue';
import { useI18n } from 'vue-i18n';
import Draggable from 'vuedraggable';
import FieldSelect from './field-select.vue';
@@ -17,6 +17,7 @@ const { t } = useI18n();
const { collection } = toRefs(props);
const fieldsStore = useFieldsStore();
onBeforeMount(async () => await fieldsStore.hydrate({ skipTranslation: true }));
onBeforeUnmount(() => fieldsStore.translateFields());
const fields = computed(() => fieldsStore.getFieldsForCollectionSorted(collection.value));