commitRow.stories.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import {CommitRow} from 'sentry/components/commitRow';
  2. export default {
  3. title: 'Components/Tables/CommitRow',
  4. component: CommitRow,
  5. };
  6. export const Default = () => {
  7. const commit = {
  8. dateCreated: '2018-11-30T18:46:31Z',
  9. message:
  10. '(improve) Add Links to Spike-Protection Email (#2408)\n\n* (improve) Add Links to Spike-Protection Email\r\n\r\nUsers now have access to useful links from the blogs and docs on Spike-protection.\r\n\r\n* fixed wording',
  11. id: 'f7f395d14b2fe29a4e253bf1d3094d61e6ad4434',
  12. author: {
  13. username: 'example@sentry.io',
  14. lastLogin: '2018-11-30T21:18:09.812Z',
  15. isSuperuser: true,
  16. isManaged: false,
  17. lastActive: '2018-11-30T21:25:15.222Z',
  18. id: '224288',
  19. isActive: true,
  20. has2fa: false,
  21. name: 'Foo Bar',
  22. avatarUrl: 'https://example.com/avatar.png',
  23. dateJoined: '2018-02-26T23:57:43.766Z',
  24. emails: [
  25. {
  26. is_verified: true,
  27. id: '231605',
  28. email: 'example@sentry.io',
  29. },
  30. ],
  31. avatar: {
  32. avatarUuid: null,
  33. avatarType: 'letter_avatar',
  34. },
  35. hasPasswordAuth: true,
  36. email: 'example@sentry.io',
  37. },
  38. repository: {
  39. id: '4',
  40. name: 'example/repo-name',
  41. provider: 'github',
  42. url: 'https://github.com/example/repo-name',
  43. status: 'active',
  44. externalSlug: 'example/repo-name',
  45. },
  46. };
  47. const nonuserCommit = {
  48. ...commit,
  49. dateCreated: '2018-11-30T18:46:31Z',
  50. author: {
  51. username: 'example@sentry.io',
  52. isActive: true,
  53. has2fa: false,
  54. name: 'Foo Bar',
  55. avatarUrl: 'https://example.com/avatar.png',
  56. dateJoined: '2018-02-26T23:57:43.766Z',
  57. emails: [
  58. {
  59. is_verified: true,
  60. id: '231605',
  61. email: 'example@sentry.io',
  62. },
  63. ],
  64. avatar: {
  65. avatarUuid: null,
  66. avatarType: 'letter_avatar',
  67. },
  68. hasPasswordAuth: true,
  69. email: 'example@sentry.io',
  70. },
  71. };
  72. return (
  73. <div>
  74. <CommitRow commit={commit} />
  75. <CommitRow commit={nonuserCommit} />
  76. </div>
  77. );
  78. };
  79. Default.storyName = 'CommitRow';