accountDetails.tsx 943 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type {JsonFormObject} from 'sentry/components/forms/types';
  2. export const route = '/settings/account/details/';
  3. // For fields that are
  4. const getUserIsManaged = ({user}) => user.isManaged;
  5. const formGroups: JsonFormObject[] = [
  6. {
  7. // Form "section"/"panel"
  8. title: 'Account Details',
  9. fields: [
  10. {
  11. name: 'name',
  12. type: 'string',
  13. required: true,
  14. // additional data/props that is related to rendering of form field rather than data
  15. label: 'Name',
  16. placeholder: 'e.g. John Doe',
  17. help: 'Your full name',
  18. },
  19. {
  20. name: 'username',
  21. type: 'string',
  22. required: true,
  23. autoComplete: 'username',
  24. label: 'Username',
  25. placeholder: 'e.g. name@example.com',
  26. help: '',
  27. disabled: getUserIsManaged,
  28. visible: ({user}) => user.email !== user.username,
  29. },
  30. ],
  31. },
  32. ];
  33. export default formGroups;