File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to Elasticsearch B.V. under one or more contributor
3+ * license agreements. See the NOTICE file distributed with
4+ * this work for additional information regarding copyright
5+ * ownership. Elasticsearch B.V. licenses this file to you under
6+ * the Apache License, Version 2.0 (the "License"); you may
7+ * not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
19+
20+ import { schema , TypeOf } from '@kbn/config-schema' ;
21+
22+ export const configSchema = schema . object ( {
23+ allowByValueEmbeddables : schema . boolean ( { defaultValue : false } ) ,
24+ } ) ;
25+
26+ export type ConfigSchema = TypeOf < typeof configSchema > ;
Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ declare module '../../share/public' {
9494
9595export type DashboardUrlGenerator = UrlGeneratorContract < typeof DASHBOARD_APP_URL_GENERATOR > ;
9696
97+ interface DashboardFeatureFlagConfig {
98+ allowByValueEmbeddables : boolean ;
99+ }
100+
97101interface SetupDependencies {
98102 data : DataPublicPluginSetup ;
99103 embeddable : EmbeddableSetup ;
@@ -125,6 +129,7 @@ export interface DashboardStart {
125129 embeddableType : string ;
126130 } ) => void | undefined ;
127131 dashboardUrlGenerator ?: DashboardUrlGenerator ;
132+ dashboardFeatureFlagConfig : DashboardFeatureFlagConfig ;
128133 DashboardContainerByValueRenderer : ReturnType < typeof createDashboardContainerByValueRenderer > ;
129134}
130135
@@ -411,6 +416,7 @@ export class DashboardPlugin
411416 getSavedDashboardLoader : ( ) => savedDashboardLoader ,
412417 addEmbeddableToDashboard : this . addEmbeddableToDashboard . bind ( this , core ) ,
413418 dashboardUrlGenerator : this . dashboardUrlGenerator ,
419+ dashboardFeatureFlagConfig : this . initializerContext . config . get < DashboardFeatureFlagConfig > ( ) ,
414420 DashboardContainerByValueRenderer : createDashboardContainerByValueRenderer ( {
415421 factory : dashboardContainerFactory ,
416422 } ) ,
Original file line number Diff line number Diff line change 1717 * under the License.
1818 */
1919
20- import { PluginInitializerContext } from '../../../core/server' ;
20+ import { PluginInitializerContext , PluginConfigDescriptor } from '../../../core/server' ;
2121import { DashboardPlugin } from './plugin' ;
22+ import { configSchema , ConfigSchema } from '../config' ;
23+
24+ export const config : PluginConfigDescriptor < ConfigSchema > = {
25+ exposeToBrowser : {
26+ allowByValueEmbeddables : true ,
27+ } ,
28+ schema : configSchema ,
29+ } ;
2230
2331// This exports static code and TypeScript types,
2432// as well as, Kibana Platform `plugin()` initializer.
You can’t perform that action at this time.
0 commit comments