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 SMTP plugin to use sections and zones format #36091

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Sep 3, 2024

Description

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

Fixes #35505

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/10704929692
Commit: f58dfce
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 04 Sep 2024 19:46:08 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive email sending interface in the SMTP plugin, allowing users to input recipient addresses, subject, body type, and attachments.
    • Enhanced layout with a new DOUBLE_COLUMN_ZONE structure for improved organization of input fields.
  • Improvements

    • Expanded styling capabilities for the dynamic input text control, allowing for more flexible sizing and better responsiveness in the UI.
    • Updated existing configurations to streamline the email composition process and improve user experience.
  • Bug Fixes

    • Adjusted CSS rules to remove minimum height and width constraints for better adaptability of UI components.

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

coderabbitai bot commented Sep 3, 2024

Walkthrough

The changes encompass modifications to the SMTP plugin's user interface, enhancing the email sending configuration. Key updates include the introduction of new JSON structures for the email body and the overall layout, improving the organization of input fields. Additionally, CSS adjustments enhance the styling of dynamic input text controls, allowing for better responsiveness and usability. These changes aim to streamline the email composition process while maintaining essential functionalities.

Changes

Files Change Summary
app/client/src/components/formControls/DynamicInputTextControl.tsx, app/client/src/pages/Editor/ActionForm/Zone/styles.module.css Updated the DynamicInputTextControl to include a new CSS class for improved styling. The CSS file added a rule for the new class to unset minimum dimensions, enhancing flexibility in UI components.
app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/body.json, app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/root.json, app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/send.json Introduced new JSON configurations for the SMTP plugin, restructuring the layout and control types to improve user experience. Key changes include the addition of DOUBLE_COLUMN_ZONE and the new body.json for email composition.

Assessment against linked issues

Objective Addressed Explanation
Add Zone & Section to SMTP plugin form (35505)

🌟 In the realm of code, new forms arise,
With zones and sections, a feast for the eyes.
Dynamic inputs dance, CSS takes flight,
Crafting emails with ease, oh what a sight!
SMTP's journey, a streamlined quest,
In the world of plugins, we build the best! ✨


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.

@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 labels Sep 3, 2024
@github-actions github-actions bot added the Enhancement New feature or request label Sep 3, 2024
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Sep 3, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10684897723.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36091.
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: 1

Outside diff range, codebase verification and nitpick comments (2)
app/client/src/pages/Editor/ActionForm/Zone/styles.module.css (1)

51-54: Temporary fix approved, but avoid using !important and address the root cause.

Great job on improving the flexibility of the dynamic input text control! This change allows for better responsiveness and adaptability of the UI components that utilize this class.

However, I would advise against using !important as it can make the code harder to maintain and override in the future. It's best to address the root cause of the issue in the DynamicTextFeildControl component, as mentioned in the comment.

Consider removing the !important declarations and addressing the minimum width issue in the DynamicTextFeildControl component. This will make the code more maintainable and easier to work with in the long run.

app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/body.json (1)

1-108: Great job on structuring the email body configuration using sections and zones! The JSON format is well-organized and enhances the usability of the plugin. 👏

A few additional suggestions to consider:

  1. Consider adding validation for email addresses in the "Recipients", "CC", and "BCC" fields to ensure that only valid email formats are accepted.

  2. For the "Attachment(s)" field, you might want to provide more guidance or examples on how to use the {{Filepicker.files}} template. This will help users understand how to attach files effectively.

  3. If there are any character limits for fields like "Subject" or "Body", consider adding validation to enforce those limits and prevent unexpected behavior.

Overall, the JSON structure is well-designed and follows best practices. It effectively utilizes the sections and zones format to create a user-friendly configuration for the SMTP plugin. Keep up the great work! 😊

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6ad6a11 and 7f78900.

Files selected for processing (5)
  • 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/smtpPlugin/src/main/resources/editor/body.json (1 hunks)
  • app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/root.json (1 hunks)
  • app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/send.json (1 hunks)
Additional comments not posted (9)
app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/root.json (2)

4-4: Verify the impact of upgrading to SECTION_V2.

The controlType has been updated from SECTION to SECTION_V2, which indicates a version upgrade.

Please ensure that this change is compatible with the rest of the codebase and does not introduce any breaking changes. Consider running the following script to search for potential issues:


29-29: Verify the purpose and content of the new body.json file.

The files array has been updated to include a new file body.json, which suggests that the configuration now supports additional components or interactions.

Please ensure that the content of the body.json file aligns with the overall purpose of the SMTP plugin and does not introduce any security vulnerabilities or inconsistencies. Consider running the following script to analyze the file:

Verification successful

Verification Complete: body.json is Properly Integrated and Secure

The body.json file is a well-structured configuration file that defines the email body section for the SMTP plugin. It includes fields for recipients, subject, body type, and attachments, using dynamic input controls to facilitate flexible email composition. The file is correctly referenced in root.json, confirming its integration into the plugin's configuration. No security vulnerabilities or inconsistencies were found.

  • The file's content aligns with the SMTP plugin's purpose.
  • No sensitive information is present in the file.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Analyze the content of the `body.json` file.

# Test 1: Check if the file exists. Expect: The file to be present.
if [ ! -f "app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/body.json" ]; then
    echo "The body.json file is missing."
else
    echo "The body.json file is present."
fi

# Test 2: Validate the JSON syntax. Expect: Valid JSON.
cat app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/body.json | jq empty

# Test 3: Search for sensitive information. Expect: No sensitive information present.
rg --type json $'password|credential|token' app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/body.json

Length of output: 374


Script:

#!/bin/bash
# Output the content of the `body.json` file to understand its structure and purpose.
cat app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/body.json

# Search for references to `body.json` in the codebase to understand its usage.
rg 'body.json' --context 5

Length of output: 3915

app/server/appsmith-plugins/smtpPlugin/src/main/resources/editor/send.json (6)

27-27: LGTM!

The change in the label from "Set Reply To Email" to "Set reply to email" improves the consistency in capitalization. It's a minor change that enhances the readability and adherence to common conventions.


35-37: Great job on maintaining consistency and utilizing conditional visibility!

The introduction of another DOUBLE_COLUMN_ZONE control type with the identifier SEND-Z3 further reinforces the consistent use of this layout structure. The change in the placeholderText for the "Reply to email" field from "replyTo@example.com" to "email@example.com" aligns with the placeholder text used in other email fields, improving overall consistency.

Moreover, the conditional visibility of the "Reply to email" field based on the "isReplyTo" switch is a good practice. It ensures that the field only appears when the user opts to set a reply-to address, providing a cleaner and more intuitive user interface.

Also applies to: 43-43


2-2: Verify the impact of the SECTION_V2 control type change.

The controlType in the SEND section has been changed from SECTION to SECTION_V2. It's crucial to ensure that this change is properly supported and doesn't introduce any compatibility issues.

Please run the following script to verify the usage and impact of the SECTION_V2 control type:


9-10: Verify the impact of the DOUBLE_COLUMN_ZONE control type change and the addition of the identifier property.

The controlType for child elements has been changed from SECTION to DOUBLE_COLUMN_ZONE, and a new identifier property with the value SEND-Z1 has been added. It's important to ensure that this new structure is properly supported and improves the user experience without causing any layout issues.

Please run the following script to verify the usage and impact of the DOUBLE_COLUMN_ZONE control type and the identifier property:

Verification successful

Let's ensure we have thoroughly verified the changes. We need to check for any error messages or logs related to the DOUBLE_COLUMN_ZONE control type and the SEND-Z1 identifier. It seems the previous search might have missed some files due to incorrect filtering. Let's run a new script to search through all files for any potential issues.


The DOUBLE_COLUMN_ZONE control type and SEND-Z1 identifier are properly supported and integrated.

The DOUBLE_COLUMN_ZONE control type is referenced in the application logic, indicating it is a recognized feature. No error messages or logs were found related to these changes, suggesting no compatibility or layout issues. The unique identifier SEND-Z1 is specific to the configuration and does not cause any conflicts.

  • Code Reference: app/client/src/pages/Editor/QueryEditor/FormRender.tsx handles DOUBLE_COLUMN_ZONE.

These findings confirm that the changes are well-integrated and do not introduce any issues. Keep up the good work in maintaining a robust codebase!

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage and impact of the `DOUBLE_COLUMN_ZONE` control type and the `identifier` property.

# Test 1: Search for the usage of `DOUBLE_COLUMN_ZONE` control type in the codebase.
# Expect: Occurrences in relevant files, indicating proper support.
rg --type-add 'json:*.json' --type json $'DOUBLE_COLUMN_ZONE'

# Test 2: Search for the usage of the `identifier` property with the value `SEND-Z1`.
# Expect: Occurrences in relevant files, indicating proper usage.
rg --type-add 'json:*.json' --type json $'"identifier": "SEND-Z1"'

# Test 3: Search for any error messages or logs related to `DOUBLE_COLUMN_ZONE` or `SEND-Z1`.
# Expect: No error messages or logs, indicating no compatibility or layout issues.
rg --type-add 'log:*.log' --type log $'DOUBLE_COLUMN_ZONE|SEND-Z1'

Length of output: 1798


Script:

#!/bin/bash
# Description: Re-verify the absence of error messages or logs related to `DOUBLE_COLUMN_ZONE` and `SEND-Z1`.

# Test: Search for any error messages or logs related to `DOUBLE_COLUMN_ZONE` or `SEND-Z1` in all files.
# Expect: No error messages or logs, indicating no compatibility or layout issues.
rg 'DOUBLE_COLUMN_ZONE|SEND-Z1' --glob '!*.json' --glob '!*.md'

Length of output: 155


23-25: Verify the proper usage of multiple DOUBLE_COLUMN_ZONE control types and the absence of conflicts or layout issues.

The introduction of another DOUBLE_COLUMN_ZONE control type with the identifier SEND-Z2 suggests a consistent use of this layout structure. It's important to ensure that the usage of multiple DOUBLE_COLUMN_ZONE control types doesn't lead to any conflicts or layout issues.

Please run the following script to verify the proper usage of multiple DOUBLE_COLUMN_ZONE control types and the absence of conflicts or layout issues:


13-19: Verify the alignment of the validation logic with the isRequired property and the clarity of the user interface.

The label for "From email *" has been changed to "From email", removing the asterisk that visually marked the field as required. However, the isRequired property has been added to ensure that a valid input is still required for the "From email" field.

It's important to verify the following:

  1. The validation logic aligns with the isRequired property, enforcing the requirement for a valid email input.
  2. The user interface clearly communicates the required nature of the "From email" field, even without the asterisk in the label.

Please run the following script to verify the alignment of the validation logic and the clarity of the user interface:

app/client/src/components/formControls/DynamicInputTextControl.tsx (1)

87-90: Great work on enhancing the styling capabilities of the input text control! 👍

The addition of the uqi-dynamic-input-text CSS class to the div element is a smart move. It allows for more specific CSS targeting, which can help improve the visual presentation and behavior of the component.

Here are a few additional insights:

  • The existing dynamic class that incorporates props.name is still present, ensuring backward compatibility and maintaining any existing styling or functionality that relies on that class.
  • The changes are focused on the styling aspect and do not alter the overall structure or functionality of the component, which is great for maintaining stability.

Keep up the excellent work in improving the user experience through thoughtful styling enhancements! 🎨✨

Comment on lines +8 to +22
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "SELECTOR-Z1",
"children": [
{
"label": "Send email",
"value": "SEND"
"label": "Command",
"description": "Choose method you would like to use to send an email",
"configProperty": "actionConfiguration.formData.command",
"controlType": "DROP_DOWN",
"initialValue": "SEND",
"options": [
{
"label": "Send email",
"value": "SEND"
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Documentation Update Needed for DOUBLE_COLUMN_ZONE Control Type

The introduction of the DOUBLE_COLUMN_ZONE control type and the restructuring of the dropdown configuration have not been reflected in the documentation. This discrepancy could lead to confusion for users and developers.

  • Please update the relevant documentation to include details about the new DOUBLE_COLUMN_ZONE control type and its impact on the dropdown configuration.

If you need assistance with updating the documentation, feel free to reach out. It's important to ensure that all changes are clearly communicated to maintain consistency and clarity.

Analysis chain

Verify the impact of introducing the DOUBLE_COLUMN_ZONE control type.

The introduction of the DOUBLE_COLUMN_ZONE control type and the restructuring of the dropdown configuration suggest a redesign of the user interface.

Please ensure that these changes are properly reflected in the plugin's documentation and user guides. Consider running the following script to search for potential discrepancies:

If you need any help updating the documentation, please let me know. I'd be happy to assist you in ensuring that the changes are accurately reflected in the user guides.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for potential discrepancies in the documentation related to the `DOUBLE_COLUMN_ZONE` introduction.

# Test: Search for occurrences of the dropdown configuration in markdown files. 
# Expect: The documentation to be updated to reflect the new structure.
rg --type md $'Command|Choose method you would like to use to send an email'

Length of output: 515

Copy link

github-actions bot commented Sep 3, 2024

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

@ankitakinger
Copy link
Contributor Author

Testing completed on EE. Everything looks good.

@ankitakinger ankitakinger merged commit 5aa9392 into release Sep 5, 2024
82 checks passed
@ankitakinger ankitakinger deleted the action-redesign/smtp-v2 branch September 5, 2024 05:11
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
…tions and zones format (appsmithorg#36091)

## Description

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

Fixes [appsmithorg#35505 ](appsmithorg#35505)

## 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/10704929692>
> Commit: f58dfce
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10704929692&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 04 Sep 2024 19:46:08 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**
- Introduced a comprehensive email sending interface in the SMTP plugin,
allowing users to input recipient addresses, subject, body type, and
attachments.
- Enhanced layout with a new `DOUBLE_COLUMN_ZONE` structure for improved
organization of input fields.

- **Improvements**
- Expanded styling capabilities for the dynamic input text control,
allowing for more flexible sizing and better responsiveness in the UI.
- Updated existing configurations to streamline the email composition
process and improve user experience.

- **Bug Fixes**
- Adjusted CSS rules to remove minimum height and width constraints for
better adaptability of UI components.

<!-- 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 SMTP plugin form
2 participants