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

[Backport 2.x] Adding feature flag to OpenSearch Flow #518

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 4 additions & 9 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
"server": true,
"ui": true,
"requiredBundles": [],
"requiredPlugins": [
"navigation",
"opensearchDashboardsUtils"
],
"requiredPlugins": ["navigation", "opensearchDashboardsUtils"],
"optionalPlugins": [
"dataSource",
"dataSourceManagement",
"contentManagement"
],
"supportedOSDataSourceVersions": ">=2.18.0 <4.0.0",
"requiredOSDataSourcePlugins": [
"opensearch-ml",
"opensearch-flow-framework"
]
}
"requiredOSDataSourcePlugins": ["opensearch-ml", "opensearch-flow-framework"],
"configPath": ["flowFrameworkDashboards"]
}
10 changes: 9 additions & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { PluginInitializerContext } from '../../../src/core/server';
import {
PluginConfigDescriptor,
PluginInitializerContext,
} from '../../../src/core/server';
import { FlowFrameworkDashboardsPlugin } from './plugin';
import { configSchema, ConfigSchema } from '../server/types';

export const config: PluginConfigDescriptor<ConfigSchema> = {
schema: configSchema,
};

// This exports static code and TypeScript types,
// as well as, OpenSearch Dashboards Platform `plugin()` initializer.
Expand Down
8 changes: 8 additions & 0 deletions server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { schema, TypeOf } from '@osd/config-schema';

export const configSchema = schema.object({
enabled: schema.maybe(schema.boolean()),
});

export type ConfigSchema = TypeOf<typeof configSchema>;

export interface FlowFrameworkDashboardsPluginSetup {}
export interface FlowFrameworkDashboardsPluginStart {}
Loading