accountPreferences.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import {JsonFormObject} from 'sentry/components/forms/type';
  2. import languages from 'sentry/data/languages';
  3. import timezones from 'sentry/data/timezones';
  4. import {t} from 'sentry/locale';
  5. // Export route to make these forms searchable by label/help
  6. export const route = '/settings/account/details/';
  7. // Called before sending API request, these fields need to be sent as an
  8. // `options` object
  9. const transformOptions = (data: object) => ({options: data});
  10. const formGroups: JsonFormObject[] = [
  11. {
  12. // Form "section"/"panel"
  13. title: 'Preferences',
  14. fields: [
  15. {
  16. name: 'theme',
  17. type: 'select',
  18. label: t('Theme'),
  19. help: t(
  20. "Select your theme preference. It can be synced to your system's theme, always light mode, or always dark mode."
  21. ),
  22. choices: [
  23. ['light', t('Light')],
  24. ['dark', t('Dark')],
  25. ['system', t('Default to system')],
  26. ],
  27. getData: transformOptions,
  28. },
  29. {
  30. name: 'language',
  31. type: 'select',
  32. label: t('Language'),
  33. choices: languages,
  34. getData: transformOptions,
  35. },
  36. {
  37. name: 'timezone',
  38. type: 'select',
  39. label: t('Timezone'),
  40. choices: timezones,
  41. getData: transformOptions,
  42. },
  43. {
  44. name: 'clock24Hours',
  45. type: 'boolean',
  46. label: t('Use a 24-hour clock'),
  47. getData: transformOptions,
  48. },
  49. {
  50. name: 'stacktraceOrder',
  51. type: 'select',
  52. required: false,
  53. choices: [
  54. [-1, t('Default (let Sentry decide)')],
  55. [1, t('Most recent call last')],
  56. [2, t('Most recent call first')],
  57. ],
  58. label: t('Stack Trace Order'),
  59. help: t('Choose the default ordering of frames in stack traces'),
  60. getData: transformOptions,
  61. },
  62. ],
  63. },
  64. ];
  65. export default formGroups;