diff --git a/packages/entities/entities-plugins/src/components/PluginForm.vue b/packages/entities/entities-plugins/src/components/PluginForm.vue index b6db51c3ee..b0240d75cc 100644 --- a/packages/entities/entities-plugins/src/components/PluginForm.vue +++ b/packages/entities/entities-plugins/src/components/PluginForm.vue @@ -466,7 +466,6 @@ const defaultFormSchema: DefaultPluginsSchemaRecord = reactive({ default: [], help: t('plugins.form.fields.protocols.help'), label: t('plugins.form.fields.protocols.label'), - placeholder: t('plugins.form.fields.protocols.placeholder'), required: true, styleClasses: 'plugin-protocols-select', type: 'multiselect', @@ -852,7 +851,8 @@ const buildFormSchema = (parentKey: string, response: Record, initi // Field type is an input, determine input type, such as 'text', or 'number' if (initialFormSchema[field].type === 'input') { - if (['string', 'number'].includes(typeof initialFormSchema[field].default)) { + if (['string', 'number'].includes(typeof initialFormSchema[field].default) && props.config.app === 'konnect') { + // Konnect API respects default values if the field is not set, so display them in the placeholder initialFormSchema[field].placeholder = `Default: ${ initialFormSchema[field].default === '' ? '' : initialFormSchema[field].default }` @@ -1274,6 +1274,13 @@ onBeforeMount(async () => { defaultFormSchema.protocols.default = defaultValues + // Konnect API respects default values if the field is not set, so display them in the placeholder + defaultFormSchema.protocols.placeholder = props.config.app === 'konnect' + ? t('plugins.form.fields.protocols.placeholderWithDefaultValues', { + protocols: defaultValues.join(', '), + }) + : t('plugins.form.fields.protocols.placeholder') + if (elements.one_of?.length) { defaultFormSchema.protocols.values = elements.one_of.map((value: string) => ({ label: value, value })) } diff --git a/packages/entities/entities-plugins/src/locales/en.json b/packages/entities/entities-plugins/src/locales/en.json index a559a59f4f..588793a8ff 100644 --- a/packages/entities/entities-plugins/src/locales/en.json +++ b/packages/entities/entities-plugins/src/locales/en.json @@ -534,6 +534,7 @@ "protocols": { "label": "Protocols", "placeholder": "Select valid protocols for the plugin", + "placeholderWithDefaultValues": "Select valid protocols for the plugin. Default protocols: {protocols}", "help": "A list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type." } },