fix(TEAMMSBMOB-19098): Исправлены ссылка

This commit is contained in:
Конюхова Дарья
2025-10-09 23:12:48 +07:00
parent fae141b77e
commit 1ffcbd0f3e
16 changed files with 48 additions and 34 deletions
+1
View File
@@ -9,3 +9,4 @@ export * from './currencies';
export * from './unicode';
export * from './authorities';
export * from './saleGradients';
export * from './regexp';
+5 -1
View File
@@ -92,13 +92,16 @@ const ECO_SERVICES_PATHS = {
SBP: `${ECO_CLIENT_ENDPOINT}/sbp`,
SBP_CONTRACTS: `${ECO_CLIENT_ENDPOINT}/sbp/contracts`,
OFFER_LIST: `${ECO_CLIENT_ENDPOINT}/offer/list`,
CROSS_BORDER_AB_PAYMENTS: 'https://app.ab-payments.ru/?idp=gpb',
} as const;
const CROSS_SELLING_JSON = {
PRODUCT_CAROUSEL: '/product-carousel/product-carousel-data.json',
};
const CROSS_BORDER_AB_PAYMENTS = {
AUTH: 'https://app.ab-payments.ru/auth',
};
export {
PATHS,
PATHS_PROFILE,
@@ -109,4 +112,5 @@ export {
ECO_SERVICES_PATHS,
ECO_CLIENT_ENDPOINT,
CROSS_SELLING_JSON,
CROSS_BORDER_AB_PAYMENTS,
};
+3
View File
@@ -0,0 +1,3 @@
const EXTERNAL_URL_REGEXP = /^https?:\/\//;
export { EXTERNAL_URL_REGEXP };
@@ -1,4 +1,4 @@
import { ECO_SERVICES_PATHS, EXTERNAL_PATHS, type BannerItemDto } from '@msb/shared';
import { CROSS_BORDER_AB_PAYMENTS, EXTERNAL_PATHS, type BannerItemDto } from '@msb/shared';
import icons from '../assets';
const GHOST_BANNERS: BannerItemDto[] = [
@@ -19,7 +19,7 @@ const GHOST_BANNERS: BannerItemDto[] = [
codeName: 'main_page_payments_banner',
imagePath: icons.internationalTransfers,
gradient: 'radial-gradient(81.47% 111.43% at 60.35% 105%, #714FF5 13.97%, #38389E 94.67%)',
href: ECO_SERVICES_PATHS.CROSS_BORDER_AB_PAYMENTS,
href: CROSS_BORDER_AB_PAYMENTS.AUTH,
isExternal: true,
},
];
@@ -4,7 +4,8 @@
"title": "Счёт\nбесплатно",
"saleGradient": "sale2",
"imagePath": "/product-carousel/assets/accounts.webp",
"navigatePath": "/accounts",
"navigatePath": "/open-account/new",
"isEcoPath": true,
"ymCode": "your_products_accounts"
},
{
@@ -24,13 +25,13 @@
"saleGradient": "",
"isGift": true,
"imagePath": "/product-carousel/assets/gift.webp",
"navigatePath": "",
"navigatePath": "https://app.ab-payments.ru/auth",
"ymCode": ""
},
{
"id": 4,
"title": "Депозит\nдля бизнеса",
"description": "До 16,2%",
"description": "Онлайн",
"saleGradient": "sale1",
"imagePath": "/product-carousel/assets/deposit.webp",
"navigatePath": "/deposits",
@@ -39,7 +40,7 @@
{
"id": 5,
"title": "МНО",
"description": "До 15,5%",
"description": "Онлайн",
"saleGradient": "sale4",
"imagePath": "/product-carousel/assets/mno.webp",
"navigatePath": "/deposits/treasury-deals",
@@ -52,7 +53,7 @@
"description": "Выгодно",
"saleGradient": "sale3",
"imagePath": "/product-carousel/assets/acquiring.webp",
"navigatePath": "/paymenthub/lk",
"navigatePath": "/paymenthub/contract-lead/fea658c5-1f05-40db-acd1-5090aca721ba",
"isEcoPath": true,
"ymCode": "your_products_acquiring"
}
@@ -74,7 +74,7 @@
"title": "Овернайт\nпо лучшей ставке",
"description": "Размещайте свободные средства\nпо выгодной ставке на 1 день",
"buttons": [
{ "link": "/deposits/treasury-deals", "linkDocType": "DEPOSIT", "text": "Открыть депозит", "ymCode": "stories_slide_overnight_open" }
{ "link": "/deposits/treasury-deals", "linkDocType": "OVERNIGHT", "text": "Открыть депозит", "ymCode": "stories_slide_overnight_open" }
]
}
}
@@ -97,7 +97,7 @@
"description": "Оформите бизнес-карту для оплаты личных покупок и затрат по бизнесу",
"buttons": [
{
"link": "/business-cards",
"link": "/business-cards/card-issue",
"linkType": "eco",
"text": "Выпустить карту",
"ymCode": "stories_slide_business_cards_open_card"
@@ -124,7 +124,7 @@
"description": "Оформите банковскую гарантию онлайн\nот 10 минут на сумму до 200 млн.рублей.\nБез залога и поручителей.",
"buttons": [
{
"link": "/bank-guarantees",
"link": "/credit-cabinet/limits",
"linkType": "eco",
"text": "Отправить заявку",
"ymCode": "stories_slide_bank_guarantees_application"
@@ -151,7 +151,7 @@
"description": "Прозрачные условия, выгодные ставки\nи индивидуальные предложения\nдля любого бизнеса",
"buttons": [
{
"link": "/paymenthub/lk",
"link": "/paymenthub/contract-lead/fea658c5-1f05-40db-acd1-5090aca721ba",
"linkType": "eco",
"text": "Подключить",
"ymCode": "stories_slide_acquiring_connect"
@@ -199,7 +199,7 @@
"title": "Заказ справок",
"description": "Заказывайте онлайн основные справки\nс получением на электронном\nили бумажном носителе",
"buttons": [
{ "link": "/statements-and-inquiries/inquiries", "text": "Заказать справку", "ymCode": "stories_slide_inquiries_request" }
{ "link": "/statements-and-inquiries/inquiries-create", "text": "Заказать справку", "ymCode": "stories_slide_inquiries_request" }
]
}
}
@@ -16,7 +16,7 @@ export default {
CREDIT_AND_DOCUMENT_PRODUCTS: 'Кредитные и документарные продукты',
CREDITING: 'Кредитование',
ISSUING_CARDS_VIEWING_INFORMATION_REPORTS: 'Выпуск карт, просмотр информации и отчётов',
ISSUING_CARDS_VIEWING_INFORMATION_REPORTS: 'Оформление кредита, просмотр информации и отчетов',
BANK_GUARANTEES: 'Банковские гарантии',
REGISTRATION_BANK_GUARANTEES: 'Оформление электронных банковских гарантий',
@@ -1,5 +1,5 @@
import { lightTheme } from '@fractal-ui/styling';
import { ECO_SERVICES_PATHS, PATHS, STATEMENTS_AND_INQUIRIES_PATHS } from '@msb/shared';
import { CROSS_BORDER_AB_PAYMENTS, ECO_SERVICES_PATHS, PATHS, STATEMENTS_AND_INQUIRIES_PATHS } from '@msb/shared';
import icons from '../assets';
import type { ServicesGroup } from '../model';
import LOCALIZATION from './localization';
@@ -39,7 +39,7 @@ const SERVICES_FOR_YOU: ServicesGroup[] = [
description: LOCALIZATION.CROSS_BORDER_PAYMENTS,
iconBackground: lightTheme.gradients.sunsetSky,
icon: icons.crossborderPayments,
navigateUrl: ECO_SERVICES_PATHS.CROSS_BORDER_AB_PAYMENTS,
navigateUrl: CROSS_BORDER_AB_PAYMENTS.AUTH,
},
{
title: LOCALIZATION.FEA_ACCOUNT_CURRENCY,
@@ -59,7 +59,7 @@ const SERVICES_FOR_YOU: ServicesGroup[] = [
description: LOCALIZATION.ISSUING_CARDS_VIEWING_INFORMATION_REPORTS,
iconBackground: lightTheme.gradients.sapphire,
icon: icons.crediting,
navigateUrl: ECO_SERVICES_PATHS.CREDITING,
navigateUrl: ECO_SERVICES_PATHS.BANK_GUARANTEES,
},
{
title: LOCALIZATION.BANK_GUARANTEES,
@@ -2,6 +2,7 @@ import { useRef, useState } from 'react';
import { ButtonIcon } from '@fractal-ui/core';
import { Badge } from '@fractal-ui/extended';
import { Text } from '@fractal-ui/styling';
import type { DOC_TYPES } from '@msb/shared';
import { MEDIA, SmoothAutoHeight, useMediaQuery } from '@msb/shared';
import { useHistory } from 'react-router-dom';
import { heartImage } from '../assets';
@@ -10,7 +11,7 @@ import * as S from './GhostAccount.styles';
interface Props {
text: string;
badgeText: string;
navigateTo: { href: string; isExternal?: boolean };
navigateTo: { href: string; isExternal?: boolean; docType?: DOC_TYPES };
isDefaultOpened: boolean;
onClose(): void;
}
@@ -28,7 +29,9 @@ const GhostAccount = ({ badgeText, text, navigateTo, isDefaultOpened, onClose }:
const history = useHistory();
const handleClick = () => {
if (navigateTo.isExternal) {
if (navigateTo.docType) {
history.push(navigateTo.href, { docType: navigateTo.docType });
} else if (navigateTo.isExternal) {
window.open(navigateTo.href, '_blank', 'noopener,noreferrer');
} else {
history.push(navigateTo.href);
@@ -1,4 +1,4 @@
import { ECO_CLIENT_ENDPOINT, useYaMetrika, YM_GOALS } from '@msb/shared';
import { ECO_CLIENT_ENDPOINT, EXTERNAL_URL_REGEXP, useYaMetrika, YM_GOALS } from '@msb/shared';
import { useHistory } from 'react-router-dom';
import type { ProductAd } from '../model';
import * as S from './ProductAdSlide.styles';
@@ -22,6 +22,8 @@ const ProductAdSlide = ({ productAd }: Props) => {
window.open(`${ECO_CLIENT_ENDPOINT}${productAd.navigatePath}`, '_blank', 'noopener,noreferrer');
} else if (productAd.navigateDocType) {
history.push(productAd.navigatePath, { docType: productAd.navigateDocType });
} else if (EXTERNAL_URL_REGEXP.test(productAd.navigatePath)) {
window.open(productAd.navigatePath, '_blank', 'noopener,noreferrer');
} else {
history.push(productAd.navigatePath);
}
@@ -1,4 +1,4 @@
import { GHOST_BANNERS, PATHS, type BannerItemDto } from '@msb/shared';
import { GHOST_BANNERS, PATHS, PATHS_DEPOSITS, type BannerItemDto } from '@msb/shared';
import { Icons } from '../assets';
const banners: BannerItemDto[] = [
@@ -18,7 +18,8 @@ const promoBanner = {
title: 'Депозиты\nсроком от 1 дня',
description: 'Высокая ставка\nбез ограничения по сумме',
image: Icons.promoDeposit,
href: PATHS.DEPOSITS,
link: PATHS_DEPOSITS.TREASURY_DEALS,
docType: 'DEPOSIT',
background: 'linear-gradient(316.3deg, #FF712E 31.96%, #AB1A39 98.87%)',
};
@@ -39,8 +39,8 @@ const MainPage = (): ReactElement => {
history.push(PATHS.SERVICES);
};
const openDeposits = () => {
history.push(PATHS.DEPOSITS);
const navigateTo = (link: string, docType: string) => {
history.push(link, { docType });
};
return (
@@ -50,7 +50,7 @@ const MainPage = (): ReactElement => {
<GradientButton dataAction="services" onClick={handleOpenProduct}>
{LOCALIZATION.ADD_NEW_PRODUCT}
</GradientButton>
<PromoBanner navigateTo={openDeposits} {...promoBanner} />
<PromoBanner navigateTo={() => navigateTo(promoBanner.link, promoBanner.docType)} {...promoBanner} />
<FullVersion page="main_page" />
<BlockedAccountsInformers haveCloseButton haveScroll isButtonNavigateToAccountsPage />
{/* WIP: временно отключен */}
@@ -3,10 +3,10 @@ const LOCALIZATION = {
OPEN_ACCOUNT: 'Открыть счёт',
OPEN_PRODUCT: 'Открыть продукт',
HERE_YOUR_ACCOUNTS: 'Здесь будут ваши счета',
BUSINESS_ACCOUNT_FOR_ZERO: 'Счёт для бизнеса за 0 ₽',
BUSINESS_ACCOUNT_FOR_ZERO: 'Доход на остаток по счету',
DEPOSITS_AND_MNO: 'Депозиты и МНО',
HERE_YOUR_DEPOSITS: 'Здесь будут ваши депозиты и МНО',
PERSONAL_DEPOSIT_RATE: 'Депозит до 16,2%',
PERSONAL_DEPOSIT_RATE: 'Депозит по лучшей ставке',
CREDITS: 'Кредиты',
CREDIT_FOR_AMOUNT: 'Кредит на сумму до 10 млн ₽ ',
HERE_YOUR_CREDITS: 'Здесь будут ваши кредиты',
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { MEDIA, PATHS_DEPOSITS, SomethingWrongTabError, useMediaQuery, useYaMetrika, YM_GOALS } from '@msb/shared';
import { DOC_TYPES, MEDIA, PATHS_DEPOSITS, SomethingWrongTabError, useMediaQuery, useYaMetrika, YM_GOALS } from '@msb/shared';
import { useHistory } from 'react-router-dom';
import { LOCALIZATION } from '../../../constants';
import { DepositAccount, type DepositAccountModel } from '@/entities/DepositAccount';
@@ -79,7 +79,7 @@ const DepositAccounts = ({ depositAccounts, hasError, isGhostAccountOpened, onCl
<GhostAccount
badgeText={LOCALIZATION.PERSONAL_DEPOSIT_RATE}
isDefaultOpened={isGhostAccountOpened}
navigateTo={{ href: PATHS_DEPOSITS.OPEN_PRODUCT }}
navigateTo={{ href: PATHS_DEPOSITS.OPEN_PRODUCT, docType: DOC_TYPES.DEPOSIT }}
text={LOCALIZATION.GO_REGISTRATION}
onClose={onCloseGhostAccount}
/>
@@ -17,6 +17,8 @@ import {
YM_GOALS,
PATHS_PAYMENTS,
SomethingWrongTabError,
PATHS_DEPOSITS,
DOC_TYPES,
} from '@msb/shared';
import { useHistory } from 'react-router-dom';
import { LOCALIZATION } from '../../../constants';
@@ -154,7 +156,7 @@ const FinancialAccounts = ({
<GhostAccount
badgeText={LOCALIZATION.BUSINESS_ACCOUNT_FOR_ZERO}
isDefaultOpened={isGhostAccountOpened}
navigateTo={{ href: PATHS.ACCOUNTS }}
navigateTo={{ href: PATHS_DEPOSITS.TREASURY_DEALS, docType: DOC_TYPES.MNO }}
text={LOCALIZATION.GO_REGISTRATION}
onClose={onCloseGhostAccount}
/>
@@ -1,6 +1,5 @@
import { useCallback, useMemo, type ReactElement } from 'react';
import { lightTheme } from '@fractal-ui/styling';
import { ECO_CLIENT_ENDPOINT, useYaMetrika, YM_GOALS } from '@msb/shared';
import { ECO_CLIENT_ENDPOINT, EXTERNAL_URL_REGEXP, useYaMetrika, YM_GOALS } from '@msb/shared';
import { useHistory } from 'react-router-dom';
import { GRADIENT_STORIES, RADIANT_GRADIENT_STORIES } from '../../constants';
import { sortStoriesByVisit } from '../../lib/sortStoriesByVisit';
@@ -12,8 +11,6 @@ import StoriesGroup, { StoryContent } from '../StoriesGroup';
const { ActionButton, TextBlock } = StoryContent;
const EXTERNAL_URL_REGEXP = /^https?:\/\//;
const StoriesBlock = (): ReactElement => {
const history = useHistory();
const { stories, isLoading } = useStories();