@redocly/theme 0.21.2 → 0.22.0
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/lib/components/Catalog/CatalogCard.d.ts +1 -0
- package/lib/components/Catalog/CatalogCard.js +2 -1
- package/lib/components/Feedback/Emotions.d.ts +4 -0
- package/lib/components/Feedback/Emotions.js +74 -0
- package/lib/components/Feedback/Feedback.js +6 -0
- package/lib/components/Feedback/Mood.d.ts +8 -0
- package/lib/components/Feedback/Mood.js +116 -0
- package/lib/components/Feedback/index.d.ts +1 -0
- package/lib/components/Feedback/index.js +3 -1
- package/lib/components/Feedback/types.d.ts +24 -0
- package/lib/components/OpenApiDocs/ScorecardBadges.d.ts +10 -0
- package/lib/components/OpenApiDocs/ScorecardBadges.js +36 -0
- package/lib/components/OpenApiDocs/index.d.ts +1 -0
- package/lib/components/OpenApiDocs/index.js +1 -0
- package/lib/config.d.ts +10 -1
- package/lib/config.js +4 -1
- package/lib/globalStyle.js +3 -0
- package/lib/icons/DissatisfiedIcon/DissatisfiedIcon.d.ts +4 -0
- package/lib/icons/DissatisfiedIcon/DissatisfiedIcon.js +18 -0
- package/lib/icons/DissatisfiedIcon/index.d.ts +1 -0
- package/lib/icons/DissatisfiedIcon/index.js +18 -0
- package/lib/icons/NeutralIcon/NeutralIcon.d.ts +4 -0
- package/lib/icons/NeutralIcon/NeutralIcon.js +18 -0
- package/lib/icons/NeutralIcon/index.d.ts +1 -0
- package/lib/icons/NeutralIcon/index.js +18 -0
- package/lib/icons/SatisfiedIcon/SatisfiedIcon.d.ts +4 -0
- package/lib/icons/SatisfiedIcon/SatisfiedIcon.js +18 -0
- package/lib/icons/SatisfiedIcon/index.d.ts +1 -0
- package/lib/icons/SatisfiedIcon/index.js +18 -0
- package/lib/icons/index.d.ts +3 -0
- package/lib/icons/index.js +3 -0
- package/lib/layouts/OIDCForbidden.d.ts +2 -0
- package/lib/layouts/OIDCForbidden.js +95 -0
- package/lib/layouts/index.d.ts +1 -0
- package/lib/layouts/index.js +1 -0
- package/lib/types/portal/src/shared/constants.d.ts +2 -1
- package/lib/types/portal/src/shared/constants.js +1 -0
- package/lib/types/portal/src/shared/types/feedback.d.ts +2 -2
- package/package.json +2 -2
- package/src/components/Catalog/CatalogCard.tsx +1 -1
- package/src/components/Feedback/Emotions.tsx +59 -0
- package/src/components/Feedback/Feedback.tsx +13 -1
- package/src/components/Feedback/Mood.tsx +133 -0
- package/src/components/Feedback/index.ts +1 -0
- package/src/components/Feedback/types.ts +21 -0
- package/src/components/OpenApiDocs/ScorecardBadges.tsx +55 -0
- package/src/components/OpenApiDocs/index.ts +1 -0
- package/src/config.ts +4 -1
- package/src/globalStyle.ts +3 -0
- package/src/icons/DissatisfiedIcon/DissatisfiedIcon.tsx +38 -0
- package/src/icons/DissatisfiedIcon/index.ts +1 -0
- package/src/icons/NeutralIcon/NeutralIcon.tsx +34 -0
- package/src/icons/NeutralIcon/index.ts +1 -0
- package/src/icons/SatisfiedIcon/SatisfiedIcon.tsx +45 -0
- package/src/icons/SatisfiedIcon/index.ts +1 -0
- package/src/icons/index.ts +3 -0
- package/src/layouts/OIDCForbidden.tsx +89 -0
- package/src/layouts/index.ts +1 -0
- package/src/types/portal/src/shared/constants.ts +1 -0
- package/src/types/portal/src/shared/types/feedback.ts +2 -2
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { useSearchParams } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
import { useTranslate } from '@portal/hooks';
|
|
6
|
+
|
|
7
|
+
export function OIDCForbidden(): JSX.Element {
|
|
8
|
+
const { translate } = useTranslate();
|
|
9
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
10
|
+
const [errorDescription, setErrorDescription] = useState<string>('');
|
|
11
|
+
|
|
12
|
+
const translationKeys = {
|
|
13
|
+
title: 'theme.page.forbidden.title',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// use whatever you want here
|
|
17
|
+
const URL_REGEX =
|
|
18
|
+
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/;
|
|
19
|
+
|
|
20
|
+
const renderText = (text: string) =>
|
|
21
|
+
text.split(' ').map((part: string) =>
|
|
22
|
+
URL_REGEX.test(part) ? (
|
|
23
|
+
<ErrorDescriptionLink key={part} href={part}>
|
|
24
|
+
{part}{' '}
|
|
25
|
+
</ErrorDescriptionLink>
|
|
26
|
+
) : (
|
|
27
|
+
part + ' '
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (Array.from(searchParams).length) {
|
|
33
|
+
setErrorDescription(searchParams.get('error_description') || searchParams.get('error') || '');
|
|
34
|
+
setSearchParams({});
|
|
35
|
+
}
|
|
36
|
+
}, [searchParams, setSearchParams]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Wrapper data-component-name="Pages/OIDCForbidden">
|
|
40
|
+
<Header>403</Header>
|
|
41
|
+
<Description data-translation-key={translationKeys.title}>
|
|
42
|
+
{translate(translationKeys.title, 'Access forbidden')}
|
|
43
|
+
</Description>
|
|
44
|
+
{errorDescription && <ErrorDescription>{renderText(errorDescription)}</ErrorDescription>}
|
|
45
|
+
</Wrapper>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const Wrapper = styled.div`
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
margin: 25px auto;
|
|
55
|
+
font-family: var(--page-403-font-family);
|
|
56
|
+
text-align: center;
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const Header = styled.div`
|
|
60
|
+
color: var(--page-403-header-text-color);
|
|
61
|
+
margin: var(--page-403-header-margin);
|
|
62
|
+
font-size: var(--page-403-header-font-size);
|
|
63
|
+
line-height: var(--page-403-header-line-height);
|
|
64
|
+
font-weight: var(--page-403-header-font-weight);
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const Description = styled.div`
|
|
68
|
+
color: var(--page-403-description-text-color);
|
|
69
|
+
margin: var(--page-403-description-margin);
|
|
70
|
+
font-size: var(--page-403-description-font-size);
|
|
71
|
+
line-height: var(--page-403-description-line-height);
|
|
72
|
+
font-weight: var(--page-403-description-font-weight);
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const ErrorDescription = styled.div`
|
|
76
|
+
margin: var(--page-403-oidc-description-margin);
|
|
77
|
+
font-size: var(--page-403-oidc-description-font-size);
|
|
78
|
+
color: var(--page-403-description-text-color);
|
|
79
|
+
line-height: var(--page-403-description-line-height);
|
|
80
|
+
font-weight: var(--page-403-description-font-weight);
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
const ErrorDescriptionLink = styled.a`
|
|
84
|
+
color: var(--link-text-color);
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
color: var(--link-hover-text-color);
|
|
88
|
+
}
|
|
89
|
+
`;
|
package/src/layouts/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FEEDBACK_TYPES } from '../constants';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type {RatingProps, SentimentProps, CommentProps, MoodProps} from '@theme/components/Feedback';
|
|
4
4
|
|
|
5
5
|
export type SubmitFeedbackParams = {
|
|
6
6
|
type: string;
|
|
@@ -10,5 +10,5 @@ export type SubmitFeedbackParams = {
|
|
|
10
10
|
|
|
11
11
|
export type FeedbackProps = {
|
|
12
12
|
type: FEEDBACK_TYPES;
|
|
13
|
-
settings: (RatingProps | SentimentProps | CommentProps)['settings'];
|
|
13
|
+
settings: (RatingProps | SentimentProps | CommentProps | MoodProps)['settings'];
|
|
14
14
|
}
|