[PR #29957] feat: add editing support for trigger subscriptions #32631

Closed
opened 2026-02-21 20:51:46 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/29957

State: closed
Merged: Yes


Summary

This PR adds the ability to edit existing trigger subscriptions, which was previously not supported. Users can now modify subscription settings without having to delete and recreate them.

Screenshots

API Key Edit OAuth
API Key Step 1 API Key Step 2
Manual Subscription Edit Subscription Edit Button
Manual Edit OAuth Edit

Key Changes

Backend (API)

  • Added TriggerSubscriptionUpdateApi endpoint for updating subscriptions
  • Added TriggerSubscriptionVerifyApi endpoint for verifying credentials during edit
  • Added PluginFetchDynamicSelectOptionsWithCredentialsApi endpoint for fetching dynamic options with custom credentials (used when editing credentials before saving)
  • Enhanced TriggerProviderService with rebuild and update capabilities
  • Proper handling of [__HIDDEN__] credential values during updates

Frontend (Web)

  • Created separate edit modals for each credential type:
    • ManualEditModal - For unauthorized/manual subscriptions (edit name + properties)
    • OAuthEditModal - For OAuth subscriptions (edit name + parameters)
    • ApiKeyEditModal - For API Key subscriptions (two-step flow: verify credentials → edit parameters)
  • Added step navigation with clickable status indicators for API Key editing
  • Dynamic options now work with newly entered credentials during editing
  • Only sends changed fields to backend (credentials, parameters, properties)

Subscription Type Support

Type Editable Fields Flow
Manual (Unauthorized) Name, Properties Single step
OAuth Name, Parameters Single step
API Key Credentials, Name, Parameters Two-step (verify → configure)

Test Plan

  • Edit a Manual subscription - verify name and properties can be updated
  • Edit an OAuth subscription - verify name and parameters can be updated
  • Edit an API Key subscription:
    • Verify credentials step works
    • Verify navigation between steps (back button, clickable step indicator)
    • Verify dynamic select options load with new credentials
    • Verify unchanged credentials (all [__HIDDEN__]) are not sent to backend
  • Verify subscription list refreshes after successful edit

Closes #29956

**Original Pull Request:** https://github.com/langgenius/dify/pull/29957 **State:** closed **Merged:** Yes --- ## Summary This PR adds the ability to edit existing trigger subscriptions, which was previously not supported. Users can now modify subscription settings without having to delete and recreate them. ### Screenshots <table> <tr> <td align="center"><strong>API Key Edit </strong></td> <td align="center"><strong>OAuth</strong></td> </tr> <tr> <td><img width="400" alt="API Key Step 1" src="https://github.com/user-attachments/assets/4d3133a3-d31b-403a-a439-b828f5a7b121" /></td> <td><img width="400" alt="API Key Step 2" src="https://github.com/user-attachments/assets/73156c71-df6f-450f-b352-53c047cae434" /></td> </tr> <tr> <td align="center"><strong>Manual Subscription Edit</strong></td> <td align="center"><strong>Subscription Edit Button</strong></td> </tr> <tr> <td><img width="400" alt="Manual Edit" src="https://github.com/user-attachments/assets/c10664ed-8fda-435c-8a7b-3c30483bbc9f" /></td> <td><img width="400" alt="OAuth Edit" src="https://github.com/user-attachments/assets/81a5bcd4-8bcd-471f-96b9-00d55b2373ef" /></td> </tr> </table> ### Key Changes **Backend (API)** - Added `TriggerSubscriptionUpdateApi` endpoint for updating subscriptions - Added `TriggerSubscriptionVerifyApi` endpoint for verifying credentials during edit - Added `PluginFetchDynamicSelectOptionsWithCredentialsApi` endpoint for fetching dynamic options with custom credentials (used when editing credentials before saving) - Enhanced `TriggerProviderService` with rebuild and update capabilities - Proper handling of `[__HIDDEN__]` credential values during updates **Frontend (Web)** - Created separate edit modals for each credential type: - `ManualEditModal` - For unauthorized/manual subscriptions (edit name + properties) - `OAuthEditModal` - For OAuth subscriptions (edit name + parameters) - `ApiKeyEditModal` - For API Key subscriptions (two-step flow: verify credentials → edit parameters) - Added step navigation with clickable status indicators for API Key editing - Dynamic options now work with newly entered credentials during editing - Only sends changed fields to backend (credentials, parameters, properties) ### Subscription Type Support | Type | Editable Fields | Flow | |------|----------------|------| | Manual (Unauthorized) | Name, Properties | Single step | | OAuth | Name, Parameters | Single step | | API Key | Credentials, Name, Parameters | Two-step (verify → configure) | ## Test Plan - [ ] Edit a Manual subscription - verify name and properties can be updated - [ ] Edit an OAuth subscription - verify name and parameters can be updated - [ ] Edit an API Key subscription: - [ ] Verify credentials step works - [ ] Verify navigation between steps (back button, clickable step indicator) - [ ] Verify dynamic select options load with new credentials - [ ] Verify unchanged credentials (all `[__HIDDEN__]`) are not sent to backend - [ ] Verify subscription list refreshes after successful edit Closes #29956
yindo added the pull-request label 2026-02-21 20:51:46 -05:00
yindo closed this issue 2026-02-21 20:51:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32631