mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
fix: variable parsing incompatibility with {{title}} data in secondary confirm (#6838)
* fix: variable parsing incompatibility with {{title}} data in secondary confirmation * fix: bug
This commit is contained in:
parent
18f7dc6d17
commit
25bfdd61d4
@ -739,9 +739,11 @@ export function SecondConFirm() {
|
||||
title={t('Secondary confirmation')}
|
||||
initialValues={{
|
||||
title:
|
||||
t(fieldSchema?.['x-component-props']?.confirm?.title, { title: compile(fieldSchema.title) }) ||
|
||||
compile(fieldSchema?.['x-component-props']?.confirm?.title) ||
|
||||
t('Perform the {{title}}', { title: compile(fieldSchema.title) }),
|
||||
content:
|
||||
t(fieldSchema?.['x-component-props']?.confirm?.content, { title: compile(fieldSchema.title) }) ||
|
||||
compile(fieldSchema?.['x-component-props']?.confirm?.content) ||
|
||||
t('Are you sure you want to perform the {{title}} action?', { title: compile(fieldSchema.title) }),
|
||||
}}
|
||||
|
@ -454,6 +454,7 @@ const RenderButton = ({
|
||||
const variables = useVariables();
|
||||
const localVariables = useLocalVariables();
|
||||
const openPopupRef = useRef(null);
|
||||
const compile = useCompile();
|
||||
openPopupRef.current = openPopup;
|
||||
const scopes = {
|
||||
variables,
|
||||
@ -467,8 +468,9 @@ const RenderButton = ({
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const resultTitle = await getVariableValue(confirm?.title, scopes);
|
||||
const resultContent = await getVariableValue(confirm?.content, scopes);
|
||||
|
||||
const resultTitle = await getVariableValue(t(confirm?.title, { title: compile(fieldSchema.title) }), scopes);
|
||||
const resultContent = await getVariableValue(t(confirm?.content, { title: compile(fieldSchema.title) }), scopes);
|
||||
if (!disabled && aclCtx) {
|
||||
const onOk = () => {
|
||||
if (onClick) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user