|
23 | 23 | )
|
24 | 24 | from sentry.integrations.jira.models.create_issue_metadata import JiraIssueTypeMetadata
|
25 | 25 | from sentry.integrations.jira.tasks import migrate_issues
|
26 |
| -from sentry.integrations.mixins.issues import ( |
27 |
| - MAX_CHAR, |
28 |
| - BaseFormFieldConfig, |
29 |
| - IssueSyncIntegration, |
30 |
| - ResolveSyncAction, |
31 |
| -) |
| 26 | +from sentry.integrations.mixins.issues import MAX_CHAR, IssueSyncIntegration, ResolveSyncAction |
32 | 27 | from sentry.integrations.models.external_issue import ExternalIssue
|
33 | 28 | from sentry.integrations.models.integration_external_project import IntegrationExternalProject
|
34 | 29 | from sentry.integrations.services.integration import integration_service
|
@@ -133,15 +128,6 @@ class JiraProjectMapping(TypedDict):
|
133 | 128 | label: str
|
134 | 129 |
|
135 | 130 |
|
136 |
| -class SelectFormFieldConfig(BaseFormFieldConfig, total=False): |
137 |
| - choices: list[tuple[str, str]] |
138 |
| - updatesForm: bool |
139 |
| - |
140 |
| - |
141 |
| -class AsyncSelectFormFieldConfig(SelectFormFieldConfig): |
142 |
| - url: str |
143 |
| - |
144 |
| - |
145 | 131 | class JiraIntegration(IssueSyncIntegration):
|
146 | 132 | outbound_status_key = "sync_status_forward"
|
147 | 133 | inbound_status_key = "sync_status_reverse"
|
@@ -842,41 +828,33 @@ def get_create_issue_config(self, group: Group | None, user: RpcUser, **kwargs):
|
842 | 828 | if not any(c for c in issue_type_choices if c[0] == issue_type):
|
843 | 829 | issue_type = issue_type_meta["id"]
|
844 | 830 |
|
845 |
| - projects_form_field = SelectFormFieldConfig( |
846 |
| - name="project", |
847 |
| - label="Jira Project", |
848 |
| - choices=[(p["id"], f"{p["key"]} - {p["name"]}") for p in jira_projects], |
849 |
| - default=meta["id"], |
850 |
| - type="select", |
851 |
| - updatesForm=True, |
852 |
| - required=True, |
853 |
| - ) |
854 |
| - |
| 831 | + projects_form_field = { |
| 832 | + "name": "project", |
| 833 | + "label": "Jira Project", |
| 834 | + "choices": [(p["id"], f"{p["key"]} - {p["name"]}") for p in jira_projects], |
| 835 | + "default": meta["id"], |
| 836 | + "type": "select", |
| 837 | + "updatesForm": True, |
| 838 | + "required": True, |
| 839 | + } |
855 | 840 | if features.has("organizations:jira-paginated-projects", group.organization, actor=user):
|
856 |
| - paginated_projects_url = self.search_url(group.organization.slug) |
857 |
| - projects_form_field = AsyncSelectFormFieldConfig( |
858 |
| - name="project", |
859 |
| - label="Jira Project", |
860 |
| - choices=[(p["id"], f"{p["key"]} - {p["name"]}") for p in jira_projects], |
861 |
| - default=meta["id"], |
862 |
| - type="select", |
863 |
| - updatesForm=True, |
864 |
| - required=True, |
865 |
| - url=paginated_projects_url, |
| 841 | + paginated_projects_url = reverse( |
| 842 | + "sentry-extensions-jira-search", args=[self.organization.slug, self.model.id] |
866 | 843 | )
|
| 844 | + projects_form_field["url"] = paginated_projects_url |
867 | 845 |
|
868 | 846 | fields = [
|
869 | 847 | projects_form_field,
|
870 | 848 | *fields,
|
871 |
| - SelectFormFieldConfig( |
872 |
| - name="issuetype", |
873 |
| - label="Issue Type", |
874 |
| - choices=issue_type_choices, |
875 |
| - default=issue_type or issue_type_meta["id"], |
876 |
| - type="select", |
877 |
| - updatesForm=True, |
878 |
| - required=bool(issue_type_choices), |
879 |
| - ), |
| 849 | + { |
| 850 | + "name": "issuetype", |
| 851 | + "label": "Issue Type", |
| 852 | + "default": issue_type or issue_type_meta["id"], |
| 853 | + "type": "select", |
| 854 | + "choices": issue_type_choices, |
| 855 | + "updatesForm": True, |
| 856 | + "required": bool(issue_type_choices), # required if we have any type choices |
| 857 | + }, |
880 | 858 | ]
|
881 | 859 |
|
882 | 860 | # title is renamed to summary before sending to Jira
|
|
0 commit comments