diff --git a/public/app/features/admin/UserSyncInfo.tsx b/public/app/features/admin/UserSyncInfo.tsx deleted file mode 100644 index 9e53df0b952..00000000000 --- a/public/app/features/admin/UserSyncInfo.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import React, { PureComponent } from 'react'; -import { dateTimeFormat } from '@grafana/data'; -import { LdapUserSyncInfo } from 'app/types'; -import { Spinner } from '@grafana/ui'; - -interface Props { - disableSync: boolean; - syncInfo: LdapUserSyncInfo; - onSync?: () => void; -} - -interface State { - isSyncing: boolean; -} - -const format = 'dddd YYYY-MM-DD HH:mm zz'; - -export class UserSyncInfo extends PureComponent { - state = { - isSyncing: false, - }; - - onSyncClick = async () => { - const { onSync } = this.props; - this.setState({ isSyncing: true }); - try { - if (onSync) { - await onSync(); - } - } finally { - this.setState({ isSyncing: false }); - } - }; - - render() { - const { syncInfo, disableSync } = this.props; - const { isSyncing } = this.state; - const nextSyncSuccessful = syncInfo && syncInfo.nextSync; - const nextSyncTime = nextSyncSuccessful ? dateTimeFormat(syncInfo.nextSync!, { format }) : ''; - const prevSyncSuccessful = syncInfo && syncInfo.prevSync; - const prevSyncTime = prevSyncSuccessful ? dateTimeFormat(syncInfo.prevSync!, { format }) : ''; - const isDisabled = isSyncing || disableSync; - - return ( - <> - - -
- -

LDAP

-
-
- - - - - - {prevSyncSuccessful && } - - - - - - -
Last synchronisation{prevSyncTime}Successful
Next scheduled synchronisation{nextSyncTime}
-
-
- - ); - } -}