From a4a364e7c1f00a2a286a1f0f37134b8a5ce91f37 Mon Sep 17 00:00:00 2001 From: Ashok Kumar M <35134347+marks0351@users.noreply.github.com> Date: Thu, 11 Apr 2024 19:03:39 +0530 Subject: [PATCH] chore: fix ee type checks issue. (#32612) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1RhworVRJTWKPbR01bvcARyY7mXv5SA%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=-JgUAyW) ## Description Fixing type check fails. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.MobileResponsive" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: b2aa34efcacd0c5603b45dd177d8259500ee8c38 > Cypress dashboard url: Click here! --- app/client/src/actions/featureFlagActions.ts | 2 +- app/client/src/ce/entities/FeatureFlag.ts | 1 - app/client/src/ce/selectors/featureFlagsSelectors.ts | 7 ++----- app/client/src/reducers/uiReducers/usersReducer.ts | 6 ++---- app/client/src/utils/hooks/useFeatureFlagOverride.ts | 6 ++---- app/client/src/utils/storage.ts | 2 +- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app/client/src/actions/featureFlagActions.ts b/app/client/src/actions/featureFlagActions.ts index 1311ecfeaa..a805cfa1d0 100644 --- a/app/client/src/actions/featureFlagActions.ts +++ b/app/client/src/actions/featureFlagActions.ts @@ -1,5 +1,5 @@ import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants"; -import type { OverriddenFeatureFlags } from "@appsmith/entities/FeatureFlag"; +import type { OverriddenFeatureFlags } from "utils/hooks/useFeatureFlagOverride"; export const setFeatureFlagOverridesAction = ( overrides: OverriddenFeatureFlags, diff --git a/app/client/src/ce/entities/FeatureFlag.ts b/app/client/src/ce/entities/FeatureFlag.ts index 8bb2712afd..29c19a8b25 100644 --- a/app/client/src/ce/entities/FeatureFlag.ts +++ b/app/client/src/ce/entities/FeatureFlag.ts @@ -61,7 +61,6 @@ export const FEATURE_FLAG = { export type FeatureFlag = keyof typeof FEATURE_FLAG; export type FeatureFlags = Record; -export type OverriddenFeatureFlags = Partial>; export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = { TEST_FLAG: true, diff --git a/app/client/src/ce/selectors/featureFlagsSelectors.ts b/app/client/src/ce/selectors/featureFlagsSelectors.ts index 66e4216de6..9bcc0efef5 100644 --- a/app/client/src/ce/selectors/featureFlagsSelectors.ts +++ b/app/client/src/ce/selectors/featureFlagsSelectors.ts @@ -1,12 +1,9 @@ import type { AppState } from "@appsmith/reducers"; -import type { - FeatureFlag, - FeatureFlags, - OverriddenFeatureFlags, -} from "@appsmith/entities/FeatureFlag"; +import type { FeatureFlag, FeatureFlags } from "@appsmith/entities/FeatureFlag"; import { createSelector } from "reselect"; import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag"; import memoize from "micro-memoize"; +import type { OverriddenFeatureFlags } from "utils/hooks/useFeatureFlagOverride"; const combineFeatureFlags = memoize( (featureFlags: FeatureFlags, overriddenFlags: OverriddenFeatureFlags) => { diff --git a/app/client/src/reducers/uiReducers/usersReducer.ts b/app/client/src/reducers/uiReducers/usersReducer.ts index e325460582..4dd7b52ba3 100644 --- a/app/client/src/reducers/uiReducers/usersReducer.ts +++ b/app/client/src/reducers/uiReducers/usersReducer.ts @@ -8,11 +8,9 @@ import { import type { User } from "constants/userConstants"; import { DefaultCurrentUserDetails } from "constants/userConstants"; -import type { - FeatureFlags, - OverriddenFeatureFlags, -} from "@appsmith/entities/FeatureFlag"; +import type { FeatureFlags } from "@appsmith/entities/FeatureFlag"; import { DEFAULT_FEATURE_FLAG_VALUE } from "@appsmith/entities/FeatureFlag"; +import type { OverriddenFeatureFlags } from "utils/hooks/useFeatureFlagOverride"; const initialState: UsersReduxState = { loadingStates: { diff --git a/app/client/src/utils/hooks/useFeatureFlagOverride.ts b/app/client/src/utils/hooks/useFeatureFlagOverride.ts index 07298f7411..99625d941e 100644 --- a/app/client/src/utils/hooks/useFeatureFlagOverride.ts +++ b/app/client/src/utils/hooks/useFeatureFlagOverride.ts @@ -1,7 +1,4 @@ -import type { - FeatureFlag, - OverriddenFeatureFlags, -} from "@appsmith/entities/FeatureFlag"; +import type { FeatureFlag } from "@appsmith/entities/FeatureFlag"; import { setFeatureFlagOverridesAction, updateFeatureFlagOverrideAction, @@ -20,6 +17,7 @@ export const AvailableFeaturesToOverride: FeatureFlag[] = [ "ab_wds_enabled", "release_layout_conversion_enabled", ]; +export type OverriddenFeatureFlags = Partial>; export const useFeatureFlagOverride = () => { const dispatch = useDispatch(); diff --git a/app/client/src/utils/storage.ts b/app/client/src/utils/storage.ts index ef8b0b944b..300d4a0024 100644 --- a/app/client/src/utils/storage.ts +++ b/app/client/src/utils/storage.ts @@ -5,8 +5,8 @@ import type { VersionUpdateState } from "../sagas/WebsocketSagas/versionUpdatePr import { isNumber } from "lodash"; import { EditorModes } from "components/editorComponents/CodeEditor/EditorConfig"; import type { EditorViewMode } from "@appsmith/entities/IDE/constants"; +import type { OverriddenFeatureFlags } from "./hooks/useFeatureFlagOverride"; import { AvailableFeaturesToOverride } from "./hooks/useFeatureFlagOverride"; -import type { OverriddenFeatureFlags } from "@appsmith/entities/FeatureFlag"; export const STORAGE_KEYS: { [id: string]: string;