diff --git a/apps/files_external/src/components/AddExternalStorageDialog/BackendConfiguration.vue b/apps/files_external/src/components/AddExternalStorageDialog/BackendConfiguration.vue index 49a4dccdd4ffa..e7a1972ebe355 100644 --- a/apps/files_external/src/components/AddExternalStorageDialog/BackendConfiguration.vue +++ b/apps/files_external/src/components/AddExternalStorageDialog/BackendConfiguration.vue @@ -20,9 +20,10 @@ const props = defineProps<{ watch(() => props.configuration, () => { for (const key in props.configuration) { if (!(key in modelValue.value)) { - modelValue.value[key] = props.configuration[key]?.type === ConfigurationType.Boolean + modelValue.value[key] = props.configuration[key]?.defaultValue ?? (props.configuration[key]?.type === ConfigurationType.Boolean ? false : '' + ) } } }, { immediate: true }) diff --git a/apps/files_external/src/types.ts b/apps/files_external/src/types.ts index 80a5122b7c86a..a71022e4c5864 100644 --- a/apps/files_external/src/types.ts +++ b/apps/files_external/src/types.ts @@ -21,6 +21,9 @@ export const ConfigurationType = Object.freeze({ export const ConfigurationFlag = Object.freeze({ None: 0, + /** + * Indicates that the configuration option is optional and can be left empty ("not required") + */ Optional: 1, UserProvided: 2, Hidden: 4, @@ -94,6 +97,11 @@ export interface IConfigurationOption { * Optional tooltip for the configuration option */ tooltip?: string + + /** + * Default value for the configuration option. + */ + defaultValue?: string | boolean } export interface IAuthMechanism {