Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit bf8f1f3

Browse files
authored
Revert "Amina/77702_personal_details_validation_on_duplicate_account (#7266)" (#7346)
This reverts commit 3de795c.
1 parent 3de795c commit bf8f1f3

File tree

6 files changed

+60
-87
lines changed

6 files changed

+60
-87
lines changed

src/javascript/app/pages/user/new_account/new_account_form_config/address-details-config.js

Lines changed: 49 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,55 @@
11
const AddressDetailForm = require('../new_account_modules/address_detail_form');
22
const localize = require('../../../../../_common/localize').localize;
33

4-
const getAddressDetailsConfig = ({ account_settings, is_svg }) => {
5-
const isImmutable = (field) => account_settings.immutable_fields.includes(field);
6-
return ([
7-
{
8-
id : 'address_line_1',
9-
section : 'address_section',
10-
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
11-
default_value: account_settings.address_line_1 || '',
12-
is_immutable : isImmutable('address_line_1'),
13-
rules : ['req', 'address', ['length', { min: 1, max: 700 }]],
14-
},
15-
{
16-
id : 'address_line_2',
17-
section : 'address_section',
18-
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
19-
default_value: account_settings.address_line_2 || '',
20-
is_immutable : isImmutable('address_line_2'),
21-
rules : [['length', { min: 0, max: 70 }]],
22-
},
23-
{
24-
id : 'address_city',
25-
section : 'address_section',
26-
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
27-
default_value: account_settings.address_city || '',
28-
is_immutable : isImmutable('address_city'),
29-
rules : [
30-
'req', 'address_city',
31-
['regular', { regex: /^[a-zA-Z\s\W'.-]{1,35}$/ }],
32-
],
33-
},
34-
{
35-
id : 'address_state',
36-
section : 'address_section',
37-
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
38-
default_value: account_settings.address_state || '',
39-
is_immutable : isImmutable('address_state'),
40-
rules : [
41-
['regular', { regex: /^[\w\s\W'.-;,]{0,60}$/ }],
42-
// Isle of Man and SVG Clients do not need to fill out state.
43-
...(account_settings.country_code === 'im' || is_svg ? [] : ['req']),
44-
],
45-
},
46-
{
47-
id : 'address_postcode',
48-
section : 'address_section',
49-
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
50-
default_value: account_settings.address_postcode || '',
51-
is_immutable : isImmutable('address_postcode'),
52-
rules : [
53-
['length', { min: 0, max: 20 }],
54-
'postcode',
55-
// GB and IM residence are required to fill in the post code.
56-
...(/^(im|gb)$/.test(account_settings.country_code) ? ['req'] : []),
57-
],
58-
},
59-
]);
60-
};
4+
const getAddressDetailsConfig = ({ account_settings, is_svg }) => [
5+
{
6+
id : 'address_line_1',
7+
section : 'address_section',
8+
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
9+
default_value: account_settings.address_line_1 || '',
10+
rules : ['req', 'address', ['length', { min: 1, max: 700 }]],
11+
},
12+
{
13+
id : 'address_line_2',
14+
section : 'address_section',
15+
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
16+
default_value: account_settings.address_line_2 || '',
17+
rules : [['length', { min: 0, max: 70 }]],
18+
},
19+
{
20+
id : 'address_city',
21+
section : 'address_section',
22+
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
23+
default_value: account_settings.address_city || '',
24+
rules : [
25+
'req', 'address_city',
26+
['regular', { regex: /^[a-zA-Z\s\W'.-]{1,35}$/ }],
27+
],
28+
},
29+
{
30+
id : 'address_state',
31+
section : 'address_section',
32+
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
33+
default_value: account_settings.address_state || '',
34+
rules : [
35+
['regular', { regex: /^[\w\s\W'.-;,]{0,60}$/ }],
36+
// Isle of Man and SVG Clients do not need to fill out state.
37+
...(account_settings.country_code === 'im' || is_svg ? [] : ['req']),
38+
],
39+
},
40+
{
41+
id : 'address_postcode',
42+
section : 'address_section',
43+
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
44+
default_value: account_settings.address_postcode || '',
45+
rules : [
46+
['length', { min: 0, max: 20 }],
47+
'postcode',
48+
// GB and IM residence are required to fill in the post code.
49+
...(/^(im|gb)$/.test(account_settings.country_code) ? ['req'] : []),
50+
],
51+
},
52+
];
6153

6254
const getRequiredFields = (landing_company, all_fields) =>
6355
all_fields.filter(field => field.supported_in.includes(landing_company));

src/javascript/app/pages/user/new_account/new_account_form_config/personal-details-config.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@ const localize = require('../../../../../_common/localize').localize;
22
const PersonalDetailForm = require('../new_account_modules/personal_detail_form');
33

44
const getPersonalDetailsConfig = ({ account_settings, residence_list }) => {
5-
const isImmutable = (field) => account_settings.immutable_fields.includes(field);
65
const config = [
76
{
87
id : 'salutation',
98
section : 'name',
109
supported_in : ['iom', 'malta', 'maltainvest'],
1110
default_value: account_settings.salutation || '',
12-
is_immutable : isImmutable('salutation'),
11+
is_immutable : true,
1312
rules : ['req'],
1413
},
1514
{
1615
id : 'first_name',
1716
section : 'name',
1817
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
1918
default_value: account_settings.first_name || '',
20-
is_immutable : isImmutable('first_name'),
19+
is_immutable : true,
2120
rules : ['req', 'letter_symbol', ['length', { min: 2, max: 50 }]],
2221
},
2322
{
2423
id : 'last_name',
2524
section : 'name',
2625
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
2726
default_value: account_settings.last_name || '',
28-
is_immutable : isImmutable('last_name'),
27+
is_immutable : true,
2928
rules : ['req', 'letter_symbol', ['length', { min: 2, max: 50 }]],
3029
},
3130
{
@@ -35,31 +34,30 @@ const getPersonalDetailsConfig = ({ account_settings, residence_list }) => {
3534
default_value: account_settings.date_of_birth
3635
? account_settings.date_of_birth
3736
: '',
38-
is_immutable: isImmutable('date_of_birth'),
37+
is_immutable: true,
3938
rules : ['req'],
4039
},
4140
{
4241
id : 'place_of_birth',
4342
section : 'detail',
4443
supported_in : ['maltainvest', 'iom', 'malta'],
4544
default_value: account_settings.place_of_birth || '',
46-
is_immutable : isImmutable('place_of_birth'),
45+
is_immutable : true,
4746
rules : ['req'],
4847
},
4948
{
5049
id : 'citizen',
5150
section : 'detail',
5251
supported_in : ['iom', 'malta', 'maltainvest'],
5352
default_value: account_settings.citizen || '',
54-
is_immutable : isImmutable('citizen'),
53+
is_immutable : true,
5554
rules : ['req'],
5655
},
5756
{
5857
id : 'phone',
5958
section : 'detail',
6059
supported_in : ['svg', 'iom', 'malta', 'maltainvest'],
6160
default_value: account_settings.phone || '',
62-
is_immutable : isImmutable('phone'),
6361
rules : ['req', 'phone', ['length',
6462
{ min: 9, max: 35, value: () => $('#phone').val().replace(/\D/g, '') },
6563
]],
@@ -69,15 +67,13 @@ const getPersonalDetailsConfig = ({ account_settings, residence_list }) => {
6967
section : 'tax',
7068
supported_in : ['maltainvest'],
7169
default_value: account_settings.tax_residence || '',
72-
is_immutable : isImmutable('tax_residence'),
7370
rules : ['req', ['length', { min: 1, max: 20 }]],
7471
},
7572
{
7673
id : 'tax_identification_number',
7774
section : 'tax',
7875
supported_in : ['maltainvest'],
7976
default_value: account_settings.tax_identification_number || '',
80-
is_immutable : isImmutable('tax_identification_numbe'),
8177
rules : [
8278
'req',
8379
['tax_id', { residence_list, $warning: $('#tax_id_warning'), $tax_residence: $('#tax_residence') }],
@@ -89,23 +85,20 @@ const getPersonalDetailsConfig = ({ account_settings, residence_list }) => {
8985
section : 'tax',
9086
supported_in : ['maltainvest'],
9187
default_value: false,
92-
is_immutable : isImmutable('tax_identification_confirm'),
9388
rules : ['req'],
9489
},
9590
{
9691
id : 'account_opening_reason',
9792
section : 'account_opening_reason',
9893
supported_in : ['iom', 'malta', 'maltainvest'],
9994
default_value: account_settings.account_opening_reason || '',
100-
is_immutable : isImmutable('account_opening_reason'),
10195
rules : ['req'],
10296
},
10397
{
10498
id : 'accurate_answer_warning',
10599
section : '',
106100
supported_in : ['maltainvest'],
107101
default_value: '',
108-
is_immutable : isImmutable('accurate_answer_warning'),
109102
rules : [],
110103
},
111104
];

src/javascript/app/pages/user/new_account/new_account_modules/address_detail_form.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ const AddressDetailForm = (() => {
2020

2121
getElementById(`${field.section}_section`).setVisibility(1);
2222
getElementById(`${field.id}_row`).setVisibility(1);
23-
if (field.is_immutable) {
24-
if (field.id === 'address_state') {
25-
$('#address_state').parent().css('pointer-events', 'none');
26-
$('#select2-address_state-container').addClass('immutable-field');
27-
$('#select2-address_state-container').parent().addClass('white-bg-color');
28-
} else {
29-
$(`#${field.id}`).attr('disabled', 'disabled').addClass('immutable-field');
30-
}
31-
}
3223
});
3324
};
3425

src/javascript/app/pages/user/new_account/new_account_modules/personal_detail_form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const PersonalDetailForm = (() => {
6767
}
6868
getElementById(`${field.section}_section`).setVisibility(1);
6969
getElementById(`${field.id}_row`).setVisibility(1);
70-
if (field.is_immutable) $(`#${field.id}`).attr('disabled', 'disabled').addClass('immutable-field');
70+
if (field.is_immutable && field.default_value !== '') $(`#${field.id}`).attr('disabled', 'disabled');
7171
});
7272
};
7373

src/root_files/_common/binary-to-deriv/js/sprite-cd6ec4.smartcharts.svg

Lines changed: 4 additions & 1 deletion
Loading

src/sass/_common/common.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ a.button-disabled {
9696
pointer-events: none;
9797
}
9898

99-
.immutable-field {
100-
pointer-events: none;
101-
-webkit-text-fill-color: $COLOR_GRAY; // to make disabled field normal one in ios
102-
opacity: 1; /* required for iphone */
103-
}
104-
10599
span.checked {
106100
background: url('../images/pages/authenticate/checked.svg') no-repeat;
107101
width: 16px;

0 commit comments

Comments
 (0)