From e5a1c5a9fe5bb492cbeb80e5b3ff2c2b1ca7b0c2 Mon Sep 17 00:00:00 2001 From: separatrix Date: Tue, 16 Dec 2025 18:12:09 +0300 Subject: [PATCH 1/3] 1 --- src/components/ErrorPage/ErrorPage.scss | 1 + src/components/ErrorPage/ErrorPage.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ErrorPage/ErrorPage.scss b/src/components/ErrorPage/ErrorPage.scss index 537a99be..08183c1f 100644 --- a/src/components/ErrorPage/ErrorPage.scss +++ b/src/components/ErrorPage/ErrorPage.scss @@ -43,6 +43,7 @@ max-width: 800px; margin-bottom: 20px; + white-space: pre-line; } &__description { diff --git a/src/components/ErrorPage/ErrorPage.tsx b/src/components/ErrorPage/ErrorPage.tsx index fc852f06..203092ed 100644 --- a/src/components/ErrorPage/ErrorPage.tsx +++ b/src/components/ErrorPage/ErrorPage.tsx @@ -18,6 +18,7 @@ export interface ErrorPageProps { code?: number; pageGroup?: string; homeUrl?: string; + receiveAccessText?: string; receiveAccessUrl?: string; links?: LinkType[]; errorTitle?: string; @@ -26,6 +27,7 @@ export interface ErrorPageProps { const ErrorPage: React.FC = ({ code = 500, homeUrl, + receiveAccessText, receiveAccessUrl, pageGroup, links, @@ -50,7 +52,7 @@ const ErrorPage: React.FC = ({ {receiveAccessUrl && ( )} From a6d5e801101ef22af60cca87f4af819f9fdf3cfb Mon Sep 17 00:00:00 2001 From: separatrix Date: Tue, 16 Dec 2025 18:19:21 +0300 Subject: [PATCH 2/3] 2 --- demo/src/Components/ErrorPage/index.scss | 1 + .../Components/ErrorPage/index.stories.tsx | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 demo/src/Components/ErrorPage/index.scss diff --git a/demo/src/Components/ErrorPage/index.scss b/demo/src/Components/ErrorPage/index.scss new file mode 100644 index 00000000..04f88c8e --- /dev/null +++ b/demo/src/Components/ErrorPage/index.scss @@ -0,0 +1 @@ +@import '@diplodoc/components'; diff --git a/demo/src/Components/ErrorPage/index.stories.tsx b/demo/src/Components/ErrorPage/index.stories.tsx index d8fc6c1c..fe667f93 100644 --- a/demo/src/Components/ErrorPage/index.stories.tsx +++ b/demo/src/Components/ErrorPage/index.stories.tsx @@ -1,22 +1,32 @@ import React from 'react'; import {ERROR_CODES, ErrorPage} from '@diplodoc/components'; +import './index.scss'; + type Args = { Title: string; Mobile: string; ErrorCode: string; + ReceiveAccessText?: string; + ReceiveAccessUrl?: string; }; const ErrorPageDemo = (args: Args) => { const title = args['Title']; const isMobile = args['Mobile']; const errorCode = args['ErrorCode']; + const receiveAccessText = args['ReceiveAccessText'] || ''; + const receiveAccessUrl = args['ReceiveAccessUrl']; + + const processedUrl = receiveAccessUrl?.trim(); + const renderMultiline = (text: string) => text.replace(/\r\n/g, '\n').replace(/\\n/g, '\n'); return (
@@ -37,6 +47,12 @@ export default { control: 'select', options: ERROR_CODES, }, + ReceiveAccessText: { + control: 'text', + }, + ReceiveAccessUrl: { + control: 'text', + }, }, }; @@ -45,5 +61,6 @@ export const Error = { Title: '', Mobile: false, ErrorCode: ERROR_CODES, + ReceiveAccessText: 'Request access', }, }; From 13edfd108ff2c0c2c5e349fde1c02e547ccf7702 Mon Sep 17 00:00:00 2001 From: separatrix Date: Tue, 16 Dec 2025 18:28:09 +0300 Subject: [PATCH 3/3] 3 --- demo/src/Components/ErrorPage/index.stories.tsx | 2 +- src/components/constants.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/demo/src/Components/ErrorPage/index.stories.tsx b/demo/src/Components/ErrorPage/index.stories.tsx index fe667f93..8c940bfd 100644 --- a/demo/src/Components/ErrorPage/index.stories.tsx +++ b/demo/src/Components/ErrorPage/index.stories.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {ERROR_CODES, ErrorPage} from '@diplodoc/components'; -import './index.scss'; +// import './index.scss'; type Args = { Title: string; diff --git a/src/components/constants.ts b/src/components/constants.ts index 01ac90eb..107952cf 100644 --- a/src/components/constants.ts +++ b/src/components/constants.ts @@ -16,3 +16,6 @@ export const DOC_PAGE_FEEDBACK_SHOWN_URL = BASE_URL + '/iframe.html?args=HideFeedback:false&id=pages-document--document&viewMode=story'; export const SEARCH_SUGGEST_URL = BASE_URL + '/iframe.html?id=components-searchsuggest--search-suggest&viewMode=story'; +export const ERROR_PAGE_URL = + BASE_URL + + '/iframe.html?args=ErrorCode:403;Title:Page%20403;ReceiveAccessText:Custom%20link;ReceiveAccessUrl:access&id=pages-error--error&viewMode=story';