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: Updating the config for Google sheets plugin to use sections and zones format #36117

Merged
merged 12 commits into from
Sep 12, 2024

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Sep 4, 2024

Description

Action redesign: Updating the config for Google sheets plugin to use sections and zones format

Fixes #35483

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10818868016
Commit: 578b1ca
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 11 Sep 2024 21:13:39 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced styling flexibility for dynamic input text controls with a new CSS class.
    • Updated Google Sheets plugin configuration to support improved layout and organization with new control types, including SECTION_V2, DOUBLE_COLUMN_ZONE, and SINGLE_COLUMN_ZONE.
    • Introduced a new ENTITY_SELECTOR component for streamlined entity selection in Google Sheets integration.
  • Bug Fixes

    • Resolved issues with minimum height and width constraints for dynamic input text controls, improving responsiveness.
  • Style

    • Improved layout responsiveness for various controls by removing hardcoded widths and enhancing CSS rules.
  • Chores

    • Made formatting adjustments to the HTML and JavaScript code for improved readability without impacting functionality.

Copy link
Contributor

coderabbitai bot commented Sep 4, 2024

Walkthrough

The changes involve significant updates to the Google Sheets plugin and related components, focusing on enhancing the structure and functionality of the control configurations. Key modifications include the introduction of new control types, restructuring of child elements into zones, and updates to CSS for improved styling. These adjustments aim to streamline the user interface and improve the organization of controls without altering the core functionality.

Changes

Files Change Summary
app/client/src/components/formControls/DynamicInputTextControl.tsx, app/client/src/pages/Editor/ActionForm/Zone/styles.module.css Added new CSS classes for styling flexibility, removed minimum height and width constraints, and enhanced the JSX structure for improved styling capabilities in various components.
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json, fetch_many.json, insert.json, root.json, update.json Updated controlType from SECTION to SECTION_V2 across multiple JSON files, restructured child elements into DOUBLE_COLUMN_ZONE and SINGLE_COLUMN_ZONE, and refined visibility logic for controls to enhance user interaction.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant Plugin

    User->>UI: Interacts with Google Sheets Plugin
    UI->>Plugin: Sends configuration request
    Plugin-->>UI: Returns updated control structure
    UI->>User: Displays enhanced controls and options
Loading

Assessment against linked issues

Objective Addressed Explanation
Add Zone & Section to Google sheet plugin form (#35483)

In the realm of code where changes bloom,
New zones and sections dispel the gloom.
With controls refined and styling bright,
The Google Sheets plugin takes flight!
Enhancements abound, a joyful delight,
As users engage in a seamless night.
🌟✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions github-actions bot added IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo Enhancement New feature or request labels Sep 4, 2024
Copy link

github-actions bot commented Sep 4, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10698991061.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36117.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 50bbc49 and ac2a64a.

Files selected for processing (7)
  • app/client/src/components/formControls/DynamicInputTextControl.tsx (1 hunks)
  • app/client/src/pages/Editor/ActionForm/Zone/styles.module.css (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json (3 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/insert.json (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/update.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/components/formControls/DynamicInputTextControl.tsx
Additional comments not posted (19)
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json (2)

2-2: Verify the impact of updating the controlType to "SECTION_V2".

The controlType has been updated from "SECTION" to "SECTION_V2", which suggests a shift to a new version of the section control.

Please ensure that this change does not introduce any breaking changes or unexpected behavior in the plugin's functionality. Consider running tests to validate the plugin's behavior with the updated controlType.


9-21: Great work on restructuring the children elements!

The introduction of the parent object with controlType: "DOUBLE_COLUMN_ZONE" and identifier: "DELETE-Z1" enhances the organization and presentation of the child components within the section. The child element retains its original properties, ensuring that the core functionality remains intact.

app/client/src/pages/Editor/ActionForm/Zone/styles.module.css (1)

51-53: Great work on enhancing the styling flexibility for dynamic input text controls! 👍

The changes you made to remove the minimum height and width constraints for the .uqi-dynamic-input-text class are a good temporary solution to address the ongoing issue with the minimum width of the code editor in the DynamicTextFieldControl.

Using the !important priority ensures that these styles override any other conflicting styles applied to the element. This will provide more flexibility in sizing the dynamic input text controls until the underlying issue is resolved.

Just remember to revisit this workaround once the code editor's minimum width issue is fixed, as indicated by the comment. Keep up the great work! 🌟

app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/update.json (4)

5-5: Great work on refining the conditional logic!

The change ensures that the control is only displayed when the required data is available, improving the user experience.


7-8: Nice addition of the label and description properties!

These properties will help users better understand the purpose and functionality of the control.


2-2: Verify the impact of changing the controlType to SECTION_V2.

Ensure that the change does not break any existing functionality and is compatible with the rest of the codebase.

Run the following script to verify the usage of SECTION_V2:


11-12: Verify the impact of changing the controlType to SINGLE_ZOLUMN_ZONE.

Ensure that the change aligns with the overall design and functionality of the plugin.

Run the following script to verify the usage of SINGLE_ZOLUMN_ZONE:

app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/insert.json (3)

2-2: Great work updating the controlType to SECTION_V2! 👍

This change aligns with the goal of enhancing the structure and functionality of the control configurations. The new version of the section control may offer improved features and capabilities.


9-24: Excellent job restructuring the "Spreadsheet Name" input within the new DOUBLE_COLUMN_ZONE control type! 🎉

This change enhances the logical grouping of controls and improves the overall organization of the configuration. By nesting related inputs within the new layout, you've made the interface more intuitive and user-friendly. Keep up the great work!


27-28: Fantastic job introducing the SINGLE_COLUMN_ZONE control type for the "Row objects"! 🙌

This change contributes to the overall goal of creating a more flexible and visually structured configuration. By organizing the "Row objects" within the new control type, you've enhanced the modularity and readability of the layout. Well done!

app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json (4)

9-39: Verify the user experience impact of introducing the DOUBLE_COLUMN_ZONE control.

Ensure that this change enhances the user experience and doesn't introduce any usability issues. Consider the following:

  • Is the new layout intuitive and easy to navigate?
  • Are the UI elements properly aligned and styled within the new control?
  • Does the change introduce any accessibility concerns?

Manually test the UI changes to ensure a smooth user experience. Provide feedback on any usability issues encountered.


42-75: Verify the functionality of the redefined Cell range option.

Ensure that the Cell range option functions as expected with the new property name and tooltip text. Consider the following:

  • Test various cell range inputs to ensure proper filtering of data.
  • Verify that the tooltip text accurately describes the purpose and usage of the option.

Provide test cases and expected results for the Cell range option. Report any discrepancies or errors encountered.

Additionally, update the documentation to reflect the changes made to the Filter Format section and the redefined Cell range option.


Line range hint 78-143: Verify the impact of the changes on the Rows Section functionality.

Ensure that the reorganization of the Filter By, Sort By, and pagination sections within the new SINGLE_COLUMN_ZONE controls doesn't alter the core functionality. Consider the following:

  • Test the filtering, sorting, and pagination features to ensure they work as expected.
  • Verify that the new layout improves the readability and maintainability of the configuration.

Provide test cases and expected results for the Rows Section functionality. Report any discrepancies or errors encountered.

Additionally, monitor the performance of the Rows Section after the changes to ensure there are no significant performance implications due to the reorganization.

Also applies to: 145-162, 164-190


2-2: Verify the impact of changing the controlType to SECTION_V2.

Ensure that this change is consistently applied across the codebase and doesn't introduce any breaking changes.

Run the following script to verify the usage of SECTION_V2:

app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json (5)

8-10: Verify the rendering and handling of the "DOUBLE_COLUMN_ZONE" control type.

The introduction of the "DOUBLE_COLUMN_ZONE" control type suggests an improvement in the organization and presentation of the user interface. It's crucial to verify that the application properly renders and handles this new control type to ensure the desired layout is achieved.

To verify this, please follow these steps:

  1. Run the application and navigate to the Google Sheets plugin configuration interface.
  2. Inspect the rendered layout and ensure that the child elements are organized into a double-column layout as intended by the "DOUBLE_COLUMN_ZONE" control type.
  3. Interact with the elements within the double-column zone and confirm that they behave as expected.

If the layout appears as intended and the elements function correctly, it indicates that the application properly supports the "DOUBLE_COLUMN_ZONE" control type. If any issues are observed, further investigation and fixes may be necessary.


12-49: Verify the functionality and behavior of the reformatted "Operation" dropdown.

The "Operation" dropdown has been reformatted to improve clarity and presentation. It's essential to ensure that the reformatting does not introduce any unintended changes to the functionality or behavior of the dropdown.

To verify this, please perform the following tests:

  1. Open the Google Sheets plugin configuration interface and locate the "Operation" dropdown.
  2. Interact with the dropdown and ensure that all the expected options are present and selectable.
  3. Select each option one by one and verify that the corresponding functionality is triggered correctly.
  4. Confirm that the selected option is properly reflected in the application's state and any related UI elements.

If the dropdown functions as expected and the reformatting has not introduced any issues, then the changes can be considered safe. If any anomalies or unexpected behaviors are observed, further investigation and fixes may be required.


52-77: Verify the conditional logic and dependencies of the reformatted "Entity" dropdown.

The "Entity" dropdown has been reformatted to enhance clarity and presentation while preserving its properties, options, and conditional logic. It's crucial to verify that the reformatting maintains the existing conditional logic and dependencies based on the selected operation.

To verify this, please perform the following tests:

  1. Open the Google Sheets plugin configuration interface and locate the "Entity" dropdown.
  2. Select different options in the "Operation" dropdown and observe the behavior of the "Entity" dropdown.
  3. Ensure that the options in the "Entity" dropdown are enabled or disabled based on the selected operation, as defined by the conditional logic.
  4. Verify that the selected entity type is properly reflected in the application's state and any related UI elements.
  5. Confirm that the dropdown's behavior aligns with the conditions specified in the disabled properties of each option.

If the "Entity" dropdown exhibits the expected conditional behavior and dependencies based on the selected operation, then the reformatting can be considered successful. If any discrepancies or unexpected behaviors are observed, further investigation and fixes may be necessary.


86-154: Thoroughly test the functionality of the "Entity Selector" with the updated schema.

The schema for the "Entity Selector" has been restructured to enhance its functionality and behavior. It's crucial to perform comprehensive testing to ensure that the "Entity Selector" functions as intended with the updated schema.

To thoroughly test the "Entity Selector," please follow these steps:

  1. Open the Google Sheets plugin configuration interface and locate the "Entity Selector" section.
  2. Test the "Spreadsheet" dropdown:
    • Verify that the dropdown is populated with the expected options from the user's Google Drive.
    • Select a spreadsheet and ensure that the selection is properly reflected in the application's state.
  3. Test the "Sheet name" dropdown:
    • Verify that the dropdown is populated with the sheets from the selected spreadsheet.
    • Select a sheet and ensure that the selection is properly reflected in the application's state.
    • Confirm that the dropdown is shown or hidden based on the conditions specified in the show property.
  4. Test the "Table heading row index" input:
    • Enter valid and invalid values and verify that the input validates the entered data correctly.
    • Confirm that the input is shown or hidden based on the conditions specified in the show property.
  5. Test the interaction between the dropdowns and the "Table heading row index" input:
    • Verify that the options in the dropdowns and the visibility of the input are updated dynamically based on the user's selections and the specified conditions.

Perform these tests with different combinations of operations and entity types to cover all possible scenarios. If the "Entity Selector" functions as expected and the updated schema does not introduce any issues, then the changes can be considered reliable. If any bugs or unexpected behaviors are encountered, further investigation and fixes may be required.


4-4: Verify the support and benefits of the "SECTION_V2" control type.

The controlType for the main section has been updated from "SECTION" to "SECTION_V2". It's crucial to ensure that the application fully supports the "SECTION_V2" control type and that it provides the intended enhancements over the previous "SECTION" type.

To verify this, please run the following script:

This script searches for references to the "SECTION_V2" control type in the application's TypeScript and JavaScript files. If references are found, it indicates that the application likely supports this control type. If no references are found, further investigation may be necessary to ensure proper support and functionality.

Verification successful

Let's try a different approach to ensure we thoroughly check for the "SECTION_V2" control type across the entire codebase. We'll search without specifying file types to avoid the previous issue. This will help us determine if "SECTION_V2" is supported or referenced anywhere in the code.


The "SECTION_V2" control type is supported and integrated into the application.

The search results show that "SECTION_V2" is referenced in both client-side and server-side files, indicating that it is indeed supported and used across various configurations. This suggests that the application is equipped to handle this control type effectively.

  • Client-side Reference: Found in app/client/src/pages/Editor/QueryEditor/FormRender.tsx.
  • Server-side References: Found in multiple JSON configuration files related to plugins.

This confirms that the transition from "SECTION" to "SECTION_V2" is well-supported within the codebase. Keep up the good work in ensuring compatibility and enhancements!

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash

# Check if the application code references the "SECTION_V2" control type
if rg --type typescript --type javascript 'SECTION_V2' > /dev/null; then
  echo "The application code references the 'SECTION_V2' control type."
else
  echo "The application code does not reference the 'SECTION_V2' control type. Further investigation is needed."
fi

Length of output: 309


Script:

#!/bin/bash

# Search for references to "SECTION_V2" across all files in the codebase
rg 'SECTION_V2' || echo "No references to 'SECTION_V2' found in the codebase."

Length of output: 1026

Copy link

github-actions bot commented Sep 4, 2024

Deploy-Preview-URL: https://ce-36117.dp.appsmith.com

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@ankitakinger ankitakinger added the ok-to-test Required label for CI label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10713324884.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36117.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ac2a64a and de0a4c6.

Files selected for processing (4)
  • app/client/src/components/formControls/SortingControl.tsx (1 hunks)
  • app/client/src/pages/Editor/ActionForm/Zone/styles.module.css (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json (3 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json (2 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/components/formControls/SortingControl.tsx
Files skipped from review as they are similar to previous changes (2)
  • app/client/src/pages/Editor/ActionForm/Zone/styles.module.css
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json
Additional comments not posted (5)
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json (5)

2-2: Updated control type to SECTION_V2.

This change aligns with the PR's objective to enhance the structure and usability of the plugin's interface. The new SECTION_V2 likely offers improved capabilities or structure over the previous version.


9-41: Introduction of DOUBLE_COLUMN_ZONE for better layout organization.

The new DOUBLE_COLUMN_ZONE at FETCH_MANY-Z1 is designed to improve the layout and organization of UI components. This change is part of the broader effort to enhance user experience by making the interface more intuitive and structured.


44-79: Enhanced filter format section within another DOUBLE_COLUMN_ZONE.

The restructuring under FETCH_MANY-Z2 includes a more detailed filter format section, which now supports both "Where Clause" and "Cell range" options. This enhancement should provide users with clearer and more flexible filtering capabilities, aligning with the goal of improving the plugin's usability.


Line range hint 84-149: Single column zones for specialized sections.

The introduction of SINGLE_COLUMN_ZONE at ROWS-SECTION-Z2 and subsequent zones is a strategic design choice to segregate different functionalities clearly. Each zone is dedicated to specific aspects like filtering and sorting, which should help in maintaining a clean and organized UI.


Line range hint 152-176: Continued use of SINGLE_COLUMN_ZONE for additional sorting and pagination functionalities.

The continued use of SINGLE_COLUMN_ZONE in ROWS-SECTION-Z3 and ROWS-SECTION-Z4 for sorting and pagination reflects a consistent approach to UI design in the plugin. This consistency is crucial for user familiarity and ease of use.

Copy link

github-actions bot commented Sep 5, 2024

Deploy-Preview-URL: https://ce-36117.dp.appsmith.com

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Sep 5, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10714320172.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36117.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between de0a4c6 and c0e6829.

Files selected for processing (1)
  • app/client/public/index.html (6 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/public/index.html

Copy link

github-actions bot commented Sep 5, 2024

Deploy-Preview-URL: https://ce-36117.dp.appsmith.com

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Sep 9, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10771923892.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36117.
recreate: .

Copy link

github-actions bot commented Sep 9, 2024

Deploy-Preview-URL: https://ce-36117.dp.appsmith.com

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10805238144.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36117.
recreate: .

albinAppsmith
albinAppsmith previously approved these changes Sep 11, 2024
Copy link

Deploy-Preview-URL: https://ce-36117.dp.appsmith.com

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10810588299.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36117.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/entity_data.json (2)

43-66: The spreadsheet URL dropdown control looks good! 🙌

The dropdown control provides a convenient way for users to select the spreadsheet they want to work with. The conditional display based on the selected entity type and command ensures that the control is only shown when relevant, reducing clutter and confusion.

The dynamic value fetching is a great feature that populates the available options based on the user's spreadsheets, making it easy for them to select the desired spreadsheet.

One suggestion for improvement:

Consider adding a placeholder text to the dropdown control to provide a hint or example of the expected spreadsheet URL format. This can help users understand what kind of value they should enter.

You can add the placeholderText property to the control object with a suitable value, like this:

{
  "label": "Spreadsheet",
  "tooltipText": "The URL of the spreadsheet in your Google Drive",
  "propertyName": "rows_get_spreadsheetUrl",
  "configProperty": "actionConfiguration.formData.sheetUrl.data",
  "controlType": "DROP_DOWN",
  "isSearchable": true,
  "isRequired": true,
+ "placeholderText": "https://docs.google.com/spreadsheets/d/xyz/edit#gid=0",
  "fetchOptionsConditionally": true,
  "alternateViewTypes": ["json"],
  "conditionals": {
    ...
  }
}

This will provide a visual cue to users about the expected format of the spreadsheet URL.


93-104: The table heading row index control is a useful addition! 🎉

The text input control allows users to specify the row index that contains the table headings in the selected sheet. This flexibility is important as different spreadsheets may have different structures and layouts.

The conditional display based on the selected entity type, command, and sheet name ensures that the control is only shown when it is applicable, keeping the form streamlined and relevant.

The initial value of "1" provides a reasonable default for the table heading row index, as it is a common convention for the first row to contain the headings.

One suggestion for improvement:

Consider adding validation to ensure that the entered value is a positive integer. You can achieve this by adding a "validation" property to the control object with a suitable regular expression pattern, like this:

{
  "label": "Table heading row index",
  "tooltipText": "The index of the column names in the sheet (starts from 1)",
  "propertyName": "rows_get_tableHeadingRowIndex",
  "configProperty": "actionConfiguration.formData.tableHeaderIndex.data",
  "controlType": "QUERY_DYNAMIC_INPUT_TEXT",
  "initialValue": "1",
  "isRequired": true,
+ "validation": "^[1-9]\\d*$",
  "conditionals": {
    "show": "{{ new Object({ 'SPREADSHEET': [], 'SHEET': [], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data) && !!actionConfiguration.formData.sheetName.data }}"
  }
}

The regular expression pattern ^[1-9]\\d*$ ensures that the entered value starts with a non-zero digit and can be followed by any number of digits. This validation will prevent users from entering invalid or negative values for the table heading row index.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 43f350c and 578b1ca.

Files selected for processing (3)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/entity_data.json (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json (1 hunks)
  • app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json (1 hunks)
Additional comments not posted (11)
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json (4)

4-4: Verify the support and functionality of the new "SECTION_V2" control type.

The controlType for the main section has been updated from "SECTION" to "SECTION_V2". This change suggests an upgrade to the handling of this component.

Please ensure that:

  1. The application properly supports the "SECTION_V2" control type.
  2. The new control type provides the intended enhancements and does not introduce any unexpected behavior.

8-10: Verify the implementation and rendering of the "DOUBLE_COLUMN_ZONE" control type.

A new control type "DOUBLE_COLUMN_ZONE" has been introduced to organize the layout of child elements. This change aims to enhance the structure and presentation of the editor interface.

Please ensure that:

  1. The "DOUBLE_COLUMN_ZONE" control type is properly implemented in the application.
  2. The child elements are correctly rendered within this new control type, maintaining the intended layout and functionality.

12-49: Verify the functionality of the reformatted "Operation" dropdown.

The "Operation" dropdown has been reformatted to improve clarity and presentation while preserving its properties and options.

Please ensure that:

  1. The dropdown continues to function as expected after the reformatting.
  2. The options and their associated values remain intact and trigger the appropriate actions when selected.

56-62: Verify the existence and contents of the referenced JSON files.

The "files" array has been updated with new JSON file references, suggesting changes to the associated configurations used by the plugin.

Please ensure that:

  1. The referenced JSON files (entity_data.json, insert.json, delete.json, fetch_many.json, and update.json) exist in the expected locations.
  2. The contents of these JSON files align with the intended configurations and do not introduce any inconsistencies or errors.
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/entity_data.json (2)

9-42: Great work on the entity type dropdown control! 👍

The dropdown control is well-structured and provides a clear way for users to select the entity type they want to work with. The dynamic enabling and disabling of options based on the selected command is a nice touch that improves the user experience.

The form configuration evaluation ensures that the options are always up-to-date and relevant to the current state of the form.

Overall, this is a solid implementation of the entity type selection control.


67-92: The sheet name dropdown control is well-implemented! 👌

The dropdown control provides a straightforward way for users to select the sheet they want to work with within the selected spreadsheet. The conditional display based on the selected entity type, command, and spreadsheet URL ensures that the control is only shown when necessary, keeping the form focused and relevant.

The dynamic value fetching is a valuable feature that populates the available options based on the sheets in the selected spreadsheet. This saves users from having to manually enter the sheet name and reduces the chances of errors.

The code for the sheet name dropdown control is clean, readable, and follows the established structure and conventions.

Great job on this control!

app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json (5)

2-10: Great work on upgrading the control type! 👍

I see that you've updated the controlType from SECTION to SECTION_V2. This change indicates an enhancement to the control's functionality or structure, which is a step in the right direction.

I also noticed that the identifier property remains unchanged, ensuring that the control can still be uniquely identified within the configuration.

Keep up the good work! 🌟


11-45: Excellent restructuring of the children array! 🎉

I noticed that you've reorganized the children array to include multiple sections, each with its own unique identifier (e.g., FETCH_MANY-Z1, FETCH_MANY-Z2). This modular approach is fantastic as it improves the maintainability and readability of the configuration. 📚

Moreover, the introduction of new control types like DOUBLE_COLUMN_ZONE and SINGLE_COLUMN_ZONE is a great addition. These control types will enhance the layout and organization of the UI components, making it easier for users to navigate and interact with the plugin. 🎨

Your efforts in restructuring the configuration are commendable and will definitely contribute to a better user experience. Well done! 👏


48-85: Fantastic enhancements to the Filter Format section! 🎉

I see that you've made the Filter Format section part of a more complex structure, which now includes additional options for filtering data. This change provides users with more flexibility and control over how they filter the data, making the plugin more versatile. 💪

The redefinition of the Cell range option with a new property name (rows_get_cellRange) and tooltip text is a great improvement. It enhances clarity and makes it easier for users to understand the purpose of this option. 💡

I also noticed that you've retained the conditionals for showing these elements. This is excellent as it ensures that the logic governing the visibility of the filtering options remains consistent with the previous implementation. 🎯

Overall, these changes to the Filter Format section are a significant step forward in terms of functionality and usability. Great job! 🙌


90-187: Excellent addition of dedicated Rows Sections for filtering and sorting! 👏

I noticed that you've introduced new SINGLE_COLUMN_ZONE sections specifically for filtering and sorting rows. This is a fantastic improvement as it enhances the organization and clarity of these options within the configuration. 🏗️

Moving the Filter By and Sort By options into these dedicated sections is a logical choice. It groups related configurations together, making it easier for users to understand and navigate the various options available for filtering and sorting data. 🗂️

I also appreciate the use of conditionals to control the visibility of these sections based on the selected queryFormat. This ensures that the filtering and sorting options are displayed only when relevant, providing a cleaner and more focused user interface. 🎚️

These changes to the Rows Section for filtering and sorting are a significant improvement in terms of structure and usability. Well done! 🌟


188-217: Great work on refining the pagination configuration! 👍

I see that you've moved the pagination configuration into a new SINGLE_COLUMN_ZONE section. This change improves the organization and separation of concerns within the configuration, making it easier to locate and manage the pagination settings. 📊

The updates to the placeholderText and tooltipText properties are particularly helpful. They now provide clear guidance on how to bind the pagination values (limit and offset) to widget properties. This improvement enhances usability by assisting users in correctly configuring the pagination functionality. 🔍

I also noticed that you've retained the initialValue for limit and offset. Maintaining consistency with the previous implementation is important to ensure a smooth transition for existing users. 🤝

Overall, these changes to the pagination configuration are a step in the right direction. The dedicated section and improved guidance will make it easier for users to understand and configure pagination in their applications. Well done! 👏

Copy link

Deploy-Preview-URL: https://ce-36117.dp.appsmith.com

Copy link

Failed server tests

  • com.appsmith.server.git.CommonGitServiceCETest#createBranch_BranchDeleteLogo_SrcLogoRemainsUnchanged

@ankitakinger ankitakinger added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Sep 11, 2024
@ankitakinger ankitakinger merged commit 0f6305c into release Sep 12, 2024
155 checks passed
@ankitakinger ankitakinger deleted the action-redesign/gsheets branch September 12, 2024 06:36
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
…o use sections and zones format (appsmithorg#36117)

## Description

Action redesign: Updating the config for Google sheets plugin to use
sections and zones format

Fixes [appsmithorg#35483](appsmithorg#35483)

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10818868016>
> Commit: 578b1ca
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10818868016&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 11 Sep 2024 21:13:39 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced styling flexibility for dynamic input text controls with a
new CSS class.
- Updated Google Sheets plugin configuration to support improved layout
and organization with new control types, including `SECTION_V2`,
`DOUBLE_COLUMN_ZONE`, and `SINGLE_COLUMN_ZONE`.
- Introduced a new `ENTITY_SELECTOR` component for streamlined entity
selection in Google Sheets integration.

- **Bug Fixes**
- Resolved issues with minimum height and width constraints for dynamic
input text controls, improving responsiveness.

- **Style**
- Improved layout responsiveness for various controls by removing
hardcoded widths and enhancing CSS rules.

- **Chores**
- Made formatting adjustments to the HTML and JavaScript code for
improved readability without impacting functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product ok-to-test Required label for CI Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Add Zone & Section to Google sheet plugin form
2 participants