From 631088dae7f10e43b380a93aaa95fb01c0cb696a Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Mon, 5 Feb 2024 19:36:08 +0530 Subject: [PATCH 1/6] fix initial value cron value in applications --- .../AppSchedule/AppSchedule.component.tsx | 15 +++++-- .../pages/AppInstall/AppInstall.component.tsx | 39 +++++++++++-------- .../main/resources/ui/src/utils/CronUtils.ts | 29 ++++++++++++++ 3 files changed, 62 insertions(+), 21 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx index f0dede491d6d..3ecb5e554529 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx @@ -24,9 +24,11 @@ import { AppScheduleClass, AppType, } from '../../../generated/entity/applications/app'; -import { PipelineType } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; import { getIngestionPipelineByFqn } from '../../../rest/ingestionPipelineAPI'; -import { getIngestionFrequency } from '../../../utils/CommonUtils'; +import { + getCronExpression, + getCronInitialValue, +} from '../../../utils/CronUtils'; import TestSuiteScheduler from '../../AddDataQualityTest/components/TestSuiteScheduler'; import Loader from '../../Loader/Loader'; import AppRunsHistory from '../AppRunsHistory/AppRunsHistory.component'; @@ -45,6 +47,11 @@ const AppSchedule = ({ const [isPipelineDeployed, setIsPipelineDeployed] = useState(false); const [isLoading, setIsLoading] = useState(true); + const initialValue = useMemo( + () => getCronInitialValue(appData.appType, appData.name), + [appData.name, appData.appType] + ); + const fetchPipelineDetails = useCallback(async () => { setIsLoading(true); try { @@ -89,7 +96,7 @@ const AppSchedule = ({ }; const onDialogSave = (cron: string) => { - onSave(cron); + onSave(getCronExpression(cron, initialValue)); setShowModal(false); }; @@ -231,7 +238,7 @@ const AppSchedule = ({ okText: t('label.save'), }} includePeriodOptions={initialOptions} - initialData={getIngestionFrequency(PipelineType.Application)} + initialData={initialValue} onCancel={onDialogCancel} onSubmit={onDialogSave} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx index 2f1a62f5ff0e..2cc6fe8987e6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx @@ -38,14 +38,11 @@ import { ScheduleTimeline, } from '../../generated/entity/applications/createAppRequest'; import { AppMarketPlaceDefinition } from '../../generated/entity/applications/marketplace/appMarketPlaceDefinition'; -import { PipelineType } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline'; import { useFqn } from '../../hooks/useFqn'; import { installApplication } from '../../rest/applicationAPI'; import { getMarketPlaceApplicationByFqn } from '../../rest/applicationMarketPlaceAPI'; -import { - getEntityMissingError, - getIngestionFrequency, -} from '../../utils/CommonUtils'; +import { getEntityMissingError } from '../../utils/CommonUtils'; +import { getCronExpression, getCronInitialValue } from '../../utils/CronUtils'; import { formatFormDataForSubmit } from '../../utils/JSONSchemaFormUtils'; import { getMarketPlaceAppDetailsPath, @@ -72,6 +69,24 @@ const AppInstall = () => { [appData] ); + const { initialOptions, initialValue } = useMemo(() => { + let initialOptions; + + if (appData?.name === 'DataInsightsReportApplication') { + initialOptions = ['Week']; + } else if (appData?.appType === AppType.External) { + initialOptions = ['Day']; + } + + return { + initialOptions, + initialValue: getCronInitialValue( + appData?.appType ?? AppType.Internal, + appData?.name ?? '' + ), + }; + }, [appData?.name, appData?.appType]); + const fetchAppDetails = useCallback(async () => { setIsLoading(true); try { @@ -104,7 +119,7 @@ const AppInstall = () => { appConfiguration: appConfiguration ?? appData?.appConfiguration, appSchedule: { scheduleType: ScheduleTimeline.Custom, - cronExpression: repeatFrequency, + cronExpression: getCronExpression(repeatFrequency, initialValue), }, name: fqn, description: appData?.description, @@ -126,16 +141,6 @@ const AppInstall = () => { setActiveServiceStep(3); }; - const initialOptions = useMemo(() => { - if (appData?.name === 'DataInsightsReportApplication') { - return ['Week']; - } else if (appData?.appType === AppType.External) { - return ['Day']; - } - - return undefined; - }, [appData?.name, appData?.appType]); - const RenderSelectedTab = useCallback(() => { if (!appData || !jsonSchema) { return <>; @@ -182,7 +187,7 @@ const AppInstall = () => { setActiveServiceStep(appData.allowConfiguration ? 2 : 1) } diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts index 5c2179ab9525..32530442c7af 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts @@ -31,6 +31,7 @@ import { StateValue, ToDisplay, } from '../components/common/CronEditor/CronEditor.interface'; +import { AppType } from '../generated/entity/applications/app'; export const getQuartzCronExpression = (state: StateValue) => { const { @@ -172,3 +173,31 @@ export const getStateValue = (valueStr: string) => { return stateVal; }; + +export const getCronExpression = ( + repeatFrequency: string, + initialValue: string +) => { + if (repeatFrequency === initialValue) { + return getQuartzCronExpression(getStateValue(repeatFrequency)) ?? ''; + } + + return repeatFrequency; +}; + +export const getCronInitialValue = (appType: AppType, appName: string) => { + const value = { + min: 0, + hour: 0, + }; + + let initialValue = getHourCron(value); + + if (appName === 'DataInsightsReportApplication') { + initialValue = getWeekCron({ ...value, dow: 0 }); + } else if (appType === AppType.External) { + initialValue = getDayCron(value); + } + + return initialValue; +}; From 5802e61c010722e20a9e0e7dba4a020c1762e345 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 6 Feb 2024 13:42:59 +0530 Subject: [PATCH 2/6] added unit test for cron utils functions --- .../resources/ui/src/utils/CronUtils.test.ts | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts index 46eb522da20e..b990c7a6c5f0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts @@ -11,7 +11,12 @@ * limitations under the License. */ -import { getQuartzCronExpression } from './CronUtils'; +import { AppType } from '../generated/entity/applications/app'; +import { + getCronExpression, + getCronInitialValue, + getQuartzCronExpression, +} from './CronUtils'; describe('getQuartzCronExpression function', () => { it('should generate cron expression for every minute', () => { @@ -94,3 +99,55 @@ describe('getQuartzCronExpression function', () => { expect(result).toEqual('0 30 10 ? * 4'); }); }); + +describe('getCronExpression function', () => { + const cronExpression1 = '0 0 * * *'; + const cronExpression2 = '0 0 0 * * ?'; + + it('should generate different cron expression if repeatFrequency and initialValue is same', () => { + const result = getCronExpression(cronExpression1, cronExpression1); + + expect(result).toEqual(cronExpression2); + }); + + it('should not generate same cron expression if repeatFrequency and initialValue is same', () => { + const result = getCronExpression(cronExpression1, cronExpression1); + + expect(result).not.toEqual(cronExpression1); + }); + + it('should get same repeatFrequency cron if repeatFrequency is different', () => { + const result = getCronExpression(cronExpression2, cronExpression1); + + expect(result).toEqual(cronExpression2); + }); +}); + +describe('getCronInitialValue function', () => { + it('should generate hour cron expression if appType is internal and appName is not DataInsightsReportApplication', () => { + const result = getCronInitialValue( + AppType.Internal, + 'SearchIndexingApplication' + ); + + expect(result).toEqual('0 * * * *'); + }); + + it('should generate week cron expression if appName is DataInsightsReportApplication', () => { + const result = getCronInitialValue( + AppType.Internal, + 'DataInsightsReportApplication' + ); + + expect(result).toEqual('0 0 * * 0'); + }); + + it('should generate day cron expression if appType is external', () => { + const result = getCronInitialValue( + AppType.External, + 'DataInsightsApplication' + ); + + expect(result).toEqual('0 0 * * *'); + }); +}); From ca36449c060f47e61c468ce510785f211d78144b Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Wed, 7 Feb 2024 19:04:00 +0530 Subject: [PATCH 3/6] remove quartz cron for applicaion from ui install and edit --- .../components/TestSuiteScheduler.tsx | 16 +++++----- .../AppSchedule/AppSchedule.component.tsx | 20 +++---------- .../pages/AppInstall/AppInstall.component.tsx | 5 ++-- .../resources/ui/src/utils/CronUtils.test.ts | 29 +------------------ .../main/resources/ui/src/utils/CronUtils.ts | 11 ------- 5 files changed, 16 insertions(+), 65 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx index 15b791d0a109..4ebd5286a14c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ -import { Button, Col, Row, Space } from 'antd'; +import { Button, Col, Form, Row, Space } from 'antd'; import { t } from 'i18next'; import React, { useEffect, useState } from 'react'; import CronEditor from '../../common/CronEditor/CronEditor'; @@ -38,12 +38,14 @@ const TestSuiteScheduler: React.FC = ({ return ( - setRepeatFrequency(value)} - /> +
+ setRepeatFrequency(value)} + /> + diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx index 3ecb5e554529..2d3365f3c5c6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx @@ -25,10 +25,6 @@ import { AppType, } from '../../../generated/entity/applications/app'; import { getIngestionPipelineByFqn } from '../../../rest/ingestionPipelineAPI'; -import { - getCronExpression, - getCronInitialValue, -} from '../../../utils/CronUtils'; import TestSuiteScheduler from '../../AddDataQualityTest/components/TestSuiteScheduler'; import Loader from '../../Loader/Loader'; import AppRunsHistory from '../AppRunsHistory/AppRunsHistory.component'; @@ -47,11 +43,6 @@ const AppSchedule = ({ const [isPipelineDeployed, setIsPipelineDeployed] = useState(false); const [isLoading, setIsLoading] = useState(true); - const initialValue = useMemo( - () => getCronInitialValue(appData.appType, appData.name), - [appData.name, appData.appType] - ); - const fetchPipelineDetails = useCallback(async () => { setIsLoading(true); try { @@ -81,10 +72,6 @@ const AppSchedule = ({ return cronstrue.toString(cronExp, { throwExceptionOnParseError: false, - // Quartz cron format accepts 1-7 or SUN-SAT so need to increment index by 1 - // Ref: https://www.quartz-scheduler.org/api/2.1.7/org/quartz/CronExpression.html - dayOfWeekStartIndexZero: false, - monthStartIndexZero: false, }); } @@ -96,7 +83,7 @@ const AppSchedule = ({ }; const onDialogSave = (cron: string) => { - onSave(getCronExpression(cron, initialValue)); + onSave(cron); setShowModal(false); }; @@ -232,13 +219,14 @@ const AppSchedule = ({ open={showModal} title={t('label.update-entity', { entity: t('label.schedule') })}> diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx index 2cc6fe8987e6..2ad2f5134fb5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AppInstall/AppInstall.component.tsx @@ -42,7 +42,7 @@ import { useFqn } from '../../hooks/useFqn'; import { installApplication } from '../../rest/applicationAPI'; import { getMarketPlaceApplicationByFqn } from '../../rest/applicationMarketPlaceAPI'; import { getEntityMissingError } from '../../utils/CommonUtils'; -import { getCronExpression, getCronInitialValue } from '../../utils/CronUtils'; +import { getCronInitialValue } from '../../utils/CronUtils'; import { formatFormDataForSubmit } from '../../utils/JSONSchemaFormUtils'; import { getMarketPlaceAppDetailsPath, @@ -119,7 +119,7 @@ const AppInstall = () => { appConfiguration: appConfiguration ?? appData?.appConfiguration, appSchedule: { scheduleType: ScheduleTimeline.Custom, - cronExpression: getCronExpression(repeatFrequency, initialValue), + cronExpression: repeatFrequency, }, name: fqn, description: appData?.description, @@ -185,7 +185,6 @@ const AppInstall = () => {
{t('label.schedule')} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts index b990c7a6c5f0..dce5f0c71d03 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.test.ts @@ -12,11 +12,7 @@ */ import { AppType } from '../generated/entity/applications/app'; -import { - getCronExpression, - getCronInitialValue, - getQuartzCronExpression, -} from './CronUtils'; +import { getCronInitialValue, getQuartzCronExpression } from './CronUtils'; describe('getQuartzCronExpression function', () => { it('should generate cron expression for every minute', () => { @@ -100,29 +96,6 @@ describe('getQuartzCronExpression function', () => { }); }); -describe('getCronExpression function', () => { - const cronExpression1 = '0 0 * * *'; - const cronExpression2 = '0 0 0 * * ?'; - - it('should generate different cron expression if repeatFrequency and initialValue is same', () => { - const result = getCronExpression(cronExpression1, cronExpression1); - - expect(result).toEqual(cronExpression2); - }); - - it('should not generate same cron expression if repeatFrequency and initialValue is same', () => { - const result = getCronExpression(cronExpression1, cronExpression1); - - expect(result).not.toEqual(cronExpression1); - }); - - it('should get same repeatFrequency cron if repeatFrequency is different', () => { - const result = getCronExpression(cronExpression2, cronExpression1); - - expect(result).toEqual(cronExpression2); - }); -}); - describe('getCronInitialValue function', () => { it('should generate hour cron expression if appType is internal and appName is not DataInsightsReportApplication', () => { const result = getCronInitialValue( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts index 32530442c7af..2d852e80640a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CronUtils.ts @@ -174,17 +174,6 @@ export const getStateValue = (valueStr: string) => { return stateVal; }; -export const getCronExpression = ( - repeatFrequency: string, - initialValue: string -) => { - if (repeatFrequency === initialValue) { - return getQuartzCronExpression(getStateValue(repeatFrequency)) ?? ''; - } - - return repeatFrequency; -}; - export const getCronInitialValue = (appType: AppType, appName: string) => { const value = { min: 0, From 18c0aed241349e744580e43b5d0bea453820f4cd Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Thu, 8 Feb 2024 10:50:12 +0530 Subject: [PATCH 4/6] changes as per comments and fix unit test --- .../AddDataQualityTest/AddDataQualityTest.interface.ts | 1 - .../AddDataQualityTest/components/TestSuiteScheduler.tsx | 2 -- .../Applications/AppDetails/AppDetails.component.tsx | 1 - .../components/Applications/AppSchedule/AppSchedule.test.tsx | 5 ----- .../Applications/AppSchedule/AppScheduleProps.interface.ts | 1 - 5 files changed, 10 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTest.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTest.interface.ts index ea256c841d31..b041267bb8ce 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTest.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTest.interface.ts @@ -45,7 +45,6 @@ export interface TestSuiteSchedulerProps { initialData?: string; onSubmit: (repeatFrequency: string) => void; onCancel: () => void; - isQuartzCron?: boolean; buttonProps?: { okText: string; cancelText: string; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx index 4ebd5286a14c..47a40a071b3d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestSuiteScheduler.tsx @@ -22,7 +22,6 @@ const TestSuiteScheduler: React.FC = ({ buttonProps, onCancel, onSubmit, - isQuartzCron = false, includePeriodOptions, }) => { const [repeatFrequency, setRepeatFrequency] = useState( @@ -41,7 +40,6 @@ const TestSuiteScheduler: React.FC = ({
setRepeatFrequency(value)} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx index e73d72732c8f..5415ede6af6f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx @@ -348,7 +348,6 @@ const AppDetails = () => { {appData && ( ({ .mockImplementation((...args) => mockGetIngestionPipelineByFqn(...args)), })); -jest.mock('../../../utils/CommonUtils', () => ({ - getIngestionFrequency: jest.fn(), -})); - jest.mock('../../AddDataQualityTest/components/TestSuiteScheduler', () => jest.fn().mockImplementation(({ onSubmit, onCancel }) => (
@@ -73,7 +69,6 @@ const mockProps1 = { name: 'DataInsightsReportApplication', }, onSave: mockOnSave, - onCancel: jest.fn(), onDemandTrigger: mockOnDemandTrigger, onDeployTrigger: mockOnDeployTrigger, }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppScheduleProps.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppScheduleProps.interface.ts index 90d52317ea51..fa1901f4a844 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppScheduleProps.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppScheduleProps.interface.ts @@ -14,7 +14,6 @@ import { App } from '../../../generated/entity/applications/app'; export interface AppScheduleProps { appData: App; - onCancel: () => void; onSave: (cron: string) => void; onDemandTrigger: () => void; onDeployTrigger: () => void; From 1f31255d48b35541d5c5a62bf9f75b1a67257456 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Thu, 8 Feb 2024 11:43:24 +0530 Subject: [PATCH 5/6] fix unit test --- .../AppDetails/AppDetails.test.tsx | 23 +++++++------------ .../AppSchedule/AppSchedule.component.tsx | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.test.tsx index 5310621a9d70..5b5b6a2fa71d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.test.tsx @@ -124,17 +124,14 @@ jest.mock('../AppRunsHistory/AppRunsHistory.component', () => jest.mock('../AppSchedule/AppSchedule.component', () => jest .fn() - .mockImplementation( - ({ onCancel, onSave, onDemandTrigger, onDeployTrigger }) => ( - <> - AppSchedule - - - - - - ) - ) + .mockImplementation(({ onSave, onDemandTrigger, onDeployTrigger }) => ( + <> + AppSchedule + + + + + )) ); jest.mock('./ApplicationSchemaClassBase', () => ({ @@ -233,9 +230,5 @@ describe('AppDetails component', () => { expect(mockDeployApp).toHaveBeenCalled(); expect(mockGetApplicationByName).toHaveBeenCalled(); - - userEvent.click(screen.getByRole('button', { name: 'Cancel AppSchedule' })); - - expect(mockPush).toHaveBeenCalled(); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx index 2d3365f3c5c6..e6bac1b1565e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppSchedule/AppSchedule.component.tsx @@ -225,7 +225,7 @@ const AppSchedule = ({ }} includePeriodOptions={initialOptions} initialData={ - (appData.appSchedule as AppScheduleClass).cronExpression ?? '' + (appData.appSchedule as AppScheduleClass)?.cronExpression ?? '' } onCancel={onDialogCancel} onSubmit={onDialogSave} From 42e67dcc9326b26127af2d33f4f1f12f982ddb71 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 9 Feb 2024 12:14:21 +0530 Subject: [PATCH 6/6] fix user cypress failure on click --- .../src/main/resources/ui/cypress/common/Utils/Users.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/Users.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/Users.ts index 320b5f806fa6..fcacddef0498 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/Users.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/Utils/Users.ts @@ -85,8 +85,7 @@ export const softDeleteUser = (username: string, displayName: string) => { verifyResponseStatusCode('@searchUser', 200); // Click on delete button - cy.get(`[data-testid="delete-user-btn-${username}"]`); - cy.get(':nth-child(4) > .ant-space > .ant-space-item > .ant-btn').click(); + cy.get(`[data-testid="delete-user-btn-${username}"]`).click(); // Soft deleting the user cy.get('[data-testid="soft-delete"]').click(); cy.get('[data-testid="confirmation-text-input"]').type('DELETE');