Skip to content

Commit eb89838

Browse files
Merge pull request #2660 from epam/2588-error-pages-add-possibility-to-provide-support-link
[ErrorPage]: Added field to provide support link
2 parents c8448dc + 9634224 commit eb89838

File tree

7 files changed

+38
-7
lines changed

7 files changed

+38
-7
lines changed

app/src/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { RouterProvider } from 'react-router';
44
import { createBrowserRouter } from 'react-router-dom';
55
import { init as initApm } from '@elastic/apm-rum';
66
import { Router6AdaptedRouter, useUuiServices, UuiContext, IProcessRequest, GAListener } from '@epam/uui-core';
7+
import { i18n } from '@epam/uui';
78
import { AmplitudeListener } from './analyticsEvents';
89
import { svc } from './services';
910
import App from './App';
@@ -19,6 +20,14 @@ import '@epam/assets/theme/theme_eduverse_light.scss';
1920
import '@epam/assets/theme/theme_eduverse_dark.scss';
2021
import './index.module.scss';
2122

23+
i18n.errorHandler.supportLink = (
24+
<>
25+
You can track the service availability at
26+
{' '}
27+
<a href={ `https://status.epam.com/?utm_source=${window.location.host}&utm_medium=ErrorPage&utm_campaign=StatusAquisitionTracking` }>status.epam.com</a>
28+
</>
29+
);
30+
2231
const router6 = createBrowserRouter([
2332
{ path: '*', element: <App /> },
2433
]);

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 5.xx.xx - xx.xx.2024
22

33
**What's New**
4+
* [ErrorPage]: Added field for additional message with support link (it works with `500, 503, default` errors), added support link for the site
45

56
**What's Fixed**
67
* [PickerInput]: fixed unnecessary api calls on body open with `minCharsToSearch` prop and search in body

uui-core/src/services/ErrorContext.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export interface ErrorPageInfo {
4343
imageUrl?: string;
4444
/** Url of error image to display on error page in case of mobile layout (app width < 720px) */
4545
mobileImageUrl?: string;
46+
/** Additional message with link to the support portal */
47+
supportLink?: React.ReactNode;
4648
}
4749

4850
export class UuiError extends Error {

uui/components/errors/ErrorPage.module.scss

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@
3939
font-size: 16px;
4040
color: var(--uui-text-primary);
4141
max-width: 700px;
42+
margin-top: 8px;
43+
}
44+
45+
:global(.uui-error-support-link) {
46+
font-family: var(--uui-font);
47+
font-weight: 400;
48+
text-align: center;
49+
line-height: 24px;
50+
font-size: 16px;
51+
color: var(--uui-text-primary);
52+
max-width: 700px;
53+
margin-top: 18px;
54+
55+
a {
56+
text-decoration: none;
57+
}
4258
}
4359

4460
@media screen and (max-width: 720px) {
@@ -48,7 +64,6 @@
4864
}
4965

5066
:global(.uui-error-title) {
51-
font-family: var(--uui-font);
5267
font-weight: 400;
5368
font-size: 24px;
5469
line-height: 30px;
@@ -57,12 +72,10 @@
5772
}
5873

5974
:global(.uui-error-subtitle) {
60-
font-family: var(--uui-font);
61-
font-weight: 400;
62-
text-align: center;
63-
line-height: 24px;
64-
font-size: 16px;
65-
color: var(--uui-text-primary);
75+
max-width: 460px;
76+
}
77+
78+
:global(.uui-error-support-link) {
6679
max-width: 460px;
6780
}
6881
}

uui/components/errors/ErrorPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
1313
<img className="uui-error-image" src={ isMobileScreen && props.mobileImageUrl ? props.mobileImageUrl : props.imageUrl } alt="ERROR OCCURRED!" />
1414
<div className="uui-error-title">{props.title}</div>
1515
<div className="uui-error-subtitle">{props.subtitle}</div>
16+
<div className="uui-error-support-link">{props?.supportLink}</div>
1617
</div>
1718
</div>
1819
);

uui/components/errors/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@ export const getErrorPageConfig = () => ({
2626
mobileImageUrl: 'https://static.cdn.epam.com/uploads/690afa39a93c88c4dd13758fe1d869d5/EPM-UUI/error-pages-illustrations/L_Error_500_Monochrome.svg',
2727
title: i18n.errorHandler.errorPageConfig.serverError.title,
2828
subtitle: i18n.errorHandler.errorPageConfig.serverError.subtitle,
29+
supportLink: i18n.errorHandler.supportLink,
2930
},
3031
serviceUnavailable: {
3132
imageUrl: 'https://static.cdn.epam.com/uploads/690afa39a93c88c4dd13758fe1d869d5/EPM-UUI/error-pages-illustrations/L_Error_503_Monochrome.svg',
3233
mobileImageUrl: 'https://static.cdn.epam.com/uploads/690afa39a93c88c4dd13758fe1d869d5/EPM-UUI/error-pages-illustrations/L_Error_503_Monochrome.svg',
3334
title: i18n.errorHandler.errorPageConfig.serviceUnavailable.title,
3435
subtitle: i18n.errorHandler.errorPageConfig.serviceUnavailable.subtitle,
36+
supportLink: i18n.errorHandler.supportLink,
3537
},
3638
default: {
3739
imageUrl: 'https://static.cdn.epam.com/uploads/690afa39a93c88c4dd13758fe1d869d5/EPM-UUI/error-pages-illustrations/L_Empty_Monochrome.svg',
3840
mobileImageUrl: 'https://static.cdn.epam.com/uploads/690afa39a93c88c4dd13758fe1d869d5/EPM-UUI/error-pages-illustrations/L_Empty_Monochrome.svg',
3941
title: i18n.errorHandler.errorPageConfig.default.title,
4042
subtitle: i18n.errorHandler.errorPageConfig.default.subtitle,
43+
supportLink: i18n.errorHandler.supportLink,
4144
},
4245
});

uui/i18n.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ReactNode } from 'react';
12
import { i18n as uuiI18n } from '@epam/uui-core';
23

34
const TREE_SHAKEABLE_INIT = () => ({
@@ -153,6 +154,7 @@ const TREE_SHAKEABLE_INIT = () => ({
153154
subtitle: 'We are trying to recover. Please wait.',
154155
},
155156
},
157+
supportLink: undefined as ReactNode,
156158
},
157159
});
158160

0 commit comments

Comments
 (0)