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

refactor(ui): Making improvements to UI ingestion forms, adding MySQL, Trino, Presto, MSSQL, MariaDB forms #6607

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export const LookerWarning = ({ type }: Props) => {
if (type === LOOKER) {
link = (
<a href={LOOKML_DOC_LINK} target="_blank" rel="noopener noreferrer">
DataHub lookml module
DataHub LookML Ingestion Source
</a>
);
} else if (type === LOOK_ML) {
link = (
<a href={LOOKER_DOC_LINK} target="_blank" rel="noopener noreferrer">
DataHub looker module
DataHub Looker Ingestion Source
</a>
);
}
Expand All @@ -32,8 +32,8 @@ export const LookerWarning = ({ type }: Props) => {
banner
message={
<>
To get complete Looker metadata integration (including Looker views and lineage to the underlying
warehouse tables), you must <b>also</b> use the {link}.
To complete the Looker integration (including Looker views and lineage to the underlying warehouse
tables), you must <b>also</b> use the {link}.
</>
}
/>
Expand Down
113 changes: 14 additions & 99 deletions datahub-web-react/src/app/ingest/source/builder/RecipeForm/bigquery.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { RecipeField, FieldType, setListValuesOnRecipe } from './common';
import { RecipeField, FieldType } from './common';

export const BIGQUERY_PROJECT_ID: RecipeField = {
name: 'project_id',
label: 'BigQuery Project ID',
label: 'Project ID',
tooltip: 'Project ID where you have rights to run queries and create tables.',
placeholder: 'my-project-123',
type: FieldType.TEXT,
fieldPath: 'source.config.project_id',
rules: null,
required: true,
};

export const BIGQUERY_CREDENTIAL_PROJECT_ID: RecipeField = {
name: 'credential.project_id',
label: 'Credentials Project ID',
tooltip: 'Project id to set the credentials.',
tooltip: "The Project ID, which can be found in your service account's JSON Key (project_id)",
placeholder: 'my-project-123',
type: FieldType.TEXT,
fieldPath: 'source.config.credential.project_id',
Expand All @@ -23,129 +24,43 @@ export const BIGQUERY_CREDENTIAL_PROJECT_ID: RecipeField = {
export const BIGQUERY_PRIVATE_KEY_ID: RecipeField = {
name: 'credential.private_key_id',
label: 'Private Key Id',
tooltip: 'Private key id.',
placeholder: 'BQ_PRIVATE_KEY_ID',
tooltip: "The Private Key id, which can be found in your service account's JSON Key (private_key_id)",
type: FieldType.SECRET,
fieldPath: 'source.config.credential.private_key_id',
placeholder: 'd0121d0000882411234e11166c6aaa23ed5d74e0',
rules: null,
required: true,
};

export const BIGQUERY_PRIVATE_KEY: RecipeField = {
name: 'credential.private_key',
label: 'Private Key',
placeholder: 'BQ_PRIVATE_KEY',
tooltip: 'Private key in a form of "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n".',
tooltip: "The Private key, which can be found in your service account's JSON Key (private_key).",
placeholder: '-----BEGIN PRIVATE KEY-----....\n-----END PRIVATE KEY-----',
type: FieldType.SECRET,
fieldPath: 'source.config.credential.private_key',
rules: null,
required: true,
};

export const BIGQUERY_CLIENT_EMAIL: RecipeField = {
name: 'credential.client_email',
label: 'Client Email',
tooltip: 'Client email.',
tooltip: "The Client Email, which can be found in your service account's JSON Key (client_email).",
placeholder: '[email protected]',
type: FieldType.TEXT,
fieldPath: 'source.config.credential.client_email',
rules: null,
required: true,
};

export const BIGQUERY_CLIENT_ID: RecipeField = {
name: 'credential.client_id',
label: 'Client ID',
tooltip: 'Client ID.',
tooltip: "The Client ID, which can be found in your service account's JSON Key (client_id).",
placeholder: '123456789098765432101',
type: FieldType.TEXT,
fieldPath: 'source.config.credential.client_id',
rules: null,
};

const schemaAllowFieldPath = 'source.config.schema_pattern.allow';
export const BIGQUERY_SCHEMA_ALLOW: RecipeField = {
name: 'schema_pattern.allow',
label: 'Allow Patterns',
tooltip: 'Use regex here.',
placeholder: '^my_schema$',
type: FieldType.LIST,
buttonLabel: 'Add pattern',
fieldPath: schemaAllowFieldPath,
rules: null,
section: 'Schemas',
setValueOnRecipeOverride: (recipe: any, values: string[]) =>
setListValuesOnRecipe(recipe, values, schemaAllowFieldPath),
};

const schemaDenyFieldPath = 'source.config.schema_pattern.deny';
export const BIGQUERY_SCHEMA_DENY: RecipeField = {
name: 'schema_pattern.deny',
label: 'Deny Patterns',
tooltip: 'Use regex here.',
placeholder: '^my_schema$',
type: FieldType.LIST,
buttonLabel: 'Add pattern',
fieldPath: schemaDenyFieldPath,
rules: null,
section: 'Schemas',
setValueOnRecipeOverride: (recipe: any, values: string[]) =>
setListValuesOnRecipe(recipe, values, schemaDenyFieldPath),
};

const tableAllowFieldPath = 'source.config.table_pattern.allow';
export const BIGQUERY_TABLE_ALLOW: RecipeField = {
name: 'table_pattern.allow',
label: 'Allow Patterns',
tooltip: 'Use regex here.',
placeholder: '^my_schema\\.table_name$',
type: FieldType.LIST,
buttonLabel: 'Add pattern',
fieldPath: tableAllowFieldPath,
rules: null,
section: 'Tables',
setValueOnRecipeOverride: (recipe: any, values: string[]) =>
setListValuesOnRecipe(recipe, values, tableAllowFieldPath),
};

const tableDenyFieldPath = 'source.config.table_pattern.deny';
export const BIGQUERY_TABLE_DENY: RecipeField = {
name: 'table_pattern.deny',
label: 'Deny Patterns',
tooltip: 'Use regex here.',
placeholder: '^my_schema\\.table_name$',
type: FieldType.LIST,
buttonLabel: 'Add pattern',
fieldPath: tableDenyFieldPath,
rules: null,
section: 'Tables',
setValueOnRecipeOverride: (recipe: any, values: string[]) =>
setListValuesOnRecipe(recipe, values, tableDenyFieldPath),
};

const viewAllowFieldPath = 'source.config.view_pattern.allow';
export const BIGQUERY_VIEW_ALLOW: RecipeField = {
name: 'view_pattern.allow',
label: 'Allow Patterns',
tooltip: 'Use regex here.',
placeholder: '^my_schema\\.view_name$',
type: FieldType.LIST,
buttonLabel: 'Add pattern',
fieldPath: viewAllowFieldPath,
rules: null,
section: 'Views',
setValueOnRecipeOverride: (recipe: any, values: string[]) =>
setListValuesOnRecipe(recipe, values, viewAllowFieldPath),
};

const viewDenyFieldPath = 'source.config.view_pattern.deny';
export const BIGQUERY_VIEW_DENY: RecipeField = {
name: 'view_pattern.deny',
label: 'Deny Patterns',
tooltip: 'Use regex here.',
placeholder: '^my_schema\\.view_name$',
type: FieldType.LIST,
buttonLabel: 'Add pattern',
fieldPath: viewDenyFieldPath,
rules: null,
section: 'Views',
setValueOnRecipeOverride: (recipe: any, values: string[]) =>
setListValuesOnRecipe(recipe, values, viewDenyFieldPath),
required: true,
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { FieldType, RecipeField, setListValuesOnRecipe } from './common';
export const BIGQUERY_BETA_PROJECT_ID: RecipeField = {
name: 'credential.project_id',
label: 'Project ID',
tooltip: 'Project id to set the credentials.',
tooltip: "The Project ID, which can be found in your service account's JSON Key (project_id)",
placeholder: 'my-project-123',
type: FieldType.TEXT,
fieldPath: 'source.config.credential.project_id',
rules: null,
required: true,
};

const projectIdAllowFieldPath = 'source.config.project_id_pattern.allow';
Expand Down
Loading