@redneckz/wildless-cms-uni-blocks 0.14.1048 → 0.14.1050
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.1049.js +47 -0
- package/bundle/bundle.umd.js +28 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/renderSections.d.ts +2 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/renderSections.d.ts +2 -1
- package/dist/components/ApplicationForm/renderSections.js +1 -1
- package/dist/components/ApplicationForm/renderSections.js.map +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.js +4 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/dist/retail/api/getCardTypes.js +15 -4
- package/dist/retail/api/getCardTypes.js.map +1 -1
- package/dist/retail/api/getPaymentSystems.js +6 -1
- package/dist/retail/api/getPaymentSystems.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DadataPartySelectField.js +1 -1
- package/dist/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -1
- package/dist/ui-kit/FormField/getField.js +1 -1
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/renderSections.d.ts +2 -1
- package/lib/components/ApplicationForm/renderSections.js +1 -1
- package/lib/components/ApplicationForm/renderSections.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.js +4 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/lib/retail/api/getCardTypes.js +15 -4
- package/lib/retail/api/getCardTypes.js.map +1 -1
- package/lib/retail/api/getPaymentSystems.js +6 -1
- package/lib/retail/api/getPaymentSystems.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DadataPartySelectField.js +1 -1
- package/lib/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -1
- package/lib/ui-kit/FormField/getField.js +1 -1
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +28 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/renderSections.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderSections.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/renderSections.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderSections.js.map +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js +4 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/mobile/dist/retail/api/getCardTypes.js +15 -4
- package/mobile/dist/retail/api/getCardTypes.js.map +1 -1
- package/mobile/dist/retail/api/getPaymentSystems.js +6 -1
- package/mobile/dist/retail/api/getPaymentSystems.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DadataPartySelectField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderSections.d.ts +2 -1
- package/mobile/lib/components/ApplicationForm/renderSections.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderSections.js.map +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js +4 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/mobile/lib/retail/api/getCardTypes.js +15 -4
- package/mobile/lib/retail/api/getCardTypes.js.map +1 -1
- package/mobile/lib/retail/api/getPaymentSystems.js +6 -1
- package/mobile/lib/retail/api/getPaymentSystems.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DadataPartySelectField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +2 -2
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderSections.tsx +5 -2
- package/mobile/src/hooks/useAspects/aspects/forwardQuery.ts +7 -1
- package/mobile/src/retail/api/getCardTypes.ts +18 -4
- package/mobile/src/retail/api/getPaymentSystems.ts +10 -7
- package/mobile/src/ui-kit/FormField/Fields/DadataPartySelectField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/getField.tsx +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +2 -2
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +2 -2
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/src/components/ApplicationForm/renderSections.tsx +5 -2
- package/src/hooks/useAspects/aspects/forwardQuery.ts +7 -1
- package/src/retail/api/getCardTypes.ts +18 -4
- package/src/retail/api/getPaymentSystems.ts +10 -7
- package/src/ui-kit/FormField/Fields/DadataPartySelectField.tsx +1 -1
- package/src/ui-kit/FormField/getField.tsx +1 -1
|
@@ -10,16 +10,19 @@ import type { additionalParamsType, FieldDef } from './ApplicationFormContent';
|
|
|
10
10
|
type renderSectionsType = {
|
|
11
11
|
typeForm: FormTypeFieldDef;
|
|
12
12
|
additionalParams?: additionalParamsType;
|
|
13
|
+
disabled?: boolean;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export const renderSections = (
|
|
16
17
|
sections: SectionsProps[],
|
|
17
18
|
field: FormFieldRegisterer<Record<string, any>>,
|
|
18
|
-
{ typeForm, additionalParams }: renderSectionsType,
|
|
19
|
+
{ typeForm, additionalParams, disabled }: renderSectionsType,
|
|
19
20
|
) =>
|
|
20
21
|
sections.map((_, i) => (
|
|
21
22
|
<div key={`section-${i}`} className={style(inputColumnStyles(_.columns), 'grid')}>
|
|
22
23
|
{renderTitle(_.title)}
|
|
23
|
-
{(_?.inputs || [])?.map(
|
|
24
|
+
{(_?.inputs || [])?.map(
|
|
25
|
+
getField<FieldDef>(field, { typeForm, disabled, ...additionalParams }),
|
|
26
|
+
)}
|
|
24
27
|
</div>
|
|
25
28
|
));
|
|
@@ -4,11 +4,17 @@ import { type PreventableEventWithTarget } from '../../../ui-kit/PreventableEven
|
|
|
4
4
|
import { adjustSessionQuery } from '../../../utils/adjustSessionQuery';
|
|
5
5
|
import { isURL } from '../../../utils/url';
|
|
6
6
|
|
|
7
|
+
const URLS_WITHOUT_QUERY = ['https://private-banking.rshb.ru/'];
|
|
8
|
+
|
|
7
9
|
export const forwardQuery = async (ev: PreventableEventWithTarget) => {
|
|
8
10
|
const anchor = (ev.target as Element | null)?.closest('a');
|
|
9
11
|
const navigator = locationNavigator();
|
|
10
12
|
|
|
11
|
-
if (
|
|
13
|
+
if (
|
|
14
|
+
isURL(anchor?.href) &&
|
|
15
|
+
!anchor?.href?.startsWith(navigator.origin) &&
|
|
16
|
+
!URLS_WITHOUT_QUERY.includes(anchor?.href ?? '')
|
|
17
|
+
) {
|
|
12
18
|
ev.preventDefault();
|
|
13
19
|
ev.stopPropagation();
|
|
14
20
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
2
|
+
import { checkNewMicroservice } from '../utils/checkNewMicroservice';
|
|
2
3
|
import { fetchRetailJSON } from './doRequest';
|
|
3
4
|
|
|
4
5
|
export type CardTypeData = DescriptionProps & {
|
|
@@ -9,10 +10,23 @@ export type CardTypeData = DescriptionProps & {
|
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export const getCardTypes = async (paymentSystemTypeCd: string, creditProgramId: string) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const isNewMicroservice = checkNewMicroservice();
|
|
14
|
+
|
|
15
|
+
const endpoint = isNewMicroservice
|
|
16
|
+
? '/external/public-data/dictionaryFiltered'
|
|
17
|
+
: '/dictionaryFiltered';
|
|
18
|
+
|
|
19
|
+
const requestBody = isNewMicroservice
|
|
20
|
+
? {
|
|
21
|
+
paymentSystemTypeCd,
|
|
22
|
+
dictionaryType: 'CARD_TYPE',
|
|
23
|
+
}
|
|
24
|
+
: {
|
|
25
|
+
type: 'CARD_TYPE',
|
|
26
|
+
presets: { paymentSystemTypeCd, creditProgramId },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const data = await fetchRetailJSON<CardTypeData[]>(endpoint, 'POST', requestBody);
|
|
16
30
|
|
|
17
31
|
return Array.isArray(data) ? data : [];
|
|
18
32
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Option } from '../../ui-kit/Select/Option';
|
|
2
|
+
import { checkNewMicroservice } from '../utils/checkNewMicroservice';
|
|
2
3
|
import { fetchRetailJSON } from './doRequest';
|
|
3
4
|
|
|
4
5
|
type PaymentSystem = {
|
|
@@ -11,13 +12,15 @@ type PaymentSystemResponse = {
|
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export const getPaymentSystems = async (creditProgramId: string) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const isNewMicroservice = checkNewMicroservice();
|
|
16
|
+
|
|
17
|
+
const endpoint = isNewMicroservice
|
|
18
|
+
? '/external/user-data/getPaymentSystem'
|
|
19
|
+
: '/public-data/creditProgramConditions';
|
|
20
|
+
|
|
21
|
+
const data = await fetchRetailJSON<PaymentSystemResponse>(endpoint, 'POST', {
|
|
22
|
+
creditProgramId,
|
|
23
|
+
});
|
|
21
24
|
|
|
22
25
|
return formatData(data?.paymentSystems || []);
|
|
23
26
|
};
|
|
@@ -106,8 +106,8 @@ export const DadataPartySelectField = JSX<CustomFieldProps>(({ field, input = {}
|
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
<SelectControl
|
|
109
|
-
{...input}
|
|
110
109
|
{...FIELD_CONFIG[fieldName]}
|
|
110
|
+
{...input}
|
|
111
111
|
options={getOptions}
|
|
112
112
|
{...field(input.name ?? '')}
|
|
113
113
|
isSearch
|
|
@@ -21,7 +21,7 @@ export const getField =
|
|
|
21
21
|
|
|
22
22
|
return shouldRenderField({ input, field }) && Component ? (
|
|
23
23
|
<RefWrapper onFieldRef={field(input.name ?? '').setFieldRef} key={String(i)}>
|
|
24
|
-
<Component field={field} input={input} params={params} />
|
|
24
|
+
<Component field={field} input={{ ...input, disabled: params?.disabled }} params={params} />
|
|
25
25
|
</RefWrapper>
|
|
26
26
|
) : null;
|
|
27
27
|
};
|