Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial migration #54910

Merged
merged 13 commits into from
Jan 22, 2020

This file was deleted.

This file was deleted.

This file was deleted.

139 changes: 0 additions & 139 deletions src/legacy/core_plugins/kibana/common/tutorials/tutorial_schema.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/kibana/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ import { promisify } from 'util';
import { migrations } from './migrations';
import { importApi } from './server/routes/api/import';
import { exportApi } from './server/routes/api/export';
import { homeApi } from './server/routes/api/home';
import { managementApi } from './server/routes/api/management';
import { registerFieldFormats } from './server/field_formats/register';
import { registerTutorials } from './server/tutorials/register';
import * as systemApi from './server/lib/system_api';
import mappings from './mappings.json';
import { getUiSettingDefaults } from './ui_setting_defaults';
Expand Down Expand Up @@ -332,10 +330,8 @@ export default function(kibana) {
// routes
importApi(server);
exportApi(server);
homeApi(server);
managementApi(server);
registerFieldFormats(server);
registerTutorials(server);
registerCspCollector(usageCollection, server);
server.expose('systemApi', systemApi);
server.injectUiAppVars('kibana', () => injectVars(server));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import PropTypes from 'prop-types';
import { Instruction } from './instruction';
import { ParameterForm } from './parameter_form';
import { Content } from './content';
import { getDisplayText } from '../../../../../common/tutorials/instruction_variant';
import { getDisplayText } from '../../../../../../../../plugins/home/server/tutorials/instructions/instruction_variant';
import {
EuiTabs,
EuiTab,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,32 @@ import _ from 'lodash';
import { getServices } from '../kibana_services';
import { i18n } from '@kbn/i18n';

const baseUrlLP = getServices().addBasePath('/api/kibana/home/tutorials_LP');
const baseUrl = getServices().addBasePath('/api/kibana/home/tutorials');
const headers = new Headers();
headers.append('Accept', 'application/json');
headers.append('Content-Type', 'application/json');
headers.append('kbn-xsrf', 'kibana');

let tutorials = [];
let tutorialsLegacyPlatform = [];
let tutorialsNewPlatform = [];
let tutorialsLoaded = false;

async function loadTutorials() {
try {
const responseLegacyPlatform = await fetch(baseUrlLP, {
const response = await fetch(baseUrl, {
method: 'get',
credentials: 'include',
headers: headers,
});
if (responseLegacyPlatform.status >= 300) {
if (response.status >= 300) {
throw new Error(
i18n.translate('kbn.home.loadTutorials.requestFailedErrorMessage', {
defaultMessage: 'Request failed with status code: {status}',
values: { status: responseLegacyPlatform.status },
})
);
}
const responseNewPlatform = await fetch(baseUrl, {
method: 'get',
credentials: 'include',
headers: headers,
});
if (responseNewPlatform.status >= 300) {
throw new Error(
i18n.translate('kbn.home.loadTutorials.requestFailedErrorMessage', {
defaultMessage: 'Request failed with status code: {status}',
values: { status: responseNewPlatform.status },
values: { status: response.status },
})
);
}

tutorialsLegacyPlatform = await responseLegacyPlatform.json();
tutorialsNewPlatform = await responseNewPlatform.json();
tutorials = tutorialsLegacyPlatform.concat(tutorialsNewPlatform);
tutorials = await response.json();
tutorialsLoaded = true;
} catch (err) {
getServices().toastNotifications.addDanger({
Expand Down
24 changes: 0 additions & 24 deletions src/legacy/core_plugins/kibana/server/routes/api/home/index.js

This file was deleted.

This file was deleted.

Loading