Make collection id required (#1036)
This commit is contained in:
@@ -205,7 +205,7 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
|
||||
} catch (e) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to save parameters",
|
||||
title: "Failed to add parameter",
|
||||
description: "Invalid JSON for default value",
|
||||
});
|
||||
return;
|
||||
@@ -227,6 +227,14 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
|
||||
});
|
||||
}
|
||||
if (type === "credential") {
|
||||
if (!collectionId) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to add parameter",
|
||||
description: "Collection ID is required",
|
||||
});
|
||||
return;
|
||||
}
|
||||
onSave({
|
||||
key,
|
||||
parameterType: "credential",
|
||||
@@ -239,7 +247,7 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
|
||||
if (!sourceParameterKey) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to save parameters",
|
||||
title: "Failed to add parameter",
|
||||
description: "Source parameter key is required",
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -238,7 +238,7 @@ function WorkflowParameterEditPanel({
|
||||
} catch (e) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to save parameters",
|
||||
title: "Failed to save parameter",
|
||||
description: "Invalid JSON for default value",
|
||||
});
|
||||
return;
|
||||
@@ -260,6 +260,14 @@ function WorkflowParameterEditPanel({
|
||||
});
|
||||
}
|
||||
if (type === "credential") {
|
||||
if (!collectionId) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to save parameter",
|
||||
description: "Collection ID is required",
|
||||
});
|
||||
return;
|
||||
}
|
||||
onSave({
|
||||
key,
|
||||
parameterType: "credential",
|
||||
@@ -272,7 +280,7 @@ function WorkflowParameterEditPanel({
|
||||
if (!sourceParameterKey) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to save parameters",
|
||||
title: "Failed to save parameter",
|
||||
description: "Source parameter key is required",
|
||||
});
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user