mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 05:19:04 +08:00
fix: strip starting and ending quotes from field value on copy to clipboard (#5831)
This commit is contained in:
parent
4a9847abdd
commit
266894b0f8
@ -67,7 +67,6 @@ export function TableViewActions(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState<boolean>(false);
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
||||||
const textToCopy = fieldData.value;
|
|
||||||
|
|
||||||
if (record.field === 'body') {
|
if (record.field === 'body') {
|
||||||
const parsedBody = recursiveParseJSON(fieldData.value);
|
const parsedBody = recursiveParseJSON(fieldData.value);
|
||||||
@ -89,6 +88,17 @@ export function TableViewActions(
|
|||||||
: { __html: '' };
|
: { __html: '' };
|
||||||
|
|
||||||
const fieldFilterKey = filterKeyForField(fieldData.field);
|
const fieldFilterKey = filterKeyForField(fieldData.field);
|
||||||
|
let textToCopy = fieldData.value;
|
||||||
|
|
||||||
|
// remove starting and ending quotes from the value
|
||||||
|
try {
|
||||||
|
textToCopy = textToCopy.replace(/^"|"$/g, '');
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
'Failed to remove starting and ending quotes from the value',
|
||||||
|
error,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cx('value-field', isOpen ? 'open-popover' : '')}>
|
<div className={cx('value-field', isOpen ? 'open-popover' : '')}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user