Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
CNV-48259: add flag for reference into other plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
upalatucci committed Sep 11, 2024
1 parent 84abc5b commit 5ca55e5
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ cypress/screenshots

## Helm gitignore

tmp/
tmp/
.DS_Store
2 changes: 1 addition & 1 deletion cypress/e2e/StatusList.spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('NodeNetworkState list', () => {
cy.get('table').should('contain', nns.metadata.name);

// open filter toolbar
cy.get(ROW_FILTERS_BUTTON).click();
cy.get('button').contains('Filter').click();

cy.get(LLDP_ENABLED_FILTER).check();

Expand Down
2 changes: 1 addition & 1 deletion cypress/support/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const EXPAND_INTERFACE_INFO = 'ethernet-expandable-section-toggle';
export const INTERFACE_DRAWER_TEST_ID = 'interface-drawer';
export const LLDP_DRAWER_DETAILS_SECTION_TEST_ID = 'lldp-section';

export const ROW_FILTERS_BUTTON = 'button.pf-v5-c-select__toggle';
export const ROW_FILTERS_BUTTON = 'button.pf-v5-c-menu-toggle';

export const LLDP_ENABLED_FILTER = '#enabled[type="checkbox"]';

Expand Down
19 changes: 15 additions & 4 deletions plugin-manifest.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { EncodedExtension } from '@openshift/dynamic-plugin-sdk';
import type { ConsolePluginMetadata } from '@openshift-console/dynamic-plugin-sdk-webpack/lib/schema/plugin-package';
import { FeatureFlag } from '@openshift-console/dynamic-plugin-sdk';
import type { ConsolePluginBuildMetadata } from '@openshift-console/dynamic-plugin-sdk-webpack';

import { PolicyExposedModules, PolicyExtensions } from './src/views/policies/manifest';
import { StateExposedModules, StateExtensions } from './src/views/states/manifest';

export const pluginMetadata = {
export const pluginMetadata: ConsolePluginBuildMetadata = {
name: 'nmstate-console-plugin',
version: '0.0.1',
displayName: 'OpenShift Console Plugin For NMState',
Expand All @@ -13,10 +14,20 @@ export const pluginMetadata = {
exposedModules: {
...PolicyExposedModules,
...StateExposedModules,
nmstateFlags: './utils/flags',
},
dependencies: {
'@console/pluginAPI': '*',
},
} as ConsolePluginMetadata;
};

export const extensions: EncodedExtension[] = [...PolicyExtensions, ...StateExtensions];
export const extensions: EncodedExtension[] = [
{
properties: {
handler: { $codeRef: 'nmstateFlags.enableNMStateDynamicFlag' },
},
type: 'console.flag',
} as EncodedExtension<FeatureFlag>,
...PolicyExtensions,
...StateExtensions,
];
1 change: 1 addition & 0 deletions src/utils/flags/consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const FLAG_NMSTATE_DYNAMIC = 'NMSTATE_DYNAMIC';
6 changes: 6 additions & 0 deletions src/utils/flags/enableNMStateDynamicFlag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { SetFeatureFlag } from '@openshift-console/dynamic-plugin-sdk';

import { FLAG_NMSTATE_DYNAMIC } from './consts';

export const enableNMStateDynamicFlag = (setFeatureFlag: SetFeatureFlag) =>
setFeatureFlag(FLAG_NMSTATE_DYNAMIC, true);
1 change: 1 addition & 0 deletions src/utils/flags/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { enableNMStateDynamicFlag } from './enableNMStateDynamicFlag';

0 comments on commit 5ca55e5

Please sign in to comment.