Skip to content

Commit

Permalink
Remove unused code and fix defaultValue
Browse files Browse the repository at this point in the history
  • Loading branch information
nkhristinin committed Jul 20, 2022
1 parent b785fc9 commit 38be325
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
index: indicesConfig,
threatIndex: threatIndicesConfig,
};
initialState.dataSourceType =
initialState.dataViewId == null || initialState.dataViewId === ''
? DataSourceType.IndexPatterns
: DataSourceType.DataView;


const { form } = useForm<DefineStepRule>({
defaultValue: initialState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ export const getDefineStepsData = (rule: Rule): DefineStepRule => ({
eventCategoryField: rule.event_category_override,
tiebreakerField: rule.tiebreaker_field,
},
// defaulting this since it is set in the component anyways.
dataSourceType: DataSourceType.IndexPatterns,
dataSourceType: rule.data_view_id ? DataSourceType.DataView : DataSourceType.IndexPatterns,
});

export const getScheduleStepsData = (rule: Rule): ScheduleStepRule => {
Expand Down

0 comments on commit 38be325

Please sign in to comment.