Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion static/app/utils/discover/eventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ class EventView {
'sorts',
'project',
'environment',
'display',
'topEvents',
];

Expand Down Expand Up @@ -547,6 +546,13 @@ class EventView {
return false;
}

// compare Display Mode selections
// undefined Display Mode values default to "default"
const currentDisplayMode = this.display ?? DisplayModes.DEFAULT;
const otherDisplayMode = other.display ?? DisplayModes.DEFAULT;
if (!isEqual(currentDisplayMode, otherDisplayMode)) {
return false;
}
return true;
}

Expand Down
19 changes: 19 additions & 0 deletions tests/js/spec/utils/discover/eventView.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,25 @@ describe('EventView.isEqualTo()', function () {
expect(eventView.isEqualTo(eventView2)).toBe(false);
}
});

it('undefined display type equals default display type', function () {
const state = {
id: '1234',
name: 'best query',
fields: [{field: 'count()'}, {field: 'project.id'}],
sorts: generateSorts(['count']),
query: 'event.type:error',
project: [42],
start: '2019-10-01T00:00:00',
end: '2019-10-02T00:00:00',
statsPeriod: '14d',
environment: ['staging'],
yAxis: 'fam',
};
const eventView = new EventView(state);
const eventView2 = new EventView({...state, display: 'default'});
expect(eventView.isEqualTo(eventView2)).toBe(true);
});
});

describe('EventView.getResultsViewUrlTarget()', function () {
Expand Down