Skip to content

Commit

Permalink
Replace Pick<...> with two separate interfaces as it doesn't work wel…
Browse files Browse the repository at this point in the history
…l with our docs
  • Loading branch information
yakhinvadim committed Jun 10, 2021
1 parent 9b932dc commit 2425821
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ import { ChangePasswordForm } from '../../management/users/components/change_pas

export interface ChangePasswordProps {
user: AuthenticatedUser;
}

export interface ChangePasswordPropsInternal extends ChangePasswordProps {
userAPIClient: PublicMethodsOf<UserAPIClient>;
notifications: NotificationsSetup;
}

export class ChangePassword extends Component<ChangePasswordProps, {}> {
export class ChangePassword extends Component<ChangePasswordPropsInternal, {}> {
public render() {
const canChangePassword = canUserChangePassword(this.props.user);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import type { ChangePasswordProps } from './change_password';

export const getChangePasswordComponent = async (
core: CoreStart
): Promise<React.FC<Pick<ChangePasswordProps, 'user'>>> => {
): Promise<React.FC<ChangePasswordProps>> => {
const { ChangePassword } = await import('./change_password');

return (props: Pick<ChangePasswordProps, 'user'>) => {
return (props: ChangePasswordProps) => {
return (
<ChangePassword
notifications={core.notifications}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/security/public/ui_api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type LazyComponentFn<T> = (props: T) => ReactElement;
export interface UiApi {
components: {
getPersonalInfo: LazyComponentFn<PersonalInfoProps>;
getChangePassword: LazyComponentFn<Pick<ChangePasswordProps, 'user'>>;
getChangePassword: LazyComponentFn<ChangePasswordProps>;
};
}

Expand Down

0 comments on commit 2425821

Please sign in to comment.