From 219b3f58170f9071f013e299820497761353e8be Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Tue, 5 Dec 2023 12:28:16 +0530 Subject: [PATCH] fix: update start with data event & removed temp feature flag for its dev (#29285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - Removed feature flag `ab_onboarding_flow_start_with_data_dev_only_enabled` used for development of Start with data - Updated the event for Start with data with `shortcut` -> `true` as event param #### PR fixes following issue(s) Fixes #29284 > if no issue exists, please create an issue and ask the maintainers about this first > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced app creation process with a new option to create apps from data. - **Improvements** - Streamlined onboarding flow by removing the development-only feature flag for starting with data. - **Refactor** - Renamed a property to better reflect its purpose in enabling new data source creation. - **Chores** - Removed unused feature flags and related code for a cleaner codebase. --- app/client/src/ce/entities/FeatureFlag.ts | 3 -- .../Applications/CreateNewAppsOption.tsx | 38 ++++++++----------- app/client/src/ce/sagas/ApplicationSagas.tsx | 10 +---- app/client/src/ce/utils/analyticsUtilTypes.ts | 3 +- .../CreateNewDatasourceTab.tsx | 14 +++---- .../server/featureflags/FeatureFlagEnum.java | 1 - 6 files changed, 24 insertions(+), 45 deletions(-) diff --git a/app/client/src/ce/entities/FeatureFlag.ts b/app/client/src/ce/entities/FeatureFlag.ts index 58528e62e7..eed9f7a185 100644 --- a/app/client/src/ce/entities/FeatureFlag.ts +++ b/app/client/src/ce/entities/FeatureFlag.ts @@ -34,8 +34,6 @@ export const FEATURE_FLAG = { "license_git_branch_protection_enabled", license_widget_rtl_support_enabled: "license_widget_rtl_support_enabled", release_custom_widgets_enabled: "release_custom_widgets_enabled", - ab_onboarding_flow_start_with_data_dev_only_enabled: - "ab_onboarding_flow_start_with_data_dev_only_enabled", ab_create_new_apps_enabled: "ab_create_new_apps_enabled", release_show_new_sidebar_announcement_enabled: "release_show_new_sidebar_announcement_enabled", @@ -78,7 +76,6 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = { license_git_branch_protection_enabled: false, license_widget_rtl_support_enabled: false, release_custom_widgets_enabled: false, - ab_onboarding_flow_start_with_data_dev_only_enabled: false, ab_create_new_apps_enabled: false, release_show_new_sidebar_announcement_enabled: false, rollout_app_sidebar_enabled: false, diff --git a/app/client/src/ce/pages/Applications/CreateNewAppsOption.tsx b/app/client/src/ce/pages/Applications/CreateNewAppsOption.tsx index 2f77f60571..6673673d9e 100644 --- a/app/client/src/ce/pages/Applications/CreateNewAppsOption.tsx +++ b/app/client/src/ce/pages/Applications/CreateNewAppsOption.tsx @@ -15,7 +15,6 @@ import { START_WITH_TEMPLATE_CONNECT_SUBHEADING, createMessage, } from "@appsmith/constants/messages"; -import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag"; import urlBuilder from "@appsmith/entities/URLRedirect/URLAssembly"; import type { AppState } from "@appsmith/reducers"; import { @@ -49,7 +48,6 @@ import { } from "selectors/templatesSelectors"; import styled from "styled-components"; import AnalyticsUtil from "utils/AnalyticsUtil"; -import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import history from "utils/history"; import { builderURL } from "@appsmith/RouteBuilder"; import localStorage from "utils/localStorage"; @@ -204,9 +202,6 @@ const CreateNewAppsOption = ({ currentApplicationIdForCreateNewApp, ), ); - const isEnabledForStartWithData = useFeatureFlag( - FEATURE_FLAG.ab_onboarding_flow_start_with_data_dev_only_enabled, - ); const dispatch = useDispatch(); const onClickStartFromTemplate = () => { @@ -240,17 +235,17 @@ const CreateNewAppsOption = ({ ); if (devEnabled) { // fetch plugins information to show list of all plugins - if (isEnabledForStartWithData) { - dispatch(fetchPlugins()); - dispatch(fetchMockDatasources()); - if (application?.workspaceId) { - dispatch(fetchingEnvironmentConfigs(application?.workspaceId, true)); - } - setUseType(START_WITH_TYPE.DATA); + dispatch(fetchPlugins()); + dispatch(fetchMockDatasources()); + if (application?.workspaceId) { + dispatch(fetchingEnvironmentConfigs(application?.workspaceId, true)); } + setUseType(START_WITH_TYPE.DATA); } else { if (application) { - AnalyticsUtil.logEvent("CREATE_APP_FROM_SCRATCH"); + AnalyticsUtil.logEvent("CREATE_APP_FROM_DATA", { + shortcut: "true", + }); dispatch( firstTimeUserOnboardingInit( application.id, @@ -366,6 +361,13 @@ const CreateNewAppsOption = ({ }; const selectionOptions: CardProps[] = [ + { + onClick: onClickStartWithData, + src: getAssetUrl(`${ASSETS_CDN_URL}/start-with-data.svg`), + subTitle: createMessage(START_WITH_DATA_SUBTITLE), + testid: "t--start-from-data", + title: createMessage(START_WITH_DATA_TITLE), + }, { onClick: onClickStartFromScratch, src: getAssetUrl(`${ASSETS_CDN_URL}/start-from-scratch.svg`), @@ -382,16 +384,6 @@ const CreateNewAppsOption = ({ }, ]; - if (isEnabledForStartWithData) { - selectionOptions.unshift({ - onClick: onClickStartWithData, - src: getAssetUrl(`${ASSETS_CDN_URL}/start-with-data.svg`), - subTitle: createMessage(START_WITH_DATA_SUBTITLE), - testid: "t--start-from-data", - title: createMessage(START_WITH_DATA_TITLE), - }); - } - useEffect(() => { AnalyticsUtil.logEvent("ONBOARDING_CREATE_APP_FLOW", { totalOptions: selectionOptions.length, diff --git a/app/client/src/ce/sagas/ApplicationSagas.tsx b/app/client/src/ce/sagas/ApplicationSagas.tsx index c15cce5c9e..67bacd11be 100644 --- a/app/client/src/ce/sagas/ApplicationSagas.tsx +++ b/app/client/src/ce/sagas/ApplicationSagas.tsx @@ -210,10 +210,6 @@ export function* getAllApplicationSaga() { const response: FetchUsersApplicationsWorkspacesResponse = yield call( ApplicationApi.getAllApplication, ); - const isEnabledForStartWithData: boolean = yield select( - selectFeatureFlagCheck, - FEATURE_FLAG.ab_onboarding_flow_start_with_data_dev_only_enabled, - ); const isEnabledForCreateNew: boolean = yield select( selectFeatureFlagCheck, FEATURE_FLAG.ab_create_new_apps_enabled, @@ -243,11 +239,7 @@ export function* getAllApplicationSaga() { payload: workspaceApplication, }); - if ( - isEnabledForStartWithData && - isEnabledForCreateNew && - workspaceApplication.length > 0 - ) { + if (isEnabledForCreateNew && workspaceApplication.length > 0) { yield put({ type: ReduxActionTypes.SET_CURRENT_WORKSPACE, payload: workspaceApplication[0]?.workspace, diff --git a/app/client/src/ce/utils/analyticsUtilTypes.ts b/app/client/src/ce/utils/analyticsUtilTypes.ts index de18603225..ef2ec94ac2 100644 --- a/app/client/src/ce/utils/analyticsUtilTypes.ts +++ b/app/client/src/ce/utils/analyticsUtilTypes.ts @@ -361,7 +361,8 @@ export type ONBOARDING_FLOW_EVENTS = | "ONBOARDING_CREATE_APP_FLOW" | "ONBOARDING_FLOW_CLICK_BACK_BUTTON_START_FROM_DATA_PAGE" | "ONBOARDING_FLOW_CLICK_BACK_BUTTON_DATASOURCE_FORM_PAGE" - | "ONBOARDING_FLOW_DATASOURCE_FORM_CANCEL_CLICK"; + | "ONBOARDING_FLOW_DATASOURCE_FORM_CANCEL_CLICK" + | "CREATE_APP_FROM_DATA"; export type DATASOURCE_SCHEMA_EVENTS = | "DATASOURCE_SCHEMA_SEARCH" diff --git a/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx b/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx index 33e70b82fb..7eff4fbb27 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx @@ -203,7 +203,7 @@ interface CreateNewDatasourceScreenProps { showDebugger: boolean; pageId: string; isAppSidebarEnabled: boolean; - isEnabledForStartWithData: boolean; + isEnabledForCreateNew: boolean; } interface CreateNewDatasourceScreenState { @@ -235,7 +235,7 @@ class CreateNewDatasourceTab extends React.Component< dataSources, isAppSidebarEnabled, isCreating, - isEnabledForStartWithData, + isEnabledForCreateNew, pageId, } = this.props; if (!canCreateDatasource) return null; @@ -260,7 +260,7 @@ class CreateNewDatasourceTab extends React.Component< )} - {isEnabledForStartWithData && ( + {isEnabledForCreateNew && ( <> { userWorkspacePermissions, ); - const isEnabledForStartWithData = - !!featureFlags[ - FEATURE_FLAG.ab_onboarding_flow_start_with_data_dev_only_enabled - ]; + const isEnabledForCreateNew = + !!featureFlags[FEATURE_FLAG.ab_create_new_apps_enabled]; const isAppSidebarEnabled = getIsAppSidebarEnabled(state); return { dataSources: getDatasources(state), @@ -339,7 +337,7 @@ const mapStateToProps = (state: AppState) => { showDebugger, pageId, isAppSidebarEnabled, - isEnabledForStartWithData, + isEnabledForCreateNew, }; }; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/featureflags/FeatureFlagEnum.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/featureflags/FeatureFlagEnum.java index 26d16a3b90..b8742b34a2 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/featureflags/FeatureFlagEnum.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/featureflags/FeatureFlagEnum.java @@ -29,7 +29,6 @@ public enum FeatureFlagEnum { release_embed_hide_share_settings_enabled, ab_mock_mongo_schema_enabled, rollout_datasource_test_rate_limit_enabled, - ab_onboarding_flow_start_with_data_dev_only_enabled, // Add EE flags below this line, to avoid conflicts. }