-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
review: conform closer to NP standards
- Loading branch information
1 parent
2e01b85
commit 9f855e4
Showing
13 changed files
with
157 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/legacy/core_plugins/dashboard_embeddable_container/public/shim/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { PluginInitializerContext } from 'kibana/public'; | ||
import { npSetup, npStart } from 'ui/new_platform'; | ||
import { embeddablePlugin } from '../../../embeddable_api/public'; | ||
import { Plugin } from './plugin'; | ||
|
||
export function plugin(initializerContext: PluginInitializerContext) { | ||
const dashboardContainerPlugin = new Plugin(initializerContext); | ||
|
||
dashboardContainerPlugin.setup(npSetup.core, { | ||
embeddable: embeddablePlugin, | ||
}); | ||
|
||
dashboardContainerPlugin.start(npStart.core, { | ||
embeddable: embeddablePlugin, | ||
}); | ||
} | ||
|
||
plugin({} as any); |
48 changes: 48 additions & 0 deletions
48
src/legacy/core_plugins/dashboard_embeddable_container/public/shim/plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/public'; | ||
import { EmbeddablePlugin, CONTEXT_MENU_TRIGGER } from '../../../embeddable_api/public'; | ||
import { ExpandPanelAction, EXPAND_PANEL_ACTION } from '../actions/expand_panel_action'; | ||
import { DashboardContainerFactory } from '../embeddable'; | ||
|
||
export class Plugin { | ||
constructor(initializerContext: PluginInitializerContext) {} | ||
|
||
public setup(core: CoreSetup, plugins: { embeddable: EmbeddablePlugin }) { | ||
plugins.embeddable.addAction(new ExpandPanelAction()); | ||
plugins.embeddable.attachAction({ | ||
triggerId: CONTEXT_MENU_TRIGGER, | ||
actionId: EXPAND_PANEL_ACTION, | ||
}); | ||
} | ||
|
||
public start(core: CoreStart, plugins: { embeddable: EmbeddablePlugin }) { | ||
plugins.embeddable.addEmbeddableFactory( | ||
new DashboardContainerFactory({ | ||
capabilities: core.application.capabilities.dashboard as { | ||
showWriteControls: boolean; | ||
createNew: boolean; | ||
}, | ||
}) | ||
); | ||
} | ||
|
||
public stop() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { Action, actionRegistry } from './actions'; | ||
import { EmbeddableFactory, embeddableFactories } from './embeddables'; | ||
import { EmbeddablePlugin } from './types'; | ||
import { attachAction, triggerRegistry } from './triggers'; | ||
|
||
export const embeddablePlugin: EmbeddablePlugin = { | ||
addAction: (action: Action) => actionRegistry.set(action.id, action), | ||
addEmbeddableFactory: (factory: EmbeddableFactory) => | ||
embeddableFactories.set(factory.type, factory), | ||
attachAction: data => attachAction(triggerRegistry, data), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters