From 8a5b54aebbb7ab4ea1b5a9e94be55b8b9e59e10f Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:37:23 +0530 Subject: [PATCH] feat(ui): support debug option for dbt config (#10538) * feat(ui): support debug option for dbt config * fix tests and address comments --- .../DBTCloudConfig.test.tsx | 3 +++ .../DBTConfigFormBuilder/DBTCloudConfig.tsx | 6 +++++ .../DBTCommonFields.component.tsx | 27 ++++++++++++++++++- .../DBTCommonFields.test.tsx | 4 +++ .../DBTConfigFormBuilder.tsx | 15 +++++++++++ .../DBTGCSConfig.test.tsx | 10 +++++++ .../DBTConfigFormBuilder/DBTGCSConfig.tsx | 6 +++++ .../DBTHttpConfig.test.tsx | 3 +++ .../DBTConfigFormBuilder/DBTHttpConfig.tsx | 6 +++++ .../DBTLocalConfig.test.tsx | 3 +++ .../DBTConfigFormBuilder/DBTLocalConfig.tsx | 6 +++++ .../DBTConfigFormBuilder/DBTS3Config.test.tsx | 3 +++ .../DBTConfigFormBuilder/DBTS3Config.tsx | 6 +++++ 13 files changed, 97 insertions(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.test.tsx index 8a4dd92a3ab..5fc9e60829d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.test.tsx @@ -24,6 +24,7 @@ const mockDbtCloudProjectId = jest.fn(); const mockDbtCloudJobId = jest.fn(); const mockUpdateDBTClassification = jest.fn(); const mockUpdateDBTCloudUrl = jest.fn(); +const mockHandleEnableDebugLogCheck = jest.fn(); const mockProps = { dbtCloudAccountId: '', @@ -41,6 +42,8 @@ const mockProps = { handleDbtCloudJobId: mockDbtCloudJobId, handleDbtCloudUrl: mockUpdateDBTCloudUrl, handleUpdateDBTClassification: mockUpdateDBTClassification, + enableDebugLog: false, + handleEnableDebugLogCheck: mockHandleEnableDebugLogCheck, }; jest.mock('./DBTCommonFields.component', () => diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.tsx index 3e3fd8639c8..82d62f051b5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCloudConfig.tsx @@ -37,6 +37,8 @@ interface Props extends DBTFormCommonProps, DbtConfigCloud { handleDbtCloudJobId: (value: string) => void; handleUpdateDBTClassification: (value: string) => void; handleDbtCloudUrl: (value: string) => void; + enableDebugLog: boolean; + handleEnableDebugLogCheck: (value: boolean) => void; } export const DBTCloudConfig: FunctionComponent = ({ @@ -58,6 +60,8 @@ export const DBTCloudConfig: FunctionComponent = ({ dbtClassificationName, handleDbtCloudUrl, handleUpdateDBTClassification, + enableDebugLog, + handleEnableDebugLogCheck, }: Props) => { const [errors, setErrors] = useState(); @@ -185,6 +189,8 @@ export const DBTCloudConfig: FunctionComponent = ({ dbtClassificationName={dbtClassificationName} dbtUpdateDescriptions={dbtUpdateDescriptions} descriptionId="cloud-update-description" + enableDebugLog={enableDebugLog} + handleEnableDebugLogCheck={handleEnableDebugLogCheck} handleUpdateDBTClassification={handleUpdateDBTClassification} handleUpdateDescriptions={handleUpdateDescriptions} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCommonFields.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCommonFields.component.tsx index d1020340e28..cc3de460923 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCommonFields.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DBTConfigFormBuilder/DBTCommonFields.component.tsx @@ -14,6 +14,7 @@ import { Input, Space, Switch, Typography } from 'antd'; import React, { Fragment } from 'react'; import { useTranslation } from 'react-i18next'; +import { getSeparator } from 'utils/CommonUtils'; import { Field } from '../../Field/Field'; interface Props { @@ -22,6 +23,8 @@ interface Props { handleUpdateDBTClassification: (value: string) => void; dbtUpdateDescriptions: boolean; handleUpdateDescriptions: (value: boolean) => void; + enableDebugLog: boolean; + handleEnableDebugLogCheck: (value: boolean) => void; } function DBTCommonFields({ @@ -30,15 +33,37 @@ function DBTCommonFields({ dbtClassificationName, handleUpdateDescriptions, handleUpdateDBTClassification, + handleEnableDebugLogCheck, + enableDebugLog, }: Props) { const { t } = useTranslation(); return ( + + + + + + + {t('message.enable-debug-logging')} + + {getSeparator('')} + +