getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.3k stars 4.22k forks source link

Can't pre-populate a FormField and provide typeahead suggestions #79080

Open danielcompton opened 1 month ago

danielcompton commented 1 month ago

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

We're trying to create a Issue integration for Sentry. Users will be able to link issues to existing tasks. I'd like to be able to show recently edited/created issues as suggestions in the form field before users start typing.

Here is our integration schema:

``` { "elements": [ { "type": "issue-link", "create": { "uri": "/api/integrations.sentry.create-task", "required_fields": [ { "type": "text", "label": "Task Name", "name": "title", "default": "issue.title" }, { "type": "textarea", "label": "Task Description", "name": "description", "default": "issue.description" } ], "optional_fields": [ { "type": "select", "label": "What's the status of this task?", "name": "column", "options": [ [ "TODO", "Planned" ], [ "DOING", "In Progress" ], [ "DONE", "Completed" ] ] }, { "type": "select", "label": "What is the estimated complexity?", "name": "complexity", "options": [ [ "1", "1" ], [ "2", "2" ], [ "3", "3" ], [ "5", "5" ], [ "8", "8" ] ] } ] }, "link": { "uri": "/api/integrations.sentry.link-task", "required_fields": [ { "type": "select", "label": "Which task would you like to link to this Sentry Issue?", "name": "itemId", "uri": "/api/integrations.sentry.task-options" } ] } }, { "type": "alert-rule-action", "title": "Create an alert ticket in ACME Kanban", "settings": { "type": "alert-rule-settings", "uri": "/v1/sentry/alert-rule-action/", "description": "Provide the details for the alert ticket", "required_fields": [ { "type": "text", "label": "Alert Ticket Title", "name": "title" }, { "type": "textarea", "label": "Alert Ticket Description", "name": "description" } ], "optional_fields": [ { "type": "select", "label": "Who would you like assigned to the Alert Ticket?", "name": "userId", "uri": "/api/integrations.sentry.user-options" } ] } } ] } ```

Expected Result

Selecting one of the suggested search results selects it in the field.

Actual Result

I can't seem to select a typeahead selection item. Here I've sent "Test1" as an initial value when loading the component. Whenever I try to click on a search result, the result isn't selected.

https://github.com/user-attachments/assets/6ccc890a-65a8-48c9-bfcc-43bb98624ec9

A workaround is to set

 "skip_load_on_open": true

on the select field. Then I can select typeahead results, but then I don't get to show any suggested tasks first.

https://github.com/user-attachments/assets/7be5bca3-a2ad-41c2-9a1c-ad6dded8618a

Product Area

Issues

Link

No response

DSN

No response

Version

No response

getsantry[bot] commented 1 month ago

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] commented 1 month ago

Routing to @getsentry/product-owners-settings-integrations for triage ⏲️

sentaur-athena commented 1 month ago

Thanks for the feedback @danielcompton . Right now we can't prioritize this but I add it to backlog.

danielcompton commented 1 month ago

Gotcha! It might be good to update the docs to mention this, I thought it was a bug in my app at first.