scancode.io
scancode.io copied to clipboard
webhook subscription target URLs: Add textarea in project settings view
webhooksubscriptions: Add textarea input for target URLs
- Create a new form obj
WebhookSubscriptionArea
- Include
WebhookSubscriptionArea
inProjectSettingsForm
- Initial value is "\n" separated list of URLs retrieved using
project.websubscriptions.all()
- While submitting form
- Check if
websubscriptions
input already is notNone
or""
- Delete all existing
WebhookSubscription
objects for the project - Create new
WebhookSubscription
objects for each URL in the input - Delete
webhooksubscriptions
key fromconfig
dict to avoid saving it insettings
model
- Check if
UI updates
https://github.com/nexB/scancode.io/assets/64846852/5bd1c392-49fb-40f6-a45e-3ffa914b1e9c
Fixes: #1027
@jayanth-kumar-morem The WebhookSubscription is not related to the project inputs but rather to the Project itself. The Webhook management does not belong to the "Inputs" related parts of the UI.
Ack @tdruez
so, on create project page
, I'll place it below the execute now check box
And on the specific project page
, I'll add a modal beside, Add inputs
and Add pipeline
boxes
Will that be fine ?
@jayanth-kumar-morem I don't think we want to complexify the "project creation" on form with webhook management for now. Also, a new box along inputs and pipelines on the projetc details view will not be ideal. I think we should start with adding the Webhook management in the project settings view for now.
@tdruez Requesting for code review
The Webhook system and models were enhanced in https://github.com/nexB/scancode.io/pull/1338 Closing.