Skip to content

Commit d00f1e1

Browse files
committed
fix
1 parent f7357be commit d00f1e1

8 files changed

Lines changed: 69 additions & 43 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GO.MACRO = $${GO:-go}
2121
VERBOSE.MACRO = $${VERBOSE:-0}
2222

2323
CHANNEL = development
24-
CLIENT_DIR = client
24+
CLIENT_DIR = client_v2
2525
DEPLOY_SCRIPT_PATH = not/a/real/path
2626
DIST_DIR = dist
2727
GOAMD64 = v1

client_v2/src/install/Setup/AddressList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import { getIpList, getDnsAddress, getWebAddress } from '../../helpers/helpers';
44
import { ALL_INTERFACES_IP } from '../../helpers/constants';
55
import { InstallInterface } from '../../initialState';
6+
import theme from 'panel/lib/theme';
67

78
interface renderItemProps {
89
ip: string;
@@ -19,7 +20,7 @@ const renderItem = ({ ip, port, isDns }: renderItemProps) => {
1920
{isDns ? (
2021
<strong>{dnsAddress}</strong>
2122
) : (
22-
<a href={webAddress} target="_blank" rel="noopener noreferrer">
23+
<a href={webAddress} target="_blank" className={theme.link.link} rel="noopener noreferrer">
2324
{webAddress}
2425
</a>
2526
)}

client_v2/src/install/Setup/Auth.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Controller, useForm } from 'react-hook-form';
33
import { Trans, useTranslation } from 'react-i18next';
44
import Controls from './Controls';
55
import { validatePasswordLength, validateRequiredValue } from '../../helpers/validators';
6-
import { Input } from '../../components/ui/Controls/Input';
6+
import { Input } from 'panel/common/controls/Input';
77

88
type AuthFormValues = {
99
username: string;
@@ -60,10 +60,11 @@ export const Auth = ({ onAuthSubmit }: Props) => {
6060
<Input
6161
{...field}
6262
type="text"
63+
id="install_username"
6364
data-testid="install_username"
6465
label={t('install_auth_username')}
6566
placeholder={t('install_auth_username_enter')}
66-
error={fieldState.error?.message}
67+
errorMessage={fieldState.error?.message}
6768
autoComplete="username"
6869
/>
6970
)}
@@ -84,10 +85,11 @@ export const Auth = ({ onAuthSubmit }: Props) => {
8485
<Input
8586
{...field}
8687
type="password"
88+
id="install_password"
8789
data-testid="install_password"
8890
label={t('install_auth_password')}
8991
placeholder={t('install_auth_password_enter')}
90-
error={fieldState.error?.message}
92+
errorMessage={fieldState.error?.message}
9193
autoComplete="new-password"
9294
/>
9395
)}
@@ -108,10 +110,11 @@ export const Auth = ({ onAuthSubmit }: Props) => {
108110
<Input
109111
{...field}
110112
type="password"
113+
id="install_confirm_password"
111114
data-testid="install_confirm_password"
112115
label={t('install_auth_confirm')}
113116
placeholder={t('install_auth_confirm')}
114-
error={fieldState.error?.message}
117+
errorMessage={fieldState.error?.message}
115118
autoComplete="new-password"
116119
/>
117120
)}

client_v2/src/install/Setup/Controls.tsx

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
33
import { Trans } from 'react-i18next';
44

55
import * as actionCreators from '../../actions/install';
6+
import { Button } from 'panel/common/ui/Button';
67

78
interface ControlsProps {
89
install: {
@@ -33,13 +34,15 @@ class Controls extends Component<ControlsProps> {
3334
case 2:
3435
case 3:
3536
return (
36-
<button
37+
<Button
3738
data-testid="install_back"
3839
type="button"
39-
className="btn btn-secondary btn-lg setup__button"
40+
size="small"
41+
variant="secondary"
42+
className="setup__button"
4043
onClick={this.props.prevStep}>
4144
<Trans>back</Trans>
42-
</button>
45+
</Button>
4346
);
4447
default:
4548
return false;
@@ -52,44 +55,52 @@ class Controls extends Component<ControlsProps> {
5255
switch (step) {
5356
case 1:
5457
return (
55-
<button
58+
<Button
5659
data-testid="install_get_started"
5760
type="button"
58-
className="btn btn-success btn-lg setup__button"
59-
onClick={nextStep}>
61+
onClick={nextStep}
62+
size="small"
63+
variant="primary"
64+
className="setup__button">
6065
<Trans>get_started</Trans>
61-
</button>
66+
</Button>
6267
);
6368
case 2:
6469
case 3:
6570
return (
66-
<button
71+
<Button
6772
data-testid="install_next"
6873
type="submit"
69-
className="btn btn-success btn-lg setup__button"
74+
size="small"
75+
variant="primary"
76+
className="setup__button"
7077
disabled={invalid || pristine || install.processingSubmit}>
7178
<Trans>next</Trans>
72-
</button>
79+
</Button>
7380
);
7481
case 4:
7582
return (
76-
<button
83+
<Button
7784
data-testid="install_next"
7885
type="button"
79-
className="btn btn-success btn-lg setup__button"
86+
size="small"
87+
variant="primary"
88+
className="setup__button"
8089
onClick={nextStep}>
8190
<Trans>next</Trans>
82-
</button>
91+
</Button>
8392
);
8493
case 5:
8594
return (
86-
<button
95+
<Button
8796
data-testid="install_open_dashboard"
8897
type="button"
89-
className="btn btn-success btn-lg setup__button"
98+
size="small"
99+
variant="primary"
100+
className="setup__button"
90101
onClick={() => this.props.openDashboard(ip, port)}>
91102
<Trans>open_dashboard</Trans>
92-
</button>
103+
</Button>
93104
);
94105
default:
95106
return false;
@@ -101,10 +112,8 @@ class Controls extends Component<ControlsProps> {
101112

102113
return (
103114
<div className="setup__nav">
104-
<div className="btn-list">
105-
{this.renderPrevButton(install.step)}
106-
{this.renderNextButton(install.step)}
107-
</div>
115+
{this.renderPrevButton(install.step)}
116+
{this.renderNextButton(install.step)}
108117
</div>
109118
);
110119
}

client_v2/src/install/Setup/Setup.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
}
5353

5454
.setup__nav {
55-
text-align: center;
55+
display: flex;
56+
gap: 16px;
57+
justify-content: center;
5658
}
5759

5860
.setup__step {
@@ -130,9 +132,7 @@
130132
}
131133

132134
.setup__button {
133-
min-width: 120px;
134-
padding-left: 30px;
135-
padding-right: 30px;
135+
max-width: 200px;
136136
}
137137

138138
.setup__error {

client_v2/src/login/Login/Form.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from 'react';
22
import { Controller, useForm } from 'react-hook-form';
33
import { useTranslation } from 'react-i18next';
4-
import { Input } from '../../components/ui/Controls/Input';
5-
import { validateRequiredValue } from '../../helpers/validators';
4+
import { validateRequiredValue } from 'panel/helpers/validators';
5+
import { Input } from 'panel/common/controls/Input';
6+
import { Button } from 'panel/common/ui/Button';
67

78
export type LoginFormValues = {
89
username: string;
@@ -39,14 +40,14 @@ const Form = ({ onSubmit, processing }: LoginFormProps) => {
3940
render={({ field, fieldState }) => (
4041
<Input
4142
{...field}
43+
id="username"
4244
data-testid="username"
4345
type="text"
4446
label={t('username_label')}
4547
placeholder={t('username_placeholder')}
46-
error={fieldState.error?.message}
48+
errorMessage={fieldState.error?.message}
4749
autoComplete="username"
4850
autoCapitalize="none"
49-
disabled={processing}
5051
/>
5152
)}
5253
/>
@@ -60,26 +61,28 @@ const Form = ({ onSubmit, processing }: LoginFormProps) => {
6061
render={({ field, fieldState }) => (
6162
<Input
6263
{...field}
64+
id="password"
6365
data-testid="password"
6466
type="password"
6567
label={t('password_label')}
6668
placeholder={t('password_placeholder')}
67-
error={fieldState.error?.message}
69+
errorMessage={fieldState.error?.message}
6870
autoComplete="current-password"
69-
disabled={processing}
7071
/>
7172
)}
7273
/>
7374
</div>
7475

7576
<div className="form-footer">
76-
<button
77+
<Button
78+
id="sign_in"
7779
data-testid="sign_in"
7880
type="submit"
79-
className="btn btn-success btn-block"
81+
variant="primary"
82+
size="small"
8083
disabled={processing || !isValid}>
8184
{t('sign_in')}
82-
</button>
85+
</Button>
8386
</div>
8487
</div>
8588
</form>

client_v2/src/login/Login/Login.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
letter-spacing: 0;
3939
}
4040

41+
.login__link {
42+
margin-top: 16px;
43+
border: 0;
44+
background: transparent;
45+
}
46+
4147
@media screen and (min-width: 992px) {
4248
.login__message {
4349
position: absolute;

client_v2/src/login/Login/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import React, { useState } from 'react';
22
import { useSelector, useDispatch } from 'react-redux';
33
import { Trans } from 'react-i18next';
4+
import cn from 'clsx';
45

5-
import * as actionCreators from '../../actions/login';
6+
import theme from 'panel/lib/theme';
67

8+
import * as actionCreators from '../../actions/login';
79
import Toasts from '../../components/Toasts';
810
import Form, { LoginFormValues } from './Form';
11+
import { LoginState } from '../../initialState';
912

1013
import './Login.css';
11-
import { LoginState } from '../../initialState';
1214

1315
export const Login = () => {
1416
const dispatch = useDispatch();
@@ -29,7 +31,7 @@ export const Login = () => {
2931
<Form onSubmit={handleSubmit} processing={processingLogin} />
3032

3133
<div className="login__info">
32-
<button type="button" className="btn btn-link login__link" onClick={toggleText}>
34+
<button type="button" className={cn(theme.link.link, 'login__link')} onClick={toggleText}>
3335
<Trans>forgot_password</Trans>
3436
</button>
3537

@@ -41,7 +43,9 @@ export const Login = () => {
4143
href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#password-reset"
4244
key="0"
4345
target="_blank"
44-
rel="noopener noreferrer">
46+
rel="noopener noreferrer"
47+
className={theme.link.link}
48+
>
4549
link
4650
</a>,
4751
]}>

0 commit comments

Comments
 (0)