Skip to content

Commit

Permalink
use plugin id const, return promise reject
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Aug 26, 2022
1 parent e25652a commit e8767d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { parseInterval } from '../../../../../common/util/parse_interval';
import { mlCalendarService } from '../../../services/calendar_service';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { ML_PAGES } from '../../../../../common/constants/locator';
import { PLUGIN_ID } from '../../../../../common/constants/app';

export function loadFullJob(jobId) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -288,7 +289,7 @@ export async function cloneJob(jobId) {
);
}

getApplication().navigateToApp('ml', { path: ML_PAGES.ANOMALY_DETECTION_CREATE_JOB });
getApplication().navigateToApp(PLUGIN_ID, { path: ML_PAGES.ANOMALY_DETECTION_CREATE_JOB });
} catch (error) {
getToastNotificationService().displayErrorToast(
error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ import type { CoreStart } from '@kbn/core/public';
import { ML_PAGES } from '../../../common/constants/locator';
import { MlLicense } from '../../../common/license';
import { showExpiredLicenseWarning } from './expired_warning';
import { PLUGIN_ID } from '../../../common/constants/app';

export class MlClientLicense extends MlLicense {
constructor(private application: CoreStart['application']) {
super();
}

private redirectToKibana() {
return this.application.navigateToApp('home');
this.application.navigateToApp('home');
return Promise.reject();
}

private redirectToBasic() {
return this.application.navigateToApp('ml', { path: ML_PAGES.DATA_VISUALIZER });
this.application.navigateToApp(PLUGIN_ID, { path: ML_PAGES.DATA_VISUALIZER });
return Promise.reject();
}

fullLicenseResolver(): Promise<void> {
Expand Down

0 comments on commit e8767d4

Please sign in to comment.