Support credit cards in 1Password credential parameters (#3746)

This commit is contained in:
Stanislav Novosad
2025-10-17 10:13:47 -06:00
committed by GitHub
parent e3ecc4b657
commit 75ce98e841
3 changed files with 87 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ import { WorkflowParameterInput } from "../../WorkflowParameterInput";
import { ParametersState } from "../types";
import { getDefaultValueForParameterType } from "../workflowEditorUtils";
import { validateBitwardenLoginCredential } from "./util";
import { HelpTooltip } from "@/components/HelpTooltip";
type Props = {
type: WorkflowEditorParameterType;
@@ -273,19 +274,32 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
{type === "credential" && credentialType === "onepassword" && (
<>
<div className="space-y-1">
<Label className="text-xs text-slate-300">Vault ID</Label>
<div className="flex gap-2">
<Label className="text-xs text-slate-300">Vault ID</Label>
<HelpTooltip content="You can find the Vault ID and Item ID in the URL when viewing the item in 1Password on the web." />
</div>
<Input
value={vaultId}
onChange={(e) => setVaultId(e.target.value)}
/>
</div>
<div className="space-y-1">
<Label className="text-xs text-slate-300">Item ID</Label>
<div className="flex gap-2">
<Label className="text-xs text-slate-300">Item ID</Label>
<HelpTooltip content="Supports all 1Password item types: Logins, Passwords, Credit Cards, Secure Notes, and more." />
</div>
<Input
value={itemId}
onChange={(e) => setItemId(e.target.value)}
/>
</div>
<div className="rounded-md bg-slate-800 p-2">
<div className="space-y-1 text-xs text-slate-400">
* Credit Cards: Due to a 1Password limitation, add the
expiration date as a separate text field named "Expire Date"
in the format MM/YYYY (e.g. 09/2027).
</div>
</div>
</>
)}
{type === "credential" && credentialType === "azurevault" && (

View File

@@ -31,6 +31,7 @@ import {
} from "../types";
import { getDefaultValueForParameterType } from "../workflowEditorUtils";
import { validateBitwardenLoginCredential } from "./util";
import { HelpTooltip } from "@/components/HelpTooltip";
type Props = {
type: WorkflowEditorParameterType;
@@ -357,19 +358,32 @@ function WorkflowParameterEditPanel({
{type === "credential" && credentialType === "onepassword" && (
<>
<div className="space-y-1">
<Label className="text-xs text-slate-300">Vault ID</Label>
<div className="flex gap-2">
<Label className="text-xs text-slate-300">Vault ID</Label>
<HelpTooltip content="You can find the Vault ID and Item ID in the URL when viewing the item in 1Password on the web." />
</div>
<Input
value={vaultId}
onChange={(e) => setVaultId(e.target.value)}
/>
</div>
<div className="space-y-1">
<Label className="text-xs text-slate-300">Item ID</Label>
<div className="flex gap-2">
<Label className="text-xs text-slate-300">Item ID</Label>
<HelpTooltip content="Supports all 1Password item types: Logins, Passwords, Credit Cards, Secure Notes, and more." />
</div>
<Input
value={opItemId}
onChange={(e) => setOpItemId(e.target.value)}
/>
</div>
<div className="rounded-md bg-slate-800 p-2">
<div className="space-y-1 text-xs text-slate-400">
Credit Cards: Due to a 1Password limitation, add the
expiration date as a separate text field named Expire Date
in the format MM/YYYY (e.g. 09/2027).
</div>
</div>
</>
)}
{type === "credential" && credentialType === "azurevault" && (