mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Allows users to delete a condition of a conditional operator #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -78,14 +78,17 @@ function InnerSwitchNode({ id, data, selected }: NodeProps<ISwitchNode>) {
|
||||
{positions.map((position, idx) => {
|
||||
return (
|
||||
<div key={idx}>
|
||||
<section className="flex flex-col">
|
||||
<div className="flex justify-between">
|
||||
<span className="text-text-sub-title text-xs translate-y-2">
|
||||
{idx < positions.length - 1 &&
|
||||
position.condition?.logical_operator?.toUpperCase()}
|
||||
</span>
|
||||
<section className="flex flex-col text-xs">
|
||||
<div className="text-right">
|
||||
<span>{getConditionKey(idx, positions.length)}</span>
|
||||
<div className="text-text-sub-title">
|
||||
{idx < positions.length - 1 && position.text}
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-background-checked">
|
||||
{idx < positions.length - 1 &&
|
||||
position.condition?.logical_operator?.toUpperCase()}
|
||||
</span>
|
||||
{position.condition && (
|
||||
<ConditionBlock
|
||||
condition={position.condition}
|
||||
|
||||
@ -18,10 +18,6 @@ export const useBuildSwitchHandlePositions = ({
|
||||
return get(data, 'form.conditions', []);
|
||||
}, [data]);
|
||||
|
||||
useEffect(() => {
|
||||
console.info('xxx0000');
|
||||
}, [conditions]);
|
||||
|
||||
const positions = useMemo(() => {
|
||||
const list: Array<{
|
||||
text: string;
|
||||
@ -31,7 +27,7 @@ export const useBuildSwitchHandlePositions = ({
|
||||
}> = [];
|
||||
|
||||
[...conditions, ''].forEach((x, idx) => {
|
||||
let top = idx === 0 ? 53 : list[idx - 1].top + 10 + 14; // case number (Case 1) height + flex gap
|
||||
let top = idx === 0 ? 53 : list[idx - 1].top + 10 + 14 + 16 + 16; // case number (Case 1) height + flex gap
|
||||
if (idx >= 1) {
|
||||
const previousItems = conditions[idx - 1]?.items ?? [];
|
||||
if (previousItems.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user