에디터 정리 및 버그 수정
This commit is contained in:
@@ -233,10 +233,16 @@ export function FormControllerPanel({ block, blocks, selectedBlockId, updateBloc
|
||||
)
|
||||
.map((fieldBlock) => {
|
||||
const fieldId = fieldBlock.id;
|
||||
const fieldLabel = (fieldBlock.props as any).label ??
|
||||
(fieldBlock.props as any).groupLabel ??
|
||||
(fieldBlock.props as any).formFieldName ??
|
||||
fieldId;
|
||||
const anyProps: any = fieldBlock.props ?? {};
|
||||
|
||||
const transmissionKey: string | undefined = anyProps.formFieldName;
|
||||
const labelText: string | undefined = anyProps.label ?? anyProps.groupLabel;
|
||||
|
||||
const displayLabel = transmissionKey
|
||||
? labelText && labelText !== transmissionKey
|
||||
? `${transmissionKey} (${labelText})`
|
||||
: transmissionKey
|
||||
: labelText || fieldId;
|
||||
|
||||
const checked = (formProps.fieldIds ?? []).includes(fieldId);
|
||||
|
||||
@@ -260,7 +266,7 @@ export function FormControllerPanel({ block, blocks, selectedBlockId, updateBloc
|
||||
} as any);
|
||||
}}
|
||||
/>
|
||||
<span>{fieldLabel}</span>
|
||||
<span>{displayLabel}</span>
|
||||
</label>
|
||||
);
|
||||
})}
|
||||
@@ -283,9 +289,17 @@ export function FormControllerPanel({ block, blocks, selectedBlockId, updateBloc
|
||||
.filter((b) => b.type === "button")
|
||||
.map((buttonBlock) => {
|
||||
const btnProps = buttonBlock.props as ButtonBlockProps;
|
||||
const transmissionKey = btnProps.formFieldName;
|
||||
const labelText = btnProps.label;
|
||||
const displayLabel = transmissionKey
|
||||
? labelText && labelText !== transmissionKey
|
||||
? `${transmissionKey} (${labelText})`
|
||||
: transmissionKey
|
||||
: labelText || buttonBlock.id;
|
||||
|
||||
return (
|
||||
<option key={buttonBlock.id} value={buttonBlock.id}>
|
||||
{btnProps.label || buttonBlock.id}
|
||||
{displayLabel}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user