fix(#11575): filter pattern does not work if , in regex (#11849)

* fix(#11575): filter pattern does not work if `,` in regex

* chore: update the filter pattern component

* update cypress

* minor change

* chore: add `noImplicitAny` in tsconfig
This commit is contained in:
Sachin Chaurasiya 2023-06-02 00:55:59 +05:30 committed by GitHub
parent b7a1066f5b
commit 25370156c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 30 additions and 36 deletions

View File

@ -87,7 +87,7 @@ describe('BigQuery Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type(filterPattern);
.type(`${filterPattern}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -62,7 +62,7 @@ describe('Glue Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type(filterPattern);
.type(`${filterPattern}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -59,7 +59,7 @@ describe('Kafka Ingestion', () => {
.check();
cy.get('[data-testid="filter-pattern-includes-topic"]')
.should('be.visible')
.type(topicName);
.type(`${topicName}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -65,7 +65,7 @@ describe('Metabase Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-dashboard"]')
.scrollIntoView()
.should('be.visible')
.type(tableName);
.type(`${tableName}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -47,7 +47,7 @@ describe('MySQL Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type(Cypress.env('mysqlDatabaseSchema'));
.type(`${Cypress.env('mysqlDatabaseSchema')}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -75,7 +75,7 @@ describe('Postgres Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type(filterPattern);
.type(`${filterPattern}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -65,7 +65,7 @@ describe('RedShift Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type('dbt_jaffle');
.type('dbt_jaffle{enter}');
cy.get('[data-testid="toggle-button-include-views"]')
.should('be.visible')
.click();

View File

@ -56,7 +56,7 @@ describe('Snowflake Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type(schema);
.type(`${schema}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -63,7 +63,7 @@ describe('Superset Ingestion', () => {
cy.get('[data-testid="filter-pattern-includes-dashboard"]')
.scrollIntoView()
.should('be.visible')
.type(tableName);
.type(`${tableName}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -74,7 +74,7 @@ describe('Data Quality and Profiler should work properly', () => {
cy.get('[data-testid="filter-pattern-includes-schema"]')
.scrollIntoView()
.should('be.visible')
.type(Cypress.env('mysqlDatabaseSchema'));
.type(`${Cypress.env('mysqlDatabaseSchema')}{enter}`);
};
testServiceCreationAndIngestion({

View File

@ -11,7 +11,7 @@
* limitations under the License.
*/
import { Checkbox, Col, Input, Row, Space, Typography } from 'antd';
import { Checkbox, Col, Row, Select, Space, Typography } from 'antd';
import { t } from 'i18next';
import { capitalize } from 'lodash';
import React from 'react';
@ -31,20 +31,6 @@ const FilterPattern = ({
includePatternExtraInfo,
type,
}: FilterPatternProps) => {
const includeFilterChangeHandler = (
event: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>
) => {
const value = event.target.value ? event.target.value.split(',') : [];
getIncludeValue(value, type);
};
const excludeFilterChangeHandler = (
event: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>
) => {
const value = event.target.value ? event.target.value.split(',') : [];
getExcludeValue(value, type);
};
return (
<div data-testid="filter-pattern-container">
<Row>
@ -72,15 +58,16 @@ const FilterPattern = ({
<label className="d-flex flex-col">{t('label.include')}:</label>
</Space>
<Input
<Select
className="m-t-xss"
data-testid={`filter-pattern-includes-${type}`}
disabled={isDisabled}
placeholder={t('message.list-of-strings-regex-patterns-csv')}
type="text"
value={includePattern}
onChange={includeFilterChangeHandler}
mode="tags"
placeholder={t('message.filter-pattern-placeholder')}
value={includePattern ?? []}
onChange={(value) => getIncludeValue(value, type)}
/>
{includePatternExtraInfo && (
<Typography.Text
className="text-grey-muted m-t-xss m-b-xss"
@ -93,14 +80,14 @@ const FilterPattern = ({
<Space size={2}>
<label className="d-flex flex-col">{t('label.exclude')}:</label>
</Space>
<Input
<Select
className="m-t-xss"
data-testid={`filter-pattern-excludes-${type}`}
disabled={isDisabled}
placeholder={t('message.list-of-strings-regex-patterns-csv')}
type="text"
value={excludePattern}
onChange={excludeFilterChangeHandler}
mode="tags"
placeholder={t('message.filter-pattern-placeholder')}
value={excludePattern ?? []}
onChange={(value) => getExcludeValue(value, type)}
/>
</Field>
{showSeparator && getSeparator('')}

View File

@ -1131,6 +1131,7 @@
"field-verify-certs-description": "This indicates whether to verify certificates when using SSL connection to Elasticsearch. It's ignored by default and is set to true. Ensure that you send the certificates in the property `CA Certificates`.",
"filter-pattern-include-exclude-info": "Explicitly {{activity}} {{filterPattern}} by adding a list of comma-separated regex.",
"filter-pattern-info": "Choose to include or exclude {{filterPattern}} as part of the metadata ingestion.",
"filter-pattern-placeholder": "To add a filter pattern, simply type it in and press Enter",
"find-in-table": "Find in table",
"fosters-collaboration-among-producers-and-consumers": "Fosters collaboration among the producers and consumers of data.",
"get-started-with-open-metadata": "Get started with OpenMetadata",

View File

@ -1131,6 +1131,7 @@
"field-verify-certs-description": "Esto indica si debemos verificar los certificados al usar una conexión SSL con Elasticsearch. Por defecto se ignoran. Asegúrese de enviar los certificados en la propiedad Certificados CA.",
"filter-pattern-include-exclude-info": "Excluya o incluya explícitamente {{filterPattern}} mediante la adición de una lista de expresiones regulares separadas por comas.",
"filter-pattern-info": "Elija incluir o excluir {{filterPattern}} como parte de la ingestión de metadatos.",
"filter-pattern-placeholder": "To add a filter pattern, simply type it in and press Enter",
"find-in-table": "Buscar en la tabla",
"fosters-collaboration-among-producers-and-consumers": "Fomenta la colaboración entre los productores y consumidores de datos.",
"get-started-with-open-metadata": "Empezar con OpenMetadata",

View File

@ -1131,6 +1131,7 @@
"field-verify-certs-description": "Indique si les certificats doivent être vérifiés lors de l'utilisation du protocole SSL pour la connection à ElasticSearch. Ignoré par défault. Si \"true\" est sélectionné, la certificat doit être passé dans `CA Certificates`.",
"filter-pattern-include-exclude-info": "Explicitly {{activity}} {{filterPattern}} by adding a list of comma-separated regex.",
"filter-pattern-info": "Choisir d'inclure ou d'exclure {{filterPattern}} en tant que partie de l'ingestion de métadonnées.",
"filter-pattern-placeholder": "To add a filter pattern, simply type it in and press Enter",
"find-in-table": "Trouver dans la table",
"fosters-collaboration-among-producers-and-consumers": "Encouragez la collaborations entre les consommateurs et producteurs de données",
"get-started-with-open-metadata": "Commencez votre Journée avec OpenMetadata",

View File

@ -1131,6 +1131,7 @@
"field-verify-certs-description": "This indicates whether to verify certificates when using SSL connection to Elasticsearch. It's ignored by default and is set to true. Ensure that you send the certificates in the property `CA Certificates`.",
"filter-pattern-include-exclude-info": "Explicitly {{activity}} {{filterPattern}} by adding a list of comma-separated regex.",
"filter-pattern-info": "メタデータ取り込み時に{{filterPattern}}を含めるか除外するか選択する。",
"filter-pattern-placeholder": "To add a filter pattern, simply type it in and press Enter",
"find-in-table": "テーブルで探す",
"fosters-collaboration-among-producers-and-consumers": "Fosters collaboration among the producers and consumers of data.",
"get-started-with-open-metadata": "Get started with OpenMetadata",

View File

@ -1131,6 +1131,7 @@
"field-verify-certs-description": "Isso indica se os certificados devem ser verificados ao usar a conexão SSL com o Elasticsearch. Por padrão, é ignorado e definido como verdadeiro. Certifique-se de enviar os certificados na propriedade 'Certificados CA'.",
"filter-pattern-include-exclude-info": "{{activity}} explicitamente {{filterPattern}} adicionando uma lista de regex separadas por vírgula.",
"filter-pattern-info": "Escolha incluir ou excluir {{filterPattern}} como parte da ingestão de metadados.",
"filter-pattern-placeholder": "To add a filter pattern, simply type it in and press Enter",
"find-in-table": "Encontrar na tabela",
"fosters-collaboration-among-producers-and-consumers": "Promove a colaboração entre produtores e consumidores de dados.",
"get-started-with-open-metadata": "Comece com o OpenMetadata",

View File

@ -1131,6 +1131,7 @@
"field-verify-certs-description": "指示在使用 SSL 连接到 Elasticsearch 时是否验证证书,默认情况下忽略。如果设置为 true请确保将证书设置到“CA 证书”属性中",
"filter-pattern-include-exclude-info": "通过添加逗号分隔的正则表达式列表明确{{activity}} {{filterPattern}}",
"filter-pattern-info": "选择包含或排除{{filterPattern}}作为元数据提取的一部分",
"filter-pattern-placeholder": "To add a filter pattern, simply type it in and press Enter",
"find-in-table": "在数据表中查找",
"fosters-collaboration-among-producers-and-consumers": "促进数据生产者和使用者之间的合作",
"get-started-with-open-metadata": "开始使用 OpenMetadata",

View File

@ -30,7 +30,8 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"allowUnreachableCode": false,
"skipLibCheck": true
"skipLibCheck": true,
"noImplicitAny": true
},
"include": ["src"]
}