Merge pull request #32061 from elaine-mattos/feat/add-description-plugin-feature-flags
feat(core-plugin-api): add optional description to plugin feature flags
This commit is contained in:
@@ -103,7 +103,10 @@ describe('createSpecializedApp', () => {
|
||||
features: [
|
||||
createFrontendPlugin({
|
||||
pluginId: 'test',
|
||||
featureFlags: [{ name: 'a' }, { name: 'b' }],
|
||||
featureFlags: [
|
||||
{ name: 'a' },
|
||||
{ name: 'b', description: 'Feature B description' },
|
||||
],
|
||||
extensions: [
|
||||
createExtension({
|
||||
attachTo: { id: 'root', input: 'app' },
|
||||
@@ -146,6 +149,11 @@ describe('createSpecializedApp', () => {
|
||||
|
||||
expect(screen.getByText('flags:test=a,test=b')).toBeInTheDocument();
|
||||
|
||||
expect(flags).toEqual([
|
||||
{ name: 'a', pluginId: 'test' },
|
||||
{ name: 'b', pluginId: 'test', description: 'Feature B description' },
|
||||
]);
|
||||
|
||||
expect(app.apis).toMatchInlineSnapshot(`
|
||||
ApiResolver {
|
||||
"apis": Map {
|
||||
|
||||
@@ -346,6 +346,7 @@ export function createSpecializedApp(options?: CreateSpecializedAppOptions): {
|
||||
OpaqueFrontendPlugin.toInternal(feature).featureFlags.forEach(flag =>
|
||||
featureFlagApi.registerFlag({
|
||||
name: flag.name,
|
||||
description: flag.description,
|
||||
pluginId: feature.id,
|
||||
}),
|
||||
);
|
||||
@@ -354,6 +355,7 @@ export function createSpecializedApp(options?: CreateSpecializedAppOptions): {
|
||||
toInternalFrontendModule(feature).featureFlags.forEach(flag =>
|
||||
featureFlagApi.registerFlag({
|
||||
name: flag.name,
|
||||
description: flag.description,
|
||||
pluginId: feature.pluginId,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user