PromucFlow_constructor/app/client/test/testMockedWidgets.tsx
Ankita Kinger c21e5edaf2
chore: Moving static layout styled components to a common file for re-using on EE (#39379)
## Description

- Moving static layout styled components to a common file for re-using
on EE
- Updating AppIDE folder name: `layout` to `layouts`
- Showing the Add button for libraries via props to re-use the component
on EE

Fixes [#39037](https://github.com/appsmithorg/appsmith/issues/39037)

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13436155470>
> Commit: bafebbe1d485867240076a2122d87aac26eab177
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13436155470&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 20 Feb 2025 14:41:02 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**
- Introduced an option in the libraries panel to conditionally display
an “add” button, offering a more dynamic experience.
- Added new layout components to facilitate better layout management
within the application.

- **Refactor**
- Enhanced layout management through unified grid-based components for
improved visual consistency.
- Updated component interfaces to accept new props for enhanced
functionality.
  - Adjusted import paths to reflect a restructured file organization.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-02-20 20:34:06 +05:30

27 lines
905 B
TypeScript

import { APP_MODE } from "entities/App";
import AppViewerPageContainer from "pages/AppViewer/AppViewerPageContainer";
import Canvas from "pages/Editor/Canvas";
import IDE from "pages/AppIDE/layouts";
import React from "react";
import { useSelector } from "react-redux";
import { getCanvasWidgetsStructure } from "ee/selectors/entitiesSelector";
import { useMockDsl } from "./testCommon";
export function MockCanvas() {
const canvasWidgetsStructure = useSelector(getCanvasWidgetsStructure);
return <Canvas canvasWidth={0} widgetsStructure={canvasWidgetsStructure} />;
}
export function UpdateAppViewer({ dsl }: { dsl: unknown }) {
const hasLoaded = useMockDsl(dsl, APP_MODE.PUBLISHED);
return hasLoaded ? <AppViewerPageContainer /> : null;
}
export function UpdatedEditor({ dsl }: { dsl: unknown }) {
const hasLoaded = useMockDsl(dsl, APP_MODE.EDIT);
return hasLoaded ? <IDE /> : null;
}