This is an automated email from the ASF dual-hosted git repository.
likyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new afa3a0083 fix(config-ui): adjust createdDateAfter position on the
create bp (#3949)
afa3a0083 is described below
commit afa3a008375bd29b0bff24c11d9b289bbd30785a
Author: 青湛 <[email protected]>
AuthorDate: Thu Dec 15 16:27:25 2022 +0800
fix(config-ui): adjust createdDateAfter position on the create bp (#3949)
---
config-ui/src/pages/blueprint/create/bp-context.tsx | 4 ++--
.../detail/components/update-policy-dialog/index.tsx | 11 +++++++++--
config-ui/src/pages/blueprint/detail/panel/configuration.tsx | 8 ++++++--
config-ui/src/pages/blueprint/detail/types.ts | 2 +-
4 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/config-ui/src/pages/blueprint/create/bp-context.tsx
b/config-ui/src/pages/blueprint/create/bp-context.tsx
index c520a2356..ba670a508 100644
--- a/config-ui/src/pages/blueprint/create/bp-context.tsx
+++ b/config-ui/src/pages/blueprint/create/bp-context.tsx
@@ -131,13 +131,13 @@ export const BPContextProvider = ({ from, projectName,
children }: Props) => {
enable: true,
cronConfig,
isManual,
- skipOnFail,
- createdDateAfter
+ skipOnFail
}
if (mode === ModeEnum.normal) {
params.settings = {
version: '2.0.0',
+ createdDateAfter,
connections: uniqueList.map((unique) => {
const connection = connections.find(
(cs) => cs.unique === unique
diff --git
a/config-ui/src/pages/blueprint/detail/components/update-policy-dialog/index.tsx
b/config-ui/src/pages/blueprint/detail/components/update-policy-dialog/index.tsx
index cf5469363..58bd02f18 100644
---
a/config-ui/src/pages/blueprint/detail/components/update-policy-dialog/index.tsx
+++
b/config-ui/src/pages/blueprint/detail/components/update-policy-dialog/index.tsx
@@ -21,7 +21,10 @@ import React, { useState, useEffect } from 'react'
import { Dialog } from '@/components'
import { SyncPolicy } from '@/plugins'
+import type { BlueprintType } from '../../types'
+
interface Props {
+ blueprint: BlueprintType
isManual: boolean
cronConfig: string
skipOnFail: boolean
@@ -32,6 +35,7 @@ interface Props {
}
export const UpdatePolicyDialog = ({
+ blueprint,
saving,
onCancel,
onSubmit,
@@ -47,14 +51,17 @@ export const UpdatePolicyDialog = ({
setCronConfig(props.cronConfig)
setSkipOnFail(props.skipOnFail)
setCreatedDateAfter(props.createdDateAfter)
- }, [props])
+ }, [])
const handleSubmit = () => {
onSubmit({
isManual,
cronConfig,
skipOnFail,
- createdDateAfter
+ settings: {
+ ...blueprint.settings,
+ createdDateAfter
+ }
})
}
diff --git a/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
b/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
index 97fd20a6a..edcaba059 100644
--- a/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
+++ b/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
@@ -184,7 +184,10 @@ export const Configuration = ({
<h3>Sync Policy</h3>
<div className='detail'>
<span>
- {cron.label}({dayjs(cron.nextTime).format('HH:mm A')})
+ {cron.label}
+ {cron.value !== 'manual'
+ ? dayjs(cron.nextTime).format('HH:mm A')
+ : null}
</span>
<Icon
icon='annotation'
@@ -208,10 +211,11 @@ export const Configuration = ({
)}
{type === 'frequency' && (
<UpdatePolicyDialog
+ blueprint={blueprint}
isManual={blueprint.isManual}
cronConfig={blueprint.cronConfig}
skipOnFail={blueprint.skipOnFail}
- createdDateAfter={blueprint.createdDateAfter}
+ createdDateAfter={blueprint.settings.createdDateAfter}
saving={saving}
onCancel={handleCancel}
onSubmit={handleUpdatePolicy}
diff --git a/config-ui/src/pages/blueprint/detail/types.ts
b/config-ui/src/pages/blueprint/detail/types.ts
index 67a13fb2e..5ad8c6bf0 100644
--- a/config-ui/src/pages/blueprint/detail/types.ts
+++ b/config-ui/src/pages/blueprint/detail/types.ts
@@ -33,9 +33,9 @@ export type BlueprintType = {
isManual: boolean
cronConfig: string
skipOnFail: boolean
- createdDateAfter: null | string
settings: {
version: string
+ createdDateAfter: null | string
connections: Array<{
plugin: Plugins
connectionId: ID