feat: Update useConfigurations and useHiddenConfigurations to use InputVarType constants for type values

pull/21398/head
twwu 11 months ago
parent d1d83f8a2a
commit 7c3af74b0d

@ -117,7 +117,7 @@ export const useConfigurations = (props: {
required: true,
showConditions: [{
variable: 'type',
value: 'text-input',
value: InputVarType.textInput,
}],
min: 1,
max: TEXT_MAX_LENGTH,
@ -128,7 +128,7 @@ export const useConfigurations = (props: {
required: true,
showConditions: [{
variable: 'type',
value: 'select',
value: InputVarType.select,
}],
}, {
type: InputFieldType.fileTypes,
@ -137,7 +137,7 @@ export const useConfigurations = (props: {
required: true,
showConditions: [{
variable: 'type',
value: 'file',
value: InputVarType.singleFile,
}],
}, {
type: InputFieldType.fileTypes,
@ -146,7 +146,7 @@ export const useConfigurations = (props: {
required: true,
showConditions: [{
variable: 'type',
value: 'file-list',
value: InputVarType.multiFiles,
}],
}, {
type: InputFieldType.checkbox,
@ -201,18 +201,29 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'text-input',
value: InputVarType.textInput,
}],
showOptional: true,
}, {
type: InputFieldType.textInput,
type: InputFieldType.textInput,
label: t('appDebug.variableConfig.defaultValue'),
variable: 'default',
placeholder: t('appDebug.variableConfig.defaultValuePlaceholder'),
required: false,
showConditions: [{
variable: 'type',
value: InputVarType.paragraph,
}],
showOptional: true,
}, {
type: InputFieldType.numberInput,
label: t('appDebug.variableConfig.defaultValue'),
variable: 'default',
placeholder: t('appDebug.variableConfig.defaultValuePlaceholder'),
required: false,
showConditions: [{
variable: 'type',
value: 'number',
value: InputVarType.number,
}],
showOptional: true,
}, {
@ -222,7 +233,7 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'select',
value: InputVarType.select,
}],
showOptional: true,
options: defaultSelectOptions,
@ -237,7 +248,18 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'text-input',
value: InputVarType.textInput,
}],
showOptional: true,
}, {
type: InputFieldType.textInput,
label: t('appDebug.variableConfig.placeholder'),
variable: 'placeholder',
placeholder: t('appDebug.variableConfig.placeholderPlaceholder'),
required: false,
showConditions: [{
variable: 'type',
value: InputVarType.paragraph,
}],
showOptional: true,
}, {
@ -248,7 +270,7 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'number',
value: InputVarType.number,
}],
showOptional: true,
}, {
@ -259,7 +281,7 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'number',
value: InputVarType.number,
}],
showOptional: true,
}, {
@ -269,7 +291,7 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'file',
value: InputVarType.singleFile,
}],
}, {
type: InputFieldType.uploadMethod,
@ -278,7 +300,7 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'file-list',
value: InputVarType.multiFiles,
}],
}, {
type: InputFieldType.numberSlider,
@ -287,7 +309,7 @@ export const useHiddenConfigurations = (props: {
required: false,
showConditions: [{
variable: 'type',
value: 'file-list',
value: InputVarType.multiFiles,
}],
description: t('appDebug.variableConfig.maxNumberTip', {
imgLimit: formatFileSize(imgSizeLimit),

Loading…
Cancel
Save