PromucFlow_constructor/app/client/src/pages/AppIDE/layouts/StaticLayout.tsx

74 lines
2.1 KiB
TypeScript
Raw Normal View History

chore: Transitions for IDE (#35714) ## Description Uses `AnimatedGridLayout` component to introduce transitions for the IDE. This is behind a feature flag Fixes #34538 Fixes #30863 Fixes #34544 ## 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/10737363879> > Commit: a912f5c52366abe48768727a1c605cd72b48752c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10737363879&attempt=2&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/ServerSide/OnLoadTests/ExecuteAction_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>Fri, 06 Sep 2024 16:32:30 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 two new layout components: `AnimatedLayout` and `UnanimatedLayout` for improved editor interface structuring. - Added TypeScript type definitions for the DOM View Transitions API to enhance type safety and developer experience. - Implemented custom hooks, `useGridLayoutTemplate` and `useEditorStateLeftPaneWidth`, for dynamic grid management and left pane width calculation in the IDE layout. - **Improvements** - Enhanced layout responsiveness with the addition of dynamic grid management. - Updated the `Editor` component to use a centralized constant for height calculations, improving maintainability and consistency. - Enhanced test accuracy by refining assertions in the Git Branch Protection test suite. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Sagar Khalasi <sagar@appsmith.com>
2024-09-09 10:55:50 +00:00
import React from "react";
import {
useGitModEnabled,
useGitProtectedMode,
} from "pages/Editor/gitSync/hooks/modHooks";
import { GitProtectedBranchCallout as GitProtectedBranchCalloutNew } from "git";
import BottomBar from "components/BottomBar";
import EditorWrapperContainer from "pages/Editor/commons/EditorWrapperContainer";
import Sidebar from "./routers/Sidebar";
import LeftPane from "./routers/LeftPane";
import MainPane from "./routers/MainPane";
import RightPane from "./routers/RightPane";
import { ProtectedCallout } from "../components/ProtectedCallout";
import { useGridLayoutTemplate } from "./hooks/useGridLayoutTemplate";
import { Areas } from "./constants";
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" ### :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/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 15:04:06 +00:00
import {
GridContainer,
LayoutContainer,
} from "IDE/Components/LayoutComponents";
function GitProtectedBranchCallout() {
const isGitModEnabled = useGitModEnabled();
const isProtectedMode = useGitProtectedMode();
if (isGitModEnabled) {
return <GitProtectedBranchCalloutNew />;
}
if (isProtectedMode) {
return <ProtectedCallout />;
}
return null;
}
chore: Transitions for IDE (#35714) ## Description Uses `AnimatedGridLayout` component to introduce transitions for the IDE. This is behind a feature flag Fixes #34538 Fixes #30863 Fixes #34544 ## 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/10737363879> > Commit: a912f5c52366abe48768727a1c605cd72b48752c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10737363879&attempt=2&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/ServerSide/OnLoadTests/ExecuteAction_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>Fri, 06 Sep 2024 16:32:30 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 two new layout components: `AnimatedLayout` and `UnanimatedLayout` for improved editor interface structuring. - Added TypeScript type definitions for the DOM View Transitions API to enhance type safety and developer experience. - Implemented custom hooks, `useGridLayoutTemplate` and `useEditorStateLeftPaneWidth`, for dynamic grid management and left pane width calculation in the IDE layout. - **Improvements** - Enhanced layout responsiveness with the addition of dynamic grid management. - Updated the `Editor` component to use a centralized constant for height calculations, improving maintainability and consistency. - Enhanced test accuracy by refining assertions in the Git Branch Protection test suite. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Sagar Khalasi <sagar@appsmith.com>
2024-09-09 10:55:50 +00:00
export const StaticLayout = React.memo(() => {
chore: Transitions for IDE (#35714) ## Description Uses `AnimatedGridLayout` component to introduce transitions for the IDE. This is behind a feature flag Fixes #34538 Fixes #30863 Fixes #34544 ## 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/10737363879> > Commit: a912f5c52366abe48768727a1c605cd72b48752c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10737363879&attempt=2&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/ServerSide/OnLoadTests/ExecuteAction_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>Fri, 06 Sep 2024 16:32:30 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 two new layout components: `AnimatedLayout` and `UnanimatedLayout` for improved editor interface structuring. - Added TypeScript type definitions for the DOM View Transitions API to enhance type safety and developer experience. - Implemented custom hooks, `useGridLayoutTemplate` and `useEditorStateLeftPaneWidth`, for dynamic grid management and left pane width calculation in the IDE layout. - **Improvements** - Enhanced layout responsiveness with the addition of dynamic grid management. - Updated the `Editor` component to use a centralized constant for height calculations, improving maintainability and consistency. - Enhanced test accuracy by refining assertions in the Git Branch Protection test suite. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Sagar Khalasi <sagar@appsmith.com>
2024-09-09 10:55:50 +00:00
const { areas, columns } = useGridLayoutTemplate();
const isSidebarVisible = columns[0] !== "0px";
return (
<>
<GitProtectedBranchCallout />
chore: Transitions for IDE (#35714) ## Description Uses `AnimatedGridLayout` component to introduce transitions for the IDE. This is behind a feature flag Fixes #34538 Fixes #30863 Fixes #34544 ## 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/10737363879> > Commit: a912f5c52366abe48768727a1c605cd72b48752c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10737363879&attempt=2&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/ServerSide/OnLoadTests/ExecuteAction_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>Fri, 06 Sep 2024 16:32:30 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 two new layout components: `AnimatedLayout` and `UnanimatedLayout` for improved editor interface structuring. - Added TypeScript type definitions for the DOM View Transitions API to enhance type safety and developer experience. - Implemented custom hooks, `useGridLayoutTemplate` and `useEditorStateLeftPaneWidth`, for dynamic grid management and left pane width calculation in the IDE layout. - **Improvements** - Enhanced layout responsiveness with the addition of dynamic grid management. - Updated the `Editor` component to use a centralized constant for height calculations, improving maintainability and consistency. - Enhanced test accuracy by refining assertions in the Git Branch Protection test suite. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Sagar Khalasi <sagar@appsmith.com>
2024-09-09 10:55:50 +00:00
<EditorWrapperContainer>
<GridContainer
style={{
gridTemplateRows: "100%",
gridTemplateAreas: areas
.map((area) => `"${area.join(" ")}"`)
.join("\n"),
gridTemplateColumns: columns.join(" "),
}}
>
<LayoutContainer name={Areas.Sidebar}>
{isSidebarVisible ? <Sidebar /> : <div />}
</LayoutContainer>
<LayoutContainer name={Areas.Explorer}>
<LeftPane />
</LayoutContainer>
<LayoutContainer name={Areas.WidgetEditor}>
<MainPane id="app-body" />
</LayoutContainer>
<LayoutContainer name={Areas.PropertyPane}>
<RightPane />
</LayoutContainer>
</GridContainer>
</EditorWrapperContainer>
<BottomBar />
</>
);
});