mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-02 10:41:04 +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(
|
const credentialParameters = workflowParameters.filter(
|
||||||
(parameter) => parameter.parameterType === "credential",
|
(parameter) => parameter.parameterType === "credential",
|
||||||
);
|
);
|
||||||
|
const credentialInputParameters = workflowParameters.filter(
|
||||||
|
(parameter) =>
|
||||||
|
parameter.parameterType === "workflow" &&
|
||||||
|
parameter.dataType === "credential_id",
|
||||||
|
);
|
||||||
const isCloud = useContext(CloudContext);
|
const isCloud = useContext(CloudContext);
|
||||||
const { data: credentials = [], isLoading } = useCredentialsQuery({
|
const { data: credentials = [], isLoading } = useCredentialsQuery({
|
||||||
enabled: isCloud,
|
enabled: isCloud,
|
||||||
|
@ -44,6 +49,14 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
|
||||||
type: "parameter",
|
type: "parameter",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const credentialInputParameterOptions = credentialInputParameters.map(
|
||||||
|
(parameter) => ({
|
||||||
|
label: parameter.key,
|
||||||
|
value: parameter.key,
|
||||||
|
type: "parameter",
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
const filteredCredentialParameterOptions = credentialParameterOptions.filter(
|
const filteredCredentialParameterOptions = credentialParameterOptions.filter(
|
||||||
(option) =>
|
(option) =>
|
||||||
!credentialOptions.some(
|
!credentialOptions.some(
|
||||||
|
@ -51,7 +64,11 @@ function LoginBlockCredentialSelector({ value, onChange }: Props) {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const options = [...credentialOptions, ...filteredCredentialParameterOptions];
|
const options = [
|
||||||
|
...credentialOptions,
|
||||||
|
...filteredCredentialParameterOptions,
|
||||||
|
...credentialInputParameterOptions,
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
|
|
Loading…
Add table
Reference in a new issue