mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-28 11:50:02 +00:00
parent
c4ece1d883
commit
6c92d2f9ec
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="448" height="112" viewBox="0 0 448 112" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M212.658 109.793L4.73114 12.8014C3.23202 12.1078 2.04208 11.2826 1.23007 10.3734C0.41806 9.46425 -3.7107e-07 8.48907 -3.28017e-07 7.50414C-2.84965e-07 6.51921 0.41806 5.54403 1.23007 4.63485C2.04208 3.72567 3.23203 2.90049 4.73114 2.2069C6.21802 1.5076 7.98697 0.952557 9.93604 0.573777C11.8851 0.194998 13.9756 -1.89718e-05 16.0871 -1.88795e-05C18.1985 -1.87872e-05 20.2891 0.194998 22.2382 0.573778C24.1872 0.952558 25.9562 1.5076 27.4431 2.2069L224.014 93.976L420.584 2.20692C423.596 0.802005 427.681 0.0127354 431.94 0.0127356C434.049 0.0127357 436.138 0.206502 438.086 0.582982C440.034 0.959462 441.805 1.51128 443.296 2.20692C444.787 2.90256 445.97 3.72841 446.778 4.63731C447.585 5.54621 448 6.52037 448 7.50416C448 9.49101 446.308 11.3965 443.296 12.8014L235.37 109.793C233.883 110.492 232.114 111.047 230.165 111.426C228.216 111.805 226.125 112 224.014 112C221.902 112 219.812 111.805 217.863 111.426C215.914 111.047 214.145 110.492 212.658 109.793Z" fill="#6B7280"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -1522,7 +1522,12 @@ export const AddServiceModal: FunctionComponent<Props> = ({
|
|||||||
if (description) {
|
if (description) {
|
||||||
serviceDetailsData.push({
|
serviceDetailsData.push({
|
||||||
key: 'Description',
|
key: 'Description',
|
||||||
value: <RichTextEditorPreviewer markdown={description} />,
|
value: (
|
||||||
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
|
markdown={description}
|
||||||
|
/>
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,10 @@ const ChangeLogs = ({ data }: Props) => {
|
|||||||
<div className="tw-border-b tw-mb-2.5 tw-border-text">
|
<div className="tw-border-b tw-mb-2.5 tw-border-text">
|
||||||
<p className="tw-text-base tw-font-medium tw-mb-2.5">{log}</p>
|
<p className="tw-text-base tw-font-medium tw-mb-2.5">{log}</p>
|
||||||
</div>
|
</div>
|
||||||
<RichTextEditorPreviewer markdown={data[log]} />
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
|
markdown={data[log]}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,7 +67,10 @@ const FeaturesCarousel = ({ data }: Props) => {
|
|||||||
<div className="tw-px-1" key={uniqueId()}>
|
<div className="tw-px-1" key={uniqueId()}>
|
||||||
<p className="tw-text-sm tw-font-medium tw-mb-2">{d.title}</p>
|
<p className="tw-text-sm tw-font-medium tw-mb-2">{d.title}</p>
|
||||||
<div className="tw-text-sm tw-mb-3">
|
<div className="tw-text-sm tw-mb-3">
|
||||||
<RichTextEditorPreviewer markdown={d.description} />
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
|
markdown={d.description}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{d.path ? (
|
{d.path ? (
|
||||||
|
@ -50,7 +50,10 @@ const CardListItem: FunctionComponent<Props> = ({
|
|||||||
cardStyle.body.base,
|
cardStyle.body.base,
|
||||||
isActive ? cardStyle.body.active : cardStyle.body.default
|
isActive ? cardStyle.body.active : cardStyle.body.default
|
||||||
)}>
|
)}>
|
||||||
<RichTextEditorPreviewer markdown={card.data} />
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
|
markdown={card.data}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -26,7 +26,7 @@ type Props = {
|
|||||||
owner?: Table['owner'];
|
owner?: Table['owner'];
|
||||||
hasEditAccess?: boolean;
|
hasEditAccess?: boolean;
|
||||||
blurWithBodyBG?: boolean;
|
blurWithBodyBG?: boolean;
|
||||||
removeBlurOnScroll?: boolean;
|
removeBlur?: boolean;
|
||||||
description: string;
|
description: string;
|
||||||
isEdit?: boolean;
|
isEdit?: boolean;
|
||||||
onDescriptionEdit?: () => void;
|
onDescriptionEdit?: () => void;
|
||||||
@ -46,29 +46,35 @@ const Description = ({
|
|||||||
onDescriptionUpdate,
|
onDescriptionUpdate,
|
||||||
isReadOnly = false,
|
isReadOnly = false,
|
||||||
blurWithBodyBG = false,
|
blurWithBodyBG = false,
|
||||||
removeBlurOnScroll = false,
|
removeBlur = false,
|
||||||
entityName,
|
entityName,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
return (
|
return (
|
||||||
<div className="schema-description tw-relative">
|
<div className="schema-description tw-relative">
|
||||||
<div className="tw-px-3 tw-py-1 tw-flex">
|
<div className="tw-px-3 tw-py-1 tw-flex">
|
||||||
<div className="tw-relative">
|
<div className="tw-relative">
|
||||||
{!removeBlurOnScroll && description.length > 800 && (
|
{/* {!removeBlur && description.length > 800 && (
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'tw-absolute tw-inset-0 tw-z-10',
|
'tw-absolute tw-inset-0 tw-z-10',
|
||||||
blurWithBodyBG ? 'on-scroll-blur-body' : 'on-scroll-blur-white'
|
blurWithBodyBG ? 'on-scroll-blur-body' : 'on-scroll-blur-white'
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
)}
|
)} */}
|
||||||
<div
|
<div
|
||||||
className="description tw-h-full tw-overflow-y-scroll tw-max-h-40 tw-min-h-12 tw-relative tw-py-2.5"
|
className="description tw-h-full tw-overflow-y-scroll tw-min-h-12 tw-relative tw-py-2.5"
|
||||||
data-testid="description"
|
data-testid="description"
|
||||||
id="center">
|
id="center">
|
||||||
{description?.trim() ? (
|
{description?.trim() ? (
|
||||||
<RichTextEditorPreviewer
|
<RichTextEditorPreviewer
|
||||||
|
blurClasses={
|
||||||
|
blurWithBodyBG ? 'see-more-blur-body' : 'see-more-blur-white'
|
||||||
|
}
|
||||||
className="tw-p-2"
|
className="tw-p-2"
|
||||||
|
enableSeeMoreVariant={!removeBlur}
|
||||||
markdown={description}
|
markdown={description}
|
||||||
|
maxHtClass="tw-max-h-36"
|
||||||
|
maxLen={800}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<span className="tw-no-description tw-p-2">
|
<span className="tw-no-description tw-p-2">
|
||||||
|
@ -56,7 +56,12 @@ const MarkdownWithPreview = forwardRef<editorRef, Props>(
|
|||||||
return 'Nothing to preview';
|
return 'Nothing to preview';
|
||||||
}
|
}
|
||||||
|
|
||||||
return <RichTextEditorPreviewer markdown={preview} />;
|
return (
|
||||||
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
|
markdown={preview}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
|
@ -18,21 +18,43 @@ import { Link } from 'react-router-dom';
|
|||||||
import rehypeRaw from 'rehype-raw';
|
import rehypeRaw from 'rehype-raw';
|
||||||
import gfm from 'remark-gfm';
|
import gfm from 'remark-gfm';
|
||||||
import { isValidUrl } from '../../../utils/CommonUtils';
|
import { isValidUrl } from '../../../utils/CommonUtils';
|
||||||
|
import SVGIcons, { Icons } from '../../../utils/SvgUtils';
|
||||||
|
|
||||||
|
const MAX_LENGTH = 300;
|
||||||
|
|
||||||
/*eslint-disable */
|
/*eslint-disable */
|
||||||
const RichTextEditorPreviewer = ({
|
const RichTextEditorPreviewer = ({
|
||||||
markdown,
|
markdown,
|
||||||
className = '',
|
className = '',
|
||||||
|
blurClasses = 'see-more-blur',
|
||||||
|
maxHtClass = 'tw-h-24',
|
||||||
|
maxLen = MAX_LENGTH,
|
||||||
|
enableSeeMoreVariant = true,
|
||||||
}: {
|
}: {
|
||||||
markdown: string;
|
markdown: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
blurClasses?: string;
|
||||||
|
maxHtClass?: string;
|
||||||
|
maxLen?: number;
|
||||||
|
enableSeeMoreVariant?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const [content, setContent] = useState<string>('');
|
const [content, setContent] = useState<string>('');
|
||||||
|
const [displayMoreText, setDisplayMoreText] = useState(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setContent(markdown);
|
setContent(markdown);
|
||||||
}, [markdown]);
|
}, [markdown]);
|
||||||
return (
|
return (
|
||||||
<div className={classNames('content-container', className)}>
|
<div
|
||||||
|
className={classNames(
|
||||||
|
'content-container tw-relative',
|
||||||
|
className,
|
||||||
|
enableSeeMoreVariant && markdown.length > maxLen && !displayMoreText
|
||||||
|
? `${maxHtClass} tw-overflow-hidden`
|
||||||
|
: null,
|
||||||
|
{
|
||||||
|
'tw-mb-5': displayMoreText,
|
||||||
|
}
|
||||||
|
)}>
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
children={content
|
children={content
|
||||||
.replaceAll(/</g, '<')
|
.replaceAll(/</g, '<')
|
||||||
@ -78,6 +100,30 @@ const RichTextEditorPreviewer = ({
|
|||||||
remarkPlugins={[gfm] as unknown as PluggableList | undefined}
|
remarkPlugins={[gfm] as unknown as PluggableList | undefined}
|
||||||
rehypePlugins={[[rehypeRaw, { allowDangerousHtml: false }]]}
|
rehypePlugins={[[rehypeRaw, { allowDangerousHtml: false }]]}
|
||||||
/>
|
/>
|
||||||
|
{enableSeeMoreVariant && markdown.length > MAX_LENGTH && (
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
'tw-absolute tw-flex tw-h-full tw-w-full tw-inset-x-0',
|
||||||
|
!displayMoreText ? blurClasses : null,
|
||||||
|
{
|
||||||
|
'tw-top-0 tw-bottom-0': !displayMoreText,
|
||||||
|
' tw--bottom-4': displayMoreText,
|
||||||
|
}
|
||||||
|
)}>
|
||||||
|
<p
|
||||||
|
className="tw-cursor-pointer tw-self-end tw-pointer-events-auto tw-text-primary tw-mx-auto"
|
||||||
|
onClick={() => setDisplayMoreText((pre) => !pre)}>
|
||||||
|
<span className="tw-flex tw-items-center tw-gap-2">
|
||||||
|
<SVGIcons
|
||||||
|
alt="expand-collapse"
|
||||||
|
className={classNames({ 'rotate-inverse': displayMoreText })}
|
||||||
|
width="32"
|
||||||
|
icon={Icons.CHEVRON_DOWN}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -62,7 +62,10 @@ const TableDataCardBody: FunctionComponent<Props> = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="description-text" data-testid="description-text">
|
<div className="description-text" data-testid="description-text">
|
||||||
{description.trim() ? (
|
{description.trim() ? (
|
||||||
<RichTextEditorPreviewer markdown={description} />
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
|
markdown={description}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<span className="tw-no-description">No description added</span>
|
<span className="tw-no-description">No description added</span>
|
||||||
)}
|
)}
|
||||||
|
@ -557,6 +557,7 @@ const RolesPage = () => {
|
|||||||
className="tw-mb-3 tw--ml-5"
|
className="tw-mb-3 tw--ml-5"
|
||||||
data-testid="description-container">
|
data-testid="description-container">
|
||||||
<Description
|
<Description
|
||||||
|
blurWithBodyBG
|
||||||
description={currentRole?.description || ''}
|
description={currentRole?.description || ''}
|
||||||
entityName={currentRole?.displayName}
|
entityName={currentRole?.displayName}
|
||||||
isEdit={isEditable}
|
isEdit={isEditable}
|
||||||
|
@ -560,6 +560,7 @@ const ServicesPage = () => {
|
|||||||
data-testid="service-description">
|
data-testid="service-description">
|
||||||
{service.description ? (
|
{service.description ? (
|
||||||
<RichTextEditorPreviewer
|
<RichTextEditorPreviewer
|
||||||
|
enableSeeMoreVariant={false}
|
||||||
markdown={service.description}
|
markdown={service.description}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
@ -333,6 +333,10 @@
|
|||||||
animation: highlight 3000ms ease-out;
|
animation: highlight 3000ms ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rotate-inverse {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes highlight {
|
@keyframes highlight {
|
||||||
0% {
|
0% {
|
||||||
@apply tw-bg-warning-lite;
|
@apply tw-bg-warning-lite;
|
||||||
|
@ -844,3 +844,38 @@ body .profiler-graph .recharts-active-dot circle {
|
|||||||
);
|
);
|
||||||
pointer-events: none; /* so the text is still selectable */
|
pointer-events: none; /* so the text is still selectable */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.see-more-blur-white {
|
||||||
|
background: linear-gradient(
|
||||||
|
to top,
|
||||||
|
rgba(255, 255, 255, 1) 10%,
|
||||||
|
rgba(255, 255, 255, 0) 36%
|
||||||
|
);
|
||||||
|
pointer-events: none; /* so the text is still selectable */
|
||||||
|
}
|
||||||
|
|
||||||
|
.see-more-blur-body {
|
||||||
|
background: linear-gradient(
|
||||||
|
to top,
|
||||||
|
rgba(248, 249, 250, 1) 10%,
|
||||||
|
rgba(255, 255, 255, 0) 36%
|
||||||
|
);
|
||||||
|
pointer-events: none; /* so the text is still selectable */
|
||||||
|
}
|
||||||
|
|
||||||
|
.see-more-blur {
|
||||||
|
background: linear-gradient(
|
||||||
|
to top,
|
||||||
|
rgba(255, 255, 255, 1) 20%,
|
||||||
|
rgba(255, 255, 255, 0) 42%
|
||||||
|
);
|
||||||
|
pointer-events: none; /* so the text is still selectable */
|
||||||
|
}
|
||||||
|
.tableBody-row:hover .see-more-blur {
|
||||||
|
background: linear-gradient(
|
||||||
|
to top,
|
||||||
|
rgba(245, 246, 248, 1) 20%,
|
||||||
|
rgba(255, 255, 255, 0) 42%
|
||||||
|
);
|
||||||
|
pointer-events: none; /* so the text is still selectable */
|
||||||
|
}
|
||||||
|
@ -76,6 +76,7 @@ import IconTrends from '../assets/svg/ic-trends.svg';
|
|||||||
import IconUpArrow from '../assets/svg/ic-up-arrow.svg';
|
import IconUpArrow from '../assets/svg/ic-up-arrow.svg';
|
||||||
import IconVEllipsis from '../assets/svg/ic-v-ellipsis.svg';
|
import IconVEllipsis from '../assets/svg/ic-v-ellipsis.svg';
|
||||||
import IconWorkflows from '../assets/svg/ic-workflows.svg';
|
import IconWorkflows from '../assets/svg/ic-workflows.svg';
|
||||||
|
import IconChevronDown from '../assets/svg/icon-chevron-down.svg';
|
||||||
import IconKey from '../assets/svg/icon-key.svg';
|
import IconKey from '../assets/svg/icon-key.svg';
|
||||||
import IconNotNull from '../assets/svg/icon-notnull.svg';
|
import IconNotNull from '../assets/svg/icon-notnull.svg';
|
||||||
import IconTour from '../assets/svg/icon-tour.svg';
|
import IconTour from '../assets/svg/icon-tour.svg';
|
||||||
@ -229,6 +230,7 @@ export const Icons = {
|
|||||||
ARROW_DOWN_PRIMARY: 'icon-arrow-down-primary',
|
ARROW_DOWN_PRIMARY: 'icon-arrow-down-primary',
|
||||||
ANNOUNCEMENT: 'icon-announcement',
|
ANNOUNCEMENT: 'icon-announcement',
|
||||||
ANNOUNCEMENT_WHITE: 'icon-announcement-white',
|
ANNOUNCEMENT_WHITE: 'icon-announcement-white',
|
||||||
|
CHEVRON_DOWN: 'icon-chevron-down',
|
||||||
};
|
};
|
||||||
|
|
||||||
const SVGIcons: FunctionComponent<Props> = ({
|
const SVGIcons: FunctionComponent<Props> = ({
|
||||||
@ -660,6 +662,10 @@ const SVGIcons: FunctionComponent<Props> = ({
|
|||||||
case Icons.ANNOUNCEMENT_WHITE:
|
case Icons.ANNOUNCEMENT_WHITE:
|
||||||
IconComponent = IconAnnouncementWhite;
|
IconComponent = IconAnnouncementWhite;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case Icons.CHEVRON_DOWN:
|
||||||
|
IconComponent = IconChevronDown;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user