@redneckz/wildless-cms-uni-blocks 0.14.233 → 0.14.235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/migration-scripts/0.14.169.js +84 -107
- package/bin/migration-scripts/0.14.213.js +178 -203
- package/bin/migration-scripts/0.14.224.js +1 -1
- package/bin/migration-scripts/0.14.234.js +17 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +4 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ProductBlock/renderBackwardButton.d.ts +1 -1
- package/bundle/model/ContentPageMeta.d.ts +2 -1
- package/dist/components/ApplicationFormCustom/getObjectValidator.js +1 -1
- package/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/dist/components/ProductBlock/renderBackwardButton.d.ts +1 -1
- package/dist/components/ProductBlock/renderBackwardButton.js +3 -2
- package/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/dist/model/ContentPageMeta.d.ts +2 -1
- package/lib/components/ApplicationFormCustom/getObjectValidator.js +1 -1
- package/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/lib/components/ProductBlock/renderBackwardButton.d.ts +1 -1
- package/lib/components/ProductBlock/renderBackwardButton.js +3 -2
- package/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/lib/model/ContentPageMeta.d.ts +2 -1
- package/mobile/bundle/bundle.umd.js +4 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ProductBlock/renderBackwardButton.d.ts +1 -1
- package/mobile/bundle/model/ContentPageMeta.d.ts +2 -1
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/mobile/dist/components/ProductBlock/renderBackwardButton.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js +3 -2
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/dist/model/ContentPageMeta.d.ts +2 -1
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ProductBlock/renderBackwardButton.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js +3 -2
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/lib/model/ContentPageMeta.d.ts +2 -1
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +1 -1
- package/mobile/src/components/ApplicationFormCustom/getObjectValidator.tsx +1 -1
- package/mobile/src/components/ProductBlock/renderBackwardButton.tsx +7 -2
- package/mobile/src/model/ContentPageMeta.ts +3 -1
- package/package.json +1 -1
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +1 -1
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +1 -1
- package/src/components/ApplicationFormCustom/getObjectValidator.tsx +1 -1
- package/src/components/ProductBlock/renderBackwardButton.tsx +7 -2
- package/src/model/ContentPageMeta.ts +3 -1
- package/bin/migration-scripts/0.10.10.js +0 -44
- package/bin/migration-scripts/0.10.2.js +0 -31
- package/bin/migration-scripts/0.10.3.js +0 -19
- package/bin/migration-scripts/0.6.32.js +0 -32
- package/bin/migration-scripts/0.8.15.js +0 -32
- package/bin/migration-scripts/0.8.17.js +0 -35
- package/bin/migration-scripts/0.8.23.js +0 -31
- package/bin/migration-scripts/0.8.24.js +0 -30
- package/bin/migration-scripts/0.9.8.js +0 -29
|
@@ -9,118 +9,63 @@ export default traversePageBlocks(
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
function adjustApplicationFormCorruptionBlock(block) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
block.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
if (isMigrateForm(block, 'ApplicationFormCorruption')) {
|
|
13
|
+
block.type = 'ApplicationFormCustom';
|
|
14
|
+
const formBlock = block.content?.formBlock;
|
|
15
|
+
block.content = {
|
|
16
|
+
title: formBlock?.title,
|
|
17
|
+
typeForm: 'CORRUPTION',
|
|
18
|
+
endpoint: 'lead',
|
|
19
|
+
formColumns: 1,
|
|
20
|
+
inputs: [
|
|
21
|
+
...userInputs,
|
|
22
|
+
{
|
|
23
|
+
name: 'region',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'email',
|
|
28
|
+
},
|
|
29
|
+
comment,
|
|
30
|
+
consentDataProcessing,
|
|
31
|
+
],
|
|
32
|
+
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
33
|
+
link: formBlock?.link || {
|
|
34
|
+
text: 'обработкой персональных данных',
|
|
35
|
+
href: 'https://beta.rshb.ru/natural/privacy-policy',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
20
38
|
}
|
|
21
|
-
|
|
22
|
-
block.type = 'ApplicationFormCustom';
|
|
23
|
-
const formBlock = block.content?.formBlock;
|
|
24
|
-
block.content = {
|
|
25
|
-
title: formBlock?.title,
|
|
26
|
-
typeForm: 'CORRUPTION',
|
|
27
|
-
endpoint: 'lead',
|
|
28
|
-
formColumns: 1,
|
|
29
|
-
inputs: [
|
|
30
|
-
{
|
|
31
|
-
name: 'surname',
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'name',
|
|
36
|
-
required: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'middleName',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'phone',
|
|
43
|
-
required: true,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'region',
|
|
47
|
-
required: true,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'email',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'comment',
|
|
54
|
-
required: true,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'consentDataProcessing',
|
|
58
|
-
required: true,
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
62
|
-
link: formBlock?.link || {
|
|
63
|
-
text: 'обработкой персональных данных',
|
|
64
|
-
href: 'https://beta.rshb.ru/natural/privacy-policy',
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
39
|
}
|
|
68
40
|
|
|
69
41
|
function adjustApplicationFormAntiFraudBlock(block) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
block.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
42
|
+
if (isMigrateForm(block, 'ApplicationFormAntiFraud')) {
|
|
43
|
+
block.type = 'ApplicationFormCorruption';
|
|
44
|
+
const formBlock = block.content?.formBlock;
|
|
45
|
+
block.content = {
|
|
46
|
+
title: formBlock?.title,
|
|
47
|
+
typeForm: 'ANTIFRAUD',
|
|
48
|
+
endpoint: 'lead',
|
|
49
|
+
formColumns: 1,
|
|
50
|
+
inputs: [
|
|
51
|
+
...userInputs,
|
|
52
|
+
{
|
|
53
|
+
name: 'birthday',
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'client',
|
|
58
|
+
},
|
|
59
|
+
comment,
|
|
60
|
+
consentDataProcessing,
|
|
61
|
+
],
|
|
62
|
+
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
63
|
+
link: formBlock?.link || {
|
|
64
|
+
text: 'обработкой персональных данных',
|
|
65
|
+
href: 'https://beta.rshb.ru/natural/privacy-policy',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
77
68
|
}
|
|
78
|
-
|
|
79
|
-
block.type = 'ApplicationFormCorruption';
|
|
80
|
-
const formBlock = block.content?.formBlock;
|
|
81
|
-
block.content = {
|
|
82
|
-
title: formBlock?.title,
|
|
83
|
-
typeForm: 'ANTIFRAUD',
|
|
84
|
-
endpoint: 'lead',
|
|
85
|
-
formColumns: 1,
|
|
86
|
-
inputs: [
|
|
87
|
-
{
|
|
88
|
-
name: 'surname',
|
|
89
|
-
required: true,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'name',
|
|
93
|
-
required: true,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'middleName',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'phone',
|
|
100
|
-
required: true,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'birthday',
|
|
104
|
-
required: true,
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'client',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'comment',
|
|
111
|
-
required: true,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: 'consentDataProcessing',
|
|
115
|
-
required: true,
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
119
|
-
link: formBlock?.link || {
|
|
120
|
-
text: 'обработкой персональных данных',
|
|
121
|
-
href: 'https://beta.rshb.ru/natural/privacy-policy',
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
69
|
}
|
|
125
70
|
|
|
126
71
|
function adjustClearBlock(block) {
|
|
@@ -138,3 +83,35 @@ function adjustClearBlock(block) {
|
|
|
138
83
|
deleteProp(content, 'isDotted');
|
|
139
84
|
}
|
|
140
85
|
}
|
|
86
|
+
|
|
87
|
+
const isMigrateForm = (block, type) =>
|
|
88
|
+
block?.content &&
|
|
89
|
+
block.type === 'ApplicationForm' &&
|
|
90
|
+
block?.content?.formBlock?.formType === type;
|
|
91
|
+
|
|
92
|
+
const userInputs = [
|
|
93
|
+
{
|
|
94
|
+
name: 'surname',
|
|
95
|
+
required: true,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'name',
|
|
99
|
+
required: true,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'middleName',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'phone',
|
|
106
|
+
required: true,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
const comment = {
|
|
111
|
+
name: 'comment',
|
|
112
|
+
required: true,
|
|
113
|
+
};
|
|
114
|
+
const consentDataProcessing = {
|
|
115
|
+
name: 'consentDataProcessing',
|
|
116
|
+
required: true,
|
|
117
|
+
};
|
|
@@ -11,225 +11,200 @@ export default traversePageBlocks(
|
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
function adjustApplicationAcquiring(block) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
block.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
inputs: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
14
|
+
if (isMigrateForm(block, 'ApplicationFormAcquiring')) {
|
|
15
|
+
block.type = 'ApplicationFormCustom';
|
|
16
|
+
const formBlock = block.content?.formBlock;
|
|
17
|
+
block.content = {
|
|
18
|
+
title: formBlock?.title,
|
|
19
|
+
typeForm: 'ACQR',
|
|
20
|
+
endpoint: 'sendcorporatelead',
|
|
21
|
+
sections: [
|
|
22
|
+
{
|
|
23
|
+
title: 'Вид эквайринга и регион',
|
|
24
|
+
columns: 2,
|
|
25
|
+
inputs: [
|
|
26
|
+
{ name: 'acquiringType', required: true },
|
|
27
|
+
{ name: 'region', required: true },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'Данные организации',
|
|
32
|
+
columns: 2,
|
|
33
|
+
inputs: [
|
|
34
|
+
{ name: 'fullName', required: true },
|
|
35
|
+
{ name: 'inn', required: true },
|
|
36
|
+
{ name: 'name', required: true },
|
|
37
|
+
{ name: 'phone', required: true },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{ inputs: [{ name: 'onlineCheckout' }] },
|
|
41
|
+
{ inputs: [{ name: 'posTerminal' }] },
|
|
42
|
+
],
|
|
43
|
+
button: formBlock?.button || button,
|
|
44
|
+
link: formBlock?.link || {
|
|
45
|
+
text: linkTextShort,
|
|
46
|
+
href: linkHref,
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
],
|
|
51
|
-
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
52
|
-
link: formBlock?.link || {
|
|
53
|
-
text: 'условиями передачи данных',
|
|
54
|
-
href: '/privacy-policy',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
57
50
|
}
|
|
58
51
|
|
|
59
52
|
function adjustApplicationUltraPremium(block) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
53
|
+
if (isMigrateForm(block, 'ApplicationFormUltraPremium')) {
|
|
54
|
+
block.type = 'ApplicationFormCustom';
|
|
55
|
+
const formBlock = block.content?.formBlock;
|
|
56
|
+
const defaultType = formBlock?.defaultType ?? 'ULTRASERVICE';
|
|
57
|
+
deleteProp(formBlock, 'defaultType');
|
|
58
|
+
block.content = {
|
|
59
|
+
title: formBlock?.title,
|
|
60
|
+
typeForm: defaultType,
|
|
61
|
+
endpoint: 'lead',
|
|
62
|
+
sections: [
|
|
63
|
+
{
|
|
64
|
+
title: 'Ваши данные',
|
|
65
|
+
columns: 2,
|
|
66
|
+
inputs: [
|
|
67
|
+
{ name: 'surname', required: true },
|
|
68
|
+
{ name: 'name', required: true },
|
|
69
|
+
{ name: 'middleName' },
|
|
70
|
+
{ name: 'phone', required: true },
|
|
71
|
+
{ name: 'email', required: true },
|
|
72
|
+
{ name: 'serviceType', required: true },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
title: 'Офис банка',
|
|
77
|
+
columns: 2,
|
|
78
|
+
inputs: [
|
|
79
|
+
{ name: 'region', required: true },
|
|
80
|
+
{ name: 'addressBranch', required: true },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{ inputs: [{ name: 'comment' }] },
|
|
84
|
+
{ inputs: [{ name: 'consentDataProcessing', required: true }] },
|
|
85
|
+
],
|
|
86
|
+
button: formBlock?.button || button,
|
|
87
|
+
link: formBlock?.link || {
|
|
88
|
+
text: linkText,
|
|
89
|
+
href: linkHref,
|
|
97
90
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
],
|
|
101
|
-
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
102
|
-
link: formBlock?.link || {
|
|
103
|
-
text: 'Согласен на обработку персональных данных',
|
|
104
|
-
href: '/privacy-policy',
|
|
105
|
-
},
|
|
106
|
-
};
|
|
91
|
+
};
|
|
92
|
+
}
|
|
107
93
|
}
|
|
108
94
|
|
|
109
95
|
function adjustApplicationDeposit(block) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
block.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{ name: 'consentDataProcessing', required: true },
|
|
132
|
-
],
|
|
96
|
+
if (isMigrateForm(block, 'ApplicationFormDeposit')) {
|
|
97
|
+
block.type = 'ApplicationFormCustom';
|
|
98
|
+
const formBlock = block.content?.formBlock;
|
|
99
|
+
block.content = {
|
|
100
|
+
title: formBlock?.title,
|
|
101
|
+
typeForm: 'DPST',
|
|
102
|
+
endpoint: 'lead',
|
|
103
|
+
sections: [
|
|
104
|
+
{
|
|
105
|
+
title: 'Оставьте заявку и мы ответим на любые вопросы по депозитам',
|
|
106
|
+
inputs: [
|
|
107
|
+
{ name: 'name', required: true },
|
|
108
|
+
{ name: 'phone', required: true },
|
|
109
|
+
{ name: 'consentDataProcessing', required: true },
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
button: formBlock?.button || button,
|
|
114
|
+
link: formBlock?.link || {
|
|
115
|
+
text: linkText,
|
|
116
|
+
href: linkHref,
|
|
133
117
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
link: formBlock?.link || {
|
|
137
|
-
text: 'Согласен на обработку персональных данных',
|
|
138
|
-
href: '/privacy-policy',
|
|
139
|
-
},
|
|
140
|
-
};
|
|
118
|
+
};
|
|
119
|
+
}
|
|
141
120
|
}
|
|
142
121
|
|
|
143
122
|
function adjustApplicationFormIndividuals(block) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
block
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
{ name: 'consentDataProcessing', required: true },
|
|
172
|
-
],
|
|
123
|
+
if (isMigrateForm(block, 'ApplicationFormIndividuals')) {
|
|
124
|
+
block.type = 'ApplicationFormCustom';
|
|
125
|
+
const formBlock = block.content?.formBlock;
|
|
126
|
+
const product = block.content?.product;
|
|
127
|
+
block.content = {
|
|
128
|
+
title: formBlock?.title,
|
|
129
|
+
typeForm: 'PRODUCT',
|
|
130
|
+
endpoint: 'lead',
|
|
131
|
+
sections: [
|
|
132
|
+
{
|
|
133
|
+
title: 'Заполните форму',
|
|
134
|
+
columns: 2,
|
|
135
|
+
inputs: [
|
|
136
|
+
{ name: 'surname', required: true },
|
|
137
|
+
{ name: 'name', required: true },
|
|
138
|
+
{ name: 'middleName' },
|
|
139
|
+
{ name: 'birthday', required: true },
|
|
140
|
+
{ name: 'phone', required: true },
|
|
141
|
+
{ name: 'email', required: true },
|
|
142
|
+
{ name: 'consentDataProcessing', required: true },
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
button: formBlock?.button || button,
|
|
147
|
+
link: formBlock?.link || {
|
|
148
|
+
text: linkText,
|
|
149
|
+
href: linkHref,
|
|
173
150
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
href: '/privacy-policy',
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
if (product) {
|
|
182
|
-
block.content.additionalParams = { product: product };
|
|
151
|
+
};
|
|
152
|
+
if (product) {
|
|
153
|
+
block.content.additionalParams = { product: product };
|
|
154
|
+
}
|
|
183
155
|
}
|
|
184
156
|
}
|
|
185
157
|
|
|
186
158
|
function adjustApplicationFormCredit(block) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
block.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
159
|
+
if (isMigrateForm(block, 'ApplicationFormCredit')) {
|
|
160
|
+
block.type = 'ApplicationFormCustom';
|
|
161
|
+
const formBlock = block.content?.formBlock;
|
|
162
|
+
block.content = {
|
|
163
|
+
title: formBlock?.title ?? 'Оформите заявку на кредит прямо сейчас',
|
|
164
|
+
typeForm: 'CRED',
|
|
165
|
+
endpoint: 'sendcorporatelead',
|
|
166
|
+
sections: [
|
|
167
|
+
{
|
|
168
|
+
title: 'Параметры кредита',
|
|
169
|
+
columns: 2,
|
|
170
|
+
inputs: [{ name: 'amount' }, { name: 'term' }],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
title: 'Данные организации',
|
|
174
|
+
columns: 2,
|
|
175
|
+
inputs: [
|
|
176
|
+
{ name: 'fullName', required: true, label: 'Наименование организации' },
|
|
177
|
+
{ name: 'annualRevenue', required: true },
|
|
178
|
+
{ name: 'inn', required: true },
|
|
179
|
+
{ name: 'name', required: true, label: 'Контактное лицо' },
|
|
180
|
+
{ name: 'phone', required: true },
|
|
181
|
+
{ name: 'email', required: true },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: 'Офис банка',
|
|
186
|
+
columns: 2,
|
|
187
|
+
inputs: [
|
|
188
|
+
{ name: 'region', required: true },
|
|
189
|
+
{ name: 'addressBranch', required: true },
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
button: formBlock?.button || button,
|
|
194
|
+
link: formBlock?.link || {
|
|
195
|
+
text: linkTextShort,
|
|
196
|
+
href: linkHref,
|
|
207
197
|
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
columns: 2,
|
|
211
|
-
inputs: [
|
|
212
|
-
{ name: 'fullName', required: true, label: 'Наименование организации' },
|
|
213
|
-
{ name: 'annualRevenue', required: true },
|
|
214
|
-
{ name: 'inn', required: true },
|
|
215
|
-
{ name: 'name', required: true, label: 'Контактное лицо' },
|
|
216
|
-
{ name: 'phone', required: true },
|
|
217
|
-
{ name: 'email', required: true },
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
title: 'Офис банка',
|
|
222
|
-
columns: 2,
|
|
223
|
-
inputs: [
|
|
224
|
-
{ name: 'region', required: true },
|
|
225
|
-
{ name: 'addressBranch', required: true },
|
|
226
|
-
],
|
|
227
|
-
},
|
|
228
|
-
],
|
|
229
|
-
button: formBlock?.button || { text: 'Отправить заявку' },
|
|
230
|
-
link: formBlock?.link || {
|
|
231
|
-
text: 'условиями передачи данных',
|
|
232
|
-
href: '/privacy-policy',
|
|
233
|
-
},
|
|
234
|
-
};
|
|
198
|
+
};
|
|
199
|
+
}
|
|
235
200
|
}
|
|
201
|
+
|
|
202
|
+
const linkText = 'Согласен на обработку персональных данных';
|
|
203
|
+
const linkTextShort = 'условиями передачи данных';
|
|
204
|
+
const linkHref = '/privacy-policy';
|
|
205
|
+
const button = { text: 'Отправить заявку' };
|
|
206
|
+
|
|
207
|
+
const isMigrateForm = (block, type) =>
|
|
208
|
+
block?.content &&
|
|
209
|
+
block.type === 'ApplicationForm' &&
|
|
210
|
+
block?.content?.formBlock?.formType === type;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { traversePageBlocks } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export const description = 'v0.14.234';
|
|
4
|
+
|
|
5
|
+
export default traversePageBlocks(adjustApplicationSelfCollection);
|
|
6
|
+
|
|
7
|
+
function adjustApplicationSelfCollection(block) {
|
|
8
|
+
const content = block?.content;
|
|
9
|
+
if (
|
|
10
|
+
content &&
|
|
11
|
+
block.type === 'ApplicationFormCustom' &&
|
|
12
|
+
content?.typeForm === 'SELFCOLLECTION' &&
|
|
13
|
+
content?.sections?.[0]?.inputs?.[0]?.name === 'fullName'
|
|
14
|
+
) {
|
|
15
|
+
content.sections[0].inputs[0].name = 'name';
|
|
16
|
+
}
|
|
17
|
+
}
|