mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-07 21:16:45 +00:00
Automator feedback necessary changes for OSS (#16203)
This commit is contained in:
parent
55678e3e2c
commit
800586164d
@ -61,8 +61,11 @@ export type ScheduleIntervalProps = {
|
||||
disabledCronChange?: boolean;
|
||||
onBack: () => void;
|
||||
onDeploy: (values: WorkflowExtraConfig) => void;
|
||||
allowEnableDebugLog?: boolean;
|
||||
debugLogInitialValue?: boolean;
|
||||
};
|
||||
|
||||
export interface WorkflowExtraConfig {
|
||||
retries: number;
|
||||
retries?: number;
|
||||
enableDebugLog?: boolean;
|
||||
}
|
||||
|
||||
@ -12,10 +12,16 @@
|
||||
*/
|
||||
|
||||
import { CheckOutlined } from '@ant-design/icons';
|
||||
import { Button, Col, Form } from 'antd';
|
||||
import React from 'react';
|
||||
import { Button, Col, Form, FormProps } from 'antd';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { LOADING_STATE } from '../../../../../enums/common.enum';
|
||||
import {
|
||||
FieldProp,
|
||||
FieldTypes,
|
||||
FormItemLayout,
|
||||
} from '../../../../../interface/FormUtils.interface';
|
||||
import { generateFormFields } from '../../../../../utils/formUtils';
|
||||
import CronEditor from '../../../../common/CronEditor/CronEditor';
|
||||
import { ScheduleIntervalProps } from '../IngestionWorkflow.interface';
|
||||
|
||||
@ -29,14 +35,42 @@ const ScheduleInterval = ({
|
||||
status,
|
||||
submitButtonLabel,
|
||||
children,
|
||||
allowEnableDebugLog = false,
|
||||
debugLogInitialValue = false,
|
||||
}: ScheduleIntervalProps) => {
|
||||
const { t } = useTranslation();
|
||||
const formFields: FieldProp[] = useMemo(
|
||||
() => [
|
||||
{
|
||||
name: 'enableDebugLog',
|
||||
label: t('label.enable-debug-log'),
|
||||
type: FieldTypes.SWITCH,
|
||||
required: false,
|
||||
props: {
|
||||
'data-testid': 'enable-debug-log',
|
||||
initialValue: debugLogInitialValue,
|
||||
},
|
||||
id: 'root/enableDebugLog',
|
||||
formItemLayout: FormItemLayout.HORIZONTAL,
|
||||
},
|
||||
],
|
||||
[debugLogInitialValue]
|
||||
);
|
||||
|
||||
const handleFormSubmit: FormProps['onFinish'] = useCallback(
|
||||
(data) => {
|
||||
onDeploy({
|
||||
enableDebugLog: data.enableDebugLog,
|
||||
});
|
||||
},
|
||||
[onDeploy]
|
||||
);
|
||||
|
||||
return (
|
||||
<Form
|
||||
data-testid="schedule-intervel-container"
|
||||
layout="vertical"
|
||||
onFinish={onDeploy}>
|
||||
onFinish={handleFormSubmit}>
|
||||
<CronEditor
|
||||
disabledCronChange={disabledCronChange}
|
||||
includePeriodOptions={includePeriodOptions}
|
||||
@ -44,6 +78,10 @@ const ScheduleInterval = ({
|
||||
onChange={onChange}
|
||||
/>
|
||||
|
||||
{allowEnableDebugLog && (
|
||||
<div className="mt-4">{generateFormFields(formFields)}</div>
|
||||
)}
|
||||
|
||||
{children}
|
||||
|
||||
<Col className="d-flex justify-end mt-4" span={24}>
|
||||
|
||||
@ -26,6 +26,7 @@ export enum ExplorePageTabs {
|
||||
CONTAINERS = 'containers',
|
||||
GLOSSARY = 'glossaries',
|
||||
TAG = 'tags',
|
||||
DATA_PRODUCT = 'dataProducts',
|
||||
DASHBOARD_DATA_MODEL = 'dashboardDataModel',
|
||||
STORED_PROCEDURE = 'storedProcedure',
|
||||
SEARCH_INDEX = 'searchIndexes',
|
||||
|
||||
@ -55,6 +55,7 @@ import {
|
||||
SearchSuggestions,
|
||||
} from '../context/GlobalSearchProvider/GlobalSearchSuggestions/GlobalSearchSuggestions.interface';
|
||||
import { EntityType } from '../enums/entity.enum';
|
||||
import { ExplorePageTabs } from '../enums/Explore.enum';
|
||||
import { SearchIndex } from '../enums/search.enum';
|
||||
import { SearchSourceAlias } from '../interface/search.interface';
|
||||
import { TabsInfoData } from '../pages/ExplorePage/ExplorePage.interface';
|
||||
@ -169,84 +170,84 @@ class SearchClassBase {
|
||||
label: i18n.t('label.table-plural'),
|
||||
sortingFields: tableSortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'tables',
|
||||
path: ExplorePageTabs.TABLES,
|
||||
icon: TableIcon,
|
||||
},
|
||||
[SearchIndex.STORED_PROCEDURE]: {
|
||||
label: i18n.t('label.stored-procedure-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'storedProcedure',
|
||||
path: ExplorePageTabs.STORED_PROCEDURE,
|
||||
icon: IconStoredProcedure,
|
||||
},
|
||||
[SearchIndex.DATABASE]: {
|
||||
label: i18n.t('label.database-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'databases',
|
||||
path: ExplorePageTabs.DATABASE,
|
||||
icon: DatabaseIcon,
|
||||
},
|
||||
[SearchIndex.DATABASE_SCHEMA]: {
|
||||
label: i18n.t('label.database-schema-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'databaseSchemas',
|
||||
path: ExplorePageTabs.DATABASE_SCHEMA,
|
||||
icon: SchemaIcon,
|
||||
},
|
||||
[SearchIndex.DASHBOARD]: {
|
||||
label: i18n.t('label.dashboard-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'dashboards',
|
||||
path: ExplorePageTabs.DASHBOARDS,
|
||||
icon: DashboardIcon,
|
||||
},
|
||||
[SearchIndex.DASHBOARD_DATA_MODEL]: {
|
||||
label: i18n.t('label.dashboard-data-model-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'dashboardDataModel',
|
||||
path: ExplorePageTabs.DASHBOARD_DATA_MODEL,
|
||||
icon: IconDataModel,
|
||||
},
|
||||
[SearchIndex.PIPELINE]: {
|
||||
label: i18n.t('label.pipeline-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'pipelines',
|
||||
path: ExplorePageTabs.PIPELINES,
|
||||
icon: PipelineIcon,
|
||||
},
|
||||
[SearchIndex.TOPIC]: {
|
||||
label: i18n.t('label.topic-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'topics',
|
||||
path: ExplorePageTabs.TOPICS,
|
||||
icon: TopicIcon,
|
||||
},
|
||||
[SearchIndex.MLMODEL]: {
|
||||
label: i18n.t('label.ml-model-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'mlmodels',
|
||||
path: ExplorePageTabs.MLMODELS,
|
||||
icon: MlModelIcon,
|
||||
},
|
||||
[SearchIndex.CONTAINER]: {
|
||||
label: i18n.t('label.container-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'containers',
|
||||
path: ExplorePageTabs.CONTAINERS,
|
||||
icon: ContainerIcon,
|
||||
},
|
||||
[SearchIndex.SEARCH_INDEX]: {
|
||||
label: i18n.t('label.search-index-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'searchIndexes',
|
||||
path: ExplorePageTabs.SEARCH_INDEX,
|
||||
icon: SearchOutlined,
|
||||
},
|
||||
[SearchIndex.GLOSSARY_TERM]: {
|
||||
label: i18n.t('label.glossary-term-plural'),
|
||||
sortingFields: entitySortingFields,
|
||||
sortField: INITIAL_SORT_FIELD,
|
||||
path: 'glossaries',
|
||||
path: ExplorePageTabs.GLOSSARY,
|
||||
icon: GlossaryIcon,
|
||||
},
|
||||
[SearchIndex.TAG]: {
|
||||
@ -254,7 +255,7 @@ class SearchClassBase {
|
||||
sortingFields: tagSortingFields,
|
||||
sortField: TAGS_INITIAL_SORT_FIELD,
|
||||
sortOrder: TAGS_INITIAL_SORT_ORDER,
|
||||
path: 'tags',
|
||||
path: ExplorePageTabs.TAG,
|
||||
icon: ClassificationIcon,
|
||||
},
|
||||
[SearchIndex.DATA_PRODUCT]: {
|
||||
@ -262,7 +263,7 @@ class SearchClassBase {
|
||||
sortingFields: tagSortingFields,
|
||||
sortField: TAGS_INITIAL_SORT_FIELD,
|
||||
sortOrder: TAGS_INITIAL_SORT_ORDER,
|
||||
path: 'dataProducts',
|
||||
path: ExplorePageTabs.DATA_PRODUCT,
|
||||
icon: DataProductIcon,
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user