Add option in translation interface for opening the splitview by default (#21160)

This commit is contained in:
Daniel Biegler
2024-01-22 17:06:28 +01:00
committed by GitHub
parent eba3e08549
commit 3277405d43
4 changed files with 25 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Added option in the translation interface for opening the splitview by default

View File

@@ -80,6 +80,21 @@ export default defineInterface({
width: 'half',
},
},
{
field: 'defaultOpenSplitView',
name: '$t:interfaces.translations.default_split_view_state',
type: 'boolean',
schema: {
default_value: false,
},
meta: {
interface: 'toggle',
options: {
label: '$t:start_open',
},
width: 'half',
},
},
];
},
preview: PreviewSVG,

View File

@@ -11,11 +11,11 @@ import { useFieldsStore } from '@/stores/fields';
import { usePermissionsStore } from '@/stores/permissions';
import { fetchAll } from '@/utils/fetch-all';
import { unexpectedError } from '@/utils/unexpected-error';
import { getEndpoint } from '@directus/utils';
import { cloneDeep, isNil } from 'lodash';
import { computed, ref, toRefs, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import LanguageSelect from './language-select.vue';
import { getEndpoint } from '@directus/utils';
const props = withDefaults(
defineProps<{
@@ -25,6 +25,7 @@ const props = withDefaults(
languageField?: string | null;
languageDirectionField?: string | null;
defaultLanguage?: string | null;
defaultOpenSplitView?: boolean;
userLanguage?: boolean;
value: (number | string | Record<string, any>)[] | Record<string, any>;
autofocus?: boolean;
@@ -37,6 +38,7 @@ const props = withDefaults(
autofocus: false,
disabled: false,
defaultLanguage: null,
defaultOpenSplitView: false,
userLanguage: false,
},
);
@@ -59,7 +61,7 @@ const permissionsStore = usePermissionsStore();
const { width } = useWindowSize();
const splitView = ref(false);
const splitView = ref(props.defaultOpenSplitView);
const firstLang = ref<string>();
const secondLang = ref<string>();

View File

@@ -1872,6 +1872,7 @@ interfaces:
no_collection: No Collection
toggle_split_view: Toggle Split View
enable: Enable
default_split_view_state: Default Split View State
user_language: Use Current User Language
default_language: Default Language
language_field: Language Indicator Field