Files
bruno/packages/bruno-app/src/utils/beta-features.js
Abhishek S Lal c0a2d74789 Feat/openapi sync beta tag (#7461)
* feat: introduce OpenAPI Sync beta feedback feature

- Added a feedback section in the OpenAPISyncTab and ConnectSpecForm to encourage user input during the beta phase.
- Styled the feedback message and button for better visibility.
- Updated the beta features list to include OpenAPI Sync and adjusted related components to reflect its beta status with appropriate badges.
- Enhanced the StatusBadge component to support a new 'xs' size for better integration in various UI elements.

* feat: integrate OpenAPI Sync beta feature toggle

- Updated the ImportCollectionLocation component to conditionally enable the "Check for Spec Updates" option based on the OpenAPI Sync beta feature status.
- Modified default preferences to disable OpenAPI Sync by default, ensuring users are not prompted for updates unless explicitly enabled.

* feat: enhance beta features integration in Preferences

- Updated the BETA_FEATURES array to use constants from utils/beta-features for better maintainability.
- Improved the handling of beta preferences by merging new preferences with existing ones, ensuring a smoother user experience when toggling features.

* feat: enhance OpenAPI Sync polling with beta feature toggle

- Integrated a beta feature toggle for OpenAPI Sync polling, allowing conditional activation based on user settings.
- Updated the pollingEnabled logic to incorporate the new beta feature status, ensuring better control over sync behavior.
2026-03-13 11:29:04 +05:30

21 lines
580 B
JavaScript

import { useSelector } from 'react-redux';
/**
* Beta features configuration object
* Contains all available beta feature keys
*/
export const BETA_FEATURES = Object.freeze({
NODE_VM: 'nodevm',
OPENAPI_SYNC: 'openapi-sync'
});
/**
* Hook to check if a beta feature is enabled
* @param {string} featureName - The name of the beta feature
* @returns {boolean} - Whether the feature is enabled
*/
export const useBetaFeature = (featureName) => {
const preferences = useSelector((state) => state.app.preferences);
return preferences?.beta?.[featureName] || false;
};