superuserAccessCategory.tsx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {FieldRequiredBadge} from 'sentry/components/forms/fieldGroup/fieldRequiredBadge';
  4. import RadioField from 'sentry/components/forms/fields/radioField';
  5. import TextField from 'sentry/components/forms/fields/textField';
  6. import {t} from 'sentry/locale';
  7. import {space} from 'sentry/styles/space';
  8. import TextBlock from 'sentry/views/settings/components/text/textBlock';
  9. const StyledRadioField = styled(RadioField)`
  10. display: flex;
  11. padding-left: 0;
  12. flex-direction: column;
  13. `;
  14. const StyledTextField = styled(TextField)`
  15. padding-left: 0;
  16. `;
  17. const StyledTextBlock = styled(TextBlock)`
  18. margin-bottom: ${space(1)};
  19. `;
  20. const StyledTitleBlock = styled(TextBlock)`
  21. font-size: 18px;
  22. margin-top: ${space(1)};
  23. margin-bottom: ${space(1)};
  24. `;
  25. const FlexBox = styled('div')`
  26. display: flex;
  27. `;
  28. const Left = styled('div')`
  29. display: flex;
  30. flex-direction: column;
  31. `;
  32. const Right = styled('div')`
  33. display: flex;
  34. flex-direction: column;
  35. `;
  36. const Span = styled('span')`
  37. font-size: 18px;
  38. `;
  39. type SuperuserAccessCategories = [string, React.ReactNode];
  40. const EngineeringCategories: SuperuserAccessCategories[] = [
  41. ['development', 'Development'],
  42. ['debugging', 'Debugging'],
  43. ['validate_feature', 'Validate a feature'],
  44. ];
  45. const ReactiveSupportCategories: SuperuserAccessCategories[] = [
  46. ['_admin_actions', '_admin actions'],
  47. ['organization_setting_change', 'Change organization settings'],
  48. ['zendesk', 'Zendesk'],
  49. ];
  50. const ProactiveSupportCategories: SuperuserAccessCategories[] = [
  51. ['account_review', 'Account review/research'],
  52. ['customer_demo', 'Customer demo'],
  53. ['customer_provisioning', 'Customer provisioning'],
  54. ['onboarding_setup', 'Onboarding setup'],
  55. ];
  56. const OtherCategory: SuperuserAccessCategories[] = [['other', 'Other']];
  57. function SuperuserAccessCategory() {
  58. return (
  59. <Fragment>
  60. <StyledTextBlock>
  61. For more information on these categories, please{' '}
  62. <a href="https://www.notion.so/sentry/Superuser-Access-Documentation-aae9a918b5814fe0918d8e7aecacf97a">
  63. {' '}
  64. read this doc
  65. </a>
  66. .
  67. </StyledTextBlock>
  68. <StyledTitleBlock>
  69. {t('Categories of Superuser Access:')}
  70. <FieldRequiredBadge />
  71. </StyledTitleBlock>
  72. <FlexBox>
  73. <Left>
  74. <StyledRadioField
  75. name="superuserAccessCategory"
  76. inline={false}
  77. label={t('Engineering')}
  78. choices={EngineeringCategories}
  79. stacked
  80. />
  81. <StyledRadioField
  82. name="superuserAccessCategory"
  83. inline={false}
  84. label={t('Reactive Support')}
  85. choices={ReactiveSupportCategories}
  86. stacked
  87. />
  88. </Left>
  89. <Right>
  90. <StyledRadioField
  91. name="superuserAccessCategory"
  92. inline={false}
  93. label={t('Proactive Support')}
  94. choices={ProactiveSupportCategories}
  95. stacked
  96. />
  97. <StyledRadioField
  98. name="superuserAccessCategory"
  99. inline={false}
  100. label={t('Others')}
  101. choices={OtherCategory}
  102. stacked
  103. />
  104. </Right>
  105. </FlexBox>
  106. <StyledTextField
  107. inline={false}
  108. label={<Span>{t('Reason for Access:')}</Span>}
  109. name="superuserReason"
  110. flexibleControlStateSize
  111. required
  112. maxLength={128}
  113. minLength={4}
  114. placeholder="e.g. disabling SSO enforcement"
  115. />
  116. </Fragment>
  117. );
  118. }
  119. export default SuperuserAccessCategory;