mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +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;
|
password?: boolean;
|
||||||
number?: boolean;
|
number?: boolean;
|
||||||
boolean?: boolean;
|
boolean?: boolean;
|
||||||
|
expression?: boolean;
|
||||||
value?: any;
|
value?: any;
|
||||||
scope?: string | object;
|
scope?: string | object;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TextAreaWithGlobalScope = connect((props: TextAreaWithGlobalScopeProps) => {
|
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 scope = useEnvironmentVariableOptions(props.scope);
|
||||||
const fieldNames = { value: 'name', label: 'title' };
|
const fieldNames = { value: 'name', label: 'title' };
|
||||||
|
|
||||||
@ -57,5 +58,13 @@ export const TextAreaWithGlobalScope = connect((props: TextAreaWithGlobalScopePr
|
|||||||
if (boolean) {
|
if (boolean) {
|
||||||
return <Variable.Input {...props} scope={scope} fieldNames={fieldNames} />;
|
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 <TextArea {...others} scope={scope} fieldNames={fieldNames} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <Variable.Input {...others} scope={scope} fieldNames={fieldNames} />;
|
||||||
}, mapReadPretty(Input.ReadPretty));
|
}, mapReadPretty(Input.ReadPretty));
|
||||||
|
@ -174,8 +174,9 @@ export const ChannelConfigForm = () => {
|
|||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'TextAreaWithGlobalScope',
|
'x-component': 'TextAreaWithGlobalScope',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
// useTypedConstant: ['string'],
|
useTypedConstant: ['string'],
|
||||||
placeholder: `noreply <example@domain.com>`,
|
placeholder: `noreply <example@domain.com>`,
|
||||||
|
expression: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user