@@ -5,7 +5,7 @@ import { Cron } from 'react-js-cron';
5
5
import 'react-js-cron/dist/styles.css' ;
6
6
import styled from 'styled-components' ;
7
7
import cronstrue from 'cronstrue' ;
8
- import { CheckCircleOutlined , WarningOutlined , InfoCircleOutlined } from '@ant-design/icons' ;
8
+ import { CheckCircleOutlined } from '@ant-design/icons' ;
9
9
import { SourceBuilderState , StepProps } from './types' ;
10
10
import { TimezoneSelect } from './TimezoneSelect' ;
11
11
import { ANTD_GRAY , REDESIGN_COLORS } from '../../../entity/shared/constants' ;
@@ -76,27 +76,11 @@ const WarningContainer = styled.div`
76
76
color: ${ ANTD_GRAY [ 7 ] } ;
77
77
` ;
78
78
79
- const StyledWarningOutlined = styled ( WarningOutlined ) `
79
+ const StyledWarningOutlined = styled ( CheckCircleOutlined ) `
80
80
margin-right: 4px;
81
81
margin-top: 12px;
82
82
` ;
83
83
84
- const HashmarkNotice = styled . div `
85
- margin-top: 8px;
86
- padding: 8px;
87
- background-color: #e6f7ff;
88
- border: 1px solid #91d5ff;
89
- border-radius: 4px;
90
- display: flex;
91
- align-items: flex-start;
92
- ` ;
93
-
94
- const InfoIcon = styled ( InfoCircleOutlined ) `
95
- color: #1890ff;
96
- margin-right: 8px;
97
- margin-top: 3px;
98
- ` ;
99
-
100
84
const containsHashmark = ( cronExpression : string ) : boolean => {
101
85
return cronExpression . includes ( '#' ) ;
102
86
} ;
@@ -197,26 +181,32 @@ export const CreateScheduleStep = ({ state, updateState, goTo, prev }: StepProps
197
181
/>
198
182
) }
199
183
< AdvancedSchedule >
200
- < AdvancedCheckBox type = "secondary" > Show Advanced</ AdvancedCheckBox >
201
- < Checkbox
202
- checked = { advancedCronCheck }
203
- onChange = { ( event ) => setAdvancedCronCheck ( event . target . checked ) }
204
- />
184
+ < div style = { { display : 'flex' , alignItems : 'center' } } >
185
+ { advancedCronCheck && hasHashmark && (
186
+ < Typography . Text
187
+ style = { {
188
+ color : '#1890ff' ,
189
+ marginRight : '8px' ,
190
+ fontSize : '12px' ,
191
+ } }
192
+ >
193
+ (Unsupported syntax detected)
194
+ </ Typography . Text >
195
+ ) }
196
+ < AdvancedCheckBox type = "secondary" > Show Advanced</ AdvancedCheckBox >
197
+ < Checkbox
198
+ checked = { advancedCronCheck }
199
+ onChange = { ( event ) => {
200
+ if ( hasHashmark && advancedCronCheck && ! event . target . checked ) {
201
+ return ;
202
+ }
203
+ setAdvancedCronCheck ( event . target . checked ) ;
204
+ } }
205
+ disabled = { hasHashmark && advancedCronCheck }
206
+ />
207
+ </ div >
205
208
</ AdvancedSchedule >
206
209
</ Schedule >
207
- { advancedCronCheck && hasHashmark && (
208
- < HashmarkNotice >
209
- < InfoIcon />
210
- < div >
211
- < Typography . Text strong > Special schedule syntax detected</ Typography . Text >
212
- < Typography . Paragraph style = { { marginBottom : 0 } } >
213
- Your schedule uses special syntax (# character) to run on a specific occurrence of a day each month.
214
- Please combine the day of the month with the day of the week to achieve this schedule.
215
- For example use '0 0 8-14 0 1' instead of '0 0 0 0 1#2' for the 2nd Monday of the month
216
- </ Typography . Paragraph >
217
- </ div >
218
- </ HashmarkNotice >
219
- ) }
220
210
< CronText >
221
211
{ cronAsText . error && < > Invalid cron schedule. Cron must be of UNIX form:</ > }
222
212
{ ! cronAsText . text && (
@@ -244,7 +234,7 @@ export const CreateScheduleStep = ({ state, updateState, goTo, prev }: StepProps
244
234
< div >
245
235
< Button
246
236
data-testid = "ingestion-schedule-next-button"
247
- disabled = { ! interval || interval . length === 0 || cronAsText . error }
237
+ disabled = { ! scheduleCronInterval || scheduleCronInterval . length === 0 || cronAsText . error }
248
238
onClick = { onClickNext }
249
239
>
250
240
Next
0 commit comments