Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New tab ui changes #33228

Merged
merged 33 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bf1f488
feat: New tab ui changes
albinAppsmith May 7, 2024
d84c5d0
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 9, 2024
79f4185
fix: new query tab ui
albinAppsmith May 9, 2024
12534de
Removed duplicate type definition
albinAppsmith May 9, 2024
bee5670
fix: jest tests
albinAppsmith May 9, 2024
272561a
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 9, 2024
b2fa38b
fix: Add button and maximize button fixes
albinAppsmith May 10, 2024
ef30093
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 10, 2024
ab1e270
fix: cypress failures
albinAppsmith May 10, 2024
ae5654e
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 10, 2024
97feeb5
fix: add button logic change
albinAppsmith May 10, 2024
1012f63
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 10, 2024
e086e0f
fix: add click logic revert
albinAppsmith May 10, 2024
6d63f0d
fix: add and close button behaviour fix
albinAppsmith May 12, 2024
2da706b
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 12, 2024
cd2212b
fix: add and expand button shrink issue
albinAppsmith May 12, 2024
2e3629d
fix: new query tab scroll fix
albinAppsmith May 12, 2024
5ac67bc
fix: jest tests
albinAppsmith May 13, 2024
dd72f03
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 13, 2024
8d0a0ee
fix: cypress failures
albinAppsmith May 13, 2024
c0f210a
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 13, 2024
974b375
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 13, 2024
9540f0c
fix: cypress selector
albinAppsmith May 13, 2024
af6df38
fix: click create option function
albinAppsmith May 13, 2024
36faf74
fix: removed unnecessary function to get
albinAppsmith May 13, 2024
5c0b56d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 13, 2024
bff3ef1
fix: code refactor
albinAppsmith May 14, 2024
54dda9b
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 14, 2024
6debce9
fix: dependency array for query add
albinAppsmith May 14, 2024
6dff7ef
fix: close issue
albinAppsmith May 14, 2024
6eb7205
fix: cypress refactor
albinAppsmith May 14, 2024
ea658d0
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith May 14, 2024
48223f4
fix: cypress failures
albinAppsmith May 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2320,9 +2320,9 @@ export const EDITOR_PANE_TEXTS = {
js_add_button: () => "New JS object",
js_blank_object_item: () => "Blank JS object",
widget_add_button: () => "New UI element",
query_create_tab_title: () => "Create new query / API",
query_create_tab_title: () => "Create new query from",
widgets_create_tab_title: () => "Drag & drop UI elements",
js_create_tab_title: () => "Create JS object",
js_create_tab_title: () => "Create JS object from",
queries_create_from_existing: () => "From existing datasource",
queries_create_new: () => "New API",
loading_building_blocks: () => "Loading building blocks",
Expand Down
8 changes: 1 addition & 7 deletions app/client/src/ce/pages/Editor/IDE/EditorPane/JS/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,11 @@ export const useJSSegmentRoutes = (path: string): UseRoutes => {
];
}
return [
{
exact: true,
key: "AddJS",
component: AddJS,
path: [`${path}${ADD_PATH}`, `${path}/:collectionId${ADD_PATH}`],
},
{
exact: false,
key: "ListJS",
component: ListJS,
path: [path],
path: [path, `${path}${ADD_PATH}`, `${path}/:collectionId${ADD_PATH}`],
},
];
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useMemo } from "react";
import React, { useCallback, useMemo } from "react";
import history from "utils/history";
import { useLocation } from "react-router";
import { FocusEntity, identifyEntityFromPath } from "navigation/FocusEntity";
Expand Down Expand Up @@ -37,7 +37,7 @@ import ListQuery from "pages/Editor/IDE/EditorPane/Query/List";
import type { AppState } from "@appsmith/reducers";
import keyBy from "lodash/keyBy";
import { getPluginEntityIcon } from "pages/Editor/Explorer/ExplorerIcons";
import type { ListItemProps } from "design-system";
import { Tag, type ListItemProps } from "design-system";
import { useCurrentEditorState } from "pages/Editor/IDE/hooks";
import CurlImportEditor from "pages/Editor/APIEditor/CurlImportEditor";

Expand Down Expand Up @@ -166,17 +166,11 @@ export const useQuerySegmentRoutes = (path: string): UseRoutes => {
];
}
return [
{
key: "AddQuery",
exact: true,
component: AddQuery,
path: [`${path}${ADD_PATH}`, `${path}/:queryId${ADD_PATH}`],
},
{
key: "ListQuery",
exact: false,
component: ListQuery,
path: [path],
path: [path, `${path}${ADD_PATH}`, `${path}/:queryId${ADD_PATH}`],
},
];
};
Expand Down Expand Up @@ -212,7 +206,11 @@ export const useAddQueryListItems = () => {
fileOperation.entityExplorerTitle ||
fileOperation.dsName ||
fileOperation.title,
description: !!fileOperation.isBeta ? "Beta" : "",
description: !!fileOperation.isBeta ? (
<Tag isClosable={false}>Beta</Tag>
) : (
""
),
descriptionType: "inline",
onClick: onCreateItemClick.bind(null, fileOperation),
} as ListItemProps;
Expand Down
52 changes: 27 additions & 25 deletions app/client/src/ce/pages/Editor/IDE/MainPane/useRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import { QueriesBlankState } from "pages/Editor/QueryEditor/QueriesBlankState";
import { useSelector } from "react-redux";
import { getIDEViewMode, getIsSideBySideEnabled } from "selectors/ideSelectors";
import { EditorViewMode } from "@appsmith/entities/IDE/constants";
import { JSAddState } from "pages/Editor/JSEditor/JSAddState";
import { QueriesAddState } from "pages/Editor/QueryEditor/QueriesAddState";

export interface RouteReturnType extends RouteProps {
key: string;
Expand Down Expand Up @@ -170,58 +172,61 @@ function useRoutes(path: string): RouteReturnType[] {
path: `${path}${BUILDER_CHECKLIST_PATH}`,
},
{
key: "ApiEditor",
component: ApiEditor,
key: "QueryEditorAdd",
component: QueriesAddState,
exact: true,
path: [
`${path}${API_EDITOR_ID_PATH}`,
`${path}${QUERIES_EDITOR_BASE_PATH}${ADD_PATH}`,
`${path}${QUERIES_EDITOR_ID_ADD_PATH}`,
`${path}${API_EDITOR_ID_ADD_PATH}`,
`${path}${CURL_IMPORT_PAGE_PATH}${ADD_PATH}`,
`${path}${SAAS_EDITOR_API_ID_ADD_PATH}`,
],
},
{
key: "ApiEditor",
component: ApiEditor,
exact: true,
path: [`${path}${API_EDITOR_ID_PATH}`],
},
{
key: "QueryEditorList",
component: QueriesBlankState,
exact: true,
path: [
`${path}${QUERIES_EDITOR_BASE_PATH}`,
`${path}${QUERIES_EDITOR_BASE_PATH}${ADD_PATH}`,
],
path: [`${path}${QUERIES_EDITOR_BASE_PATH}`],
},
{
key: "QueryEditor",
component: QueryEditor,
exact: true,
path: [`${path}${QUERIES_EDITOR_ID_PATH}`],
},
{
key: "JSEditorAdd",
component: JSAddState,
exact: true,
path: [
`${path}${QUERIES_EDITOR_ID_PATH}`,
`${path}${QUERIES_EDITOR_ID_ADD_PATH}`,
`${path}${JS_COLLECTION_EDITOR_PATH}${ADD_PATH}`,
`${path}${JS_COLLECTION_ID_PATH}${ADD_PATH}`,
],
},
{
key: "JSEditorList",
component: JSBlankState,
exact: true,
path: [
`${path}${JS_COLLECTION_EDITOR_PATH}`,
`${path}${JS_COLLECTION_EDITOR_PATH}${ADD_PATH}`,
],
path: [`${path}${JS_COLLECTION_EDITOR_PATH}`],
},
{
key: "JSEditor File",
component: JSEditor,
exact: true,
path: [
`${path}${JS_COLLECTION_ID_PATH}`,
`${path}${JS_COLLECTION_ID_PATH}${ADD_PATH}`,
],
path: [`${path}${JS_COLLECTION_ID_PATH}`],
},
{
key: "CurlImportEditor",
component: CurlImportEditor,
exact: true,
path: [
`${path}${CURL_IMPORT_PAGE_PATH}`,
`${path}${CURL_IMPORT_PAGE_PATH}${ADD_PATH}`,
],
path: [`${path}${CURL_IMPORT_PAGE_PATH}`],
},
{
key: "SAASList",
Expand All @@ -239,10 +244,7 @@ function useRoutes(path: string): RouteReturnType[] {
key: "SAASEditor",
component: QueryEditor,
exact: true,
path: [
`${path}${SAAS_EDITOR_API_ID_PATH}`,
`${path}${SAAS_EDITOR_API_ID_ADD_PATH}`,
],
path: [`${path}${SAAS_EDITOR_API_ID_PATH}`],
},
{
key: "DatasourceEditor",
Expand Down
48 changes: 29 additions & 19 deletions app/client/src/pages/Editor/IDE/EditorPane/JS/Add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback } from "react";
import SegmentAddHeader from "../components/SegmentAddHeader";
import { EDITOR_PANE_TEXTS } from "@appsmith/constants/messages";
import type { ListItemProps } from "design-system";
import { Flex } from "design-system";
import { Flex, Tag } from "design-system";
import { useDispatch, useSelector } from "react-redux";
import { getCurrentPageId } from "selectors/editorSelectors";
import GroupedList from "../components/GroupedList";
Expand All @@ -11,8 +11,9 @@ import {
useJSAdd,
} from "@appsmith/pages/Editor/IDE/EditorPane/JS/hooks";
import type { ActionOperation } from "components/editorComponents/GlobalSearch/utils";
import type { AddProps } from "../types/AddProps";

const AddJS = () => {
const AddJS = ({ containerProps, innerContainerProps }: AddProps) => {
const dispatch = useDispatch();
const pageId = useSelector(getCurrentPageId);
const closeButtonClickHandler = useJSAdd();
Expand All @@ -32,29 +33,38 @@ const AddJS = () => {
return {
startIcon: data.icon,
title: data.entityExplorerTitle || data.title,
description: !!data.isBeta ? "Beta" : "",
description: !!data.isBeta ? <Tag isClosable={false}>Beta</Tag> : "",
descriptionType: "inline",
onClick: onCreateItemClick.bind(null, data),
} as ListItemProps;
};

return (
<Flex flexDirection="column" gap={"spaces-4"} overflow="hidden">
<SegmentAddHeader
onCloseClick={closeButtonClickHandler}
titleMessage={EDITOR_PANE_TEXTS.js_create_tab_title}
/>
<GroupedList
flexProps={{
pr: "spaces-2",
px: "spaces-3",
}}
groups={groupedJsOperations.map((op) => ({
groupTitle: op.title,
className: op.className,
items: op.operations.map(getListItems),
}))}
/>
<Flex justifyContent="center" p="spaces-3" {...containerProps}>
<Flex
flexDirection="column"
gap={"spaces-4"}
overflow="hidden"
width="100%"
{...innerContainerProps}
>
<SegmentAddHeader
onCloseClick={closeButtonClickHandler}
titleMessage={EDITOR_PANE_TEXTS.js_create_tab_title}
/>

<GroupedList
flexProps={{
pr: "spaces-2",
px: "spaces-3",
}}
groups={groupedJsOperations.map((op) => ({
groupTitle: op.title,
className: op.className,
items: op.operations.map(getListItems),
}))}
/>
</Flex>
</Flex>
);
};
Expand Down