Skip to content

Commit

Permalink
fix issue with Details in secure RTE
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmars committed Dec 13, 2024
1 parent c9ef304 commit a14c4c7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions src/components/Pega_Extensions_SecureRichText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useRef, useEffect, useState } from 'react';
import DOMPurify from 'dompurify';
import type { Editor as TinymceEditor } from 'tinymce/tinymce';
import { Editor, RichTextViewer, type EditorState } from '@pega/cosmos-react-rte';
import { Details } from '@pega/cosmos-react-work';
import { FieldValueItem, NoValue, withConfiguration } from '@pega/cosmos-react-core';
import { Details, DetailsList } from '@pega/cosmos-react-work';
import { NoValue, withConfiguration } from '@pega/cosmos-react-core';

import { formatExists, textFormatter } from './utils';
import '../create-nonce';
Expand Down Expand Up @@ -143,9 +143,22 @@ export const PegaExtensionsSecureRichText = (props: RichTextProps) => {
richTextComponent = hideLabel ? (
displayComponent
) : (
<Details>
<FieldValueItem name={label} value={displayComponent} variant='stacked' />
</Details>
<Details
name='Details'
columns={{
a: (
<DetailsList
items={[
{
id: label,
name: label,
value: displayComponent
}
]}
/>
)
}}
/>
);
} else {
// Rich Text editable component
Expand Down

0 comments on commit a14c4c7

Please sign in to comment.