Skip to content

Commit

Permalink
Properly redirect legacy URLs (#68284)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Jun 24, 2020
1 parent fc9df72 commit d1a6fa2
Show file tree
Hide file tree
Showing 96 changed files with 473 additions and 642 deletions.
1 change: 0 additions & 1 deletion packages/kbn-storybook/lib/webpack.dll.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ module.exports = {
'rxjs',
'sinon',
'tinycolor2',
'./src/legacy/ui/public/styles/font_awesome.less',
'./src/legacy/ui/public/styles/bootstrap/bootstrap_light.less',
],
plugins: [
Expand Down
32 changes: 0 additions & 32 deletions src/legacy/core_plugins/kibana/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import { promisify } from 'util';

import { getUiSettingDefaults } from './server/ui_setting_defaults';
import { registerCspCollector } from './server/lib/csp_usage_collector';
import { injectVars } from './inject_vars';

import { kbnBaseUrl } from '../../../plugins/kibana_legacy/server';

const mkdirAsync = promisify(Fs.mkdir);

Expand All @@ -43,35 +40,7 @@ export default function (kibana) {
},

uiExports: {
app: {
id: 'kibana',
title: 'Kibana',
listed: false,
main: 'plugins/kibana/kibana',
},
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
links: [],

injectDefaultVars(server, options) {
const mapConfig = server.config().get('map');
const tilemap = mapConfig.tilemap;

return {
kbnIndex: options.index,
kbnBaseUrl,

// required on all pages due to hacks that use these values
mapConfig,
tilemapsConfig: {
deprecated: {
// If url is set, old settings must be used for backward compatibility
isOverridden: typeof tilemap.url === 'string' && tilemap.url !== '',
config: tilemap,
},
},
};
},

uiSettingDefaults: getUiSettingDefaults(),
},

Expand All @@ -90,7 +59,6 @@ export default function (kibana) {
init: async function (server) {
const { usageCollection } = server.newPlatform.setup.plugins;
registerCspCollector(usageCollection, server);
server.injectUiAppVars('kibana', () => injectVars(server));
},
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ const pluginInstance = new TableVisPlugin({} as PluginInitializerContext);
export const setup = pluginInstance.setup(npSetup.core, plugins);
export const start = pluginInstance.start(npStart.core, {
data: npStart.plugins.data,
kibanaLegacy: npStart.plugins.kibanaLegacy,
});
9 changes: 0 additions & 9 deletions src/legacy/core_plugins/kibana/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,3 @@
// Public UI styles
@import 'src/legacy/ui/public/index';

// Has to come after visualize because of some
// bad cascading in the Editor layout
@import '../../../../plugins/maps_legacy/public/index';

// Management styles
@import './management/index';

// Local application mount wrapper styles
@import 'local_application_service/index';
59 changes: 0 additions & 59 deletions src/legacy/core_plugins/kibana/public/kibana.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions src/legacy/core_plugins/kibana/public/management/index.scss

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/legacy/core_plugins/timelion/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { PluginInitializerContext } from 'kibana/public';
import { npSetup } from 'ui/new_platform';
import { npSetup, npStart } from 'ui/new_platform';
import { plugin } from '.';
import { TimelionPluginSetupDependencies } from './plugin';
import { LegacyDependenciesPlugin } from './shim';
Expand All @@ -32,4 +32,4 @@ const setupPlugins: Readonly<TimelionPluginSetupDependencies> = {
const pluginInstance = plugin({} as PluginInitializerContext);

export const setup = pluginInstance.setup(npSetup.core, setupPlugins);
export const start = pluginInstance.start();
export const start = pluginInstance.start(npStart.core, npStart.plugins);
13 changes: 11 additions & 2 deletions src/legacy/core_plugins/timelion/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
import { CoreSetup, Plugin, PluginInitializerContext, IUiSettingsClient } from 'kibana/public';
import {
CoreSetup,
Plugin,
PluginInitializerContext,
IUiSettingsClient,
CoreStart,
} from 'kibana/public';
import { getTimeChart } from './panels/timechart/timechart';
import { Panel } from './panels/panel';
import { LegacyDependenciesPlugin, LegacyDependenciesPluginSetup } from './shim';
import { KibanaLegacyStart } from '../../../../plugins/kibana_legacy/public';

/** @internal */
export interface TimelionVisualizationDependencies extends LegacyDependenciesPluginSetup {
Expand Down Expand Up @@ -59,7 +66,9 @@ export class TimelionPlugin implements Plugin<Promise<void>, void> {
dependencies.timelionPanels.set(timeChartPanel.name, timeChartPanel);
}

public start() {}
public start(core: CoreStart, { kibanaLegacy }: { kibanaLegacy: KibanaLegacyStart }) {
kibanaLegacy.loadFontAwesome();
}

public stop(): void {}
}
1 change: 0 additions & 1 deletion src/legacy/ui/public/autoload/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
import './accessibility';
import './modules';
import './settings';
import './styles';
Loading

0 comments on commit d1a6fa2

Please sign in to comment.