Remove last synchronisation field from LDAP debug view (#30984)

* Remove last synchronisation field from LDAP debug view

* Apply review comments
pull/31225/head
Tania B 4 years ago committed by GitHub
parent 6aa4db387b
commit f9a293afea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      public/app/features/admin/UserLdapSyncInfo.tsx
  2. 11
      public/app/features/admin/ldap/LdapSyncInfo.tsx
  3. 9
      public/app/types/ldap.ts

@ -21,10 +21,8 @@ export class UserLdapSyncInfo extends PureComponent<Props, State> {
render() {
const { ldapSyncInfo, user } = this.props;
const prevSyncSuccessful = ldapSyncInfo && ldapSyncInfo.prevSync;
const nextSyncSuccessful = ldapSyncInfo && ldapSyncInfo.nextSync;
const nextSyncTime = nextSyncSuccessful ? dateTimeFormat(ldapSyncInfo.nextSync, { format }) : '';
const prevSyncTime = prevSyncSuccessful ? dateTimeFormat(ldapSyncInfo.prevSync!.started, { format }) : '';
const debugLDAPMappingURL = `${debugLDAPMappingBaseURL}?user=${user && user.login}`;
return (
@ -54,17 +52,6 @@ export class UserLdapSyncInfo extends PureComponent<Props, State> {
</>
)}
</tr>
<tr>
{prevSyncSuccessful ? (
<>
<td>Last synchronisation</td>
<td>{prevSyncTime}</td>
<td>Successful</td>
</>
) : (
<td colSpan={3}>Last synchronisation</td>
)}
</tr>
</tbody>
</table>
</div>

@ -26,8 +26,6 @@ export class LdapSyncInfo extends PureComponent<Props, State> {
const { ldapSyncInfo } = this.props;
const { isSyncing } = this.state;
const nextSyncTime = dateTimeFormat(ldapSyncInfo.nextSync, { format });
const prevSyncSuccessful = ldapSyncInfo && ldapSyncInfo.prevSync;
const prevSyncTime = prevSyncSuccessful ? dateTimeFormat(ldapSyncInfo.prevSync!.started, { format }) : '';
return (
<>
@ -54,15 +52,6 @@ export class LdapSyncInfo extends PureComponent<Props, State> {
<td>Next scheduled synchronisation</td>
<td>{nextSyncTime}</td>
</tr>
<tr>
<td>Last synchronisation</td>
{prevSyncSuccessful && (
<>
<td>{prevSyncTime}</td>
<td>Successful</td>
</>
)}
</tr>
</tbody>
</table>
</div>

@ -12,7 +12,6 @@ export interface SyncInfo {
enabled: boolean;
schedule: string;
nextSync: string;
prevSync?: SyncResult;
}
export interface LdapUserSyncInfo {
@ -21,14 +20,6 @@ export interface LdapUserSyncInfo {
status?: string;
}
export interface SyncResult {
started: string;
elapsed: string;
UpdatedUserIds: number[];
MissingUserIds: number[];
FailedUsers?: FailedUser[];
}
export interface FailedUser {
Login: string;
Error: string;

Loading…
Cancel
Save