fix: disabled feature walkthroughs behind a flag (#31007)

## Description

This PR removes the feature walkthroughs that were added as part of one
of the activation experiments in Q3. Although these walkthroughs were
useful in guiding users, they were appearing in untimely and incorrect
fashion.

#### PR fixes following issue(s)
Fixes #30339 
#### 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)
>
>
>
## 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
- [x] 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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Introduced a feature flag to toggle the feature walkthrough on or off.
- Added the ability to force display the feature walkthrough regardless
of the feature flag setting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
This commit is contained in:
sneha122 2024-02-13 16:44:59 +05:30 committed by GitHub
parent 92397c4559
commit 3b3b3b4476
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 9 deletions

View File

@ -51,6 +51,8 @@ export const FEATURE_FLAG = {
rollout_editor_pane_segments_enabled: "rollout_editor_pane_segments_enabled",
release_show_create_app_from_templates_enabled:
"release_show_create_app_from_templates_enabled",
rollout_remove_feature_walkthrough_enabled:
"rollout_remove_feature_walkthrough_enabled",
} as const;
export type FeatureFlag = keyof typeof FEATURE_FLAG;
@ -92,6 +94,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
release_actions_redesign_enabled: false,
rollout_editor_pane_segments_enabled: false,
release_show_create_app_from_templates_enabled: false,
rollout_remove_feature_walkthrough_enabled: false,
};
export const AB_TESTING_EVENT_KEYS = {

View File

@ -8,6 +8,10 @@ import { useLocation } from "react-router-dom";
import AnalyticsUtil from "utils/AnalyticsUtil";
import { isElementVisible } from "./utils";
import { hideIndicator } from "components/utils/Indicator";
import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag";
import { selectFeatureFlagCheck } from "@appsmith/selectors/featureFlagsSelectors";
import { useSelector } from "react-redux";
import type { AppState } from "@appsmith/reducers";
const WalkthroughRenderer = lazy(async () => {
return retryPromise(
@ -26,18 +30,27 @@ export default function Walkthrough({ children }: any) {
const [feature, setFeature] = useState<FeatureParams[]>([]);
const location = useLocation();
const isWalkthroughDisabled = useSelector((state: AppState) =>
selectFeatureFlagCheck(
state,
FEATURE_FLAG.rollout_remove_feature_walkthrough_enabled,
),
);
const pushFeature = (value: FeatureParams, prioritize = false) => {
const alreadyExists = feature.some((f) => f.targetId === value.targetId);
if (!alreadyExists) {
const _value = Array.isArray(value) ? [...value] : [value];
if (prioritize) {
// Get ahead of the queue
setFeature((e) => [..._value, ...e]);
} else {
setFeature((e) => [...e, ..._value]);
if (!isWalkthroughDisabled || !!value?.forceExecution) {
const alreadyExists = feature.some((f) => f.targetId === value.targetId);
if (!alreadyExists) {
const _value = Array.isArray(value) ? [...value] : [value];
if (prioritize) {
// Get ahead of the queue
setFeature((e) => [..._value, ...e]);
} else {
setFeature((e) => [...e, ..._value]);
}
}
updateActiveWalkthrough();
}
updateActiveWalkthrough();
};
const popFeature = (triggeredFrom?: string) => {

View File

@ -67,6 +67,9 @@ export interface FeatureParams {
dismissOnOverlayClick?: boolean;
// execute function just before showing walkthrough highlight
runBeforeWalkthrough?: () => void;
// If we want to force the display of walkthrough, set this prop to true
// If set to true, will override the feature flag as well
forceExecution?: boolean;
}
interface WalkthroughContextType {