adminOrganizations.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import Link from 'sentry/components/links/link';
  2. import ResultGrid from 'sentry/components/resultGrid';
  3. import {t} from 'sentry/locale';
  4. import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
  5. type Props = RouteComponentProps<{}, {}>;
  6. const getRow = (row: any) => [
  7. <td key={row.id}>
  8. <strong>
  9. <Link to={`/${row.slug}/`}>{row.name}</Link>
  10. </strong>
  11. <br />
  12. <small>{row.slug}</small>
  13. </td>,
  14. ];
  15. function AdminOrganizations(props: Props) {
  16. return (
  17. <div>
  18. <h3>{t('Organizations')}</h3>
  19. <ResultGrid
  20. path="/manage/organizations/"
  21. endpoint="/organizations/?show=all"
  22. method="GET"
  23. columns={[<th key="column-org">Organization</th>]}
  24. columnsForRow={getRow}
  25. hasSearch
  26. sortOptions={[
  27. ['date', 'Date Joined'],
  28. ['members', 'Members'],
  29. ['events', 'Events'],
  30. ['projects', 'Projects'],
  31. ['employees', 'Employees'],
  32. ]}
  33. defaultSort="date"
  34. {...props}
  35. />
  36. </div>
  37. );
  38. }
  39. export default AdminOrganizations;