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

[Canvas] Switch Canvas to use React Router #100579

Merged
merged 13 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,21 @@
"@kbn/config": "link:bazel-bin/packages/kbn-config/npm_module",
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module",
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto/npm_module",
"@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module",
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n/npm_module",
"@kbn/interpreter": "link:packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging/npm_module",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
"@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module",
"@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils",
"@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module",
"@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module",
"@kbn/securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module",
"@kbn/securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module",
"@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module",
"@kbn/securitysolution-io-ts-utils": "link:bazel-bin/packages/kbn-securitysolution-io-ts-utils/npm_module",
"@kbn/securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module",
"@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module",
"@kbn/securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks/npm_module",
"@kbn/securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils/npm_module",
"@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils/npm_module",
Expand All @@ -161,7 +162,6 @@
"@mapbox/mapbox-gl-draw": "^1.2.0",
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
"@mapbox/vector-tile": "1.3.1",
"@scant/router": "^0.1.1",
"@slack/webhook": "^5.0.4",
"@turf/along": "6.0.1",
"@turf/area": "6.0.1",
Expand Down Expand Up @@ -272,7 +272,6 @@
"json-stringify-safe": "5.0.1",
"jsonwebtoken": "^8.5.1",
"jsts": "^1.6.2",
"@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils",
"kea": "^2.4.2",
"leaflet": "1.5.1",
"leaflet-draw": "0.4.14",
Expand Down
8 changes: 8 additions & 0 deletions x-pack/plugins/canvas/i18n/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,14 @@ export const ComponentStrings = {
i18n.translate('xpack.canvas.workpadHeaderKioskControl.controlTitle', {
defaultMessage: 'Cycle fullscreen pages',
}),
getAutoplayListDurationManualText: () =>
i18n.translate('xpack.canvas.workpadHeaderKioskControl.autoplayListDurationManual', {
defaultMessage: 'Manually',
}),
getDisableTooltip: () =>
i18n.translate('xpack.canvas.workpadHeaderKioskControl.disableTooltip', {
defaultMessage: 'Disable auto-play',
}),
},
WorkpadHeaderRefreshControlSettings: {
getRefreshAriaLabel: () =>
Expand Down
11 changes: 0 additions & 11 deletions x-pack/plugins/canvas/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { includes, remove } from 'lodash';
import { AppMountParameters, CoreStart, CoreSetup, AppUpdater } from 'kibana/public';

import { CanvasStartDeps, CanvasSetupDeps } from './plugin';
// @ts-expect-error untyped local
import { App } from './components/app';
import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public';
import { registerLanguage } from './lib/monaco_language_def';
Expand All @@ -32,10 +31,6 @@ import { init as initStatsReporter } from './lib/ui_metric';
import { CapabilitiesStrings } from '../i18n';

import { startServices, services, ServicesProvider } from './services';
// @ts-expect-error untyped local
import { createHistory, destroyHistory } from './lib/history_provider';
// @ts-expect-error untyped local
import { stopRouter } from './lib/router_provider';
import { initFunctions } from './functions';
// @ts-expect-error untyped local
import { appUnload } from './state/actions/app';
Expand Down Expand Up @@ -103,9 +98,6 @@ export const initializeCanvas = async (
services.expressions.getService().registerFunction(fn);
}

// Re-initialize our history
createHistory();

// Create Store
const canvasStore = await createStore(coreSetup, setupPlugins);

Expand Down Expand Up @@ -178,7 +170,4 @@ export const teardownCanvas = (coreStart: CoreStart, startPlugins: CanvasStartDe

coreStart.chrome.setBadge(undefined);
coreStart.chrome.setHelpExtension(undefined);

destroyHistory();
stopRouter();
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole file makes me happy... and it's the first code file I'm reviewing. 🚀

55 changes: 0 additions & 55 deletions x-pack/plugins/canvas/public/apps/export/routes.ts

This file was deleted.

16 changes: 0 additions & 16 deletions x-pack/plugins/canvas/public/apps/home/home_app/home_app.ts

This file was deleted.

22 changes: 0 additions & 22 deletions x-pack/plugins/canvas/public/apps/home/routes.ts

This file was deleted.

15 changes: 0 additions & 15 deletions x-pack/plugins/canvas/public/apps/index.ts

This file was deleted.

110 changes: 0 additions & 110 deletions x-pack/plugins/canvas/public/apps/workpad/routes.ts

This file was deleted.

74 changes: 0 additions & 74 deletions x-pack/plugins/canvas/public/components/app/app.js

This file was deleted.

Loading