PromucFlow_constructor/app/client/src/selectors/widgetSelectors.ts

288 lines
8.5 KiB
TypeScript
Raw Normal View History

import { createSelector } from "reselect";
import type { DefaultRootState } from "react-redux";
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### 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 - [ ] 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type {
CanvasWidgetsReduxState,
FlattenedWidgetProps,
} from "ee/reducers/entityReducers/canvasWidgetsReducer";
import { getExistingWidgetNames } from "sagas/selectors";
2020-04-03 09:32:13 +00:00
import { getNextEntityName } from "utils/AppsmithUtils";
chore: Move the widget config to widget class (#26073) ## Description - Remove the config objects from widget and config maps from the widget factory. - Introduce methods in widget development API to dynamically fetch this items. - freeze the widget configuration. #### PR fixes following issue(s) Fixes https://github.com/appsmithorg/appsmith/issues/26008 > 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 - [x] Manual - [ ] 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 - [x] 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 - [x] 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
2023-09-06 12:15:04 +00:00
import WidgetFactory from "WidgetProvider/factory";
chore: ce changes related to decoupling webworker (#41033) ## Description We are improving the LCP by reducing the time to reach the first evaluation, aiming for a 1.8 to 2.2 second reduction. To achieve this, we’ve implemented the following changes: Code Splitting of Widgets: During page load, only the widgets required for an evaluation are loaded and registered. For every evaluation cycle we keep discovering widget types and load them as required. Web Worker Offloading: Macro tasks such as clearCache and JavaScript library installation have been moved to the web worker setup. These are now executed in a separate thread, allowing the firstUnevaluatedTree to be computed in parallel with JS library installation. Parallel JS Library Loading: All JavaScript libraries are now loaded in parallel within the web worker, instead of sequentially, improving efficiency. Deferred Rendering of AppViewer: We now render the AppViewer and Header component only after registering the remaining widgets. This ensures that heavy rendering tasks—such as expensive selector computations and loading additional chunks related to the AppViewer—can execute in parallel with the first evaluation, further enhancing performance. ## Automation /ok-to-test tags="@tag.All" ### :mag: 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/16202622510> > Commit: b648036bd7b74ae742f5c5d7f6cfd770867a2828 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16202622510&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Thu, 10 Jul 2025 19:22:25 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Widgets are now loaded and registered asynchronously, improving app startup and modularity. * Widget registration and configuration changes are now versioned, ensuring selectors and UI update appropriately. * Widget initialization and factory cache management are more robust, with explicit cache clearing after widget registration. * Added new Redux actions and selectors to manage first page load, deferred JS library loading, and page rendering state. * Theme handling and widget initialization in AppViewer are streamlined for faster evaluation and rendering. * Deferred loading of JavaScript libraries on first page load improves performance. * Conditional rendering gates added to AppViewer and Navigation components based on evaluation state. * **Bug Fixes** * Prevented errors when conditionally rendering widgets and navigation components before evaluation is complete. * Improved widget property pane and configuration tests to ensure all widgets are properly loaded and validated. * **Refactor** * Widget import and registration logic was refactored to support dynamic, on-demand loading. * Evaluation and initialization sagas were modularized for better maintainability and performance. * Widget factory and memoization logic were enhanced to allow explicit cache clearing and version tracking. * JavaScript library loading logic was parallelized for faster startup. * Theme application extracted into a dedicated component for clarity and reuse. * **Tests** * Expanded and updated widget and evaluation saga test suites to cover asynchronous widget loading, cache management, and first evaluation scenarios. * Added tests verifying widget factory cache behavior and first evaluation integration. * **Chores** * Updated internal dependencies and selectors to track widget configuration version changes, ensuring UI consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-11 06:54:44 +00:00
import { getWidgetConfigsVersion } from "WidgetProvider/factory/widgetConfigVersion";
import {
chore: Block Selections when Canvas is in Side by Side mode (#31587) ## Description This pull request aims to enhance the user experience within the application by modifying the canvas behavior when it is displayed in "Side by Side" mode alongside Queries or JavaScript sections. The key change is the disabling of direct selections on the canvas, allowing interactions with canvas elements only through cmd + click or by clicking on the widget's name. This adjustment is intended to facilitate a view-only mode for the canvas during Queries or JS editing, thereby improving layout and user interaction. Additionally, the PR introduces enhancements to the application's testing framework, focusing on improving test reliability in scenarios involving UI interaction and state changes. Notable updates include: - Improved error tooltip handling in CurrencyInput_spec.js. - Ensured page state saving before verifying element presence in Listv2_BasicChildWidgetInteraction_spec.js. - Replaced cy.wait("@updateLayout") with cy.assertPageSave() and introduced a delay in Listv2_spec.js to accommodate functionality changes. - Implemented visibility checks in TableV2_Button_Icon_validation_spec.js to prevent timing-related test failures. These technical updates collectively aim to bolster the application's testing framework, enhancing the reliability and accuracy of automated tests, especially in UI interaction and state change scenarios. #### PR fixes following issue(s) Fixes #30864 ## Automation /ok-to-test tags="@tag.Widget" <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8259916944> > Commit: `15e1cf937a9d15adaea68e16a55006d993a07cbf` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8259916944&attempt=1" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added new constants for widget selection and focus management. - Introduced a new event type for tracking widget selections in code mode. - **Tests** - Enhanced test assertions and interactions for better reliability and error handling in various widgets. - **Refactor** - Improved widget selection logic and URL handling for a more intuitive user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-13 06:23:49 +00:00
getAltBlockWidgetSelection,
getFocusedWidget,
getLastSelectedWidget,
getSelectedWidgets,
} from "./ui";
import { MAIN_CONTAINER_WIDGET_ID } from "constants/WidgetConstants";
import { get } from "lodash";
import { getAppMode } from "ee/selectors/applicationSelectors";
import { APP_MODE } from "entities/App";
import { getIsTableFilterPaneVisible } from "selectors/tableFilterSelectors";
import { getIsAutoHeightWithLimitsChanging } from "utils/hooks/autoHeightUIHooks";
import { getIsPropertyPaneVisible } from "./propertyPaneSelectors";
chore: Merge wds and anvil feature flags (#32609) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1LNwrMHgs05enX0VDk8QxZH7uP7Ii4HE%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=M7zehz4) ## Description Cleaning up three patterns of checks to enable wds and anvil into two. wds and anvil had to have different flags coz anvil had to play catch up with wds, now that's not the case so it does not make sense to have two flags. Old patterns - checking if the wds feature flag is enabled - checking if the anvil feature flag is enabled - checking if the layout system of the app is anvil New Pattern - checking if anvil feature flag is enabled (used only for creating an anvil app) - checking if layout system of the app is anvil Fixes #32590 _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.All" ### :mag: 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/8663918496> > Commit: e10cc2a84ed680b29c49c5b2e8175df4c18da2f8 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8663918496&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Consolidated the usage of layout system checks across the application to use a unified Anvil layout selector, enhancing consistency in layout-related conditional logic. - **Bug Fixes** - Removed outdated feature flags related to the Anvil + WDS integration, ensuring the application's feature toggling aligns with the current development strategy. - **Tests** - Updated unit tests to align with the new method of layout system determination, ensuring test environments accurately reflect production behavior. - **Chores** - Cleaned up redundant code and feature flags that are no longer in use, simplifying the codebase and reducing potential for errors. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-12 17:24:04 +00:00
import { getIsAnvilLayout } from "layoutSystems/anvil/integrations/selectors";
import { selectCombinedPreviewMode } from "./gitModSelectors";
export const getIsDraggingOrResizing = (state: DefaultRootState) =>
state.ui.widgetDragResize.isResizing || state.ui.widgetDragResize.isDragging;
export const getIsResizing = (state: DefaultRootState) =>
perf: Widget re-rendering refactor (#14485) * initial commit * props hoc * changes * removed ignores and withWidgetProps * added extra props to canvasStructure * widget props changes * list widget changes * reintroduced widget props hook and other refactors * remove warnings * added deepequal for childWidgets selector * fix global hotkeys and tabs widget jest test * fix main container test fix * fixed view mode width * fix form widget values * minor fix * fix skeleton * form widget validity fix * jest test fix * fixed tests: GlobalHotkeys, Tabs, CanvasSelectectionArena and fixed main container rendering * minor fix * minor comments * reverted commented code * simplified structure, selective redux state updates and other inconsistencies * fix junit test cases * stop form widget from force rendering children * fix test case * random commit to re run tests * update isFormValid prop only if it exists * detangling circular dependency * fixing cypress tests * cleaned up code * clean up man cnavas props and fix jest cases * fix rendering order of child widgets for canvas * fix dropdown reset spec * adding comments * cleaning up unwanted code * fix multiselect widget on deploy * adressing review comments * addressing minor review comment changes * destructuring modal widget child and fix test case * fix communityIssues cypress spec * rewrite isVisible logic to match previous behaviour * merging widget props with component props before checking isVisible * adressing review comments for modal widget's isVisible Co-authored-by: rahulramesha <rahul@appsmith.com>
2022-08-19 10:10:36 +00:00
state.ui.widgetDragResize.isResizing;
const getCanvasWidgets = (state: DefaultRootState) =>
state.entities.canvasWidgets;
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
// A selector that gets the modal widget type based on the feature flag
// This will need to be updated once Anvil and WDS are generally available
export const getModalWidgetType = createSelector(
chore: Merge wds and anvil feature flags (#32609) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1LNwrMHgs05enX0VDk8QxZH7uP7Ii4HE%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=M7zehz4) ## Description Cleaning up three patterns of checks to enable wds and anvil into two. wds and anvil had to have different flags coz anvil had to play catch up with wds, now that's not the case so it does not make sense to have two flags. Old patterns - checking if the wds feature flag is enabled - checking if the anvil feature flag is enabled - checking if the layout system of the app is anvil New Pattern - checking if anvil feature flag is enabled (used only for creating an anvil app) - checking if layout system of the app is anvil Fixes #32590 _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.All" ### :mag: 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/8663918496> > Commit: e10cc2a84ed680b29c49c5b2e8175df4c18da2f8 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8663918496&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Consolidated the usage of layout system checks across the application to use a unified Anvil layout selector, enhancing consistency in layout-related conditional logic. - **Bug Fixes** - Removed outdated feature flags related to the Anvil + WDS integration, ensuring the application's feature toggling aligns with the current development strategy. - **Tests** - Updated unit tests to align with the new method of layout system determination, ensuring test environments accurately reflect production behavior. - **Chores** - Cleaned up redundant code and feature flags that are no longer in use, simplifying the codebase and reducing potential for errors. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-12 17:24:04 +00:00
getIsAnvilLayout,
(isAnvilLayout: boolean) => {
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
let modalWidgetType = "MODAL_WIDGET";
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
chore: Merge wds and anvil feature flags (#32609) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1LNwrMHgs05enX0VDk8QxZH7uP7Ii4HE%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=M7zehz4) ## Description Cleaning up three patterns of checks to enable wds and anvil into two. wds and anvil had to have different flags coz anvil had to play catch up with wds, now that's not the case so it does not make sense to have two flags. Old patterns - checking if the wds feature flag is enabled - checking if the anvil feature flag is enabled - checking if the layout system of the app is anvil New Pattern - checking if anvil feature flag is enabled (used only for creating an anvil app) - checking if layout system of the app is anvil Fixes #32590 _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.All" ### :mag: 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/8663918496> > Commit: e10cc2a84ed680b29c49c5b2e8175df4c18da2f8 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8663918496&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Consolidated the usage of layout system checks across the application to use a unified Anvil layout selector, enhancing consistency in layout-related conditional logic. - **Bug Fixes** - Removed outdated feature flags related to the Anvil + WDS integration, ensuring the application's feature toggling aligns with the current development strategy. - **Tests** - Updated unit tests to align with the new method of layout system determination, ensuring test environments accurately reflect production behavior. - **Chores** - Cleaned up redundant code and feature flags that are no longer in use, simplifying the codebase and reducing potential for errors. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-12 17:24:04 +00:00
if (isAnvilLayout) {
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
modalWidgetType = "WDS_MODAL_WIDGET";
}
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
return modalWidgetType;
},
);
export const getModalWidgets = createSelector(
getCanvasWidgets,
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
getModalWidgetType,
(widgets, modalWidgetType) => {
const modalWidgets = Object.values(widgets).filter(
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
(widget: FlattenedWidgetProps) => widget.type === modalWidgetType,
);
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
if (modalWidgets.length === 0) return undefined;
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
return modalWidgets;
},
);
export const getModalDropdownList = createSelector(
getModalWidgets,
(modalWidgets) => {
if (!modalWidgets) return undefined;
return modalWidgets.map((widget: FlattenedWidgetProps) => ({
id: widget.widgetId,
label: widget.widgetName,
value: `${widget.widgetName}.name`,
}));
},
);
2020-04-03 09:32:13 +00:00
export const getNextModalName = createSelector(
getExistingWidgetNames,
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
getModalWidgetType,
chore: ce changes related to decoupling webworker (#41033) ## Description We are improving the LCP by reducing the time to reach the first evaluation, aiming for a 1.8 to 2.2 second reduction. To achieve this, we’ve implemented the following changes: Code Splitting of Widgets: During page load, only the widgets required for an evaluation are loaded and registered. For every evaluation cycle we keep discovering widget types and load them as required. Web Worker Offloading: Macro tasks such as clearCache and JavaScript library installation have been moved to the web worker setup. These are now executed in a separate thread, allowing the firstUnevaluatedTree to be computed in parallel with JS library installation. Parallel JS Library Loading: All JavaScript libraries are now loaded in parallel within the web worker, instead of sequentially, improving efficiency. Deferred Rendering of AppViewer: We now render the AppViewer and Header component only after registering the remaining widgets. This ensures that heavy rendering tasks—such as expensive selector computations and loading additional chunks related to the AppViewer—can execute in parallel with the first evaluation, further enhancing performance. ## Automation /ok-to-test tags="@tag.All" ### :mag: 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/16202622510> > Commit: b648036bd7b74ae742f5c5d7f6cfd770867a2828 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16202622510&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Thu, 10 Jul 2025 19:22:25 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Widgets are now loaded and registered asynchronously, improving app startup and modularity. * Widget registration and configuration changes are now versioned, ensuring selectors and UI update appropriately. * Widget initialization and factory cache management are more robust, with explicit cache clearing after widget registration. * Added new Redux actions and selectors to manage first page load, deferred JS library loading, and page rendering state. * Theme handling and widget initialization in AppViewer are streamlined for faster evaluation and rendering. * Deferred loading of JavaScript libraries on first page load improves performance. * Conditional rendering gates added to AppViewer and Navigation components based on evaluation state. * **Bug Fixes** * Prevented errors when conditionally rendering widgets and navigation components before evaluation is complete. * Improved widget property pane and configuration tests to ensure all widgets are properly loaded and validated. * **Refactor** * Widget import and registration logic was refactored to support dynamic, on-demand loading. * Evaluation and initialization sagas were modularized for better maintainability and performance. * Widget factory and memoization logic were enhanced to allow explicit cache clearing and version tracking. * JavaScript library loading logic was parallelized for faster startup. * Theme application extracted into a dedicated component for clarity and reuse. * **Tests** * Expanded and updated widget and evaluation saga test suites to cover asynchronous widget loading, cache management, and first evaluation scenarios. * Added tests verifying widget factory cache behavior and first evaluation integration. * **Chores** * Updated internal dependencies and selectors to track widget configuration version changes, ensuring UI consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-11 06:54:44 +00:00
getWidgetConfigsVersion, // Add dependency on widget configs version
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
(names, modalWidgetType) => {
const prefix =
feat: WDS - Anvil compatible Modal Widget (#30351) ## Description This PR primarily adds the modal widget to WDS. The following changes were made: 1. WidgetNameCanvas now listens to modal body scrolls to position widget name components correctly 2. Modal Widget is rendered as a detached widget that is outside of the layout flow of the main canvas 3. Main container resizer now has a higher z-index to show even if the modal is open in the preview mode 4. Widget selection flow in Anvil layout system has been modified to be handled in a central location (`AnvilMainCanvas`) 5. Modal widget's type in modal sagas are selected via a selector that checks for the feature flag. 6. Modal widget has its own preset that (at present) is similar to the Main container's layout preset #### PR fixes following issue(s) Fixes #28588 Fixes #28328 Fixes #27459 #### Media https://github.com/appsmithorg/appsmith/assets/103687/bf350be4-2202-49f3-a860-3e38681ab32e #### Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Testing > #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [ ] Cypress ## 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** - Enhanced Modal components with additional styling and customization options. - Introduced a new event type for modal submission actions. - Added a `--on-canvas-ui-z-index` CSS variable for improved layering control. - Implemented a new method for widget focus management in the editor. - **Improvements** - Modal components now use context hooks for close actions. - Improved the handling of detached widgets in various layout systems. - Simplified the drag-and-drop state management for widgets. - Upgraded the visual presentation of the widget drop area. - Enhanced widget selection with new custom event dispatching. - Updated the modal widget configuration with default settings and property pane structure. - **Bug Fixes** - Fixed an issue with modal scrolling to behave consistently with the main container. - Addressed a problem where the `id` was not found during layout element position updates. - **Style** - Adjusted modal overlay positioning and content width with new CSS standards. - Updated zIndex references to use CSS variables for consistent styling. - **Refactor** - Reorganized the `Widgets` array into categorized groups for better clarity. - Simplified the `modalPreset` function's parameters and layout declaration. - **Documentation** - Added default values for feature flags in the documentation. - **Chores** - Altered feature flags to enable new functionalities by default. - **Tests** - No visible changes to end-users in this category. - **Revert** - No visible changes to end-users in this category. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-01-26 04:00:57 +00:00
WidgetFactory.widgetConfigMap.get(modalWidgetType)?.widgetName || "";
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
return getNextEntityName(prefix, names);
},
2020-04-03 09:32:13 +00:00
);
/**
* Selector to get the parent widget of a particaular widget with id as a prop
*/
export const getParentWidget = createSelector(
getCanvasWidgets,
(state: DefaultRootState, widgetId: string) => widgetId,
(canvasWidgets, widgetId: string): FlattenedWidgetProps | undefined => {
if (canvasWidgets.hasOwnProperty(widgetId)) {
const widget = canvasWidgets[widgetId];
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
if (widget.parentId && canvasWidgets.hasOwnProperty(widget.parentId)) {
const parent = canvasWidgets[widget.parentId];
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
return parent;
}
}
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
return;
},
);
perf: Widget re-rendering refactor (#14485) * initial commit * props hoc * changes * removed ignores and withWidgetProps * added extra props to canvasStructure * widget props changes * list widget changes * reintroduced widget props hook and other refactors * remove warnings * added deepequal for childWidgets selector * fix global hotkeys and tabs widget jest test * fix main container test fix * fixed view mode width * fix form widget values * minor fix * fix skeleton * form widget validity fix * jest test fix * fixed tests: GlobalHotkeys, Tabs, CanvasSelectectionArena and fixed main container rendering * minor fix * minor comments * reverted commented code * simplified structure, selective redux state updates and other inconsistencies * fix junit test cases * stop form widget from force rendering children * fix test case * random commit to re run tests * update isFormValid prop only if it exists * detangling circular dependency * fixing cypress tests * cleaned up code * clean up man cnavas props and fix jest cases * fix rendering order of child widgets for canvas * fix dropdown reset spec * adding comments * cleaning up unwanted code * fix multiselect widget on deploy * adressing review comments * addressing minor review comment changes * destructuring modal widget child and fix test case * fix communityIssues cypress spec * rewrite isVisible logic to match previous behaviour * merging widget props with component props before checking isVisible * adressing review comments for modal widget's isVisible Co-authored-by: rahulramesha <rahul@appsmith.com>
2022-08-19 10:10:36 +00:00
export const getFocusedParentToOpen = createSelector(
getCanvasWidgets,
(state: DefaultRootState) => state.ui.widgetDragResize.focusedWidget,
perf: Widget re-rendering refactor (#14485) * initial commit * props hoc * changes * removed ignores and withWidgetProps * added extra props to canvasStructure * widget props changes * list widget changes * reintroduced widget props hook and other refactors * remove warnings * added deepequal for childWidgets selector * fix global hotkeys and tabs widget jest test * fix main container test fix * fixed view mode width * fix form widget values * minor fix * fix skeleton * form widget validity fix * jest test fix * fixed tests: GlobalHotkeys, Tabs, CanvasSelectectionArena and fixed main container rendering * minor fix * minor comments * reverted commented code * simplified structure, selective redux state updates and other inconsistencies * fix junit test cases * stop form widget from force rendering children * fix test case * random commit to re run tests * update isFormValid prop only if it exists * detangling circular dependency * fixing cypress tests * cleaned up code * clean up man cnavas props and fix jest cases * fix rendering order of child widgets for canvas * fix dropdown reset spec * adding comments * cleaning up unwanted code * fix multiselect widget on deploy * adressing review comments * addressing minor review comment changes * destructuring modal widget child and fix test case * fix communityIssues cypress spec * rewrite isVisible logic to match previous behaviour * merging widget props with component props before checking isVisible * adressing review comments for modal widget's isVisible Co-authored-by: rahulramesha <rahul@appsmith.com>
2022-08-19 10:10:36 +00:00
(canvasWidgets, focusedWidgetId) => {
return getParentToOpenIfAny(focusedWidgetId, canvasWidgets);
},
);
export const getParentToOpenSelector = (widgetId: string) => {
return createSelector(getCanvasWidgets, (canvasWidgets) => {
return getParentToOpenIfAny(widgetId, canvasWidgets);
});
};
// Check if widget is in the list of selected widgets
feat: Anvil: Interact with a focused widget's widget name component (#33646) ## Description - Add a ghost component (`AnvilWidgetNameComponentWrapper`) that prevents the widget underneath the widget name component from being focused - Select widget when dragging a focused widget from the widget name component - Adjust offsets and sizes of the ghost component and the widget name button - Remove `onMouseLeave` events from widgets and add an `onMouseLeave` event to the Canvas. - Change the pointer to `grab` for the widget name component Fixes #33385 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9201483569> > Commit: 4373df84f255534a6eb839b1cad532ae327947ec > Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9201483569&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank"> Click here!</a> > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts > <li>cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImport_spec.ts </ol> > To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a> <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No
2024-05-23 09:32:34 +00:00
export const isWidgetSelected = (widgetId?: string) => {
return createSelector(getSelectedWidgets, (widgets): boolean =>
feat: Anvil: Interact with a focused widget's widget name component (#33646) ## Description - Add a ghost component (`AnvilWidgetNameComponentWrapper`) that prevents the widget underneath the widget name component from being focused - Select widget when dragging a focused widget from the widget name component - Adjust offsets and sizes of the ghost component and the widget name button - Remove `onMouseLeave` events from widgets and add an `onMouseLeave` event to the Canvas. - Change the pointer to `grab` for the widget name component Fixes #33385 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9201483569> > Commit: 4373df84f255534a6eb839b1cad532ae327947ec > Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9201483569&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank"> Click here!</a> > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts > <li>cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImport_spec.ts </ol> > To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a> <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No
2024-05-23 09:32:34 +00:00
widgetId ? widgets.includes(widgetId) : false,
);
};
export const isWidgetFocused = (widgetId: string) => {
return createSelector(
getFocusedWidget,
(widget): boolean => widget === widgetId,
);
};
// Check if current widget is the last selected widget
export const isCurrentWidgetLastSelected = (widgetId: string) => {
return createSelector(
getLastSelectedWidget,
(widget): boolean => widget === widgetId,
);
};
// Check if current widget is one of multiple selected widgets
export const isMultiSelectedWidget = (widgetId: string) => {
return createSelector(
getSelectedWidgets,
(widgets): boolean => widgets.length > 1 && widgets.includes(widgetId),
);
};
export function getParentToOpenIfAny(
widgetId: string | undefined,
widgets: CanvasWidgetsReduxState,
) {
if (widgetId) {
let widget = get(widgets, widgetId, undefined);
// While this widget has a openParentPropertyPane equal to true
while (widget?.openParentPropertyPane) {
// Get parent widget props
const parent = get(widgets, `${widget.parentId}`, undefined);
// If parent has openParentPropertyPane = false, return the current parent
if (!parent?.openParentPropertyPane) {
return parent;
}
if (parent?.parentId && parent.parentId !== MAIN_CONTAINER_WIDGET_ID) {
widget = get(widgets, `${widget.parentId}`, undefined);
continue;
}
}
}
return;
}
export const shouldWidgetIgnoreClicksSelector = (widgetId: string) => {
return createSelector(
getFocusedWidget,
getIsTableFilterPaneVisible,
(state: DefaultRootState) => state.ui.widgetDragResize.isResizing,
(state: DefaultRootState) => state.ui.widgetDragResize.isDragging,
(state: DefaultRootState) =>
state.ui.canvasSelection.isDraggingForSelection,
getAppMode,
selectCombinedPreviewMode,
getIsAutoHeightWithLimitsChanging,
chore: Block Selections when Canvas is in Side by Side mode (#31587) ## Description This pull request aims to enhance the user experience within the application by modifying the canvas behavior when it is displayed in "Side by Side" mode alongside Queries or JavaScript sections. The key change is the disabling of direct selections on the canvas, allowing interactions with canvas elements only through cmd + click or by clicking on the widget's name. This adjustment is intended to facilitate a view-only mode for the canvas during Queries or JS editing, thereby improving layout and user interaction. Additionally, the PR introduces enhancements to the application's testing framework, focusing on improving test reliability in scenarios involving UI interaction and state changes. Notable updates include: - Improved error tooltip handling in CurrencyInput_spec.js. - Ensured page state saving before verifying element presence in Listv2_BasicChildWidgetInteraction_spec.js. - Replaced cy.wait("@updateLayout") with cy.assertPageSave() and introduced a delay in Listv2_spec.js to accommodate functionality changes. - Implemented visibility checks in TableV2_Button_Icon_validation_spec.js to prevent timing-related test failures. These technical updates collectively aim to bolster the application's testing framework, enhancing the reliability and accuracy of automated tests, especially in UI interaction and state change scenarios. #### PR fixes following issue(s) Fixes #30864 ## Automation /ok-to-test tags="@tag.Widget" <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8259916944> > Commit: `15e1cf937a9d15adaea68e16a55006d993a07cbf` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8259916944&attempt=1" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added new constants for widget selection and focus management. - Introduced a new event type for tracking widget selections in code mode. - **Tests** - Enhanced test assertions and interactions for better reliability and error handling in various widgets. - **Refactor** - Improved widget selection logic and URL handling for a more intuitive user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-13 06:23:49 +00:00
getAltBlockWidgetSelection,
(
focusedWidgetId,
isTableFilterPaneVisible,
isResizing,
isDragging,
fix: Drag to select widgets within container like widgets ends up selecting Parent widget (#20885) ## Description This PR fixes, drag to select widget feature inside container like widgets. The changes include, - Add condition to stop triggering select action when, drag to select is still active - Delay stopping drag to select to the end of the execution stack, to prevent triggering selection action - Change name of `isDragging` to `isMouseDown` to avoid confusion with the other `isDragging` in the same file - Trigger start dragging to select action after `mousedown` and `mousemove` instead on every `mousedown` Fixes #20804 Media ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual Before https://user-images.githubusercontent.com/71900764/220725344-a4a50770-1335-405f-ac32-2ec63d3c9e6f.mp4 After https://user-images.githubusercontent.com/71900764/220725390-9d94cd31-28d2-4b21-ae62-dbb98c2678ea.mp4 ### 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-07 10:12:15 +00:00
isDraggingForSelection,
appMode,
isPreviewMode,
isAutoHeightWithLimitsChanging,
chore: Block Selections when Canvas is in Side by Side mode (#31587) ## Description This pull request aims to enhance the user experience within the application by modifying the canvas behavior when it is displayed in "Side by Side" mode alongside Queries or JavaScript sections. The key change is the disabling of direct selections on the canvas, allowing interactions with canvas elements only through cmd + click or by clicking on the widget's name. This adjustment is intended to facilitate a view-only mode for the canvas during Queries or JS editing, thereby improving layout and user interaction. Additionally, the PR introduces enhancements to the application's testing framework, focusing on improving test reliability in scenarios involving UI interaction and state changes. Notable updates include: - Improved error tooltip handling in CurrencyInput_spec.js. - Ensured page state saving before verifying element presence in Listv2_BasicChildWidgetInteraction_spec.js. - Replaced cy.wait("@updateLayout") with cy.assertPageSave() and introduced a delay in Listv2_spec.js to accommodate functionality changes. - Implemented visibility checks in TableV2_Button_Icon_validation_spec.js to prevent timing-related test failures. These technical updates collectively aim to bolster the application's testing framework, enhancing the reliability and accuracy of automated tests, especially in UI interaction and state change scenarios. #### PR fixes following issue(s) Fixes #30864 ## Automation /ok-to-test tags="@tag.Widget" <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8259916944> > Commit: `15e1cf937a9d15adaea68e16a55006d993a07cbf` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8259916944&attempt=1" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added new constants for widget selection and focus management. - Introduced a new event type for tracking widget selections in code mode. - **Tests** - Enhanced test assertions and interactions for better reliability and error handling in various widgets. - **Refactor** - Improved widget selection logic and URL handling for a more intuitive user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-13 06:23:49 +00:00
isWidgetSelectionBlock,
) => {
const isFocused = focusedWidgetId === widgetId;
return (
fix: Drag to select widgets within container like widgets ends up selecting Parent widget (#20885) ## Description This PR fixes, drag to select widget feature inside container like widgets. The changes include, - Add condition to stop triggering select action when, drag to select is still active - Delay stopping drag to select to the end of the execution stack, to prevent triggering selection action - Change name of `isDragging` to `isMouseDown` to avoid confusion with the other `isDragging` in the same file - Trigger start dragging to select action after `mousedown` and `mousemove` instead on every `mousedown` Fixes #20804 Media ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual Before https://user-images.githubusercontent.com/71900764/220725344-a4a50770-1335-405f-ac32-2ec63d3c9e6f.mp4 After https://user-images.githubusercontent.com/71900764/220725390-9d94cd31-28d2-4b21-ae62-dbb98c2678ea.mp4 ### 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-07 10:12:15 +00:00
isDraggingForSelection ||
isResizing ||
isDragging ||
isPreviewMode ||
appMode !== APP_MODE.EDIT ||
!isFocused ||
isTableFilterPaneVisible ||
chore: Block Selections when Canvas is in Side by Side mode (#31587) ## Description This pull request aims to enhance the user experience within the application by modifying the canvas behavior when it is displayed in "Side by Side" mode alongside Queries or JavaScript sections. The key change is the disabling of direct selections on the canvas, allowing interactions with canvas elements only through cmd + click or by clicking on the widget's name. This adjustment is intended to facilitate a view-only mode for the canvas during Queries or JS editing, thereby improving layout and user interaction. Additionally, the PR introduces enhancements to the application's testing framework, focusing on improving test reliability in scenarios involving UI interaction and state changes. Notable updates include: - Improved error tooltip handling in CurrencyInput_spec.js. - Ensured page state saving before verifying element presence in Listv2_BasicChildWidgetInteraction_spec.js. - Replaced cy.wait("@updateLayout") with cy.assertPageSave() and introduced a delay in Listv2_spec.js to accommodate functionality changes. - Implemented visibility checks in TableV2_Button_Icon_validation_spec.js to prevent timing-related test failures. These technical updates collectively aim to bolster the application's testing framework, enhancing the reliability and accuracy of automated tests, especially in UI interaction and state change scenarios. #### PR fixes following issue(s) Fixes #30864 ## Automation /ok-to-test tags="@tag.Widget" <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8259916944> > Commit: `15e1cf937a9d15adaea68e16a55006d993a07cbf` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8259916944&attempt=1" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added new constants for widget selection and focus management. - Introduced a new event type for tracking widget selections in code mode. - **Tests** - Enhanced test assertions and interactions for better reliability and error handling in various widgets. - **Refactor** - Improved widget selection logic and URL handling for a more intuitive user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-13 06:23:49 +00:00
isAutoHeightWithLimitsChanging ||
isWidgetSelectionBlock
);
},
);
};
fix: Selected Widget Visibility (#21317) ## Description ### Part 3 of selected widget refactor As part of context switching and selected widget refactor, we saw that widgets that are inside modals or tabs and are hidden cannot be switched to without updating some meta properties. The meta properties are actually owned by the end user and the developer user would create some default values for it as well. This becomes a problem soon when the platform also tries to update it. So as part of this refactor, we will use the selected widget ancestry (the chain of widgets from the top to the currently selected widget) to handle if widgets need to be visible or not. It will also indicate the widgets in the path of selection to "make way" for the selected widget to be seen. Media https://user-images.githubusercontent.com/12022471/224916943-b10e8694-0c95-4157-bb93-288d7c0bf60a.mov - This works on any number of levels of hirarchy - The logic is supposed to handled by each widget that can potentially hide other widgets inside it - Improves some platform perf as the handing so widget meta is not done by the platform anymore Affected widgets: - Modal Widget - Tabs Widget > tl;dr: Update the platform's way to show widgets that can be hidden. Makes sure a selected widget is always shown. Fixes #1282 Resolves #18173 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual - Cypress ### Test Plan > Test case link:- [#2202](https://github.com/appsmithorg/TestSmith/issues/2202) ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity:- https://github.com/appsmithorg/appsmith/issues/1282#issuecomment-1472204952 ## 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 - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [x] Test plan has been approved by relevant developers - [x] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-23 05:43:07 +00:00
export const getSelectedWidgetAncestry = (state: DefaultRootState) =>
fix: Selected Widget Visibility (#21317) ## Description ### Part 3 of selected widget refactor As part of context switching and selected widget refactor, we saw that widgets that are inside modals or tabs and are hidden cannot be switched to without updating some meta properties. The meta properties are actually owned by the end user and the developer user would create some default values for it as well. This becomes a problem soon when the platform also tries to update it. So as part of this refactor, we will use the selected widget ancestry (the chain of widgets from the top to the currently selected widget) to handle if widgets need to be visible or not. It will also indicate the widgets in the path of selection to "make way" for the selected widget to be seen. Media https://user-images.githubusercontent.com/12022471/224916943-b10e8694-0c95-4157-bb93-288d7c0bf60a.mov - This works on any number of levels of hirarchy - The logic is supposed to handled by each widget that can potentially hide other widgets inside it - Improves some platform perf as the handing so widget meta is not done by the platform anymore Affected widgets: - Modal Widget - Tabs Widget > tl;dr: Update the platform's way to show widgets that can be hidden. Makes sure a selected widget is always shown. Fixes #1282 Resolves #18173 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual - Cypress ### Test Plan > Test case link:- [#2202](https://github.com/appsmithorg/TestSmith/issues/2202) ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity:- https://github.com/appsmithorg/appsmith/issues/1282#issuecomment-1472204952 ## 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 - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [x] Test plan has been approved by relevant developers - [x] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-23 05:43:07 +00:00
state.ui.widgetDragResize.selectedWidgetAncestry;
export const getEntityExplorerWidgetAncestry = (state: DefaultRootState) =>
fix: Do not set widget ancestry if selection happens via canvas (#22069) ## Description Implemented in #21317. A problem arose where if a widget that exists inside a tabs widget is setting the default value of the tab in order to navigate change the tab, it would fail to switch it because the selected widget logic takes over. > Improve selected widget visibility by skipping feature when selection happens via a canvas click Fixes #22070 Media https://user-images.githubusercontent.com/12022471/229714138-55f89cda-3c27-4953-91c0-46f5a9834adf.mov ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual - 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 07:25:14 +00:00
state.ui.widgetDragResize.entityExplorerAncestry;
fix: Selected Widget Visibility (#21317) ## Description ### Part 3 of selected widget refactor As part of context switching and selected widget refactor, we saw that widgets that are inside modals or tabs and are hidden cannot be switched to without updating some meta properties. The meta properties are actually owned by the end user and the developer user would create some default values for it as well. This becomes a problem soon when the platform also tries to update it. So as part of this refactor, we will use the selected widget ancestry (the chain of widgets from the top to the currently selected widget) to handle if widgets need to be visible or not. It will also indicate the widgets in the path of selection to "make way" for the selected widget to be seen. Media https://user-images.githubusercontent.com/12022471/224916943-b10e8694-0c95-4157-bb93-288d7c0bf60a.mov - This works on any number of levels of hirarchy - The logic is supposed to handled by each widget that can potentially hide other widgets inside it - Improves some platform perf as the handing so widget meta is not done by the platform anymore Affected widgets: - Modal Widget - Tabs Widget > tl;dr: Update the platform's way to show widgets that can be hidden. Makes sure a selected widget is always shown. Fixes #1282 Resolves #18173 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual - Cypress ### Test Plan > Test case link:- [#2202](https://github.com/appsmithorg/TestSmith/issues/2202) ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity:- https://github.com/appsmithorg/appsmith/issues/1282#issuecomment-1472204952 ## 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 - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [x] Test plan has been approved by relevant developers - [x] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-23 05:43:07 +00:00
export const getEntityExplorerWidgetsToExpand = createSelector(
fix: Do not set widget ancestry if selection happens via canvas (#22069) ## Description Implemented in #21317. A problem arose where if a widget that exists inside a tabs widget is setting the default value of the tab in order to navigate change the tab, it would fail to switch it because the selected widget logic takes over. > Improve selected widget visibility by skipping feature when selection happens via a canvas click Fixes #22070 Media https://user-images.githubusercontent.com/12022471/229714138-55f89cda-3c27-4953-91c0-46f5a9834adf.mov ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual - 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 07:25:14 +00:00
getEntityExplorerWidgetAncestry,
fix: Selected Widget Visibility (#21317) ## Description ### Part 3 of selected widget refactor As part of context switching and selected widget refactor, we saw that widgets that are inside modals or tabs and are hidden cannot be switched to without updating some meta properties. The meta properties are actually owned by the end user and the developer user would create some default values for it as well. This becomes a problem soon when the platform also tries to update it. So as part of this refactor, we will use the selected widget ancestry (the chain of widgets from the top to the currently selected widget) to handle if widgets need to be visible or not. It will also indicate the widgets in the path of selection to "make way" for the selected widget to be seen. Media https://user-images.githubusercontent.com/12022471/224916943-b10e8694-0c95-4157-bb93-288d7c0bf60a.mov - This works on any number of levels of hirarchy - The logic is supposed to handled by each widget that can potentially hide other widgets inside it - Improves some platform perf as the handing so widget meta is not done by the platform anymore Affected widgets: - Modal Widget - Tabs Widget > tl;dr: Update the platform's way to show widgets that can be hidden. Makes sure a selected widget is always shown. Fixes #1282 Resolves #18173 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual - Cypress ### Test Plan > Test case link:- [#2202](https://github.com/appsmithorg/TestSmith/issues/2202) ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity:- https://github.com/appsmithorg/appsmith/issues/1282#issuecomment-1472204952 ## 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 - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [x] Test plan has been approved by relevant developers - [x] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-23 05:43:07 +00:00
(selectedWidgetAncestry: string[]) => {
return selectedWidgetAncestry.slice(1);
},
);
export const showWidgetAsSelected = (widgetId: string) => {
return createSelector(
getLastSelectedWidget,
getSelectedWidgets,
(lastSelectedWidgetId, selectedWidgets) => {
return (
lastSelectedWidgetId === widgetId ||
(selectedWidgets.length > 1 && selectedWidgets.includes(widgetId))
);
},
);
};
export const getFirstSelectedWidgetInList = createSelector(
getSelectedWidgets,
(selectedWidgets) => {
return selectedWidgets?.length ? selectedWidgets[0] : undefined;
},
);
export const isCurrentWidgetActiveInPropertyPane = (widgetId: string) => {
return createSelector(
getIsPropertyPaneVisible,
getFirstSelectedWidgetInList,
(isPaneVisible, firstSelectedWidgetId) => {
return isPaneVisible && firstSelectedWidgetId === widgetId;
},
);
};
export const isResizingOrDragging = createSelector(
(state: DefaultRootState) => state.ui.widgetDragResize.isResizing,
(state: DefaultRootState) => state.ui.widgetDragResize.isDragging,
(isResizing, isDragging) => !!isResizing || !!isDragging,
);
chore: ce changes related to decoupling webworker (#41033) ## Description We are improving the LCP by reducing the time to reach the first evaluation, aiming for a 1.8 to 2.2 second reduction. To achieve this, we’ve implemented the following changes: Code Splitting of Widgets: During page load, only the widgets required for an evaluation are loaded and registered. For every evaluation cycle we keep discovering widget types and load them as required. Web Worker Offloading: Macro tasks such as clearCache and JavaScript library installation have been moved to the web worker setup. These are now executed in a separate thread, allowing the firstUnevaluatedTree to be computed in parallel with JS library installation. Parallel JS Library Loading: All JavaScript libraries are now loaded in parallel within the web worker, instead of sequentially, improving efficiency. Deferred Rendering of AppViewer: We now render the AppViewer and Header component only after registering the remaining widgets. This ensures that heavy rendering tasks—such as expensive selector computations and loading additional chunks related to the AppViewer—can execute in parallel with the first evaluation, further enhancing performance. ## Automation /ok-to-test tags="@tag.All" ### :mag: 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/16202622510> > Commit: b648036bd7b74ae742f5c5d7f6cfd770867a2828 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16202622510&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Thu, 10 Jul 2025 19:22:25 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Widgets are now loaded and registered asynchronously, improving app startup and modularity. * Widget registration and configuration changes are now versioned, ensuring selectors and UI update appropriately. * Widget initialization and factory cache management are more robust, with explicit cache clearing after widget registration. * Added new Redux actions and selectors to manage first page load, deferred JS library loading, and page rendering state. * Theme handling and widget initialization in AppViewer are streamlined for faster evaluation and rendering. * Deferred loading of JavaScript libraries on first page load improves performance. * Conditional rendering gates added to AppViewer and Navigation components based on evaluation state. * **Bug Fixes** * Prevented errors when conditionally rendering widgets and navigation components before evaluation is complete. * Improved widget property pane and configuration tests to ensure all widgets are properly loaded and validated. * **Refactor** * Widget import and registration logic was refactored to support dynamic, on-demand loading. * Evaluation and initialization sagas were modularized for better maintainability and performance. * Widget factory and memoization logic were enhanced to allow explicit cache clearing and version tracking. * JavaScript library loading logic was parallelized for faster startup. * Theme application extracted into a dedicated component for clarity and reuse. * **Tests** * Expanded and updated widget and evaluation saga test suites to cover asynchronous widget loading, cache management, and first evaluation scenarios. * Added tests verifying widget factory cache behavior and first evaluation integration. * **Chores** * Updated internal dependencies and selectors to track widget configuration version changes, ensuring UI consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-11 06:54:44 +00:00
// get widgets types associated to a tab
export const getUsedWidgetTypes = createSelector(
getCanvasWidgets,
(canvasWidgets) => {
const widgetTypes = new Set<string>();
// Iterate through all widgets in the state
Object.values(canvasWidgets).forEach((widget) => {
if (widget.type && !widget.type.startsWith("MODULE_WIDGET_")) {
widgetTypes.add(widget.type);
}
});
return Array.from(widgetTypes);
},
);