Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(audit): removing discover banner round 2 #84384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
148 changes: 0 additions & 148 deletions static/app/views/discover/banner.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions static/app/views/discover/homepage.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,6 @@ describe('Discover > Homepage', () => {
});
});

it('renders the Discover banner', async () => {
render(
<Homepage
organization={organization}
location={initialData.router.location}
router={initialData.router}
setSavedQuery={jest.fn()}
loading={false}
/>,
{router: initialData.router, organization: initialData.organization}
);

await screen.findByText('Discover Trends');
screen.getByText('Get a Tour');

expect(screen.queryByText('Build a new query')).not.toBeInTheDocument();
});

it('fetches from the homepage URL and renders fields, async page filters, async and chart information', async () => {
render(
<Homepage
Expand Down
27 changes: 1 addition & 26 deletions static/app/views/discover/resultsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Component, Fragment} from 'react';
import styled from '@emotion/styled';
import type {Location} from 'history';
import {stringify} from 'query-string';

import {fetchHomepageQuery} from 'sentry/actionCreators/discoverHomepageQueries';
import {fetchSavedQuery} from 'sentry/actionCreators/discoverSavedQueries';
Expand All @@ -15,15 +14,13 @@ import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {InjectedRouter} from 'sentry/types/legacyReactRouter';
import type {Organization, SavedQuery} from 'sentry/types/organization';
import EventView from 'sentry/utils/discover/eventView';
import type EventView from 'sentry/utils/discover/eventView';
import type {SavedQueryDatasets} from 'sentry/utils/discover/types';
import withApi from 'sentry/utils/withApi';
import {DatasetSelectorTabs} from 'sentry/views/discover/savedQuery/datasetSelectorTabs';
import {getSavedQueryWithDataset} from 'sentry/views/discover/savedQuery/utils';

import Banner from './banner';
import DiscoverBreadcrumb from './breadcrumb';
import {DEFAULT_EVENT_VIEW} from './data';
import EventInputName from './eventInputName';
import SavedQueryButtonGroup from './savedQuery';

Expand Down Expand Up @@ -129,23 +126,6 @@ class ResultsHeader extends Component<Props, State> {
);
}

renderBanner() {
const {location, organization} = this.props;
const eventView = EventView.fromNewQueryWithLocation(DEFAULT_EVENT_VIEW, location);
const to = eventView.getResultsViewUrlTarget(organization.slug);
const resultsUrl = `${to.pathname}?${stringify(to.query)}`;

return (
<BannerWrapper>
<Banner
organization={organization}
resultsUrl={resultsUrl}
showBuildNewQueryButton={false}
/>
</BannerWrapper>
);
}

render() {
const {
organization,
Expand Down Expand Up @@ -235,7 +215,6 @@ class ResultsHeader extends Component<Props, State> {
homepageQuery={homepageQuery}
/>
</Layout.HeaderActions>
{isHomepage && this.renderBanner()}
<Feature
organization={organization}
features="performance-discover-dataset-selector"
Expand Down Expand Up @@ -263,8 +242,4 @@ const Subtitle = styled('h4')`
margin: ${space(0.5)} 0 0 0;
`;

const BannerWrapper = styled('div')`
grid-column: 1 / -1;
`;

export default withApi(ResultsHeader);
Loading