mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-28 07:04:10 +00:00
* 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.
21 lines
580 B
JavaScript
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;
|
|
};
|