mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
* remove code outside of the topnav feature flag * delete NavBar folder * remove topnav toggle from backend * restructure AppChrome folder * fix utils mock * fix applinks tests * remove tests since they're covered in e2e * fix 1 of the approotpage tests * Fix another dashboardpage test * remove reverse portalling + test for plugins using deprecated onNavChanged method * kick drone * handle correlations
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { connect, ConnectedProps } from 'react-redux';
|
|
import { useMount } from 'react-use';
|
|
|
|
import { Page } from 'app/core/components/Page/Page';
|
|
import { StoreState } from 'app/types';
|
|
|
|
import { ChangePasswordForm } from './ChangePasswordForm';
|
|
import { changePassword, loadUser } from './state/actions';
|
|
|
|
export interface OwnProps {}
|
|
|
|
function mapStateToProps(state: StoreState) {
|
|
const userState = state.user;
|
|
const { isUpdating, user } = userState;
|
|
return {
|
|
isUpdating,
|
|
user,
|
|
};
|
|
}
|
|
|
|
const mapDispatchToProps = {
|
|
loadUser,
|
|
changePassword,
|
|
};
|
|
|
|
const connector = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
export type Props = OwnProps & ConnectedProps<typeof connector>;
|
|
|
|
export function ChangePasswordPage({ loadUser, isUpdating, user, changePassword }: Props) {
|
|
useMount(() => loadUser());
|
|
|
|
return (
|
|
<Page navId="profile/password">
|
|
<Page.Contents isLoading={!Boolean(user)}>
|
|
{user ? (
|
|
<>
|
|
<ChangePasswordForm user={user} onChangePassword={changePassword} isSaving={isUpdating} />
|
|
</>
|
|
) : null}
|
|
</Page.Contents>
|
|
</Page>
|
|
);
|
|
}
|
|
|
|
export default connector(ChangePasswordPage);
|