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: Query Editor full width option #37138

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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": {
Expand Down
45 changes: 24 additions & 21 deletions app/client/src/components/formControls/DynamicTextFieldControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"controlType": "SECTION_V2",
"identifier": "SECTION-ONE",
"isFullWidth": true,
"children": [
{
"controlType": "SINGLE_COLUMN_ZONE",
Expand Down
Loading