Merge pull request #393 from dbeaver/feat/show-password

feat(core-blocks): CB-1056 add option to reveal password
This commit is contained in:
Alexey
2021-06-22 18:08:15 +03:00
committed by GitHub
8 changed files with 103 additions and 33 deletions
@@ -11,6 +11,7 @@ import { observer } from 'mobx-react-lite';
import { useState, useCallback, useEffect } from 'react';
import styled, { css } from 'reshadow';
import { UsersResource } from '@cloudbeaver/core-authentication';
import { BASE_CONTAINERS_STYLES, Container, ErrorMessage, Group, InputFieldNew, SubmittingForm, useFocus } from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';
import { CommonDialogService, CommonDialogWrapper, DialogComponent, DialogComponentProps } from '@cloudbeaver/core-dialogs';
@@ -21,7 +22,6 @@ import { GQLError, GQLErrorCatcher } from '@cloudbeaver/core-sdk';
import { composes, useStyles } from '@cloudbeaver/core-theming';
import { ChangeUserPasswordDialogFooter } from './ChangeUserPasswordDialogFooter';
import { UsersResource } from '@cloudbeaver/core-authentication';
const styles = composes(
css`
@@ -38,7 +38,6 @@ const styles = composes(
}
`);
interface IState {
oldPassword: string;
newPassword: string;
@@ -55,7 +54,7 @@ export const ChangeUserPasswordDialog: DialogComponent<null, null> = observer(
rejectDialog,
}: DialogComponentProps<null, null>) {
const [focusedRef] = useFocus<HTMLInputElement>({});
const usersResource = useService(UsersResource)
const usersResource = useService(UsersResource);
const commonDialogService = useService(CommonDialogService);
const notificationService = useService(NotificationService);
const style = useStyles(styles, BASE_CONTAINERS_STYLES);
@@ -131,7 +130,7 @@ export const ChangeUserPasswordDialog: DialogComponent<null, null> = observer(
small
required
>
{translate('authentication_user_old_password')}
{translate('authentication_user_current_password')}
</InputFieldNew>
<InputFieldNew
type='password'
@@ -27,7 +27,7 @@ export default [
['authentication_administration_user_create_failed', 'Error creating new user'],
['authentication_user_name', 'User name'],
['authentication_user_credentials', 'Credentials'],
['authentication_user_old_password', 'Old password'],
['authentication_user_current_password', 'Current password'],
['authentication_user_new_password', 'New password'],
['authentication_user_password', 'User password'],
['authentication_user_password_repeat', 'Repeat password'],
@@ -25,7 +25,7 @@ export default [
['authentication_administration_user_create_failed', 'Не удалось создать пользователя'],
['authentication_user_name', 'Имя'],
['authentication_user_credentials', 'Учетные данные'],
['authentication_user_old_password', 'Старый пароль'],
['authentication_user_current_password', 'Текущий пароль'],
['authentication_user_new_password', 'Новый пароль'],
['authentication_user_password', 'Пароль'],
['authentication_user_password_repeat', 'Повторите пароль'],