set login block to add a credential parameter when new credential is … (#1969)

This commit is contained in:
Shuchang Zheng
2025-03-19 09:33:36 -07:00
committed by GitHub
parent f837c52f83
commit 05433d68d2

View File

@@ -35,12 +35,12 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
parameter.dataType === "credential_id", parameter.dataType === "credential_id",
); );
const isCloud = useContext(CloudContext); const isCloud = useContext(CloudContext);
const { data: credentials = [], isLoading } = useCredentialsQuery({ const { data: credentials = [], isFetching } = useCredentialsQuery({
enabled: isCloud, enabled: isCloud,
}); });
const noneItemValue = useId(); const noneItemValue = useId();
if (isCloud && isLoading) { if (isCloud && isFetching) {
return <Skeleton className="h-8 w-full" />; return <Skeleton className="h-8 w-full" />;
} }
@@ -135,6 +135,16 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
<CredentialsModal <CredentialsModal
onCredentialCreated={(id) => { onCredentialCreated={(id) => {
onChange?.(id); onChange?.(id);
setWorkflowParameters((prev) => {
return [
...prev,
{
parameterType: "credential",
credentialId: id,
key: id,
},
];
});
}} }}
/> />
</> </>