Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Oct 2, 2020
1 parent 023fe87 commit fb5e59d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
StyledTime,
GeneratedText,
noTimestampRetrievedText,
CopyFieldButton,
CopyablePanelField,
} from './panel_content_utilities';
import { Breadcrumbs } from './breadcrumbs';
import * as eventModel from '../../../../common/endpoint/models/event';
Expand Down Expand Up @@ -158,7 +158,7 @@ function EventDetailFields({ event }: { event: SafeResolverEvent }) {
descriptions: deepObjectEntries(value).map(([path, fieldValue]) => ({
title: <GeneratedText>{path.join('.')}</GeneratedText>,
description: (
<CopyFieldButton
<CopyablePanelField
textToCopy={String(fieldValue)}
content={<GeneratedText>{String(fieldValue)}</GeneratedText>}
/>
Expand All @@ -184,7 +184,6 @@ function EventDetailFields({ event }: { event: SafeResolverEvent }) {
</EuiTextColor>
</EuiTitle>
<EuiSpacer size="m" />

<StyledDescriptionList
type="column"
align="left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { EuiDescriptionListProps } from '@elastic/eui/src/components/description
import { StyledDescriptionList, StyledTitle } from './styles';
import * as selectors from '../../store/selectors';
import * as eventModel from '../../../../common/endpoint/models/event';
import { CopyFieldButton, GeneratedText } from './panel_content_utilities';
import { CopyablePanelField, GeneratedText } from './panel_content_utilities';
import { Breadcrumbs } from './breadcrumbs';
import { processPath, processPID } from '../../models/process_event';
import { CubeForProcess } from './cube_for_process';
Expand Down Expand Up @@ -128,7 +128,7 @@ const NodeDetailView = memo(function ({
return {
...entry,
description: (
<CopyFieldButton
<CopyablePanelField
textToCopy={String(entry.description)}
content={<GeneratedText>{String(entry.description)}</GeneratedText>}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { SafeResolverEvent } from '../../../../common/endpoint/types';
import { ResolverAction } from '../../store/actions';
import { useFormattedDate } from './use_formatted_date';
import { getEmptyTagValue } from '../../../common/components/empty_value';
import { CopyFieldButton } from './panel_content_utilities';
import { CopyablePanelField } from './panel_content_utilities';

interface ProcessTableView {
name?: string;
Expand Down Expand Up @@ -216,7 +216,7 @@ const NodeDetailTimestamp = memo(({ eventDate }: { eventDate: Date | undefined }
const formattedDate = useFormattedDate(eventDate);

return formattedDate ? (
<CopyFieldButton textToCopy={formattedDate} content={formattedDate} />
<CopyablePanelField textToCopy={formattedDate} content={formattedDate} />
) : (
getEmptyTagValue()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const StyledCopyableField = styled.div<StyledCopyableField>`
}
`;

export const CopyFieldButton = memo(
export const CopyablePanelField = memo(
({ textToCopy, content }: { textToCopy: string; content: JSX.Element | string }) => {
const { linkColor, pillStroke } = useColors();
const [isOpen, setIsOpen] = useState(false);
Expand Down

0 comments on commit fb5e59d

Please sign in to comment.