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

feat(data-warehouse): Added vitally Source #24806

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Binary file added frontend/public/services/vitally.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions frontend/src/scenes/data-warehouse/new/sourceWizardLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,45 @@ export const SOURCE_DETAILS: Record<ExternalDataSourceType, SourceConfig> = {
],
caption: 'Select an existing Salesforce account to link to PostHog or create a new connection',
},
Vitally: {
name: 'Vitally',
fields: [
{
name: 'secret_token',
label: 'Secret token',
type: 'text',
required: true,
placeholder: 'sk_live_...',
},
{
type: 'select',
name: 'region',
label: 'Vitally region',
required: true,
defaultValue: 'EU',
options: [
{
label: 'EU',
value: 'EU',
},
{
label: 'US',
value: 'US',
fields: [
{
name: 'subdomain',
label: 'Vitally subdomain',
type: 'text',
required: true,
placeholder: '',
},
],
},
],
},
],
caption: '',
},
}

export const buildKeaFormDefaultFromSourceDetails = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import IconSalesforce from 'public/services/salesforce.png'
import IconSnowflake from 'public/services/snowflake.png'
import IconMSSQL from 'public/services/sql-azure.png'
import IconStripe from 'public/services/stripe.png'
import IconVitally from 'public/services/vitally.png'
import IconZendesk from 'public/services/zendesk.png'
import { urls } from 'scenes/urls'

Expand Down Expand Up @@ -189,6 +190,7 @@ export function RenderDataWarehouseSourceIcon({
azure: Iconazure,
Salesforce: IconSalesforce,
MSSQL: IconMSSQL,
Vitally: IconVitally,
}[type]

return (
Expand All @@ -203,7 +205,7 @@ export function RenderDataWarehouseSourceIcon({
}
>
<Link to={getDataWarehouseSourceUrl(type)}>
<img src={icon} alt={type} height={sizePx} width={sizePx} className="rounded" />
<img src={icon} alt={type} height={sizePx} width={sizePx} className="rounded object-contain" />
</Link>
</Tooltip>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3861,6 +3861,7 @@ export const externalDataSources = [
'Zendesk',
'Snowflake',
'Salesforce',
'Vitally',
] as const

export type ExternalDataSourceType = (typeof externalDataSources)[number]
Expand Down
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name
ee: 0016_rolemembership_organization_member
otp_static: 0002_throttling
otp_totp: 0002_auto_20190420_0723
posthog: 0465_datawarehouse_stripe_account
posthog: 0466_alter_externaldatasource_source_type
sessions: 0001_initial
social_django: 0010_uid_db_index
two_factor: 0007_auto_20201201_1019
9 changes: 9 additions & 0 deletions mypy-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ posthog/temporal/data_imports/pipelines/rest_source/__init__.py:0: error: Argume
posthog/temporal/data_imports/pipelines/rest_source/__init__.py:0: error: Incompatible default for argument "resolved_param" (default has type "ResolvedParam | None", argument has type "ResolvedParam") [assignment]
posthog/temporal/data_imports/pipelines/rest_source/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/rest_source/__init__.py:0: error: Argument "module" to "SourceInfo" has incompatible type Module | None; expected Module [arg-type]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/temporal/data_imports/pipelines/vitally/__init__.py:0: error: Unused "type: ignore" comment [unused-ignore]
posthog/utils.py:0: error: No overload variant of "asdict" matches argument type "type[DataclassInstance]" [call-overload]
posthog/utils.py:0: note: Possible overload variants:
posthog/utils.py:0: note: def asdict(obj: DataclassInstance) -> dict[str, Any]
Expand Down
30 changes: 30 additions & 0 deletions posthog/migrations/0466_alter_externaldatasource_source_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 4.2.15 on 2024-09-05 10:44

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("posthog", "0465_datawarehouse_stripe_account"),
]

operations = [
migrations.AlterField(
model_name="externaldatasource",
name="source_type",
field=models.CharField(
choices=[
("Stripe", "Stripe"),
("Hubspot", "Hubspot"),
("Postgres", "Postgres"),
("Zendesk", "Zendesk"),
("Snowflake", "Snowflake"),
("Salesforce", "Salesforce"),
("MySQL", "MySQL"),
("MSSQL", "MSSQL"),
("Vitally", "Vitally"),
],
max_length=128,
),
),
]
8 changes: 8 additions & 0 deletions posthog/temporal/data_imports/pipelines/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
INCREMENTAL_ENDPOINTS as SALESFORCE_INCREMENTAL_ENDPOINTS,
INCREMENTAL_FIELDS as SALESFORCE_INCREMENTAL_FIELDS,
)
from posthog.temporal.data_imports.pipelines.vitally.settings import (
ENDPOINTS as VITALLY_ENDPOINTS,
INCREMENTAL_ENDPOINTS as VITALLY_INCREMENTAL_ENDPOINTS,
INCREMENTAL_FIELDS as VITALLY_INCREMENTAL_FIELDS,
)

PIPELINE_TYPE_SCHEMA_DEFAULT_MAPPING = {
ExternalDataSource.Type.STRIPE: STRIPE_ENDPOINTS,
Expand All @@ -29,6 +34,7 @@
ExternalDataSource.Type.SALESFORCE: SALESFORCE_ENDPOINTS,
ExternalDataSource.Type.MYSQL: (),
ExternalDataSource.Type.MSSQL: (),
ExternalDataSource.Type.VITALLY: VITALLY_ENDPOINTS,
}

PIPELINE_TYPE_INCREMENTAL_ENDPOINTS_MAPPING = {
Expand All @@ -40,6 +46,7 @@
ExternalDataSource.Type.SALESFORCE: SALESFORCE_INCREMENTAL_ENDPOINTS,
ExternalDataSource.Type.MYSQL: (),
ExternalDataSource.Type.MSSQL: (),
ExternalDataSource.Type.VITALLY: VITALLY_INCREMENTAL_ENDPOINTS,
}

PIPELINE_TYPE_INCREMENTAL_FIELDS_MAPPING: dict[ExternalDataSource.Type, dict[str, list[IncrementalField]]] = {
Expand All @@ -51,4 +58,5 @@
ExternalDataSource.Type.SALESFORCE: SALESFORCE_INCREMENTAL_FIELDS,
ExternalDataSource.Type.MYSQL: {},
ExternalDataSource.Type.MSSQL: {},
ExternalDataSource.Type.VITALLY: VITALLY_INCREMENTAL_FIELDS,
}
Loading
Loading