PromucFlow_constructor/app/client/src/selectors/widgetDragSelectors.ts
Rudraprasad Das 9ce2598e76
chore: git mod - integration with applications (#38439)
## Description
- Git mod integration with applications behind feature flag

Fixes #37815 
Fixes #37816 
Fixes #37817 
Fixes #37818 
Fixes #37819 
Fixes #37820 

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/12570655268>
> Commit: 7d2f1a7013bc2fc6c960699ee0b6e06800cd21f9
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12570655268&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 01 Jan 2025 14:35:46 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
2025-01-05 11:21:23 +01:00

48 lines
1.4 KiB
TypeScript

import type { AppState } from "ee/reducers";
import { createSelector } from "reselect";
import { getIsAppSettingsPaneWithNavigationTabOpen } from "./appSettingsPaneSelectors";
import { snipingModeSelector } from "./editorSelectors";
import { getWidgetSelectionBlock } from "./ui";
import { selectCombinedPreviewMode } from "./gitModSelectors";
export const getIsDragging = (state: AppState) =>
state.ui.widgetDragResize.isDragging;
export const getIsResizing = (state: AppState) =>
state.ui.widgetDragResize.isResizing;
export const getIsDraggingDisabledInEditor = (state: AppState) =>
state.ui.widgetDragResize.isDraggingDisabled;
/**
* getShouldAllowDrag is a Selector that indicates if the widget could be dragged on canvas based on different states
*/
export const getShouldAllowDrag = createSelector(
getIsResizing,
getIsDragging,
getIsDraggingDisabledInEditor,
selectCombinedPreviewMode,
snipingModeSelector,
getIsAppSettingsPaneWithNavigationTabOpen,
getWidgetSelectionBlock,
(
isResizing,
isDragging,
isDraggingDisabled,
isPreviewMode,
isSnipingMode,
isAppSettingsPaneWithNavigationTabOpen,
widgetSelectionIsBlocked,
) => {
return (
!isResizing &&
!isDragging &&
!isDraggingDisabled &&
!isSnipingMode &&
!isPreviewMode &&
!isAppSettingsPaneWithNavigationTabOpen &&
!widgetSelectionIsBlocked
);
},
);