aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/change-admin-password
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2022-11-02 11:08:39 +0100
committersonartech <sonartech@sonarsource.com>2022-11-02 20:03:01 +0000
commit2ab6fc273ecbf405f7c126fab11ddc0b9bf516da (patch)
treea6e005b4f57fb488d3e551b7df52399e69b0674c /server/sonar-web/src/main/js/apps/change-admin-password
parent60e4b88e4567c1af3051b6cdc4c8858f8b0fca21 (diff)
downloadsonarqube-2ab6fc273ecbf405f7c126fab11ddc0b9bf516da.tar.gz
sonarqube-2ab6fc273ecbf405f7c126fab11ddc0b9bf516da.zip
SONAR-13368 Bump to prettier@2.7.1
Diffstat (limited to 'server/sonar-web/src/main/js/apps/change-admin-password')
-rw-r--r--server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordApp.tsx8
-rw-r--r--server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-it.tsx10
3 files changed, 12 insertions, 11 deletions
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<Props, State> {
passwordValue: '',
confirmPasswordValue: '',
submitting: false,
- success: !props.appState.instanceUsesDefaultAdminCredentials
+ success: !props.appState.instanceUsesDefaultAdminCredentials,
};
}
@@ -74,7 +74,7 @@ export class ChangeAdminPasswordApp extends React.PureComponent<Props, State> {
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<Props, State> {
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<HTMLFormElement>) => {
e.preventDefault();
props.onSubmit();
- }}>
+ }}
+ >
<h2 className="big-spacer-bottom big">
{translate('users.change_admin_password.form.header')}
</h2>
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',
});
});