scancode.io icon indicating copy to clipboard operation
scancode.io copied to clipboard

webhook subscription target URLs: Add textarea in project settings view

Open jayanth-kumar-morem opened this issue 1 year ago • 4 comments

webhooksubscriptions: Add textarea input for target URLs

  • Create a new form obj WebhookSubscriptionArea
  • Include WebhookSubscriptionArea in ProjectSettingsForm
  • Initial value is "\n" separated list of URLs retrieved using project.websubscriptions.all()
  • While submitting form
    • Check if websubscriptions input already is not None or ""
    • Delete all existing WebhookSubscription objects for the project
    • Create new WebhookSubscription objects for each URL in the input
    • Delete webhooksubscriptions key from config dict to avoid saving it in settings model

UI updates

https://github.com/nexB/scancode.io/assets/64846852/5bd1c392-49fb-40f6-a45e-3ffa914b1e9c

Fixes: #1027

jayanth-kumar-morem avatar Dec 18 '23 06:12 jayanth-kumar-morem

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

tdruez avatar Dec 18 '23 14:12 tdruez

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 avatar Dec 18 '23 16:12 jayanth-kumar-morem

@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 avatar Dec 18 '23 16:12 tdruez

@tdruez Requesting for code review

jayanth-kumar-morem avatar Jan 25 '24 22:01 jayanth-kumar-morem

The Webhook system and models were enhanced in https://github.com/nexB/scancode.io/pull/1338 Closing.

tdruez avatar Aug 02 '24 07:08 tdruez