Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(providers): allow fields to be marked as automated #3094

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/connect-ui/src/views/Go.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export const Go: React.FC = () => {
// Append connectionConfig object
const additionalFields: z.ZodRawShape = {};
for (const [name, schema] of Object.entries(provider.connection_config || [])) {
if (schema.automated) {
continue;
}

additionalFields[name] = jsonSchemaToZod(schema);

if (schema.order) {
Expand Down Expand Up @@ -345,7 +349,7 @@ export const Go: React.FC = () => {
name={name}
render={({ field }) => {
return (
<FormItem className={cn(isPreconfigured || definition?.hidden ? 'hidden' : null)}>
<FormItem className={cn(isPreconfigured || definition?.hidden || definition?.automated ? 'hidden' : null)}>
<div>
<div className="flex gap-2 items-center pb-1">
<FormLabel className="leading-5">
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/providers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5169,7 +5169,7 @@ salesforce:
description: The instance URL of your Salesforce account
format: uri
pattern: '^https?://.*$'
optional: true
automated: true

bodinsamuel marked this conversation as resolved.
Show resolved Hide resolved
salesforce-sandbox:
display_name: Salesforce (sandbox)
Expand All @@ -5190,6 +5190,7 @@ salesforce-sandbox:
description: The instance URL of your Salesforce account
format: uri
pattern: '^https?://.*$'
automated: true

salesforce-experience-cloud:
display_name: Salesforce Experience Cloud
Expand Down
1 change: 1 addition & 0 deletions packages/types/lib/providers/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface SimplifiedJSONSchema {
suffix?: string;
doc_section?: string;
secret?: string;
automated: boolean;
}

export interface BaseProvider {
Expand Down
12 changes: 11 additions & 1 deletion scripts/validation/providers/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,14 @@
"enum": ["authorization_code", "client_credentials"]
},
"request": {
"anyOf": [{ "type": "string" }, { "type": "object" }]
"anyOf": [
{
"type": "string"
},
{
"type": "object"
}
]
}
}
},
Expand Down Expand Up @@ -462,6 +469,9 @@
"doc_section": {
"type": "string",
"pattern": "^#[a-z0-9-]+$"
},
"automated": {
"type": "boolean"
}
}
}
Expand Down
Loading