mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-01 18:20:06 +00:00
Add credential input parameter options in login block dropdown (#1916)
This commit is contained in:
parent
9e4b763896
commit
aa83da1cba
1 changed files with 18 additions and 1 deletions
|
@ -22,6 +22,11 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
|
|||
const credentialParameters = workflowParameters.filter(
|
||||
(parameter) => parameter.parameterType === "credential",
|
||||
);
|
||||
const credentialInputParameters = workflowParameters.filter(
|
||||
(parameter) =>
|
||||
parameter.parameterType === "workflow" &&
|
||||
parameter.dataType === "credential_id",
|
||||
);
|
||||
const isCloud = useContext(CloudContext);
|
||||
const { data: credentials = [], isLoading } = useCredentialsQuery({
|
||||
enabled: isCloud,
|
||||
|
@ -44,6 +49,14 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
|
|||
type: "parameter",
|
||||
}));
|
||||
|
||||
const credentialInputParameterOptions = credentialInputParameters.map(
|
||||
(parameter) => ({
|
||||
label: parameter.key,
|
||||
value: parameter.key,
|
||||
type: "parameter",
|
||||
}),
|
||||
);
|
||||
|
||||
const filteredCredentialParameterOptions = credentialParameterOptions.filter(
|
||||
(option) =>
|
||||
!credentialOptions.some(
|
||||
|
@ -51,7 +64,11 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
|
|||
),
|
||||
);
|
||||
|
||||
const options = [...credentialOptions, ...filteredCredentialParameterOptions];
|
||||
const options = [
|
||||
...credentialOptions,
|
||||
...filteredCredentialParameterOptions,
|
||||
...credentialInputParameterOptions,
|
||||
];
|
||||
|
||||
return (
|
||||
<Select
|
||||
|
|
Loading…
Add table
Reference in a new issue