diff --git a/packages/dm-core-plugins/src/job/CronJob.tsx b/packages/dm-core-plugins/src/job/CronJob.tsx
index 98febb622..57e2c19ea 100644
--- a/packages/dm-core-plugins/src/job/CronJob.tsx
+++ b/packages/dm-core-plugins/src/job/CronJob.tsx
@@ -1,9 +1,8 @@
import React, { useEffect, useState } from 'react'
-import { Button, Label } from '@equinor/eds-core-react'
-import { StyledSelect } from './Input'
+import { Autocomplete, Button } from '@equinor/eds-core-react'
import DateRangePicker from './DateRangePicker'
import styled from 'styled-components'
-import { TSchedule } from '@development-framework/dm-core'
+import { EBlueprint, TSchedule } from '@development-framework/dm-core'
enum EInterval {
HOURLY = 'Hourly',
@@ -58,6 +57,8 @@ export function CreateReoccurringJob(props: {
return Will run on sunday in every week
} else if (interval === 'Monthly') {
return Will run on the 1st on every month
+ } else if (interval === 'Daily') {
+ return Will run at {hour + ':' + minute} o'clock every day
} else if (interval === 'Hourly') {
return Will run every {hourStep} hour
}
@@ -79,10 +80,12 @@ export function CreateReoccurringJob(props: {
dayOfMonth = '1'
break
case EInterval.HOURLY:
- newHour = `*/${hourStep}`
+ newHour = hourStep ? `*/${hourStep}` : '*'
}
setSchedule(`${newMinute} ${newHour} ${dayOfMonth} ${month} ${dayOfWeek}`)
}, [interval, hour, minute, hourStep])
+
+ console.log(schedule)
return (
@@ -97,57 +100,41 @@ export function CreateReoccurringJob(props: {
/>
-
-
{
- //@ts-ignore
- // TODO fix type
- setInterval(e.target.value)
+ entry[1])}
+ label={'Interval'}
+ onInputChange={(label: string) => {
+ const chosenIntervalType = Object.entries(EInterval)
+ .filter((l) => l.length > 0 && l[1] == label)
+ .pop()
+ chosenIntervalType
+ ? setInterval(chosenIntervalType[1])
+ : setInterval(EInterval.HOURLY)
}}
- value={interval}
- >
- {Object.entries(EInterval).map(([key, value]: any) => (
-
- ))}
-
+ />
{interval !== EInterval.HOURLY && (
-
-
{
- const hourAndMinute = e.target.value
- const [newHour, newMinute] = hourAndMinute.split(':')
+ value
+ )}
+ label={'Time'}
+ onInputChange={(timestamp) => {
+ const [newHour, newMinute] = timestamp.split(':')
setMinute(newMinute)
setHour(newHour)
}}
- >
- {generateSelectableTimes().map((value: string, index) => (
-
- ))}
-
+ />
)}
{interval === EInterval.HOURLY && (
-
-
{
- setHourStep(e.target.value)
- }}
- >
- {/*TODO fix type error*/}
- {/*@ts-ignore*/}
- {[...Array(12).keys()].map((value: number, index) => (
-
- ))}
-
+
i + 1)}
+ label={'Hour step'}
+ onInputChange={(step) => setHourStep(step)}
+ />
)}
@@ -166,14 +153,12 @@ export function CreateReoccurringJob(props: {
Remove