mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Add useFormFields composable (#691)
* Extract use-form-fields into separate composable * Use new composable on fields detail
This commit is contained in:
@@ -135,6 +135,7 @@ import useFieldsStore from '@/stores/fields';
|
||||
import { Field } from '@/stores/fields/types';
|
||||
import FileInfoDrawerDetail from './components/file-info-drawer-detail.vue';
|
||||
import marked from 'marked';
|
||||
import useFormFields from '@/composables/use-form-fields';
|
||||
|
||||
type Values = {
|
||||
[field: string]: any;
|
||||
@@ -193,12 +194,14 @@ export default defineComponent({
|
||||
// These are the fields that will be prevented from showing up in the form
|
||||
const fieldsBlacklist: string[] = ['type', 'width', 'height', 'filesize', 'checksum'];
|
||||
|
||||
const formFields = computed(() => {
|
||||
const fieldsFiltered = computed(() => {
|
||||
return fieldsStore
|
||||
.getFieldsForCollection('directus_files')
|
||||
.filter((field: Field) => fieldsBlacklist.includes(field.field) === false);
|
||||
});
|
||||
|
||||
const { formFields } = useFormFields(fieldsFiltered);
|
||||
|
||||
const confirmLeave = ref(false);
|
||||
const leaveTo = ref<string | null>(null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user