issueResolution.stories.js 2.2 KB

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