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

chore: Reorganise IDE Panels #35114

Merged
merged 27 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7685e37
reorg-js-segment
hetunandu Jul 16, 2024
d26c503
Merge branch 'release' into chore/reorg-panes
hetunandu Jul 17, 2024
cad22b6
separate Editor and Explorer end points
hetunandu Jul 17, 2024
4d6a37e
Merge branch 'release' into chore/reorg-panes
hetunandu Jul 17, 2024
50852de
separate end points for queries
hetunandu Jul 17, 2024
53b78e4
split and full divide
hetunandu Jul 17, 2024
2a40212
Main pane fix routes
hetunandu Jul 18, 2024
b8bc048
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 23, 2024
3404da7
Fix explorer in side by side
hetunandu Jul 23, 2024
57d0e76
Fix sizing
hetunandu Jul 23, 2024
809cd30
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 23, 2024
d97752b
Add back missing classname
hetunandu Jul 24, 2024
65774bc
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 24, 2024
f0e6da9
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 25, 2024
c46ad43
Set 0 as the lower limit for Canvas
hetunandu Jul 25, 2024
883ebef
Fix bug with setting lower limit
hetunandu Jul 25, 2024
a111096
border changes
hetunandu Jul 25, 2024
4783cef
Test case fixes
hetunandu Jul 26, 2024
c0225d5
Update Postgres failing test
hetunandu Jul 29, 2024
9be6341
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 29, 2024
911fe82
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 30, 2024
a420821
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 30, 2024
7f717c9
Style fixes
hetunandu Jul 30, 2024
434fbd0
fix: More styles
hetunandu Jul 30, 2024
14013aa
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 31, 2024
10deced
Remove unused
hetunandu Jul 31, 2024
26688b0
Merge branch 'refs/heads/release' into chore/reorg-panes
hetunandu Jul 31, 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 @@ -28,6 +28,7 @@ describe(
appSettings.locators._navigationSettings._navStyle,
"Inline",
);
AppSidebar.navigate(AppSidebarButton.Editor);
agHelper.GetNClick(locators._previewModeToggle("edit"));
agHelper.GetNClick(appSettings.locators._topInlineMoreButton);
agHelper.GetNClickByContains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ describe(
agHelper.GetNClick(propPane._checkbox, 1, true);
PageList.VerifyIsCurrentPage("Page2");
agHelper.GetNClick(locators._exitPreviewMode);
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);

// Deploy mode
deployMode.DeployApp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,20 +608,11 @@ describe(
table.ReadTableRowColumnData(0, 0, "v2", 2000).then(($cellData) => {
expect($cellData).not.eq("159180"); //Deleted record Store_ID
});
});

it("15. Validate Deletion of the Newly Created Page - Vessels", () => {
deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad(0, 0, "v2");
//Delete the test data
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "Public.vessels",
action: "Delete",
entityType: entityItems.Page,
});
});

it("16. Validate Drop of the Newly Created - Vessels - Table from Postgres datasource", () => {
it("15. Validate Drop of the Newly Created - Vessels - Table from Postgres datasource", () => {
const deleteTblQuery = "DROP TABLE Vessels;";
dataSources.CreateQueryForDS(dsName, deleteTblQuery, "DropVessels");
agHelper.FocusElement(locators._codeMirrorTextArea);
Expand All @@ -630,7 +621,7 @@ describe(
dataSources.AssertTableInVirtuosoList(dsName, "public.vessels", false);
});

it("17. Verify application does not break when user runs the query with wrong table name", function () {
it("16. Verify application does not break when user runs the query with wrong table name", function () {
EditorNavigation.SelectEntityByName("DropVessels", EntityType.Query);
dataSources.RunQuery({ toValidateResponse: false });
cy.wait("@postExecute").then(({ response }) => {
Expand All @@ -645,7 +636,7 @@ describe(
});
});

it("18. Verify Deletion of the datasource when Pages/Actions associated are not removed yet", () => {
it("17. Verify Deletion of the datasource when Pages/Actions associated are not removed yet", () => {
deployMode.DeployApp();
deployMode.NavigateBacktoEditor();
dataSources.DeleteDatasourceFromWithinDS(dsName, 409);
Expand Down
55 changes: 18 additions & 37 deletions app/client/src/ce/pages/Editor/IDE/EditorPane/JS/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import { createMessage, EDITOR_PANE_TEXTS } from "@appsmith/constants/messages";
import { JsFileIconV2 } from "pages/Editor/Explorer/ExplorerIcons";
import { SEARCH_ITEM_TYPES } from "components/editorComponents/GlobalSearch/utils";
import type { UseRoutes } from "@appsmith/entities/IDE/constants";
import { EditorViewMode } from "@appsmith/entities/IDE/constants";
import { getIDEViewMode, getIsSideBySideEnabled } from "selectors/ideSelectors";
import JSEditor from "pages/Editor/JSEditor";
import AddJS from "pages/Editor/IDE/EditorPane/JS/Add";
import { ADD_PATH } from "@appsmith/constants/routes/appRoutes";
import ListJS from "pages/Editor/IDE/EditorPane/JS/List";
import history from "utils/history";
import { FocusEntity, identifyEntityFromPath } from "navigation/FocusEntity";
import { useModuleOptions } from "@appsmith/utils/moduleInstanceHelpers";
Expand Down Expand Up @@ -43,7 +40,7 @@ export const useJSAdd = () => {
const closeAddJS = useCallback(() => {
const url = getJSUrl(currentEntityInfo, false);
history.push(url);
}, [pageId, currentEntityInfo]);
}, [currentEntityInfo]);

return { openAddJS, closeAddJS };
};
Expand Down Expand Up @@ -77,41 +74,25 @@ export const useGroupedAddJsOperations = (): GroupedAddOperations => {
];
};

export const useJSSegmentRoutes = (path: string): UseRoutes => {
const isSideBySideEnabled = useSelector(getIsSideBySideEnabled);
const editorMode = useSelector(getIDEViewMode);
if (isSideBySideEnabled && editorMode === EditorViewMode.SplitScreen) {
return [
{
exact: true,
key: "AddJS",
component: AddJS,
path: [`${path}${ADD_PATH}`, `${path}/:baseCollectionId${ADD_PATH}`],
},
{
exact: true,
key: "JSEditor",
component: JSEditor,
path: [path + "/:baseCollectionId"],
},
{
key: "JSEmpty",
component: JSBlankState,
exact: true,
path: [path],
},
];
}
export const useJSEditorRoutes = (path: string): UseRoutes => {
return [
{
exact: false,
key: "ListJS",
component: ListJS,
path: [
path,
`${path}${ADD_PATH}`,
`${path}/:baseCollectionId${ADD_PATH}`,
],
exact: true,
key: "AddJS",
component: AddJS,
path: [`${path}${ADD_PATH}`, `${path}/:baseCollectionId${ADD_PATH}`],
},
{
exact: true,
key: "JSEditor",
component: JSEditor,
path: [path + "/:baseCollectionId"],
},
{
key: "JSEmpty",
component: JSBlankState,
exact: true,
path: [path],
},
];
};
96 changes: 39 additions & 57 deletions app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type { ActionOperation } from "components/editorComponents/GlobalSearch/u
import { SEARCH_ITEM_TYPES } from "components/editorComponents/GlobalSearch/utils";
import { createMessage, EDITOR_PANE_TEXTS } from "@appsmith/constants/messages";
import { getQueryUrl } from "@appsmith/pages/Editor/IDE/EditorPane/Query/utils";
import { getIDEViewMode, getIsSideBySideEnabled } from "selectors/ideSelectors";
import {
ADD_PATH,
API_EDITOR_ID_PATH,
Expand All @@ -26,22 +25,18 @@ import {
import { SAAS_EDITOR_API_ID_PATH } from "pages/Editor/SaaSEditor/constants";
import ApiEditor from "pages/Editor/APIEditor";
import type { UseRoutes } from "@appsmith/entities/IDE/constants";
import { EditorViewMode } from "@appsmith/entities/IDE/constants";
import QueryEditor from "pages/Editor/QueryEditor";
import AddQuery from "pages/Editor/IDE/EditorPane/Query/Add";
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 { useCurrentEditorState } from "pages/Editor/IDE/hooks";
import { createAddClassName } from "pages/Editor/IDE/EditorPane/utils";
import { QueriesBlankState } from "pages/Editor/QueryEditor/QueriesBlankState";

export const useQueryAdd = () => {
const location = useLocation();
const currentEntityInfo = identifyEntityFromPath(location.pathname);
const { segmentMode } = useCurrentEditorState();

const openAddQuery = useCallback(() => {
if (currentEntityInfo.entity === FocusEntity.QUERY_ADD) {
Expand All @@ -50,13 +45,13 @@ export const useQueryAdd = () => {
let url = "";
url = getQueryUrl(currentEntityInfo);
history.push(url);
}, [currentEntityInfo, segmentMode, location]);
}, [currentEntityInfo]);

const closeAddQuery = useCallback(() => {
let url = "";
url = getQueryUrl(currentEntityInfo, false);
history.push(url);
}, [currentEntityInfo, segmentMode, location]);
}, [currentEntityInfo]);

return { openAddQuery, closeAddQuery };
};
Expand Down Expand Up @@ -107,58 +102,45 @@ export const useGroupedAddQueryOperations = (): GroupedAddOperations => {
return groups;
};

export const useQuerySegmentRoutes = (path: string): UseRoutes => {
const isSideBySideEnabled = useSelector(getIsSideBySideEnabled);
const editorMode = useSelector(getIDEViewMode);

if (isSideBySideEnabled && editorMode === EditorViewMode.SplitScreen) {
return [
{
key: "ApiEditor",
component: ApiEditor,
exact: true,
path: [
BUILDER_PATH + API_EDITOR_ID_PATH,
BUILDER_CUSTOM_PATH + API_EDITOR_ID_PATH,
BUILDER_PATH_DEPRECATED + API_EDITOR_ID_PATH,
],
},
{
key: "AddQuery",
exact: true,
component: AddQuery,
path: [`${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
},
{
key: "SAASEditor",
component: QueryEditor,
exact: true,
path: [
BUILDER_PATH + SAAS_EDITOR_API_ID_PATH,
BUILDER_CUSTOM_PATH + SAAS_EDITOR_API_ID_PATH,
BUILDER_PATH_DEPRECATED + SAAS_EDITOR_API_ID_PATH,
],
},
{
key: "QueryEditor",
component: QueryEditor,
exact: true,
path: [path + "/:baseQueryId"],
},
{
key: "QueryEmpty",
component: QueriesBlankState,
exact: true,
path: [path],
},
];
}
export const useQueryEditorRoutes = (path: string): UseRoutes => {
return [
{
key: "ListQuery",
exact: false,
component: ListQuery,
path: [path, `${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
key: "ApiEditor",
component: ApiEditor,
exact: true,
path: [
BUILDER_PATH + API_EDITOR_ID_PATH,
BUILDER_CUSTOM_PATH + API_EDITOR_ID_PATH,
BUILDER_PATH_DEPRECATED + API_EDITOR_ID_PATH,
],
},
{
key: "AddQuery",
exact: true,
component: AddQuery,
path: [`${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
},
{
key: "SAASEditor",
component: QueryEditor,
exact: true,
path: [
BUILDER_PATH + SAAS_EDITOR_API_ID_PATH,
BUILDER_CUSTOM_PATH + SAAS_EDITOR_API_ID_PATH,
BUILDER_PATH_DEPRECATED + SAAS_EDITOR_API_ID_PATH,
],
},
{
key: "QueryEditor",
component: QueryEditor,
exact: true,
path: [path + "/:baseQueryId"],
},
{
key: "QueryEmpty",
component: QueriesBlankState,
exact: true,
path: [path],
},
];
};
Expand Down
Loading
Loading