LdapUserInfo.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React, { FC } from 'react';
  2. import { LdapUser } from 'app/types';
  3. import { LdapUserGroups } from './LdapUserGroups';
  4. import { LdapUserMappingInfo } from './LdapUserMappingInfo';
  5. import { LdapUserPermissions } from './LdapUserPermissions';
  6. import { LdapUserTeams } from './LdapUserTeams';
  7. interface Props {
  8. ldapUser: LdapUser;
  9. showAttributeMapping?: boolean;
  10. }
  11. export const LdapUserInfo: FC<Props> = ({ ldapUser, showAttributeMapping }) => {
  12. return (
  13. <>
  14. <LdapUserMappingInfo info={ldapUser.info} showAttributeMapping={showAttributeMapping} />
  15. <LdapUserPermissions permissions={ldapUser.permissions} />
  16. {ldapUser.roles && ldapUser.roles.length > 0 && (
  17. <LdapUserGroups groups={ldapUser.roles} showAttributeMapping={showAttributeMapping} />
  18. )}
  19. {ldapUser.teams && ldapUser.teams.length > 0 ? (
  20. <LdapUserTeams teams={ldapUser.teams} showAttributeMapping={showAttributeMapping} />
  21. ) : (
  22. <div className="gf-form-group">
  23. <div className="gf-form">
  24. <table className="filter-table form-inline">
  25. <tbody>
  26. <tr>
  27. <td>No teams found via LDAP</td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. </div>
  33. )}
  34. </>
  35. );
  36. };