Skip to content

Commit

Permalink
more fixes after merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Sep 5, 2024
1 parent a670bd0 commit 3517566
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class JobsListUI extends Component {
itemIdToExpandedRowMap: {},
};

this.mlApiServices = props.kibana.services.mlServices.mlApi;
this.mlApi = props.kibana.services.mlServices.mlApi;
}

static getDerivedStateFromProps(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export class GroupSelectorUI extends Component {
}

const tempJobs = newJobs.map((j) => ({ jobId: j.id, groups: j.newGroups }));
const ml = this.props.kibana.services.mlServices.mlApi;
ml.jobs
const mlApi = this.props.kibana.services.mlServices.mlApi;
mlApi.jobs
.updateGroups(tempJobs)
.then((resp) => {
let success = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export function isClosable(jobs: CombinedJobWithStats[]): boolean;
export function isResettable(jobs: CombinedJobWithStats[]): boolean;
export function forceStartDatafeeds(
toastNotifications: ToastsStart,
mlApiServices: MlApiServices,
mlApi: MlApi,
jobs: CombinedJobWithStats[],
start: number | undefined,
end: number | undefined,
finish?: () => void
): Promise<void>;
export function stopDatafeeds(
toastNotifications: ToastsStart,
mlApiServices: MlApiServices,
mlApi: MlApi,
jobs: CombinedJobWithStats[] | MlSummaryJob[],
finish?: () => void
): Promise<void>;
Expand All @@ -46,21 +46,21 @@ export function cloneJob(
): Promise<void>;
export function closeJobs(
toastNotifications: ToastsStart,
mlApiServices: MlApiServices,
mlApi: MlApi,
jobs: CombinedJobWithStats[] | MlSummaryJob[],
finish?: () => void
): Promise<void>;
export function deleteJobs(
toastNotifications: ToastsStart,
mlApiServices: MlApiServices,
mlApi: MlApi,
jobs: Array<{ id: string }>,
deleteUserAnnotations?: boolean,
deleteAlertingRules?: boolean,
finish?: () => void
): Promise<void>;
export function resetJobs(
toastNotifications: ToastsStart,
mlApiServices: MlApiServices,
mlApi: MlApi,
jobIds: string[],
deleteUserAnnotations?: boolean,
finish?: () => void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export function isResettable(jobs) {

export function forceStartDatafeeds(
toastNotifications,
mlApiServices,
mlApi,
jobs,
start,
end,
finish = () => {}
) {
const datafeedIds = jobs.filter((j) => j.hasDatafeed).map((j) => j.datafeedId);
mlApiServices.jobs
mlApi.jobs
.forceStartDatafeeds(datafeedIds, start, end)
.then((resp) => {
showResults(toastNotifications, resp, DATAFEED_STATE.STARTED);
Expand All @@ -106,9 +106,9 @@ export function forceStartDatafeeds(
});
}

export function stopDatafeeds(toastNotifications, mlApiServices, jobs, finish = () => {}) {
export function stopDatafeeds(toastNotifications, mlApi, jobs, finish = () => {}) {
const datafeedIds = jobs.filter((j) => j.hasDatafeed).map((j) => j.datafeedId);
mlApiServices.jobs
mlApi.jobs
.stopDatafeeds(datafeedIds)
.then((resp) => {
showResults(toastNotifications, resp, DATAFEED_STATE.STOPPED);
Expand Down Expand Up @@ -294,9 +294,9 @@ export async function cloneJob(toastNotifications, application, mlApi, jobId) {
}
}

export function closeJobs(toastNotifications, mlApiServices, jobs, finish = () => {}) {
export function closeJobs(toastNotifications, mlApi, jobs, finish = () => {}) {
const jobIds = jobs.map((j) => j.id);
mlApiServices.jobs
mlApi.jobs
.closeJobs(jobIds)
.then((resp) => {
showResults(toastNotifications, resp, JOB_STATE.CLOSED);
Expand All @@ -315,12 +315,12 @@ export function closeJobs(toastNotifications, mlApiServices, jobs, finish = () =

export function resetJobs(
toastNotifications,
mlApiServices,
mlApi,
jobIds,
deleteUserAnnotations,
finish = () => {}
) {
mlApiServices.jobs
mlApi.jobs
.resetJobs(jobIds, deleteUserAnnotations)
.then((resp) => {
showResults(toastNotifications, resp, JOB_ACTION.RESET);
Expand All @@ -339,14 +339,14 @@ export function resetJobs(

export function deleteJobs(
toastNotifications,
mlApiServices,
mlApi,
jobs,
deleteUserAnnotations,
deleteAlertingRules,
finish = () => {}
) {
const jobIds = jobs.map((j) => j.id);
mlApiServices.jobs
mlApi.jobs
.deleteJobs(jobIds, deleteUserAnnotations, deleteAlertingRules)
.then((resp) => {
showResults(toastNotifications, resp, JOB_STATE.DELETED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class TimeSeriesExplorer extends React.Component {
this.mlForecastService = forecastServiceFactory(this.mlApi);
this.mlIndexUtils = indexServiceFactory(this.dataViewsService);
this.mlJobService = mlJobServiceFactory(this.mlApi);
this.mlResultsService = mlResultsServiceProvider(this.mlApiServices);
this.mlResultsService = mlResultsServiceProvider(this.mlApi);
this.mlTimeSeriesExplorer = timeSeriesExplorerServiceFactory(
constructorContext.services.uiSettings,
this.mlApi,
Expand Down

0 comments on commit 3517566

Please sign in to comment.