Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Oct 2, 2024
1 parent f9a81ba commit 95a7e8f
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { renderHook } from "@testing-library/react-hooks/dom";
import { useDispatch } from "react-redux";
import { PluginType } from "entities/Action";
import { usePluginActionContext } from "../../../PluginActionContext";
import { usePluginActionContext } from "PluginActionEditor";
import { changeApi, changeQuery } from "../../../store";
import usePrevious from "utils/hooks/usePrevious";
import { useChangeActionCall } from "./useChangeActionCall";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import EntityBottomTabs from "components/editorComponents/EntityBottomTabs";
import { useDispatch, useSelector } from "react-redux";
import { setPluginActionEditorDebuggerState } from "../../store";
import { getPluginActionDebuggerState } from "../../store";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { usePluginActionResponseTabs } from "./hooks";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "ee/constants/ReduxActionConstants";
import type { Action } from "entities/Action";
import { ActionExecutionResizerHeight } from "pages/Editor/APIEditor/constants";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import type { ActionResponse } from "api/ActionAPI";
import { omit } from "lodash";
import { objectKeys } from "@appsmith/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { BottomTab } from "components/editorComponents/EntityBottomTabs";
import { getIDEViewMode } from "selectors/ideSelectors";
import { useSelector } from "react-redux";
import { EditorViewMode } from "ee/entities/IDE/constants";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import {
createMessage,
DEBUGGER_ERRORS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const defaultStoreState = {
config: {},
},
},
apiPane: {
pluginActionEditor: {
isCreating: false,
isRunning: {},
isSaving: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const storeState = {
errorCount: 0,
},
},
apiPane: {
pluginActionEditor: {
debugger: {
open: true,
responseTabHeight: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ErrorLogs from "./Debugger/Errors";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { BottomTab } from "./EntityBottomTabs";
import EntityBottomTabs from "./EntityBottomTabs";
import { DEBUGGER_TAB_KEYS } from "./Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "./Debugger/constants";
import { getErrorCount } from "selectors/debuggerSelectors";
import { ActionExecutionResizerHeight } from "pages/Editor/APIEditor/constants";
import type { Action } from "entities/Action";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { getEntityNameAndPropertyPath } from "ee/workers/Evaluation/evaluationUt
import { getPathNavigationUrl } from "selectors/navigationSelectors";
import { Button, Icon, Link, toast, Tooltip } from "@appsmith/ads";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { DEBUGGER_TAB_KEYS } from "../Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "../Debugger/constants";

const modifiers: IPopoverSharedProps["modifiers"] = {
offset: {
Expand Down Expand Up @@ -92,13 +92,15 @@ const CurrentValueWrapper = styled.div<{ colorTheme: EditorTheme }>`
display: flex;
align-items: center;
justify-content: space-between;
&:hover {
.copyIconWrapper {
display: flex;
}
}
/* for audit logs */
.pushed-content .object-key-val,
.variable-row {
border-left: 1px solid var(--ads-v2-color-border) !important;
Expand Down Expand Up @@ -173,6 +175,7 @@ const StyledIcon = styled(Icon)`
&.open-collapse {
transform: rotate(90deg);
}
float: right;
`;

Expand Down Expand Up @@ -281,6 +284,7 @@ interface PreparedStatementValue {
value: string;
parameters: Record<string, number | string>;
}

export function PreparedStatementViewer(props: {
evaluatedValue: PreparedStatementValue;
}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { getTypographyByKey } from "@appsmith/ads-old";
import type { Message } from "entities/AppsmithConsole";
import ContextualMenu from "./ContextualMenu";
import { DEBUGGER_TAB_KEYS } from "./helpers";
import { DEBUGGER_TAB_KEYS } from "./constants";
import type { FieldEntityInformation } from "../CodeEditor/EditorConfig";
import { Button } from "@appsmith/ads";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
DEBUGGER_LOGS,
INSPECT_ENTITY,
} from "ee/constants/messages";
import { DEBUGGER_TAB_KEYS } from "./helpers";
import { DEBUGGER_TAB_KEYS } from "./constants";
import EntityBottomTabs from "../EntityBottomTabs";
import { ActionExecutionResizerHeight } from "pages/Editor/APIEditor/constants";
import { IDEBottomView, ViewHideBehaviour, ViewDisplayMode } from "IDE";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export enum DEBUGGER_TAB_KEYS {
SCHEMA_TAB = "schema",
RESPONSE_TAB = "response",
HEADER_TAB = "headers",
ERROR_TAB = "ERROR",
LOGS_TAB = "LOGS_TAB",
INSPECT_TAB = "INSPECT_TAB",
}
13 changes: 2 additions & 11 deletions app/client/src/components/editorComponents/Debugger/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { createMessage, OPEN_THE_DEBUGGER, PRESS } from "ee/constants/messages";
import type { DependencyMap } from "utils/DynamicBindingUtils";
import { isChildPropertyPath } from "utils/DynamicBindingUtils";
import {
matchBuilderPath,
matchApiPath,
matchBuilderPath,
matchQueryPath,
} from "constants/routes";
import { getEntityNameAndPropertyPath } from "ee/workers/Evaluation/evaluationUtils";
Expand All @@ -22,8 +22,8 @@ const BlankStateWrapper = styled.div`
justify-content: center;
align-items: center;
color: var(--ads-v2-color-fg);
${getTypographyByKey("p1")}
${getTypographyByKey("p1")}
.debugger-shortcut {
color: var(--ads-v2-color-fg);
${getTypographyByKey("h5")}
Expand Down Expand Up @@ -51,15 +51,6 @@ export function BlankState(props: {
);
}

export enum DEBUGGER_TAB_KEYS {
SCHEMA_TAB = "schema",
RESPONSE_TAB = "response",
HEADER_TAB = "headers",
ERROR_TAB = "ERROR",
LOGS_TAB = "LOGS_TAB",
INSPECT_TAB = "INSPECT_TAB",
}

export const SeverityIcon: Record<Severity, string> = {
[Severity.INFO]: "success",
[Severity.ERROR]: "close-circle",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLocation } from "react-router";
import { DEBUGGER_TAB_KEYS } from "../helpers";
import { DEBUGGER_TAB_KEYS } from "../constants";
import { setCanvasDebuggerState } from "actions/debuggerActions";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { FocusEntityInfo } from "navigation/FocusEntity";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { DEBUGGER_TAB_KEYS } from "./Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "./Debugger/constants";
import { Tab, TabPanel, Tabs, TabsList } from "@appsmith/ads";
import styled from "styled-components";
import { LIST_HEADER_HEIGHT, FOOTER_MARGIN } from "./Debugger/DebuggerLogs";
Expand All @@ -9,11 +9,14 @@ import type { RefObject } from "react";
const TabPanelWrapper = styled(TabPanel)`
margin-top: 0;
height: calc(100% - ${LIST_HEADER_HEIGHT});
&.ads-v2-tabs__panel {
overflow: auto;
}
& .t--code-editor-wrapper.codeWrapper {
height: calc(100% - ${FOOTER_MARGIN});
& .CodeMirror-scroll {
box-sizing: border-box;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Flex, Text } from "@appsmith/ads";
import LoadingOverlayScreen from "components/editorComponents/LoadingOverlayScreen";
import type { JSCollectionData } from "ee/reducers/entityReducers/jsActionsReducer";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { DEBUGGER_TAB_KEYS } from "./Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "./Debugger/constants";
import type { BottomTab } from "./EntityBottomTabs";
import EntityBottomTabs from "./EntityBottomTabs";
import { getIsSavingEntity } from "selectors/editorSelectors";
Expand Down Expand Up @@ -56,6 +56,7 @@ const ResponseTabWrapper = styled.div`
opacity: 0.8;
pointer-events: none;
}
.response-run {
margin: 0 10px;
}
Expand Down
10 changes: 9 additions & 1 deletion app/client/src/pages/Editor/DataSourceEditor/Debugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
showDebugger,
} from "actions/debuggerActions";
import EntityBottomTabs from "components/editorComponents/EntityBottomTabs";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import Errors from "components/editorComponents/Debugger/Errors";
import DebuggerLogs from "components/editorComponents/Debugger/DebuggerLogs";
import EntityDeps from "components/editorComponents/Debugger/EntityDependecies";
Expand All @@ -37,30 +37,38 @@ export const ResizerContentContainer = styled.div`
flex: 1;
position: relative;
display: flex;
&.db-form-resizer-content,
&.saas-form-resizer-content,
&.api-datasource-content-container {
flex-direction: column;
padding: 0 var(--ads-v2-spaces-7) 0 var(--ads-v2-spaces-7);
& .t--ds-form-header {
border-bottom: 1px solid var(--ads-v2-color-border);
}
}
&.db-form-resizer-content.db-form-resizer-content-show-tabs,
&.saas-form-resizer-content.saas-form-resizer-content-show-tabs {
padding: 0;
& .t--ds-form-header {
border-bottom: none;
}
}
&.saas-form-resizer-content.saas-form-resizer-content-show-tabs form {
padding-bottom: 0;
}
border-top: none;
.db-form-content-container {
display: flex;
flex-direction: column;
width: 100%;
form {
flex-grow: 1;
}
Expand Down
4 changes: 3 additions & 1 deletion app/client/src/pages/Editor/JSEditor/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ import {
getHasManageActionPermission,
} from "ee/utils/BusinessFeatures/permissionPageHelpers";
import type { JSCollectionData } from "ee/reducers/entityReducers/jsActionsReducer";
import { DEBUGGER_TAB_KEYS } from "../../../components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import RunHistory from "ee/components/RunHistory";

interface JSFormProps {
jsCollectionData: JSCollectionData;
contextMenu: React.ReactNode;
Expand Down Expand Up @@ -99,6 +100,7 @@ const SecondaryWrapper = styled.div`
flex-direction: column;
flex: 1;
overflow: hidden;
&&& {
.ads-v2-tabs,
&.js-editor-tab {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const storeState = {
errorCount: 0,
},
},
queryPane: {
pluginActionEditor: {
debugger: {
open: true,
responseTabHeight: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useDispatch, useSelector } from "react-redux";
import styled from "styled-components";
import { getErrorCount } from "selectors/debuggerSelectors";
import { Text, TextType } from "@appsmith/ads-old";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import {
DEBUGGER_ERRORS,
DEBUGGER_LOGS,
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/pages/Editor/QueryEditor/QueryResponseTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
type CalloutLinkProps,
} from "@appsmith/ads";
import styled from "styled-components";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { setActionResponseDisplayFormat } from "actions/pluginActionActions";
import { getUpdateTimestamp } from "components/editorComponents/Debugger/ErrorLogs/ErrorLogItem";
Expand Down Expand Up @@ -66,6 +66,7 @@ const ResponseContentWrapper = styled.div<{ isError: boolean }>`
${HelpSection} {
margin-bottom: 10px;
}
position: relative;
`;

Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/ActionExecution/PluginActionSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ import { setDefaultActionDisplayFormat } from "./PluginActionSagaUtils";
import { checkAndLogErrorsIfCyclicDependency } from "sagas/helper";
import { toast } from "@appsmith/ads";
import type { TRunDescription } from "workers/Evaluation/fns/actionFns";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import { FILE_SIZE_LIMIT_FOR_BLOBS } from "constants/WidgetConstants";
import type { ActionData } from "ee/reducers/entityReducers/actionsReducer";
import { handleStoreOperations } from "./StoreActionSaga";
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/ActionExecution/errorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ActionTriggerKeys } from "ee/workers/Evaluation/fns";
import { getActionTriggerFunctionNames } from "ee/workers/Evaluation/fns";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { setDebuggerSelectedTab, showDebugger } from "actions/debuggerActions";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import store from "store";
import showToast from "sagas/ToastSagas";
import { call, put } from "redux-saga/effects";
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/JSPaneSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import { UserCancelledActionExecutionError } from "sagas/ActionExecution/errorUt
import type { EventLocation } from "ee/utils/analyticsUtilTypes";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { checkAndLogErrorsIfCyclicDependency } from "./helper";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants";
import {
getJSActionPathNameToDisplay,
isBrowserExecutionAllowed,
Expand Down

0 comments on commit 95a7e8f

Please sign in to comment.