trigger creation from overview page (#97531)

This commit is contained in:
Melissa Alvarez 2021-04-20 11:12:41 -04:00 committed by GitHub
parent 59482009f6
commit 366691a9c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,7 @@ import { DataFrameAnalyticsListRow } from '../../../data_frame_analytics/pages/a
import { AnalyticStatsBarStats, StatsBar } from '../../../components/stats_bar';
import { useMlUrlGenerator, useNavigateToPath } from '../../../contexts/kibana';
import { ML_PAGES } from '../../../../../common/constants/ml_url_generator';
import { SourceSelection } from '../../../data_frame_analytics/pages/analytics_management/components/source_selection';
interface Props {
jobCreationDisabled: boolean;
@ -38,6 +39,7 @@ export const AnalyticsPanel: FC<Props> = ({ jobCreationDisabled, setLazyJobCount
);
const [errorMessage, setErrorMessage] = useState<any>(undefined);
const [isInitialized, setIsInitialized] = useState(false);
const [isSourceIndexModalVisible, setIsSourceIndexModalVisible] = useState(false);
const mlUrlGenerator = useMlUrlGenerator();
const navigateToPath = useNavigateToPath();
@ -110,7 +112,7 @@ export const AnalyticsPanel: FC<Props> = ({ jobCreationDisabled, setLazyJobCount
}
actions={
<EuiButton
onClick={redirectToDataFrameAnalyticsManagementPage}
onClick={() => setIsSourceIndexModalVisible(true)}
color="primary"
fill
iconType="plusInCircle"
@ -160,6 +162,9 @@ export const AnalyticsPanel: FC<Props> = ({ jobCreationDisabled, setLazyJobCount
</div>
</>
)}
{isSourceIndexModalVisible === true && (
<SourceSelection onClose={() => setIsSourceIndexModalVisible(false)} />
)}
</EuiPanel>
);
};