Drop move-to-category confirm dialog
Moving a tracker to a category used to auto-create an org third party in the mapping worker, so the move was gated behind a confirmation that warned about it. The worker now only links to an existing vendor and never creates one, making the prompt inaccurate. Remove the confirm dialog and move directly on selection, folding the same-category no-op guard into handleMove. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -203,6 +203,9 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
|
||||
};
|
||||
|
||||
const handleMove = (targetCategoryId: string) => {
|
||||
if (targetCategoryId === pattern.cookieCategory?.id) {
|
||||
return;
|
||||
}
|
||||
movePattern({
|
||||
variables: {
|
||||
input: {
|
||||
@@ -234,22 +237,6 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
|
||||
});
|
||||
};
|
||||
|
||||
const handleMoveWithConfirm = (targetCategoryId: string) => {
|
||||
if (targetCategoryId === pattern.cookieCategory?.id) {
|
||||
return;
|
||||
}
|
||||
confirm(
|
||||
() => {
|
||||
handleMove(targetCategoryId);
|
||||
},
|
||||
{
|
||||
message: __("Moving this tracker to a category will create a third party for it (or link an existing one) if it doesn't have one yet. Continue?"),
|
||||
variant: "primary",
|
||||
label: __("Move"),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
const handleToggleExcluded = () => {
|
||||
updatePattern({
|
||||
variables: {
|
||||
@@ -390,7 +377,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
|
||||
<MoveToCategorySelect
|
||||
currentCategoryId={pattern.cookieCategory?.id}
|
||||
currentCategoryName={pattern.cookieCategory?.name}
|
||||
onSelect={handleMoveWithConfirm}
|
||||
onSelect={handleMove}
|
||||
/>
|
||||
</Td>
|
||||
<Td>
|
||||
|
||||
Reference in New Issue
Block a user