chore: Query Editor full width option (#37138)

This commit is contained in:
Hetu Nandu 2024-10-31 15:20:48 +05:30 committed by GitHub
parent 38c9bc0afc
commit ee02c0f17e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 33 additions and 22 deletions

View File

@ -211,7 +211,7 @@ const FormRender = (props: Props) => {
switch (section.controlType) {
case "SECTION_V2":
return <Section>{children}</Section>;
return <Section isFullWidth={section.isFullWidth}>{children}</Section>;
case "SINGLE_COLUMN_ZONE":
case "DOUBLE_COLUMN_ZONE": {

View File

@ -21,10 +21,14 @@ import { actionPathFromName } from "components/formControls/utils";
import type { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory";
import { getSqlEditorModeFromPluginName } from "components/editorComponents/CodeEditor/sql/config";
import { selectFeatureFlags } from "ee/selectors/featureFlagsSelectors";
import { Flex } from "@appsmith/ads";
const Wrapper = styled.div<{ fullWidth: boolean }>`
const Wrapper = styled.div`
min-width: 380px;
max-width: ${({ fullWidth }) => (fullWidth ? "100%" : "872px;")};
width: 100%;
min-height: 200px;
height: 100%;
display: flex;
`;
interface DynamicTextControlState {
@ -64,25 +68,24 @@ class DynamicTextControl extends BaseControl<
: EditorModes.JSON_WITH_BINDING;
return (
<Wrapper
className={`t--${configProperty} dynamic-text-field-control`}
fullWidth={isActionRedesignEnabled}
>
<DynamicTextField
dataTreePath={dataTreePath}
disabled={this.props.disabled}
evaluatedPopUpLabel={this?.props?.label}
evaluationSubstitutionType={evaluationSubstitutionType}
height="200px"
mode={mode}
name={this.props.configProperty}
placeholder={placeholderText}
showLineNumbers={
isActionRedesignEnabled || this.props.showLineNumbers
}
size={EditorSize.EXTENDED}
tabBehaviour={TabBehaviour.INDENT}
/>
<Wrapper className={`t--${configProperty} dynamic-text-field-control`}>
<Flex flex="1">
<DynamicTextField
dataTreePath={dataTreePath}
disabled={this.props.disabled}
evaluatedPopUpLabel={this?.props?.label}
evaluationSubstitutionType={evaluationSubstitutionType}
height="100%"
mode={mode}
name={this.props.configProperty}
placeholder={placeholderText}
showLineNumbers={
isActionRedesignEnabled || this.props.showLineNumbers
}
size={EditorSize.EXTENDED}
tabBehaviour={TabBehaviour.INDENT}
/>
</Flex>
</Wrapper>
);
}

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",

View File

@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",