Skip to content

Commit

Permalink
[Discover with Legacy Table] fix copy issue and open feedbacks in a n…
Browse files Browse the repository at this point in the history
…ew tab (#5761)

* add a colon (:) after the key
* ensure there's a space between each key-value pair
* allow feedback url to open in a new tab

Signed-off-by: Anan Z <ananzh@amazon.com>
  • Loading branch information
ananzh committed Jan 31, 2024
1 parent 8efba88 commit 32d8107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ export function fetchSourceTypeDataCell(
return <span>{stringify(row[columnId], null, 2)}</span>;
}
const formattedRow = idxPattern.formatHit(row);
const keys = Object.keys(formattedRow);

return (
<EuiDescriptionList type="inline" compressed>
{Object.keys(formattedRow).map((key) => (
{keys.map((key, index) => (
<Fragment key={key}>
<EuiDescriptionListTitle className="osdDescriptionListFieldTitle">
{key}
{key + ':'}
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
dangerouslySetInnerHTML={{ __html: dompurify.sanitize(formattedRow[key]) }}
/>
{index !== keys.length - 1 && ' '}
</Fragment>
))}
</EuiDescriptionList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export const TableFeedbacksPanel = ({ onClose, onTurnOff }: TableFeedbacksPanelP
<p>
Event tables: Documents are now expanded through a flyout. Density, column order, and
sorting controls have been improved.{' '}
<a href="https://survey.opensearch.org">Provide feedbacks</a>.
<a href="https://survey.opensearch.org" target="_blank" rel="noopener noreferrer">
Provide feedbacks
</a>
</p>
</EuiText>
</EuiModalBody>
Expand Down

0 comments on commit 32d8107

Please sign in to comment.