-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
…external-contribution-35985
- Loading branch information
Showing
51 changed files
with
780 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
...press/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...inActionEditor/components/PluginActionForm/components/GraphQLEditor/GraphQLEditorForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from "react"; | ||
import { reduxForm } from "redux-form"; | ||
import { API_EDITOR_FORM_NAME } from "ee/constants/forms"; | ||
import CommonEditorForm from "../CommonEditorForm"; | ||
import Pagination from "pages/Editor/APIEditor/GraphQL/Pagination"; | ||
import { GRAPHQL_HTTP_METHOD_OPTIONS } from "constants/ApiEditorConstants/GraphQLEditorConstants"; | ||
import PostBodyData from "./PostBodyData"; | ||
import { usePluginActionContext } from "PluginActionEditor"; | ||
import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; | ||
import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; | ||
import { getHasManageActionPermission } from "ee/utils/BusinessFeatures/permissionPageHelpers"; | ||
import { noop } from "lodash"; | ||
import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig"; | ||
import useGetFormActionValues from "../CommonEditorForm/hooks/useGetFormActionValues"; | ||
|
||
const FORM_NAME = API_EDITOR_FORM_NAME; | ||
|
||
function GraphQLEditorForm() { | ||
const { action } = usePluginActionContext(); | ||
const theme = EditorTheme.LIGHT; | ||
|
||
const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled); | ||
const isChangePermitted = getHasManageActionPermission( | ||
isFeatureEnabled, | ||
action.userPermissions, | ||
); | ||
|
||
const { actionConfigurationBody } = useGetFormActionValues(); | ||
|
||
return ( | ||
<CommonEditorForm | ||
action={action} | ||
bodyUIComponent={<PostBodyData actionName={action.name} />} | ||
formName={FORM_NAME} | ||
httpMethodOptions={GRAPHQL_HTTP_METHOD_OPTIONS} | ||
isChangePermitted={isChangePermitted} | ||
paginationUiComponent={ | ||
<Pagination | ||
actionName={action.name} | ||
formName={FORM_NAME} | ||
onTestClick={noop} | ||
paginationType={action.actionConfiguration.paginationType} | ||
query={actionConfigurationBody} | ||
theme={theme} | ||
/> | ||
} | ||
/> | ||
); | ||
} | ||
|
||
export default reduxForm({ form: FORM_NAME, enableReinitialize: true })( | ||
GraphQLEditorForm, | ||
); |
109 changes: 109 additions & 0 deletions
109
.../PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import React, { useCallback, useRef } from "react"; | ||
import styled from "styled-components"; | ||
import QueryEditor from "pages/Editor/APIEditor/GraphQL/QueryEditor"; | ||
import VariableEditor from "pages/Editor/APIEditor/GraphQL/VariableEditor"; | ||
import useHorizontalResize from "utils/hooks/useHorizontalResize"; | ||
import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig"; | ||
import classNames from "classnames"; | ||
import { tailwindLayers } from "constants/Layers"; | ||
|
||
const ResizableDiv = styled.div` | ||
display: flex; | ||
height: 100%; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const PostBodyContainer = styled.div` | ||
display: flex; | ||
height: 100%; | ||
overflow: hidden; | ||
&&&& .CodeMirror { | ||
height: 100%; | ||
border-top: 1px solid var(--ads-v2-color-border); | ||
border-bottom: 1px solid var(--ads-v2-color-border); | ||
border-radius: 0; | ||
padding: 0; | ||
} | ||
& .CodeMirror-scroll { | ||
margin: 0px; | ||
padding: 0px; | ||
overflow: auto !important; | ||
} | ||
`; | ||
|
||
const ResizerHandler = styled.div<{ resizing: boolean }>` | ||
width: 6px; | ||
height: 100%; | ||
margin-left: 2px; | ||
border-right: 1px solid var(--ads-v2-color-border); | ||
background: ${(props) => | ||
props.resizing ? "var(--ads-v2-color-border)" : "transparent"}; | ||
&:hover { | ||
background: var(--ads-v2-color-border); | ||
border-color: transparent; | ||
} | ||
`; | ||
|
||
const DEFAULT_GRAPHQL_VARIABLE_WIDTH = 300; | ||
|
||
interface Props { | ||
actionName: string; | ||
} | ||
|
||
function PostBodyData(props: Props) { | ||
const { actionName } = props; | ||
const theme = EditorTheme.LIGHT; | ||
const resizeableRef = useRef<HTMLDivElement>(null); | ||
const [variableEditorWidth, setVariableEditorWidth] = React.useState( | ||
DEFAULT_GRAPHQL_VARIABLE_WIDTH, | ||
); | ||
/** | ||
* Variable Editor's resizeable handler for the changing of width | ||
*/ | ||
const onVariableEditorWidthChange = useCallback((newWidth) => { | ||
setVariableEditorWidth(newWidth); | ||
}, []); | ||
|
||
const { onMouseDown, onMouseUp, onTouchStart, resizing } = | ||
useHorizontalResize( | ||
resizeableRef, | ||
onVariableEditorWidthChange, | ||
undefined, | ||
true, | ||
); | ||
|
||
return ( | ||
<PostBodyContainer> | ||
<QueryEditor | ||
dataTreePath={`${actionName}.config.body`} | ||
height="100%" | ||
name="actionConfiguration.body" | ||
theme={theme} | ||
/> | ||
<div | ||
className={`w-2 h-full -ml-2 group cursor-ew-resize ${tailwindLayers.resizer}`} | ||
onMouseDown={onMouseDown} | ||
onTouchEnd={onMouseUp} | ||
onTouchStart={onTouchStart} | ||
> | ||
<ResizerHandler | ||
className={classNames({ | ||
"transform transition": true, | ||
})} | ||
resizing={resizing} | ||
/> | ||
</div> | ||
<ResizableDiv | ||
ref={resizeableRef} | ||
style={{ | ||
width: `${variableEditorWidth}px`, | ||
paddingRight: "2px", | ||
}} | ||
> | ||
<VariableEditor actionName={actionName} theme={theme} /> | ||
</ResizableDiv> | ||
</PostBodyContainer> | ||
); | ||
} | ||
|
||
export default PostBodyData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.