Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4f2ef49
feat: New ui for overflow tabs
albinAppsmith Jun 10, 2024
4eec56e
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 10, 2024
3031920
fix: new tab click fix
albinAppsmith Jun 10, 2024
914614d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 10, 2024
1a499f3
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 17, 2024
f98571d
fix: optmised editortab component
albinAppsmith Jun 17, 2024
22b2dfb
chore: Optimisations
albinAppsmith Jun 19, 2024
000cde8
removed refs
albinAppsmith Jun 20, 2024
ad3f4e7
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 20, 2024
d31c64f
fix: seperated add button and tab
albinAppsmith Jun 20, 2024
8b98201
added border for sticky button
albinAppsmith Jun 21, 2024
e14a985
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 21, 2024
c1d0795
added missing dependency
albinAppsmith Jun 21, 2024
f89cecc
fix: removed scrollbar defer
albinAppsmith Jun 21, 2024
2703067
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 24, 2024
77611ad
fix: show list issues
albinAppsmith Jun 24, 2024
7d07044
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 24, 2024
43b8219
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 25, 2024
296c976
fix: cypress failures
albinAppsmith Jun 25, 2024
1c829af
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Jun 25, 2024
fb8addb
fix: jest test fix
albinAppsmith Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { Tag, type ListItemProps } from "design-system";
import { useCurrentEditorState } from "pages/Editor/IDE/hooks";
import CurlImportEditor from "pages/Editor/APIEditor/CurlImportEditor";
import { createAddClassName } from "pages/Editor/IDE/EditorPane/utils";
import { QueriesBlankState } from "pages/Editor/QueryEditor/QueriesBlankState";

export const useQueryAdd = () => {
const location = useLocation();
Expand Down Expand Up @@ -161,7 +162,7 @@ export const useQuerySegmentRoutes = (path: string): UseRoutes => {
},
{
key: "QueryEmpty",
component: ListQuery,
component: QueriesBlankState,
Comment thread
albinAppsmith marked this conversation as resolved.
exact: true,
path: [path],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import QueriesSegment from "./Query";
import WidgetsSegment from "./UI";
import JSSegment from "./JS";
import SegmentedHeader from "./components/SegmentedHeader";
import EditorTabs from "../EditorTabs/SplitScreenTabs";
import EditorTabs from "../EditorTabs";
import {
jsSegmentRoutes,
querySegmentRoutes,
Expand All @@ -17,19 +17,24 @@ import {
BUILDER_PATH,
BUILDER_PATH_DEPRECATED,
} from "@appsmith/constants/routes/appRoutes";
import { useSelector } from "react-redux";
import { getIDEViewMode } from "selectors/ideSelectors";
import { EditorViewMode } from "@appsmith/entities/IDE/constants";

const EditorPaneSegments = () => {
const { path } = useRouteMatch();
const ideViewMode = useSelector(getIDEViewMode);

return (
<Flex
className="relative"
flexDirection="column"
gap="spacing-2"
gap="spaces-2"
height="100%"
overflow="hidden"
>
<SegmentedHeader />
<EditorTabs />
{ideViewMode === EditorViewMode.SplitScreen ? <EditorTabs /> : null}
<Flex
className="ide-editor-left-pane__content"
flexDirection="column"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe("FileTabs", () => {
it("renders tabs correctly", () => {
const { getByTestId, getByText } = render(
<FileTabs
currentTab={mockTabs[0].key}
navigateToTab={mockNavigateToTab}
onClose={mockOnClose}
tabs={mockTabs}
Expand All @@ -40,6 +41,7 @@ describe("FileTabs", () => {
it("check tab click", () => {
const { getByTestId } = render(
<FileTabs
currentTab={mockTabs[0].key}
navigateToTab={mockNavigateToTab}
onClose={mockOnClose}
tabs={mockTabs}
Expand All @@ -54,6 +56,7 @@ describe("FileTabs", () => {
it("check for close click", () => {
const { getByTestId } = render(
<FileTabs
currentTab={mockTabs[1].key}
navigateToTab={mockNavigateToTab}
onClose={mockOnClose}
tabs={mockTabs}
Expand Down
19 changes: 7 additions & 12 deletions app/client/src/pages/Editor/IDE/EditorTabs/FileTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect } from "react";
import { useLocation } from "react-router";
import clsx from "classnames";
import { Flex, Icon, ScrollArea } from "design-system";

Expand All @@ -13,25 +12,23 @@ import {
TabIconContainer,
TabTextContainer,
} from "./StyledComponents";
import { identifyEntityFromPath } from "navigation/FocusEntity";
import { useCurrentEditorState } from "../hooks";

interface Props {
tabs: EntityItem[];
navigateToTab: (tab: EntityItem) => void;
onClose: (actionId?: string) => void;
currentTab: string;
newTabClickCallback?: () => void;
}

const FILE_TABS_CONTAINER_ID = "file-tabs-container";

const FileTabs = (props: Props) => {
const { navigateToTab, onClose, tabs } = props;
const { currentTab, navigateToTab, newTabClickCallback, onClose, tabs } =
props;
const { segment, segmentMode } = useCurrentEditorState();

const location = useLocation();

const currentEntity = identifyEntityFromPath(location.pathname);

useEffect(() => {
const activetab = document.querySelector(".editor-tab.active");
if (activetab) {
Expand Down Expand Up @@ -70,10 +67,7 @@ const FileTabs = (props: Props) => {
<Flex gap="spaces-2" height="100%" id={FILE_TABS_CONTAINER_ID}>
{tabs.map((tab: EntityItem) => (
<StyledTab
className={clsx(
"editor-tab",
currentEntity.id === tab.key && "active",
)}
className={clsx("editor-tab", currentTab === tab.key && "active")}
data-testid={`t--ide-tab-${tab.title}`}
key={tab.key}
onClick={() => navigateToTab(tab)}
Expand All @@ -92,8 +86,9 @@ const FileTabs = (props: Props) => {
{/* New Tab */}
{segmentMode === EditorEntityTabState.Add ? (
<StyledTab
className={clsx("editor-tab", "active")}
className={clsx("editor-tab", currentTab === "add" && "active")}
data-testid={`t--ide-tab-new`}
onClick={newTabClickCallback}
>
<TabTextContainer>
New {segment === EditorEntityTab.JS ? "JS" : "Query"}
Expand Down
67 changes: 0 additions & 67 deletions app/client/src/pages/Editor/IDE/EditorTabs/FullScreenTabs.tsx

This file was deleted.

79 changes: 0 additions & 79 deletions app/client/src/pages/Editor/IDE/EditorTabs/SplitScreenTabs.tsx

This file was deleted.

Loading