issueResolution.stories.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import React from 'react';
  2. import MutedBox from 'app/components/mutedBox';
  3. import ResolutionBox from 'app/components/resolutionBox';
  4. const actor = {
  5. email: 'uhoh@example.com',
  6. name: 'Uhoh',
  7. };
  8. const RESOLVED_IN_COMMIT = {
  9. actor,
  10. inCommit: {
  11. id: 'deadbeefdeadface',
  12. repository: {
  13. name: 'getsentry/sentry',
  14. provider: {
  15. id: 'github',
  16. },
  17. },
  18. dateCreated: '2020-07-01 12:13:14',
  19. },
  20. };
  21. export default {
  22. title: 'Features/Issues/ResolutionBox & MutedBox',
  23. };
  24. export const ResolvedStates = () => (
  25. <div>
  26. <div className="section">
  27. <h3>Basic resolution</h3>
  28. <ResolutionBox projectId="1" statusDetails={{}} />
  29. </div>
  30. <div className="section">
  31. <h3>Commit resolution</h3>
  32. <ResolutionBox projectId="1" statusDetails={RESOLVED_IN_COMMIT} />
  33. </div>
  34. <div className="section">
  35. <h3>Release resolution</h3>
  36. <ResolutionBox projectId="1" statusDetails={{inRelease: '20.07', actor}} />
  37. </div>
  38. <div className="section">
  39. <h3>Next Release resolution</h3>
  40. <ResolutionBox projectId="1" statusDetails={{inNextRelease: true, actor}} />
  41. </div>
  42. </div>
  43. );
  44. ResolvedStates.storyName = 'resolved states';
  45. export const MutedStates = () => (
  46. <div>
  47. <div className="section">
  48. <h3>Basic mute</h3>
  49. <MutedBox statusDetails={{}} />
  50. </div>
  51. <div className="section">
  52. <h3>Mute Until</h3>
  53. <MutedBox statusDetails={{ignoreUntil: '2020-07-01 12:13:14'}} />
  54. </div>
  55. <div className="section">
  56. <h3>Mute count</h3>
  57. <MutedBox statusDetails={{ignoreCount: 10}} />
  58. </div>
  59. <div className="section">
  60. <h3>Mute count with window</h3>
  61. <MutedBox statusDetails={{ignoreCount: 10, ignoreWindow: 5}} />
  62. </div>
  63. <div className="section">
  64. <h3>Mute user count</h3>
  65. <MutedBox statusDetails={{ignoreUserCount: 10}} />
  66. </div>
  67. <div className="section">
  68. <h3>Mute user count with window</h3>
  69. <MutedBox statusDetails={{ignoreUserCount: 10, ignoreUserWindow: 5}} />
  70. </div>
  71. </div>
  72. );
  73. MutedStates.storyName = 'muted states';