LdapUserMappingInfo.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import React, { FC } from 'react';
  2. import { LdapUserInfo } from 'app/types';
  3. interface Props {
  4. info: LdapUserInfo;
  5. showAttributeMapping?: boolean;
  6. }
  7. export const LdapUserMappingInfo: FC<Props> = ({ info, showAttributeMapping }) => {
  8. return (
  9. <div className="gf-form-group">
  10. <div className="gf-form">
  11. <table className="filter-table form-inline">
  12. <thead>
  13. <tr>
  14. <th colSpan={2}>User information</th>
  15. {showAttributeMapping && <th>LDAP attribute</th>}
  16. </tr>
  17. </thead>
  18. <tbody>
  19. <tr>
  20. <td className="width-16">First name</td>
  21. <td>{info.name.ldapValue}</td>
  22. {showAttributeMapping && <td>{info.name.cfgAttrValue}</td>}
  23. </tr>
  24. <tr>
  25. <td className="width-16">Surname</td>
  26. <td>{info.surname.ldapValue}</td>
  27. {showAttributeMapping && <td>{info.surname.cfgAttrValue}</td>}
  28. </tr>
  29. <tr>
  30. <td className="width-16">Username</td>
  31. <td>{info.login.ldapValue}</td>
  32. {showAttributeMapping && <td>{info.login.cfgAttrValue}</td>}
  33. </tr>
  34. <tr>
  35. <td className="width-16">Email</td>
  36. <td>{info.email.ldapValue}</td>
  37. {showAttributeMapping && <td>{info.email.cfgAttrValue}</td>}
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. );
  44. };