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

New Components - fillout #12690

Merged
merged 3 commits into from
Jul 4, 2024
Merged

New Components - fillout #12690

merged 3 commits into from
Jul 4, 2024

Conversation

luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Jul 2, 2024

Resolves #12553.

Summary by CodeRabbit

  • New Features

    • Introduced a new event source "New Submission (Instant)" for real-time form submission notifications.
    • Added properties and methods for enhanced form and webhook management.
  • Improvements

    • Updated the package version to 0.1.0.
    • Enhanced API request handling with a unified request method.
  • Dependencies

    • Added @pipedream/platform dependency.
@luancazarine luancazarine added the ai-assisted Content generated by AI, with human refinement and modification label Jul 2, 2024
Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jul 2, 2024 9:41pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 2, 2024 9:41pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 2, 2024 9:41pm
Copy link
Contributor

coderabbitai bot commented Jul 2, 2024

Walkthrough

The changes enhance the components/fillout module by adding a new property for fetching form options, refactoring request handling, and incorporating methods for interacting with APIs. Additionally, a new source component emits events on form submissions. The package version has been updated with a new dependency.

Changes

File Path Change Summary
components/fillout/fillout.app.mjs Added formId property, private methods for URL and headers, refactored request handling, API interaction methods.
components/fillout/package.json Version increment to "0.1.0" and added dependency @pipedream/platform with version "^3.0.0".
components/fillout/sources/new-submission-instant/... Introduced source component for emitting events on new form submissions with activation and deactivation hooks.
components/fillout/sources/new-submission-instant/... Added a test event object with structured form submission data.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant FilloutApp
    participant FilloutAPI
    Developer->>FilloutApp: Request to fetch forms
    FilloutApp->>FilloutAPI: API call to fetch forms
    FilloutAPI-->>FilloutApp: Response with forms list
    FilloutApp-->>Developer: Return forms list
    
    Developer->>FilloutApp: Create webhook for form submission
    FilloutApp->>FilloutAPI: API call to create webhook
    FilloutAPI-->>FilloutApp: Response with webhook details
    FilloutApp-->>Developer: Webhook created confirmation
    
    FilloutAPI->>FilloutApp: Webhook triggered on form submission
    FilloutApp->>FilloutAPI: Get submission details
    FilloutAPI-->>FilloutApp: Submission details response
    FilloutApp-->>Developer: Emit new submission event
Loading

Assessment against linked issues

Objective (Issue#) Addressed Explanation
Emit new event when a form receives a new submission (12553)
Establish activation and deactivation hooks for managing webhooks
Fetch forms and handle API interactions with refactored methods
Update the package version and include necessary dependencies

Poem

In the fields of code where logic grows,
A rabbit leaped with joy and prose,
"Fillout" forms with utmost care,
New submissions now we've snared.
APIs connected, hooks in place,
A smoother journey through cyberspace.
Hooray for version bump and cheer,
The future's bright, the path is clear. 🌟

Tip

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.
Sources
 - New Submission (Instant)
@luancazarine luancazarine marked this pull request as ready for review July 2, 2024 21:46
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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 85e229a and 5471a34.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (4)
  • components/fillout/fillout.app.mjs (1 hunks)
  • components/fillout/package.json (2 hunks)
  • components/fillout/sources/new-submission-instant/new-submission-instant.mjs (1 hunks)
  • components/fillout/sources/new-submission-instant/test-event.mjs (1 hunks)
Additional comments not posted (13)
components/fillout/package.json (1)

3-3: Version update and new dependency addition are appropriate.

The version update follows semantic versioning, and the new dependency is necessary for the new functionality.

Also applies to: 15-18

components/fillout/fillout.app.mjs (7)

1-2: Import statement is correct.

The import statement for axios from @pipedream/platform is necessary for making HTTP requests.


6-19: Dynamic formId options fetching is well-implemented.

The async options method for the formId property ensures dynamic fetching of form options.


21-23: Base URL method is correctly defined.

The _baseUrl method provides the correct base URL for the Fillout API.


24-28: Authorization headers method is correctly defined.

The _headers method constructs the necessary authorization headers using the OAuth access token.


29-37: Unified request handling method is well-implemented.

The _makeRequest method encapsulates the axios call, ensuring consistent request handling.


38-42: getForms method is correctly implemented.

The getForms method uses _makeRequest to fetch the list of forms from the API.


43-55: Webhook management methods are correctly implemented.

The createWebhook and deleteWebhook methods use _makeRequest to manage webhooks via the API.

components/fillout/sources/new-submission-instant/new-submission-instant.mjs (4)

1-2: Import statements are correct.

The import statements for fillout app and sampleEmit are necessary for the component functionality.


4-24: Component properties are correctly defined.

The component properties include Fillout app, HTTP interface, database service, and formId prop definition.


25-44: Webhook lifecycle management is correctly implemented.

The activate and deactivate hooks manage the webhook lifecycle by creating and deleting webhooks via the Fillout API.


46-52: Event emission method is correctly implemented.

The run method emits events with the correct structure when a new form submission is received.

components/fillout/sources/new-submission-instant/test-event.mjs (1)

1-69: Test event data is comprehensive and well-structured.

The test event object includes detailed form, submission, and associated data, providing a thorough representation for testing purposes.

@luancazarine luancazarine merged commit 789d109 into master Jul 4, 2024
11 checks passed
@luancazarine luancazarine deleted the issue-12553 branch July 4, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai-assisted Content generated by AI, with human refinement and modification
2 participants