mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* LDAP: Show all LDAP groups * Use the returned LDAP groups as the reference when debugging LDAP We need to use the LDAP groups returned as the main reference for assuming what we were able to match and what wasn't. Before, we were using the configured groups in LDAP TOML configuration file. * s/User name/Username * Add a title to for the LDAP mapping results * LDAP: UI Updates to debug view * LDAP: Make it explicit when we weren't able to match teams
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import React, { FC } from 'react';
|
|
import { LdapUserMappingInfo } from './LdapUserMappingInfo';
|
|
import { LdapUserPermissions } from './LdapUserPermissions';
|
|
import { LdapUserGroups } from './LdapUserGroups';
|
|
import { LdapUserTeams } from './LdapUserTeams';
|
|
import { LdapUser } from 'app/types';
|
|
|
|
interface Props {
|
|
ldapUser: LdapUser;
|
|
showAttributeMapping?: boolean;
|
|
}
|
|
|
|
export const LdapUserInfo: FC<Props> = ({ ldapUser, showAttributeMapping }) => {
|
|
return (
|
|
<>
|
|
<LdapUserMappingInfo info={ldapUser.info} showAttributeMapping={showAttributeMapping} />
|
|
<LdapUserPermissions permissions={ldapUser.permissions} />
|
|
{ldapUser.roles && ldapUser.roles.length > 0 && (
|
|
<LdapUserGroups groups={ldapUser.roles} showAttributeMapping={showAttributeMapping} />
|
|
)}
|
|
|
|
{ldapUser.teams && ldapUser.teams.length > 0 ? (
|
|
<LdapUserTeams teams={ldapUser.teams} showAttributeMapping={showAttributeMapping} />
|
|
) : (
|
|
<div className="gf-form-group">
|
|
<div className="gf-form">
|
|
<table className="filter-table form-inline">
|
|
<tbody>
|
|
<tr>
|
|
<td>No teams found via LDAP</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</>
|
|
);
|
|
};
|