Skip to content

Commit

Permalink
get rid of ui modules and fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Oct 17, 2019
1 parent b130290 commit 9276ba5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/dev/i18n/extractors/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function* extractCodeMessages(buffer, reporter) {
try {
ast = parse(buffer.toString(), {
sourceType: 'module',
plugins: ['jsx', 'typescript', 'objectRestSpread', 'classProperties', 'asyncGenerators'],
plugins: ['jsx', 'typescript', 'objectRestSpread', 'classProperties', 'asyncGenerators', 'dynamicImport'],
});
} catch (error) {
if (error instanceof SyntaxError) {
Expand Down
4 changes: 4 additions & 0 deletions src/legacy/ui/public/new_platform/new_platform.karma_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export const npStart = {

export function __setup__(coreSetup) {
npSetup.core = coreSetup;

// no-op application register calls (this is overwritten to
// bootstrap an LP plugin outside of tests)
npSetup.core.application.register = () => {};
}

export function __start__(coreStart) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { uiModules } from 'ui/modules';
import { SavedObjectProvider } from 'ui/saved_objects/saved_object';
import { i18n } from '@kbn/i18n';
import {
extractReferences,
injectReferences,
} from './saved_workspace_references';

const module = uiModules.get('app/dashboard');

export function SavedWorkspaceProvider(Private) {
// SavedWorkspace constructor. Usually you'd interact with an instance of this.
// ID is option, without it one will be generated on save.
Expand Down Expand Up @@ -68,8 +65,3 @@ export function SavedWorkspaceProvider(Private) {
SavedWorkspace.searchsource = false;
return SavedWorkspace;
}

// Used only by the savedDashboards service, usually no reason to change this
module.factory('SavedGraphWorkspace', function (Private) {
return Private(SavedWorkspaceProvider);
});
22 changes: 9 additions & 13 deletions x-pack/legacy/plugins/graph/public/hacks/toggle_app_link_in_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { uiModules } from 'ui/modules';
import { npStart } from 'ui/new_platform';
import { xpackInfo } from 'plugins/xpack_main/services/xpack_info';

uiModules.get('xpack/graph')
.run(() => {
const navLinkUpdates = {};
navLinkUpdates.hidden = true;
const showAppLink = xpackInfo.get('features.graph.showAppLink', false);
navLinkUpdates.hidden = !showAppLink;
if (showAppLink) {
navLinkUpdates.disabled = !xpackInfo.get('features.graph.enableAppLink', false);
navLinkUpdates.tooltip = xpackInfo.get('features.graph.message');
}
const navLinkUpdates = {};
navLinkUpdates.hidden = true;
const showAppLink = xpackInfo.get('features.graph.showAppLink', false);
navLinkUpdates.hidden = !showAppLink;
if (showAppLink) {
navLinkUpdates.disabled = !xpackInfo.get('features.graph.enableAppLink', false);
navLinkUpdates.tooltip = xpackInfo.get('features.graph.message');
}

npStart.core.chrome.navLinks.update('graph', navLinkUpdates);
});
npStart.core.chrome.navLinks.update('graph', navLinkUpdates);

0 comments on commit 9276ba5

Please sign in to comment.