mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
feat: add expression prop to TextAreaWithGlobalScope and update ConfigForm (#6221)
This commit is contained in:
parent
5fbc7697c6
commit
8e9a2dbd85
@ -35,13 +35,14 @@ interface TextAreaWithGlobalScopeProps {
|
||||
password?: boolean;
|
||||
number?: boolean;
|
||||
boolean?: boolean;
|
||||
expression?: boolean;
|
||||
value?: any;
|
||||
scope?: string | object;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export const TextAreaWithGlobalScope = connect((props: TextAreaWithGlobalScopeProps) => {
|
||||
const { supportsLineBreak, password, number, boolean, ...others } = props;
|
||||
const { supportsLineBreak, password, number, boolean, input, expression = true, ...others } = props;
|
||||
const scope = useEnvironmentVariableOptions(props.scope);
|
||||
const fieldNames = { value: 'name', label: 'title' };
|
||||
|
||||
@ -57,5 +58,13 @@ export const TextAreaWithGlobalScope = connect((props: TextAreaWithGlobalScopePr
|
||||
if (boolean) {
|
||||
return <Variable.Input {...props} scope={scope} fieldNames={fieldNames} />;
|
||||
}
|
||||
|
||||
if (input) {
|
||||
return <Variable.Input {...others} scope={scope} fieldNames={fieldNames} />;
|
||||
}
|
||||
if (expression) {
|
||||
return <TextArea {...others} scope={scope} fieldNames={fieldNames} />;
|
||||
}
|
||||
|
||||
return <Variable.Input {...others} scope={scope} fieldNames={fieldNames} />;
|
||||
}, mapReadPretty(Input.ReadPretty));
|
||||
|
@ -174,8 +174,9 @@ export const ChannelConfigForm = () => {
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'TextAreaWithGlobalScope',
|
||||
'x-component-props': {
|
||||
// useTypedConstant: ['string'],
|
||||
useTypedConstant: ['string'],
|
||||
placeholder: `noreply <example@domain.com>`,
|
||||
expression: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user