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: requesting new integration ui to accept users preferences about the new integrations #38012

Merged
merged 9 commits into from
Dec 9, 2024

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Dec 6, 2024

Description

This PR introduces a way to accept user's preferences about adding new types of integrations.
This feature is behind a feature flag : ab_request_new_integration_enabled
This fires two events : REQUEST_INTEGRATION_CTA & REQUEST_INTEGRATION_SUBMITTED
Screenshot 2024-12-06 at 3 30 19 PM

Fixes #37854
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

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

🔍 Cypress test results

Tip

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


Mon, 09 Dec 2024 08:42:36 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new integration request form, allowing users to submit requests for new integrations.
    • Added a modal for requesting new integrations with appropriate labels and error messages.
    • Enhanced input handling to support textarea fields in forms.
    • Implemented a feature flag to conditionally enable the integration request functionality.
    • Added new event tracking for integration request actions to enhance user engagement insights.
    • Added constants and messages to improve user guidance during the integration request process.
  • Bug Fixes

    • Improved error message visibility for form fields based on user interaction.
  • Documentation

    • Updated interface and component declarations to reflect new features and enhancements.

Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

Walkthrough

The pull request introduces several enhancements related to the integration request feature. It adds a new constant for user messages, a feature flag for enabling the integration request functionality, and updates to analytics event names. Additionally, new components are introduced to facilitate the submission of integration requests, including a form for user input and a modal for displaying the request interface. These changes collectively enhance the user experience for requesting new integrations.

Changes

File Path Change Summary
app/client/src/ce/constants/messages.ts Added constant REQUEST_NEW_INTEGRATIONS with various properties for user messages related to integration requests.
app/client/src/ce/entities/FeatureFlag.ts Introduced feature flag ab_request_new_integration_enabled and set its default value to false.
app/client/src/ce/utils/analyticsUtilTypes.ts Added event names REQUEST_INTEGRATION_CTA and REQUEST_INTEGRATION_SUBMITTED to EventName.
app/client/src/components/utils/ReduxFormTextField.tsx Expanded type property in FormTextFieldProps interface to include "textarea".
app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx Imported and rendered RequestNewIntegration component.
app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/form.tsx Added RequestIntegrationForm component with validation and submission logic for integration requests.
app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/index.tsx Created RequestNewIntegration component with modal functionality for integration requests.

Assessment against linked issues

Objective Addressed Explanation
Add a fixed bottom bar with a request button and modal for integration requests (#37854)
Ensure the modal collects integration name, use case, and email, with validation and success message (#37854)
Track user interactions with analytics events for integration requests (#37854)
Disable the request button if the integration field is empty (#37854) No explicit logic for disabling the button found.

Possibly related PRs

Suggested labels

Widgets & Accelerators Pod

Suggested reviewers

  • albinAppsmith
  • hetunandu

🎉 In the realm of code where features bloom,
A request for integration finds its room.
With buttons and modals, the users can share,
Their needs and their wishes, with utmost care.
Analytics in place, to track every click,
Thank you for coding, you’ve done it quick! 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7a90a3f and cb2cf80.

📒 Files selected for processing (1)
  • app/client/src/components/utils/ReduxFormTextField.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/components/utils/ReduxFormTextField.tsx

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Query & JS Pod Issues related to the query & JS Pod Task A simple Todo Enhancement New feature or request labels Dec 6, 2024
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: 3

🧹 Outside diff range and nitpick comments (6)
app/client/src/components/utils/ReduxFormTextField.tsx (1)

33-35: Consider consolidating prop handling logic

The conditional prop spreading and renderAs assignment could be simplified into a single derived props object.

- {...(componentProps.type === "textarea"
-   ? omit(componentProps, "type")
-   : componentProps)}
- renderAs={componentProps.type === "textarea" ? "textarea" : "input"}
+ {...(componentProps.type === "textarea"
+   ? { ...omit(componentProps, "type"), renderAs: "textarea" }
+   : { ...componentProps, renderAs: "input" })}

Also applies to: 42-42

app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/index.tsx (1)

47-49: Enhance analytics event with additional context

The analytics event could include more context about where the request was initiated from.

- AnalyticsUtil.logEvent("REQUEST_INTEGRATION_CTA");
+ AnalyticsUtil.logEvent("REQUEST_INTEGRATION_CTA", {
+   source: "datasources_list",
+   location: "bottom_bar"
+ });
app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/form.tsx (2)

27-35: Consider enhancing form submission handling.

The form submission implementation could be improved in the following areas:

  1. Add error handling for failed submissions
  2. Include loading state during submission
  3. Consider debouncing the submit action
 const onSubmit = (values: RequestIntegrationFormValues) => {
+  const [isSubmitting, setIsSubmitting] = useState(false);
+  try {
+    setIsSubmitting(true);
     AnalyticsUtil.logEvent("REQUEST_INTEGRATION_SUBMITTED", {
       integration_name: values.integration,
       use_case_description: values.useCase || "",
       email: values.email,
     });
+  } catch (error) {
+    // Handle error appropriately
+  } finally {
+    setIsSubmitting(false);
     props.closeModal();
+  }
 };

112-128: Strengthen email validation.

The current email validation could be enhanced to handle edge cases.

 if (!values.email || !isEmail(values.email)) {
+  // Add additional validation for common email patterns
+  const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
+  if (!emailRegex.test(values.email)) {
     errors.email = createMessage(
       REQUEST_NEW_INTEGRATIONS.REQUEST_MODAL_EMAIL.ERROR,
     );
+  }
 }
app/client/src/ce/constants/messages.ts (2)

2560-2565: Consider adding validation message for useCase field

While the integration name and email fields have error messages, the useCase field doesn't have one. For consistency, consider adding an error message:

  REQUEST_MODAL_USECASE: {
    LABEL: () => "Tell us more about your case",
    PLACEHOLDER: () =>
      "E.g. I want to create an app to manage my customers' account.",
    NAME: "useCase",
+   ERROR: () => "Please describe your use case",
  },

2566-2572: Consider adding email format validation message

The email field has a basic validation message but doesn't include a specific message for invalid email format. Consider adding one:

  REQUEST_MODAL_EMAIL: {
    LABEL: () => "Email",
    DESCRIPTION: () =>
      "Appsmith might use this email exclusively to follow up on your integration request.",
    NAME: "email",
    ERROR: () => "Please enter email",
+   FORMAT_ERROR: () => "Please enter a valid email address",
  },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fd9efb8 and f3d906a.

📒 Files selected for processing (7)
  • app/client/src/ce/constants/messages.ts (1 hunks)
  • app/client/src/ce/entities/FeatureFlag.ts (2 hunks)
  • app/client/src/ce/utils/analyticsUtilTypes.ts (1 hunks)
  • app/client/src/components/utils/ReduxFormTextField.tsx (2 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx (2 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/form.tsx (1 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/index.tsx (1 hunks)
🧰 Additional context used
📓 Learnings (1)
app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx (1)
Learnt from: sneha122
PR: appsmithorg/appsmith#29377
File: app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx:316-329
Timestamp: 2024-11-12T08:11:25.416Z
Learning: The user clarified that the feature being introduced is experimental and that automated tests will be added once the decision to keep the feature is made. This context is important for future reviews as it explains the absence of tests for certain features under development.
🔇 Additional comments (4)
app/client/src/ce/entities/FeatureFlag.ts (1)

45-45: LGTM! Feature flag follows naming convention

The feature flag is correctly implemented following the documented naming convention for AB testing flags.

Also applies to: 83-83

app/client/src/components/utils/ReduxFormTextField.tsx (1)

53-53: LGTM! Type definition update is correct

The FormTextFieldProps type extension properly includes the new textarea type.

app/client/src/ce/utils/analyticsUtilTypes.ts (1)

355-357: LGTM: Analytics events properly defined.

The new analytics events are correctly added and align with the feature requirements.

app/client/src/ce/constants/messages.ts (1)

2547-2573: LGTM! The message constants are well-structured and organized.

The constants follow the established pattern and provide clear, user-friendly messages for the integration request form.

@AmanAgarwal041 AmanAgarwal041 added the ok-to-test Required label for CI label Dec 6, 2024
@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Dec 6, 2024

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

@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Dec 6, 2024

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

Copy link

github-actions bot commented Dec 6, 2024

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

@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Dec 8, 2024

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

@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Dec 8, 2024

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

🧹 Outside diff range and nitpick comments (1)
app/client/src/ce/constants/messages.ts (1)

2571-2571: Update error message for invalid email format

Since the email field is optional, the error message should indicate an invalid email format when provided. Please update the error message accordingly.

Apply this diff to update the error message:

      ERROR: () => "Please enter email",
+     ERROR: () => "Please enter a valid email address",
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6906071 and 8c664b1.

📒 Files selected for processing (3)
  • app/client/src/ce/constants/messages.ts (1 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/form.tsx (1 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Editor/IntegrationEditor/RequestNewIntegration/index.tsx

Comment on lines +124 to +128
if (!values.email || !isEmail(values.email)) {
errors.email = createMessage(
REQUEST_NEW_INTEGRATIONS.REQUEST_MODAL_EMAIL.ERROR,
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Email field should be optional in validation

The email field is currently mandatory in the validation logic. As per the PR objectives, it should be optional. Please update the validation to reflect this.

Apply this diff to fix the validation logic:

-  if (!values.email || !isEmail(values.email)) {
+  if (values.email && !isEmail(values.email)) {
     errors.email = createMessage(
       REQUEST_NEW_INTEGRATIONS.REQUEST_MODAL_EMAIL.ERROR,
     );
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!values.email || !isEmail(values.email)) {
errors.email = createMessage(
REQUEST_NEW_INTEGRATIONS.REQUEST_MODAL_EMAIL.ERROR,
);
}
if (values.email && !isEmail(values.email)) {
errors.email = createMessage(
REQUEST_NEW_INTEGRATIONS.REQUEST_MODAL_EMAIL.ERROR,
);
}

Copy link

github-actions bot commented Dec 8, 2024

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

sneha122
sneha122 previously approved these changes Dec 9, 2024
Copy link
Contributor

@sneha122 sneha122 left a comment

Choose a reason for hiding this comment

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

LGTM, Added a nit comment to add code comments

@appsmithorg appsmithorg deleted a comment from github-actions bot Dec 9, 2024
@AmanAgarwal041 AmanAgarwal041 merged commit cbfe89e into release Dec 9, 2024
42 checks passed
@AmanAgarwal041 AmanAgarwal041 deleted the feat/37854-request-integration branch December 9, 2024 11:58
@AmanAgarwal041
Copy link
Contributor Author

Merged this PR. Will update any new design changes later cc @carinanfonseca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration ok-to-test Required label for CI Query & JS Pod Issues related to the query & JS Pod Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Implement the UI for Request a new Integration
2 participants