adminOrganizations.tsx 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {RouteComponentProps} from 'react-router';
  2. import Link from 'sentry/components/links/link';
  3. import ResultGrid from 'sentry/components/resultGrid';
  4. import {t} from 'sentry/locale';
  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. const AdminOrganizations = (props: Props) => (
  16. <div>
  17. <h3>{t('Organizations')}</h3>
  18. <ResultGrid
  19. path="/manage/organizations/"
  20. endpoint="/organizations/?show=all"
  21. method="GET"
  22. columns={[<th key="column-org">Organization</th>]}
  23. columnsForRow={getRow}
  24. hasSearch
  25. sortOptions={[
  26. ['date', 'Date Joined'],
  27. ['members', 'Members'],
  28. ['events', 'Events'],
  29. ['projects', 'Projects'],
  30. ['employees', 'Employees'],
  31. ]}
  32. defaultSort="date"
  33. {...props}
  34. />
  35. </div>
  36. );
  37. export default AdminOrganizations;