Skip to content

Commit

Permalink
fix: Hide custom extensions in navigation based on feature flag (kyma…
Browse files Browse the repository at this point in the history
  • Loading branch information
akucharska authored Dec 16, 2024
1 parent 49e02d8 commit 5ce3857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/state/resourceList/mapExtResourceToNavNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getExtensibilityPath } from 'components/Extensibility/helpers/getExtensibilityPath';
import pluralize from 'pluralize';

import { ExtResource, NavNode } from '../types';
import { configFeaturesNames, ExtResource, NavNode } from '../types';

export const mapExtResourceToNavNode = (extRes: ExtResource) => {
const node: NavNode = {} as NavNode;
Expand All @@ -14,6 +14,11 @@ export const mapExtResourceToNavNode = (extRes: ExtResource) => {
node.namespaced = extRes.general.scope === 'namespace';
node.apiGroup = extRes.general.resource.group || '';
node.apiVersion = extRes.general.resource.version;
if (extRes.general.customElement) {
node.requiredFeatures = [
configFeaturesNames.EXTENSIBILITY_CUSTOM_COMPONENTS,
];
}

return node;
};
1 change: 1 addition & 0 deletions src/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export type ExtGeneral = {
icon?: string;
id?: string;
externalNodes?: ExtensibilityNodesExt[];
customElement?: string;
};

export type ExtResource = {
Expand Down

0 comments on commit 5ce3857

Please sign in to comment.