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: Enhance Webhook component #6313

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

feat: Enhance Webhook component #6313

wants to merge 17 commits into from

Conversation

Cristhianzl
Copy link
Member

@Cristhianzl Cristhianzl commented Feb 12, 2025

This pull request includes multiple changes to both the backend and frontend of the Langflow project, focusing on adding webhook functionality, improving the user interface, and refining the data handling. The most important changes include adding a webhook polling interval, enhancing the webhook component, and updating the frontend components to support new features.

Backend Changes:

  • Webhook Polling Interval:

    • Added webhook_pooling_interval option to run function in __main__.py to define the polling interval for webhooks.
    • Updated ConfigResponse and Settings classes to include webhook_pooling_interval. [1] [2]
    • Modified update_settings function to handle webhook_pooling_interval. [1] [2]
  • Webhook Component Enhancements:

    • Added new fields (curl and endpoint) to WebhookComponent in webhook.py.
    • Introduced copy_field attribute to various input classes to support copy functionality. [1] [2] [3]
  • Logging and Utility Improvements:

    • Imported log_vertex_build in base.py and added logging for vertex builds in _execute_tasks method. [1] [2]

Frontend Changes:

  • Node Description and Input Field Enhancements:

    • Modified NodeDescription component to handle empty placeholders and memoized markdown rendering. [1] [2] [3]
    • Updated NodeInputField to include authentication and flow information metadata. [1] [2] [3] [4]
  • New Copy Field Component:

    • Added CopyFieldAreaComponent to handle copying field values with visual feedback.

These changes collectively enhance the functionality and user experience of the Langflow project, particularly in handling webhooks and improving the interface for node descriptions and input fields.

…ES list

📝 (webhook.py): Add "copy_field" attribute to MultilineInput component
📝 (input_mixin.py): Add "copy_field" attribute to BaseInputMixin class
📝 (inputs.py): Add "copy_field" attribute to StrInput class
📝 (template/field/base.py): Add "copy_field" attribute to Input class
🚀 (NodeDescription/index.tsx): Remove default placeholder text for emptyPlaceholder prop
✨ (copyFieldAreaComponent/index.tsx): Add new component for handling copy field functionality
♻️ (strRenderComponent/index.tsx): Refactor component to include CopyFieldAreaComponent when copy_field attribute is present in template data
…o improve readability and maintainability

♻️ (GenericNode/index.tsx): refactor code to improve readability and maintainability, and optimize rendering logic
…tion with external systems

📝 (graph/base.py): Add logging of vertex build information in Graph class for debugging purposes
📝 (NodeInputField/index.tsx): Add nodeInformationMetadata to NodeInputField for better tracking of node information
📝 (copyFieldAreaComponent/index.tsx): Refactor CopyFieldAreaComponent to handle different types of values, including webhooks
📝 (strRenderComponent/index.tsx): Add WebhookFieldComponent to handle webhook type in StrRenderComponent
📝 (tableNodeCellRender/index.tsx): Add nodeInformationMetadata to TableNodeCellRender for better tracking of node information
📝 (textAreaComponent/index.tsx): Add support for webhook format in TextAreaComponent for better integration with webhooks
📝 (webhookFieldComponent/index.tsx): Add WebhookFieldComponent to handle webhook type in ParameterRenderComponent
📝 (custom-parameter.tsx): Add nodeInformationMetadata to CustomParameterComponent for better tracking of node information
📝 (get-curl-code.tsx): Add support for different formats in getCurlWebhookCode for generating cURL commands
📝 (textAreaModal/index.tsx): Add onCloseModal callback to ComponentTextModal for better handling of modal closing
📝 (index.ts): Add type field to APIClassType for better typing of API classes
…mponent for improved user experience and functionality. Update the structure of the component to include the new button and styling adjustments.
@Cristhianzl Cristhianzl self-assigned this Feb 12, 2025
@github-actions github-actions bot added the enhancement New feature or request label Feb 12, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 12, 2025
Copy link

codspeed-hq bot commented Feb 12, 2025

CodSpeed Performance Report

Merging #6313 will degrade performances by 11.16%

Comparing cz/webhook (8323811) with main (0a631a6)

Summary

❌ 1 regressions
✅ 8 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_successful_run_with_output_type_any 137.2 ms 154.5 ms -11.16%

…andle token generation in webhookFieldComponent

📝 (index.tsx): import and use GenerateTokenDialog component in WebhookFieldComponent for token generation functionality
…ble modal properties

🔧 (frontend): add modalProps object to customize modal title, description, input label, input placeholder, button text, generated key message, and show icon flag
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 13, 2025
✨ (validate-webhook.ts): Add function to validate webhook data before processing
♻️ (use-get-builds-pooling-mutation): Refactor to set flow pool based on current flow
🔧 (content-render.tsx): Add data-testid attribute to api key input element
🔧 (webhookComponent.spec.ts): Refactor test to use waitForRequest for monitoring build requests
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 13, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 13, 2025
@Cristhianzl Cristhianzl marked this pull request as ready for review February 13, 2025 20:25
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Feb 13, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 13, 2025
…val for consistency

🔧 (frontend): update references to webhook_pooling_interval to webhook_polling_interval for consistency
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 13, 2025
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

great addition, some minor changes

…r code organization and maintainability

🔧 (frontend): Refactor background styles in components to use constants for consistency and easier theming
🚀 (frontend): Add custom SecretKeyModalButton component for better modularity and reusability
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 14, 2025
…s it is no longer needed

♻️ (inputs.py): Remove copy_field attribute from StrInput class as it is no longer needed
♻️ (inputs.py): Set copy_field attribute to False in MultilineInput class to ensure consistency
♻️ (template/field/base.py): Remove copy_field attribute from Input class as it is no longer needed
📝 (textAreaComponent/index.tsx): Replace hardcoded value "CURL_WEBHOOK" with constant WEBHOOK_VALUE for better readability and maintainability
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants