Skip to content

Commit

Permalink
set opensearch_dashboards_sample_data_logs as default selected
Browse files Browse the repository at this point in the history
Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Jun 6, 2024
1 parent 7e49fa6 commit 484f5cf
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ export const SourceSelector = ({
dataSourceOptions.length > 0 &&
dataSourceOptions[0].options.length > 0
) {
onChange(dataSourceOptions[0].options[0]);
const defaultSelectedSource = dataSourceOptions[0].options.find(
(item) => item.label === 'opensearch_dashboards_sample_data_logs'
);
if (defaultSelectedSource) {
onChange(defaultSelectedSource);
} else {
onChange(dataSourceOptions[0].options[0]);
}
}
}, [selectedSourceId, dataSourceOptions]);

Check failure on line 57 in src/plugins/visualize/public/application/components/source_selector.tsx

View workflow job for this annotation

GitHub Actions / Build and Verify on Linux (ciGroup1)

React Hook useEffect has a missing dependency: 'onChange'. Either include it or remove the dependency array. If 'onChange' changes too often, find the parent component that defines it and wrap that definition in useCallback

Expand Down

0 comments on commit 484f5cf

Please sign in to comment.