Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function SourceInput({
const isFocused = useMemo(
() =>
rightSide === EnumRightType.AddSonataProp &&
isEqual(item, rightSideInfo?.previousData),
[rightSide, item, rightSideInfo?.previousData]
isEqual(item.id, rightSideInfo?.previousData?.id),
[rightSide, item.id, rightSideInfo?.previousData?.id]
);

const handleChange = (changes: { [field in keyof typeof item]?: any }) => {
Expand All @@ -42,6 +42,12 @@ export function SourceInput({
}

setRequestMapping(newRequest);
if (isFocused && rightSideInfo) {
setRightSideInfo({
...rightSideInfo,
previousData: newRequest[index],
});
}
};
return (
<Flex className={styles.flexColumn} gap={4}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export function TargetInput({
}

setRequestMapping(newRequest);
if (isFocused && rightSideInfo) {
setRightSideInfo({
...rightSideInfo,
previousData: newRequest[index],
});
}
};
return (
<Flex className={styles.flexColumn} gap={4}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ const RequestItem = ({ item, index }: Props) => {
setRequestMapping(newRequest);
}
}, [continuousInput]);

return (
<div
className={clsx([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function SourceInput({
const id = `${index}-${item?.name}`;
const isFocused =
rightSide === EnumRightType.AddSellerResponse && activeResponseName === id;

return (
<Flex className={styles.flexColumn} gap={4}>
{item.source ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function TargetInput({

const isFocused =
rightSide === EnumRightType.SonataResponse && activeSonataResponse === id;

return (
<Flex className={styles.flexColumn} gap={4}>
{item.target ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const RightAddSellerProp = ({ onSelect }: Readonly<Props>) => {
styles.treeValue
);
}, [sellerApi]);

const { handleAddProp, collapseItems } = useCommonAddProp({
selectedProp,
rightSideInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ const RightAddSonataProp = ({
styles.treeValue
);
}, [correctSpec]);

const { handleAddProp, collapseItems } = useCommonAddProp({
selectedProp,
rightSideInfo,
Expand All @@ -98,7 +97,7 @@ const RightAddSonataProp = ({
setSelectedProp,
onSelect,
});

return (
<Flex
vertical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const SonataPropMapping = ({ list, title }: Readonly<Props>) => {
setRightSideInfo(undefined);
}

const notEmptyList = !!list.length
const notEmptyList = !!list.length;
return (
<Flex gap={16}>
<div className={styles.sonataPropMappingWrapper}>
Expand Down
Loading