sentryAppComponent.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. export function SentryAppComponent(params = {}) {
  2. return {
  3. uuid: 'ed517da4-a324-44c0-aeea-1894cd9923fb',
  4. type: 'issue-link',
  5. schema: {
  6. create: {
  7. required_fields: [
  8. {
  9. type: 'text',
  10. name: 'title',
  11. label: 'Title',
  12. default: 'issue.title',
  13. },
  14. {
  15. type: 'textarea',
  16. name: 'description',
  17. label: 'Description',
  18. default: 'issue.description',
  19. },
  20. {
  21. type: 'select',
  22. name: 'numbers',
  23. label: 'Numbers',
  24. choices: [
  25. ['number_1', 'one'],
  26. ['number_2', 'two'],
  27. ],
  28. },
  29. ],
  30. },
  31. link: {
  32. required_fields: [
  33. {
  34. type: 'text',
  35. name: 'issue',
  36. label: 'Issue',
  37. },
  38. ],
  39. },
  40. },
  41. sentryApp: {
  42. uuid: 'b468fed3-afba-4917-80d6-bdac99c1ec05',
  43. slug: 'foo',
  44. name: 'Foo',
  45. },
  46. ...params,
  47. };
  48. }
  49. export function SentryAppComponentAsync(params = {}) {
  50. return {
  51. uuid: 'ed517da4-a324-44c0-aeea-1894cd9923fb',
  52. type: 'issue-link',
  53. schema: {
  54. create: {
  55. required_fields: [
  56. {
  57. type: 'select',
  58. name: 'numbers',
  59. label: 'Numbers',
  60. uri: '/sentry/numbers',
  61. url: '/sentry/numbers',
  62. async: true,
  63. },
  64. ],
  65. },
  66. link: {
  67. required_fields: [
  68. {
  69. type: 'text',
  70. name: 'issue',
  71. label: 'Issue',
  72. },
  73. ],
  74. },
  75. },
  76. sentryApp: {
  77. uuid: 'b468fed3-afba-4917-80d6-bdac99c1ec05',
  78. slug: 'foo',
  79. name: 'Foo',
  80. },
  81. ...params,
  82. };
  83. }
  84. export function SentryAppComponentDependent(params = {}) {
  85. return {
  86. type: 'issue-link',
  87. uuid: 'ed517da4-a324-44c0-aeea-1894cd9923fb',
  88. schema: {
  89. link: {
  90. required_fields: [
  91. {
  92. choices: [
  93. ['A', 'project A'],
  94. ['B', 'project B'],
  95. ['C', 'project C'],
  96. ],
  97. type: 'select',
  98. uri: '/integrations/sentry/projects',
  99. name: 'project_id',
  100. label: 'Project',
  101. },
  102. {
  103. depends_on: ['project_id'],
  104. name: 'board_id',
  105. choices: [],
  106. type: 'select',
  107. uri: '/integrations/sentry/boards',
  108. label: 'Board',
  109. },
  110. ],
  111. uri: '/integrations/sentry/issues/link',
  112. },
  113. create: {
  114. required_fields: [
  115. {
  116. default: 'issue.title',
  117. type: 'text',
  118. name: 'title',
  119. label: 'Title',
  120. },
  121. {
  122. default: 'issue.description',
  123. type: 'textarea',
  124. name: 'description',
  125. label: 'Description',
  126. },
  127. {
  128. choices: [
  129. ['A', 'project A'],
  130. ['B', 'project B'],
  131. ],
  132. type: 'select',
  133. uri: '/integrations/sentry/projects',
  134. name: 'project_id',
  135. label: 'Project',
  136. },
  137. {
  138. depends_on: ['project_id'],
  139. name: 'board_id',
  140. choices: [],
  141. type: 'select',
  142. uri: '/integrations/sentry/boards',
  143. label: 'Board',
  144. },
  145. ],
  146. uri: '/integrations/sentry/issues/create',
  147. },
  148. type: 'issue-link',
  149. },
  150. sentryApp: {
  151. uuid: 'b468fed3-afba-4917-80d6-bdac99c1ec05',
  152. slug: 'foo',
  153. name: 'Foo',
  154. },
  155. ...params,
  156. };
  157. }