Skip to content

Commit

Permalink
:ref: revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
michellewzhang committed Aug 27, 2024
1 parent 4c20558 commit 286502e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
22 changes: 5 additions & 17 deletions static/app/components/events/highlights/editHighlightsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ function EditTagHighlightSection({
...props
}: EditTagHighlightSectionProps) {
const [tagFilter, setTagFilter] = useState('');
// filter out replayId because we don't want to expose
// this on issue details anymore
const tagData = event.tags
.filter(tag => tag.key?.includes(tagFilter) && tag.key !== 'replayId')
.filter(tag => tag.key?.includes(tagFilter))
.map(tag => tag.key);
const tagColumnSize = Math.ceil(tagData.length / columnCount);
const tagColumns: React.ReactNode[] = [];
Expand Down Expand Up @@ -251,17 +249,12 @@ function EditContextHighlightSection({
const ctxItems = Object.entries(ctxData);
const filteredCtxItems = ctxItems
.map<[string, string[]]>(([contextType, contextKeys]) => {
// filter out replayId because we don't want to expose
// this on issue details anymore
const filteredContextKeys = contextKeys.filter(
contextKey =>
(contextKey.includes(ctxFilter) || contextType.includes(ctxFilter)) &&
contextKey !== 'replay_id'
contextKey => contextKey.includes(ctxFilter) || contextType.includes(ctxFilter)
);
return [contextType, filteredContextKeys];
})
.filter(([_contextType, contextKeys]) => contextKeys.length !== 0);

const ctxColumnSize = Math.ceil(filteredCtxItems.length / columnCount);
const contextColumns: React.ReactNode[] = [];
for (let i = 0; i < filteredCtxItems.length; i += ctxColumnSize) {
Expand Down Expand Up @@ -338,14 +331,9 @@ export default function EditHighlightsModal({
project,
closeModal,
}: EditHighlightsModalProps) {
const {replay, ...rest} = prevHighlightContext;
const [highlightContext, setHighlightContext] = useState<HighlightContext>({
...(replay && {replay: replay?.filter(k => k !== 'replay_id')}),
...rest,
});
const [highlightTags, setHighlightTags] = useState<HighlightTags>(
prevHighlightTags.filter(p => p !== 'replayId')
);
const [highlightContext, setHighlightContext] =
useState<HighlightContext>(prevHighlightContext);
const [highlightTags, setHighlightTags] = useState<HighlightTags>(prevHighlightTags);

const organization = useOrganization();

Expand Down
12 changes: 2 additions & 10 deletions static/app/components/events/highlights/highlightsDataSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,11 @@ function HighlightsData({
const hasDisabledHighlights =
Object.values(highlightContext).flat().length === 0 && highlightTags.length === 0;

const {replay, ...rest} = highlightContext;

const highlightContextDataItems = getHighlightContextData({
event,
project,
organization,
highlightContext: {
...(replay && {replay: replay?.filter(k => k !== 'replay_id')}),
...rest,
},
highlightContext,
location,
});
const highlightContextRows = highlightContextDataItems.reduce<React.ReactNode[]>(
Expand All @@ -170,10 +165,7 @@ function HighlightsData({
[]
);

const highlightTagItems = getHighlightTagData({
event,
highlightTags: highlightTags.filter(h => h !== 'replayId'),
});
const highlightTagItems = getHighlightTagData({event, highlightTags});

const highlightTagRows = highlightTagItems.map((content, i) => (
<EventTagsTreeRow
Expand Down

0 comments on commit 286502e

Please sign in to comment.