-
Notifications
You must be signed in to change notification settings - Fork 312
Avail PropertyUI types and hide sensitive fields in the destination configuration #1187
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
ikraamg
wants to merge
1
commit into
jitsucom:newjitsu
Choose a base branch
from
ikraamg:Avail-cred-ui-types-and-hide-sensitive-destination-fields-in-UI
base: newjitsu
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+121
−67
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* UI for property | ||
*/ | ||
export type PropertyUI = { | ||
/** | ||
* Optional human-friendly name of the field | ||
*/ | ||
displayName?: string; | ||
/** | ||
* If string field should be treated as textarea (multiline input) | ||
*/ | ||
textarea?: boolean; | ||
/** | ||
* If string field should be treated as password | ||
*/ | ||
password?: boolean; | ||
/** | ||
* If the field should not be displayed. That field must have a default value | ||
*/ | ||
hidden?: boolean | ((obj: any) => boolean); | ||
/** | ||
* If the field should be a constant | ||
*/ | ||
constant?: any | ((obj: any) => any); | ||
/** | ||
* correction to field value. e.g: set default value for property that was missing before | ||
*/ | ||
correction?: any | ((obj: any) => any); | ||
|
||
/** | ||
* Documentation for the field | ||
*/ | ||
documentation?: string; | ||
/** | ||
* Name of custom editor component. See getEditorComponent() function from `[workspaceId]/destinations.txt` | ||
*/ | ||
editor?: | ||
| "ArrayTextarea" | ||
| "StringArrayEditor" | ||
| "CodeEditor" | ||
| "SnippedEditor" | ||
| "MultiSelectWithCustomOptions" | ||
| string; | ||
/** | ||
* Properties of an editor component (not implemented yet, reserved for the future) | ||
*/ | ||
editorProps?: any; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { SomeZodObject, z } from "zod"; | ||
import React, { ReactNode } from "react"; | ||
|
||
import type { PropertyUI } from "@jitsu/core-functions/src/lib/meta-types"; | ||
|
||
import amplitudeIcon from "./icons/amplitude"; | ||
import bigqueryIcon from "./icons/bigquery"; | ||
import ClickhouseIcon from "./icons/clickhouse"; | ||
|
@@ -28,7 +30,6 @@ import intercomIcon from "./icons/intercom"; | |
import webhookIcon from "./icons/webhook"; | ||
import { branding } from "../branding"; | ||
import * as meta from "@jitsu/core-functions/src/meta"; | ||
import { HubspotCredentials } from "@jitsu/core-functions/src/meta"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was already available via |
||
|
||
const s3Regions = [ | ||
"us-west-1", | ||
|
@@ -56,49 +57,6 @@ const s3Regions = [ | |
"us-gov-west-1", | ||
] as const; | ||
|
||
/** | ||
* UI for property | ||
*/ | ||
export type PropertyUI = { | ||
/** | ||
* Optional human-friendly name of the field | ||
*/ | ||
displayName?: string; | ||
/** | ||
* If string field should be treated as textarea (multiline input) | ||
*/ | ||
textarea?: boolean; | ||
/** | ||
* If string field should be treated as password | ||
*/ | ||
password?: boolean; | ||
/** | ||
* If the field should not be displayed. That field must have a default value | ||
*/ | ||
hidden?: boolean | ((obj: any) => boolean); | ||
/** | ||
* If the field should be a constant | ||
*/ | ||
constant?: any | ((obj: any) => any); | ||
/** | ||
* correction to field value. e.g: set default value for property that was missing before | ||
*/ | ||
correction?: any | ((obj: any) => any); | ||
|
||
/** | ||
* Documentation for the field | ||
*/ | ||
documentation?: string; | ||
/** | ||
* Name of custom editor component. See getEditorComponent() function from `[workspaceId]/destinations.txt` | ||
*/ | ||
editor?: string; | ||
/** | ||
* Properties of an editor component (not implemented yet, reserved for the future) | ||
*/ | ||
editorProps?: any; | ||
}; | ||
|
||
export type SchemaUI = Record<string, PropertyUI>; | ||
|
||
export const FunctionsConnectionOptions = z.object({ | ||
|
@@ -790,6 +748,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
title: "Intercom", | ||
tags: "Product Analytics", | ||
credentials: meta.IntercomDestinationCredentials, | ||
credentialsUi: meta.IntercomDestinationCredentialsUi, | ||
connectionOptions: CloudDestinationsConnectionOptions, | ||
description: ( | ||
<> | ||
|
@@ -815,6 +774,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
tags: "Product Analytics", | ||
connectionOptions: CloudDestinationsConnectionOptions, | ||
credentials: meta.JuneCredentials, | ||
credentialsUi: meta.JuneCredentialsUi, | ||
description: "June.so is a product analytics platform that provides insights into user behavior.", | ||
}, | ||
{ | ||
|
@@ -824,6 +784,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
tags: "Product Analytics", | ||
connectionOptions: CloudDestinationsConnectionOptions, | ||
credentials: meta.BrazeCredentials, | ||
credentialsUi: meta.BrazeCredentialsUi, | ||
description: "Braze is a customer engagement platform used by businesses for multichannel marketing.", | ||
}, | ||
{ | ||
|
@@ -844,6 +805,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
tags: "Product Analytics", | ||
connectionOptions: CloudDestinationsConnectionOptions, | ||
credentials: meta.Ga4Credentials, | ||
credentialsUi: meta.Ga4CredentialsUi, | ||
description: | ||
"Google Analytics 4 is a service offered by Google that reports website traffic data and marketing trends.", | ||
}, | ||
|
@@ -854,6 +816,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
tags: "Product Analytics", | ||
connectionOptions: CloudDestinationsConnectionOptions, | ||
credentials: meta.PosthogDestinationConfig, | ||
credentialsUi: meta.PosthogDestinationConfigUi, | ||
description: | ||
"Posthog is an open-source product analytics tool. Jitsu supports both self-hosted Posthog and Posthog Cloud.", | ||
}, | ||
|
@@ -864,6 +827,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
title: "Amplitude", | ||
tags: "Product Analytics", | ||
credentials: meta.AmplitudeDestinationConfig, | ||
credentialsUi: meta.AmplitudeDestinationConfigUi, | ||
description: "Amplitude is a product analytics platform", | ||
}, | ||
{ | ||
|
@@ -872,7 +836,8 @@ export const coreDestinations: DestinationType<any>[] = [ | |
connectionOptions: CloudDestinationsConnectionOptions, | ||
title: "Hubspot", | ||
tags: "CRM", | ||
credentials: HubspotCredentials, | ||
credentials: meta.HubspotCredentials, | ||
credentialsUi: meta.HubspotCredentialsConfigUi, | ||
description: "Hubspot is a CRM. Jitsu sends data to Hubspot API and updates contacts and company records", | ||
documentation: ( | ||
<> | ||
|
@@ -921,6 +886,7 @@ export const coreDestinations: DestinationType<any>[] = [ | |
title: "Segment", | ||
tags: "Special", | ||
credentials: meta.SegmentCredentials, | ||
credentialsUi: meta.SegmentCredentialsUi, | ||
description: ( | ||
<> | ||
Forward events for to Segment-compatible endpoint. It's useful if you want to use {branding.productName} for | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added these types for ease of reference. They look to be the only ones currently supported. I have not removed the acceptance of the
string
type since there is a runtime check for the editor type and I wanted to tread lightly with this change.