-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to change user password #1954
Conversation
Pull Request Test Coverage Report for Build 6793
💛 - Coveralls |
cvat-ui/src/reducers/interfaces.ts
Outdated
@@ -13,6 +13,10 @@ export interface AuthState { | |||
initialized: boolean; | |||
fetching: boolean; | |||
user: any; | |||
authActionsFetching: boolean; | |||
authActionsInitialized: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;
// Copyright (C) 2020 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { connect } from 'react-redux'; | ||
import ChangePasswordModalComponent from 'components/change-password-modal/change-password-modal'; | ||
import { CombinedState } from 'reducers/interfaces'; | ||
import { changePasswordAsync } from 'actions/auth-actions'; | ||
|
||
interface StateToProps { | ||
fetching: boolean; | ||
visible: boolean; | ||
} | ||
|
||
interface DispatchToProps { | ||
onChangePassword( | ||
oldPassword: string, | ||
newPassword1: string, | ||
newPassword2: string): void; | ||
} | ||
|
||
function mapStateToProps(state: CombinedState): StateToProps { | ||
return { | ||
fetching: state.auth.fetching, | ||
visible: state.auth.showChangePasswordDialog, | ||
}; | ||
} | ||
|
||
function mapDispatchToProps(dispatch: any): DispatchToProps { | ||
return ({ | ||
onChangePassword(oldPassword: string, newPassword1: string, newPassword2: string): void { | ||
dispatch(changePasswordAsync(oldPassword, newPassword1, newPassword2)); | ||
}, | ||
}); | ||
} | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(ChangePasswordModalComponent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can move it to components/change-password-modal/change-password-modal
and remove this file. No need to have separated container file to getting state from redux storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
); | ||
} | ||
|
||
export default withRouter(ChangePasswordComponent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how you use RouterProps here
Could you please also take a look at this PR? |
@azhavoro Please, update minor versions for |
} & FormComponentProps; | ||
|
||
class ChangePasswordFormComponent extends React.PureComponent<ChangePasswordFormProps> { | ||
private validateConfirmation = (rule: any, value: any, callback: any): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azhavoro, parameters type can be more strict than any
@azhavoro, can you also fix linting problems related to your PR, please? |
@zhiltsov-max , could you please look at the PR and test it? |
Added ability to change user password
How has this been tested?
Manual testing
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.