phabricator.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. export function PhabricatorPlugin() {
  2. return {
  3. status: 'unknown',
  4. description:
  5. 'Integrate Phabricator issue tracking by linking a user account to a project.',
  6. isTestable: false,
  7. hasConfiguration: true,
  8. shortName: 'Phabricator',
  9. id: 'phabricator',
  10. assets: [],
  11. name: 'Phabricator',
  12. author: {
  13. url: 'https://github.com/getsentry/sentry',
  14. name: 'Sentry Team',
  15. },
  16. contexts: [],
  17. doc: '',
  18. resourceLinks: [
  19. {
  20. url: 'https://github.com/getsentry/sentry/issues',
  21. title: 'Bug Tracker',
  22. },
  23. {
  24. url: 'https://github.com/getsentry/sentry',
  25. title: 'Source',
  26. },
  27. ],
  28. allowed_actions: ['create', 'link', 'unlink'],
  29. enabled: true,
  30. slug: 'phabricator',
  31. version: '9.1.0.dev0',
  32. canDisable: true,
  33. type: 'issue-tracking',
  34. metadata: {},
  35. };
  36. }
  37. export function PhabricatorCreate() {
  38. return [
  39. {
  40. default: 'ApiException: Authentication failed, token expired!',
  41. type: 'text',
  42. name: 'title',
  43. label: 'Title',
  44. },
  45. {
  46. default:
  47. 'http://dev.getsentry.net:8000/sentry/earth/issues/10/\n\n```\nApiException: Authentication failed, token expired!\n at io.sentry.example.ApiRequest.perform(ApiRequest.java:8)\n at io.sentry.example.Sidebar.fetch(Sidebar.java:5)\n at io.sentry.example.Application.home(Application.java:102)\n...\n(52 additional frame(s) were not displayed)\n\nThis is an example Java exception\n```',
  48. type: 'textarea',
  49. name: 'description',
  50. label: 'Description',
  51. },
  52. {
  53. multi: true,
  54. name: 'tags',
  55. type: 'select',
  56. required: false,
  57. label: 'Tags',
  58. has_autocomplete: true,
  59. placeholder: 'Start typing to search for a project',
  60. },
  61. {
  62. name: 'assignee',
  63. default: '',
  64. type: 'select',
  65. required: false,
  66. label: 'Assignee',
  67. has_autocomplete: true,
  68. placeholder: 'Start typing to search for an assignee',
  69. },
  70. ];
  71. }
  72. const DEFAULT_AUTOCOMPLETE_ASSIGNEE = {
  73. text: 'David Cramer (zeeg)',
  74. id: 'PHID-USER-53avnyn5r6z6daqjfwdo',
  75. };
  76. const DEFAULT_AUTOCOMPLETE_TAG1 = {text: 'Bar', id: 'PHID-PROJ-biz3qujawd2dfknvhpqv'};
  77. const DEFAULT_AUTOCOMPLETE_TAG2 = {text: 'Foo', id: 'PHID-PROJ-3dfrsmwmavdv4gbg4fxd'};
  78. export function PhabricatorAutocomplete(type = 'project', values = null) {
  79. if (values) {
  80. return {[type]: values};
  81. }
  82. if (type === 'assignee') {
  83. values = [DEFAULT_AUTOCOMPLETE_ASSIGNEE];
  84. }
  85. if (type === 'tags') {
  86. values = [DEFAULT_AUTOCOMPLETE_TAG1, DEFAULT_AUTOCOMPLETE_TAG2];
  87. }
  88. return {[type]: values};
  89. }