From 2ab6fc273ecbf405f7c126fab11ddc0b9bf516da Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Wed, 2 Nov 2022 11:08:39 +0100 Subject: SONAR-13368 Bump to prettier@2.7.1 --- .../js/apps/change-admin-password/ChangeAdminPasswordApp.tsx | 8 ++++---- .../change-admin-password/ChangeAdminPasswordAppRenderer.tsx | 5 +++-- .../__tests__/ChangeAdminPasswordApp-it.tsx | 10 +++++----- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'server/sonar-web/src/main/js/apps/change-admin-password') diff --git a/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordApp.tsx b/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordApp.tsx index 3582400a715..e1f564f6456 100644 --- a/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordApp.tsx +++ b/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordApp.tsx @@ -48,7 +48,7 @@ export class ChangeAdminPasswordApp extends React.PureComponent { passwordValue: '', confirmPasswordValue: '', submitting: false, - success: !props.appState.instanceUsesDefaultAdminCredentials + success: !props.appState.instanceUsesDefaultAdminCredentials, }; } @@ -74,7 +74,7 @@ export class ChangeAdminPasswordApp extends React.PureComponent { this.setState({ submitting: true }); const success = await changePassword({ login: DEFAULT_ADMIN_LOGIN, - password: passwordValue + password: passwordValue, }).then( () => true, () => false @@ -87,14 +87,14 @@ export class ChangeAdminPasswordApp extends React.PureComponent { checkCanSubmit = () => { this.setState(({ passwordValue, confirmPasswordValue }) => ({ - canSubmit: passwordValue === confirmPasswordValue && passwordValue !== DEFAULT_ADMIN_PASSWORD + canSubmit: passwordValue === confirmPasswordValue && passwordValue !== DEFAULT_ADMIN_PASSWORD, })); }; render() { const { appState: { canAdmin }, - location + location, } = this.props; const { canSubmit, confirmPasswordValue, passwordValue, submitting, success } = this.state; return ( diff --git a/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx b/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx index 8536936cac5..3065eb3f92c 100644 --- a/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx @@ -49,7 +49,7 @@ export default function ChangeAdminPasswordAppRenderer(props: ChangeAdminPasswor passwordValue, location, submitting, - success + success, } = props; if (!canAdmin) { @@ -84,7 +84,8 @@ export default function ChangeAdminPasswordAppRenderer(props: ChangeAdminPasswor onSubmit={(e: React.SyntheticEvent) => { e.preventDefault(); props.onSubmit(); - }}> + }} + >

{translate('users.change_admin_password.form.header')}

diff --git a/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-it.tsx b/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-it.tsx index 587875f1dfe..b8feebe3c7b 100644 --- a/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-it.tsx @@ -28,23 +28,23 @@ import ChangeAdminPasswordApp from '../ChangeAdminPasswordApp'; import { DEFAULT_ADMIN_PASSWORD } from '../constants'; jest.mock('../../../api/users', () => ({ - changePassword: jest.fn().mockResolvedValue({}) + changePassword: jest.fn().mockResolvedValue({}), })); const ui = { updateButton: byRole('button', { name: 'update_verb' }), passwordInput: byLabelText('users.change_admin_password.form.password', { selector: 'input', - exact: false + exact: false, }), confirmInput: byLabelText('users.change_admin_password.form.confirm', { selector: 'input', - exact: false + exact: false, }), unauthorizedMessage: byText('unauthorized.message'), defaultPasswordWarningMessage: byText( 'users.change_admin_password.form.cannot_use_default_password' - ) + ), }; it('should disallow change when not an admin', () => { @@ -68,7 +68,7 @@ it('should allow changing password when using the default admin password', async await user.click(ui.updateButton.get()); expect(changePassword).toHaveBeenCalledWith({ login: 'admin', - password: 'password' + password: 'password', }); }); -- cgit v1.2.3