Add feature flag for datasource setting checks

This commit is contained in:
Adria Navarro 2025-01-23 19:34:03 +01:00
parent 012bb4e1cc
commit 388a94aee1
3 changed files with 9 additions and 0 deletions

View File

@ -9,3 +9,4 @@ export {
lowercase, lowercase,
isBuilderInputFocused, isBuilderInputFocused,
} from "./helpers" } from "./helpers"
export * as featureFlag from "./featureFlags"

View File

@ -5,9 +5,15 @@ import { viewsV2 } from "./viewsV2"
import { findComponentsBySettingsType } from "@/helpers/screen" import { findComponentsBySettingsType } from "@/helpers/screen"
import { Screen, Table, ViewV2 } from "@budibase/types" import { Screen, Table, ViewV2 } from "@budibase/types"
import { featureFlag } from "@/helpers"
export const screenComponentErrors = derived( export const screenComponentErrors = derived(
[selectedScreen, tables, viewsV2], [selectedScreen, tables, viewsV2],
([$selectedScreen, $tables, $viewsV2]): Record<string, string[]> => { ([$selectedScreen, $tables, $viewsV2]): Record<string, string[]> => {
if (!featureFlag.isEnabled("CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS")) {
return {}
}
function flattenTablesAndViews(tables: Table[], views: ViewV2[]) { function flattenTablesAndViews(tables: Table[], views: ViewV2[]) {
return { return {
...tables.reduce( ...tables.reduce(

View File

@ -1,5 +1,6 @@
export enum FeatureFlag { export enum FeatureFlag {
USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR", USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR",
CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS = "CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS",
// Account-portal // Account-portal
DIRECT_LOGIN_TO_ACCOUNT_PORTAL = "DIRECT_LOGIN_TO_ACCOUNT_PORTAL", DIRECT_LOGIN_TO_ACCOUNT_PORTAL = "DIRECT_LOGIN_TO_ACCOUNT_PORTAL",
@ -7,6 +8,7 @@ export enum FeatureFlag {
export const FeatureFlagDefaults = { export const FeatureFlagDefaults = {
[FeatureFlag.USE_ZOD_VALIDATOR]: false, [FeatureFlag.USE_ZOD_VALIDATOR]: false,
[FeatureFlag.CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS]: false,
// Account-portal // Account-portal
[FeatureFlag.DIRECT_LOGIN_TO_ACCOUNT_PORTAL]: false, [FeatureFlag.DIRECT_LOGIN_TO_ACCOUNT_PORTAL]: false,