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

feat: Action redesign: updated Anthropic plugin config #35754

Merged
merged 21 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
09afd99
feat: Updated renderEachConfigV2 function to accomodate Section V2 an…
albinAppsmith Aug 19, 2024
0feacf6
feat: Updated zone to handle older margins and widths
albinAppsmith Aug 19, 2024
171f9b8
feat: Updates Section styles to nested css
albinAppsmith Aug 19, 2024
33460a1
feat: Updated layout types to better naming
albinAppsmith Aug 19, 2024
dba86b0
fix: height fixed for label with JS toggle and without toggle
albinAppsmith Aug 19, 2024
2a16aa3
fix: added classes to handle Section and Zone updates
albinAppsmith Aug 19, 2024
21432eb
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 19, 2024
1604269
feat: Updated Anthropic plugin config to use new Zone and Section
albinAppsmith Aug 19, 2024
79d1758
feat: updated root config
albinAppsmith Aug 19, 2024
9e66ea6
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 19, 2024
3dcc0df
fix: code review fix
albinAppsmith Aug 19, 2024
51b2093
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 20, 2024
4183169
Merge branch 'action-redesign/zone-section-v2-implementation' of http…
albinAppsmith Aug 20, 2024
da74b5f
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 20, 2024
1b888ef
feat: Action redesign - updated helper text to show below the control
albinAppsmith Aug 20, 2024
ccd6ffa
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 20, 2024
e2e5c41
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 21, 2024
dd2b3cd
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 21, 2024
57f51bb
Merge branch 'action-redesign/helper-text-placement' of https://githu…
albinAppsmith Aug 21, 2024
ae94734
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 22, 2024
2da09e4
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Aug 22, 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 @@ -76,7 +76,7 @@ function ToggleComponentToJsonHandler(props: HandlerProps) {
content={!!configPropertyPathJsonValue && JS_TOGGLE_DISABLED_MESSAGE}
isDisabled={!configPropertyPathJsonValue}
>
<span>
<span className="flex items-center justify-center h-[16px]">
<StyledToggleButton
data-testid={`t--${props.configProperty}-JS`}
icon="js-toggle-v2"
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/components/formControls/DropDownControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class DropDownControl extends BaseControl<Props> {

return (
<DropdownSelect
className={`t--${this?.props?.configProperty}`}
className={`t--${this?.props?.configProperty} uqi-dropdown-select`}
data-testid={this.props.configProperty}
style={styles}
width={styles.width}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function NestedComponents(props: any) {
props.fields.length > 0 &&
props.fields.map((field: string, index: number) => {
return (
<SecondaryBox key={index}>
<SecondaryBox className="array-control-secondary-box" key={index}>
{/* TODO: Fix this the next time the file is edited */}
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
{props.schema.map((sch: any, idx: number) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class InputTextControl extends BaseControl<InputControlProps> {

return (
<FieldWrapper
className="uqi-input-text"
data-testid={configProperty}
style={customStyles || {}}
width={width || ""}
Expand Down
13 changes: 6 additions & 7 deletions app/client/src/pages/Editor/ActionForm/Section/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
gap: var(--ads-v2-spaces-4);
width: 100%;
max-width: 800px;
align-items: center;
justify-content: center;
container: uqi-section / inline-size;
}

.section[data-standalone="false"] {
padding-block: var(--ads-v2-spaces-6);
}
&[data-standalone="false"] {
padding-block: var(--ads-v2-spaces-6);
}

.section[data-standalone="false"]:not(:last-child) {
border-bottom: 1px solid var(--ads-v2-color-border);
&[data-standalone="false"]:not(:last-child) {
border-bottom: 1px solid var(--ads-v2-color-border);
}
}
4 changes: 2 additions & 2 deletions app/client/src/pages/Editor/ActionForm/Zone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import styles from "./styles.module.css";

interface ZoneProps {
children: React.ReactNode;
layout?: "single-column" | "double-column";
layout?: "single_column" | "double_column";
}

const Zone: React.FC<ZoneProps> = ({ children, layout = "single-column" }) => {
const Zone: React.FC<ZoneProps> = ({ children, layout = "single_column" }) => {
return (
<div className={styles.zone} data-layout={layout}>
{children}
Expand Down
51 changes: 44 additions & 7 deletions app/client/src/pages/Editor/ActionForm/Zone/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,55 @@
gap: var(--ads-v2-spaces-4);
width: 100%;
box-sizing: border-box;
}

.zone[data-layout="double-column"] {
grid-template-columns: repeat(2, minmax(260px, 1fr));
}
&[data-layout="double_column"] {
grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.zone[data-layout="single-column"] {
grid-template-columns: 1fr;
&[data-layout="single_column"] {
grid-template-columns: 1fr;
}

/*
This section can be removed once the condition abouve each is resolved
*/
/* 1. Margin is removed from FieldWrapper component in FormRender file */
& :global(.uqi-form-wrapper) {
margin: 0;
}
/* DropdownControl default width is removed */
& :global(.uqi-dropdown-select) {
width: unset !important;
}
/* InputTexctControl min,max and width removed */
& :global(.uqi-input-text) {
width: unset !important;
min-width: unset !important;
max-width: unset !important;
}
/* FieldArrayControl hardcoded width is removed */
& :global(.t--form-control-ARRAY_FIELD) {
& :global(.t--form-control-QUERY_DYNAMIC_INPUT_TEXT) > div {
width: unset !important;
}

& > div {
width: 100% !important;

& > :global(.array-control-secondary-box) {
width: 100% !important;

& > div {
flex: 1;
}
}
}
}
/* Removable section ends here */
}

@container uqi-section (max-width: 531px) {
.zone[data-layout="double-column"] {
.zone[data-layout="double_column"] {
grid-template-columns: 1fr;
}
}
1 change: 1 addition & 0 deletions app/client/src/pages/Editor/FormConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const FlexWrapper = styled.div`
display: flex;
width: fit-content;
margin-right: 5px;
min-height: 21px;

& .t--js-toggle {
margin-bottom: 0px;
Expand Down
49 changes: 38 additions & 11 deletions app/client/src/pages/Editor/QueryEditor/FormRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import FormControl from "../FormControl";
import type { ControlProps } from "components/formControls/BaseControl";
import { Spinner } from "@appsmith/ads";
import type { QueryAction, SaaSAction } from "entities/Action";
import { Section, Zone } from "../ActionForm";

interface Props {
// TODO: Fix this the next time the file is edited
Expand Down Expand Up @@ -154,21 +155,18 @@ const FormRender = (props: Props) => {
}
if (section.hasOwnProperty("controlType")) {
// If component is type section, render it's children
if (
section.controlType === "SECTION" &&
section.hasOwnProperty("children")
) {
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return section.children.map((section: any, idx: number) => {
return renderEachConfigV2(formName, section, idx);
});
if (Object.hasOwn(section, "children")) {
return rederNodeWithChildren(section, formName);
}
try {
const { configProperty } = section;
const modifiedSection = modifySectionConfig(section, enabled);
return (
<FieldWrapper key={`${configProperty}_${idx}`}>
// TODO: Remove classname once action redesign epic is done
<FieldWrapper
className="uqi-form-wrapper"
key={`${configProperty}_${idx}`}
>
<FormControl config={modifiedSection} formName={formName} />
</FieldWrapper>
);
Expand All @@ -185,6 +183,32 @@ const FormRender = (props: Props) => {
return null;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const rederNodeWithChildren = (section: any, formName: string) => {
if (!Object.hasOwn(section, "children")) return;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const children = section.children.map((section: any, idx: number) =>
renderEachConfigV2(formName, section, idx),
);

switch (section.controlType) {
case "SECTION_V2":
return <Section>{children}</Section>;

case "SINGLE_COLUMN_ZONE":
case "DOUBLE_COLUMN_ZONE": {
const layout =
section.controlType === "SINGLE_COLUMN_ZONE"
? "single_column"
: "double_column";
return <Zone layout={layout}>{children}</Zone>;
}
default:
return children;
}
};

// Recursive call to render forms pre UQI
const renderEachConfig =
(formName: string) =>
Expand All @@ -200,7 +224,10 @@ const FormRender = (props: Props) => {
try {
const { configProperty } = formControlOrSection;
return (
<FieldWrapper key={`${configProperty}_${idx}`}>
<FieldWrapper
className="uqi-form-wrapper"
key={`${configProperty}_${idx}`}
>
<FormControl
config={formControlOrSection}
formName={formName}
Expand Down

This file was deleted.

Loading
Loading