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 f5354d534 fix(config-ui): adjust the api field (#4510)
f5354d534 is described below

commit f5354d534da9ea5cc62170bf6d3ce1e9ecd2eedf
Author: 青湛 <[email protected]>
AuthorDate: Fri Feb 24 10:28:06 2023 +0800

    fix(config-ui): adjust the api field (#4510)
    
    * fix(config-ui): adjust the api field
    
    * fix(config-ui): adjust the name for onChangeCreatedDateAfter
---
 .../blueprint/components/advanced-editor/example/jira.ts   |  2 +-
 .../blueprint/components/advanced-editor/example/tapd.ts   |  2 +-
 .../src/pages/blueprint/components/sync-policy/index.tsx   | 10 +++++-----
 config-ui/src/pages/blueprint/create/bp-context.tsx        | 14 +++++++-------
 config-ui/src/pages/blueprint/create/step-four/index.tsx   |  8 ++++----
 config-ui/src/pages/blueprint/create/types.ts              |  4 ++--
 .../detail/components/update-policy-dialog/index.tsx       | 12 ++++++------
 .../src/pages/blueprint/detail/panel/configuration.tsx     |  2 +-
 config-ui/src/pages/blueprint/types.ts                     |  2 +-
 9 files changed, 28 insertions(+), 28 deletions(-)

diff --git 
a/config-ui/src/pages/blueprint/components/advanced-editor/example/jira.ts 
b/config-ui/src/pages/blueprint/components/advanced-editor/example/jira.ts
index 81d75ca7c..6c4415303 100644
--- a/config-ui/src/pages/blueprint/components/advanced-editor/example/jira.ts
+++ b/config-ui/src/pages/blueprint/components/advanced-editor/example/jira.ts
@@ -23,7 +23,7 @@ const jira = [
       options: {
         connectionId: 1,
         boardId: 8,
-        createdDateAfter: '2006-01-02T15:04:05Z',
+        timeAfter: '2006-01-02T15:04:05Z',
       },
     },
   ],
diff --git 
a/config-ui/src/pages/blueprint/components/advanced-editor/example/tapd.ts 
b/config-ui/src/pages/blueprint/components/advanced-editor/example/tapd.ts
index 045454280..c9532046d 100644
--- a/config-ui/src/pages/blueprint/components/advanced-editor/example/tapd.ts
+++ b/config-ui/src/pages/blueprint/components/advanced-editor/example/tapd.ts
@@ -21,7 +21,7 @@ const tapd = [
     {
       plugin: 'tapd',
       options: {
-        createdDateAfter: '2006-01-02T15:04:05Z',
+        timeAfter: '2006-01-02T15:04:05Z',
         companyId: 1,
         workspaceId: 1,
         connectionId: 1,
diff --git a/config-ui/src/pages/blueprint/components/sync-policy/index.tsx 
b/config-ui/src/pages/blueprint/components/sync-policy/index.tsx
index 795eabf7f..5c127d3d2 100644
--- a/config-ui/src/pages/blueprint/components/sync-policy/index.tsx
+++ b/config-ui/src/pages/blueprint/components/sync-policy/index.tsx
@@ -31,11 +31,11 @@ interface Props {
   cronConfig: string;
   skipOnFail: boolean;
   showTimeFilter: boolean;
-  createdDateAfter: string | null;
+  timeAfter: string | null;
   onChangeIsManual: (val: boolean) => void;
   onChangeCronConfig: (val: string) => void;
   onChangeSkipOnFail: (val: boolean) => void;
-  onChangeCreatedDateAfter: (val: string | null) => void;
+  onChangeTimeAfter: (val: string | null) => void;
 }
 
 export const SyncPolicy = ({
@@ -43,11 +43,11 @@ export const SyncPolicy = ({
   cronConfig,
   skipOnFail,
   showTimeFilter,
-  createdDateAfter,
+  timeAfter,
   onChangeIsManual,
   onChangeCronConfig,
   onChangeSkipOnFail,
-  onChangeCreatedDateAfter,
+  onChangeTimeAfter,
 }: Props) => {
   const cron = useMemo(() => getCron(isManual, cronConfig), [isManual, 
cronConfig]);
 
@@ -72,7 +72,7 @@ export const SyncPolicy = ({
         <div className="block">
           <h3>Time Filter *</h3>
           <p>Select the data range you wish to collect. DevLake will collect 
the last six months of data by default.</p>
-          <StartFromSelector value={createdDateAfter} 
onChange={onChangeCreatedDateAfter} />
+          <StartFromSelector value={timeAfter} onChange={onChangeTimeAfter} />
         </div>
       )}
       <div className="block">
diff --git a/config-ui/src/pages/blueprint/create/bp-context.tsx 
b/config-ui/src/pages/blueprint/create/bp-context.tsx
index 6a8ef205b..8dfded002 100644
--- a/config-ui/src/pages/blueprint/create/bp-context.tsx
+++ b/config-ui/src/pages/blueprint/create/bp-context.tsx
@@ -45,7 +45,7 @@ export const BPContext = React.createContext<BPContextType>({
   cronConfig: '0 0 * * *',
   isManual: false,
   skipOnFail: false,
-  createdDateAfter: null,
+  timeAfter: null,
 
   onChangeStep: () => {},
   onChangeShowInspector: () => {},
@@ -59,7 +59,7 @@ export const BPContext = React.createContext<BPContextType>({
   onChangeCronConfig: () => {},
   onChangeIsManual: () => {},
   onChangeSkipOnFail: () => {},
-  onChangeCreatedDateAfter: () => {},
+  onChangeTimeAfter: () => {},
 
   onSave: () => {},
   onSaveAndRun: () => {},
@@ -84,7 +84,7 @@ export const BPContextProvider = ({ from, projectName, 
children }: Props) => {
   const [cronConfig, setCronConfig] = useState('0 0 * * *');
   const [isManual, setIsManual] = useState(false);
   const [skipOnFail, setSkipOnFail] = useState(true);
-  const [createdDateAfter, setCreatedDateAfter] = useState<string | null>(
+  const [timeAfter, setTimeAfter] = useState<string | null>(
     formatTime(dayjs().subtract(6, 'month').startOf('day').toDate(), 
'YYYY-MM-DD[T]HH:mm:ssZ'),
   );
 
@@ -128,7 +128,7 @@ export const BPContextProvider = ({ from, projectName, 
children }: Props) => {
     if (mode === ModeEnum.normal) {
       params.settings = {
         version: '2.0.0',
-        createdDateAfter,
+        timeAfter,
         connections: uniqueList.map((unique) => {
           const connection = connections.find((cs) => cs.unique === unique) as 
ConnectionItemType;
           const scope = scopeMap[unique] ?? [];
@@ -154,7 +154,7 @@ export const BPContextProvider = ({ from, projectName, 
children }: Props) => {
     cronConfig,
     isManual,
     skipOnFail,
-    createdDateAfter,
+    timeAfter,
     rawPlan,
     uniqueList,
     scopeMap,
@@ -204,7 +204,7 @@ export const BPContextProvider = ({ from, projectName, 
children }: Props) => {
         cronConfig,
         isManual,
         skipOnFail,
-        createdDateAfter,
+        timeAfter,
 
         onChangeStep: setStep,
         onChangeShowInspector: setShowInspector,
@@ -218,7 +218,7 @@ export const BPContextProvider = ({ from, projectName, 
children }: Props) => {
         onChangeCronConfig: setCronConfig,
         onChangeIsManual: setIsManual,
         onChangeSkipOnFail: setSkipOnFail,
-        onChangeCreatedDateAfter: setCreatedDateAfter,
+        onChangeTimeAfter: setTimeAfter,
 
         onSave: handleSave,
         onSaveAndRun: hanldeSaveAndRun,
diff --git a/config-ui/src/pages/blueprint/create/step-four/index.tsx 
b/config-ui/src/pages/blueprint/create/step-four/index.tsx
index 2907740cb..03bcc546a 100644
--- a/config-ui/src/pages/blueprint/create/step-four/index.tsx
+++ b/config-ui/src/pages/blueprint/create/step-four/index.tsx
@@ -30,11 +30,11 @@ export const StepFour = () => {
     isManual,
     cronConfig,
     skipOnFail,
-    createdDateAfter,
+    timeAfter,
     onChangeIsManual,
     onChangeCronConfig,
     onChangeSkipOnFail,
-    onChangeCreatedDateAfter,
+    onChangeTimeAfter,
   } = useCreateBP();
 
   return (
@@ -46,11 +46,11 @@ export const StepFour = () => {
         cronConfig={cronConfig}
         skipOnFail={skipOnFail}
         showTimeFilter={mode === ModeEnum.normal}
-        createdDateAfter={createdDateAfter}
+        timeAfter={timeAfter}
         onChangeIsManual={onChangeIsManual}
         onChangeCronConfig={onChangeCronConfig}
         onChangeSkipOnFail={onChangeSkipOnFail}
-        onChangeCreatedDateAfter={onChangeCreatedDateAfter}
+        onChangeTimeAfter={onChangeTimeAfter}
       />
     </Card>
   );
diff --git a/config-ui/src/pages/blueprint/create/types.ts 
b/config-ui/src/pages/blueprint/create/types.ts
index e420bf6a5..a3bd35d22 100644
--- a/config-ui/src/pages/blueprint/create/types.ts
+++ b/config-ui/src/pages/blueprint/create/types.ts
@@ -39,7 +39,7 @@ export type BPContextType = {
   cronConfig: string;
   isManual: boolean;
   skipOnFail: boolean;
-  createdDateAfter: string | null;
+  timeAfter: string | null;
 
   onChangeStep: React.Dispatch<React.SetStateAction<number>>;
   onChangeShowInspector: React.Dispatch<React.SetStateAction<boolean>>;
@@ -53,7 +53,7 @@ export type BPContextType = {
   onChangeCronConfig: React.Dispatch<React.SetStateAction<string>>;
   onChangeIsManual: React.Dispatch<React.SetStateAction<boolean>>;
   onChangeSkipOnFail: React.Dispatch<React.SetStateAction<boolean>>;
-  onChangeCreatedDateAfter: React.Dispatch<React.SetStateAction<string | 
null>>;
+  onChangeTimeAfter: React.Dispatch<React.SetStateAction<string | null>>;
 
   onSave: () => void;
   onSaveAndRun: () => void;
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 5ba881bc8..ce3becbb0 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
@@ -29,7 +29,7 @@ interface Props {
   isManual: boolean;
   cronConfig: string;
   skipOnFail: boolean;
-  createdDateAfter: string | null;
+  timeAfter: string | null;
   operating: boolean;
   onCancel: () => void;
   onSubmit: (params: any) => Promise<void>;
@@ -39,13 +39,13 @@ export const UpdatePolicyDialog = ({ blueprint, operating, 
onCancel, onSubmit, .
   const [isManual, setIsManual] = useState(false);
   const [cronConfig, setCronConfig] = useState('');
   const [skipOnFail, setSkipOnFail] = useState(false);
-  const [createdDateAfter, setCreatedDateAfter] = useState<string | 
null>(null);
+  const [timeAfter, setTimeAfter] = useState<string | null>(null);
 
   useEffect(() => {
     setIsManual(props.isManual);
     setCronConfig(props.cronConfig);
     setSkipOnFail(props.skipOnFail);
-    setCreatedDateAfter(props.createdDateAfter);
+    setTimeAfter(props.timeAfter);
   }, []);
 
   const handleSubmit = () => {
@@ -57,7 +57,7 @@ export const UpdatePolicyDialog = ({ blueprint, operating, 
onCancel, onSubmit, .
         blueprint.mode === ModeEnum.normal
           ? {
               ...blueprint.settings,
-              createdDateAfter,
+              timeAfter,
             }
           : undefined,
     });
@@ -80,11 +80,11 @@ export const UpdatePolicyDialog = ({ blueprint, operating, 
onCancel, onSubmit, .
         cronConfig={cronConfig}
         skipOnFail={skipOnFail}
         showTimeFilter={blueprint.mode === ModeEnum.normal}
-        createdDateAfter={createdDateAfter}
+        timeAfter={timeAfter}
         onChangeIsManual={setIsManual}
         onChangeCronConfig={setCronConfig}
         onChangeSkipOnFail={setSkipOnFail}
-        onChangeCreatedDateAfter={setCreatedDateAfter}
+        onChangeTimeAfter={setTimeAfter}
       />
     </Dialog>
   );
diff --git a/config-ui/src/pages/blueprint/detail/panel/configuration.tsx 
b/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
index 6779eb731..fc396c06d 100644
--- a/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
+++ b/config-ui/src/pages/blueprint/detail/panel/configuration.tsx
@@ -245,7 +245,7 @@ export const Configuration = ({ blueprint, operating, 
onUpdate, onRefresh }: Pro
           isManual={blueprint.isManual}
           cronConfig={blueprint.cronConfig}
           skipOnFail={blueprint.skipOnFail}
-          createdDateAfter={blueprint.settings?.createdDateAfter}
+          timeAfter={blueprint.settings?.timeAfter}
           operating={operating}
           onCancel={handleCancel}
           onSubmit={handleUpdatePolicy}
diff --git a/config-ui/src/pages/blueprint/types.ts 
b/config-ui/src/pages/blueprint/types.ts
index 9d86b95a3..362848031 100644
--- a/config-ui/src/pages/blueprint/types.ts
+++ b/config-ui/src/pages/blueprint/types.ts
@@ -37,7 +37,7 @@ export type BlueprintType = {
   plan: any;
   settings: {
     version: string;
-    createdDateAfter: null | string;
+    timeAfter: null | string;
     connections: Array<{
       plugin: string;
       connectionId: ID;

Reply via email to