PromucFlow_constructor/app/client/src/selectors/onboardingSelectors.tsx
albinAppsmith ced4ffa179
fix: Remove guided tour code (#30387)
## Description

Removed the guided tour code.

#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/30332

#### Type of change

- Bug fix (non-breaking change which fixes an issue)
- Chore (housekeeping or task changes that don't impact user perception)

## 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
- [x] My code follows the style guidelines of this project
- [x] 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
- [x] 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

- **Chores**
  - Streamlined onboarding process by removing guided tour features.
- Refined action and message management for a more intuitive user
experience.
  - Enhanced property controls generation for better user interaction.

- **Refactor**
- Simplified various components by removing unnecessary guided tour
logic.
  - Improved application and page sagas for more efficient operation.
  - Refined editor components for a smoother user interface.

- **Documentation**
  - Updated message constants for clearer user guidance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-01-24 16:31:21 +05:30

91 lines
3.3 KiB
TypeScript

import type { AppState } from "@appsmith/reducers";
import { createSelector } from "reselect";
import {
getCurrentActions,
getCanvasWidgets,
} from "@appsmith/selectors/entitiesSelector";
import type { SIGNPOSTING_STEP } from "pages/Editor/FirstTimeUserOnboarding/Utils";
import { isBoolean, intersection } from "lodash";
import { getEvaluationInverseDependencyMap } from "./dataTreeSelectors";
import { getNestedValue } from "pages/Editor/utils";
import { getDependenciesFromInverseDependencies } from "components/editorComponents/Debugger/helpers";
// Signposting selectors
export const getFirstTimeUserOnboardingApplicationIds = (state: AppState) => {
return state.ui.onBoarding.firstTimeUserOnboardingApplicationIds;
};
export const getFirstTimeUserOnboardingComplete = (state: AppState) => {
return state.ui.onBoarding.firstTimeUserOnboardingComplete;
};
export const getFirstTimeUserOnboardingModal = (state: AppState) =>
state.ui.onBoarding.showFirstTimeUserOnboardingModal;
export const getIsFirstTimeUserOnboardingEnabled = createSelector(
(state: AppState) => state.entities.pageList.applicationId,
getFirstTimeUserOnboardingApplicationIds,
(currentApplicationId, applicationIds) => {
return applicationIds.includes(currentApplicationId);
},
);
export const getInOnboardingWidgetSelection = (state: AppState) =>
state.ui.onBoarding.inOnboardingWidgetSelection;
export const getSignpostingStepState = (state: AppState) =>
state.ui.onBoarding.stepState;
export const getSignpostingStepStateByStep = createSelector(
getSignpostingStepState,
(_state: AppState, step: SIGNPOSTING_STEP) => step,
(stepState, step) => {
return stepState.find((state) => state.step === step);
},
);
export const getSignpostingUnreadSteps = createSelector(
getSignpostingStepState,
(stepState) => {
if (!stepState.length) return [];
return stepState.filter((state) => isBoolean(state.read) && !state.read);
},
);
export const getSignpostingSetOverlay = (state: AppState) =>
state.ui.onBoarding.setOverlay;
export const getSignpostingTooltipVisible = (state: AppState) =>
state.ui.onBoarding.showSignpostingTooltip;
export const getIsAnonymousDataPopupVisible = (state: AppState) =>
state.ui.onBoarding.showAnonymousDataPopup;
export const isWidgetActionConnectionPresent = createSelector(
getCanvasWidgets,
getCurrentActions,
getEvaluationInverseDependencyMap,
(widgets, actions, deps) => {
const actionLables = actions.map((action: any) => action.config.name);
let isBindingAvailable = !!Object.values(widgets).find((widget: any) => {
const depsConnections = getDependenciesFromInverseDependencies(
deps,
widget.widgetName,
);
return !!intersection(depsConnections?.directDependencies, actionLables)
.length;
});
if (!isBindingAvailable) {
isBindingAvailable = !!Object.values(widgets).find((widget: any) => {
return (
widget.dynamicTriggerPathList &&
!!widget.dynamicTriggerPathList.find((path: { key: string }) => {
return !!actionLables.find((label: string) => {
const snippet = getNestedValue(widget, path.key);
return snippet ? snippet.indexOf(`${label}.run`) > -1 : false;
});
})
);
});
}
return isBindingAvailable;
},
);