index.tsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. import {Fragment} from 'react';
  2. import {forceCheck} from 'react-lazyload';
  3. import {RouteComponentProps} from 'react-router';
  4. import styled from '@emotion/styled';
  5. import pick from 'lodash/pick';
  6. import {fetchTagValues} from 'sentry/actionCreators/tags';
  7. import {Client} from 'sentry/api';
  8. import {Alert} from 'sentry/components/alert';
  9. import GuideAnchor from 'sentry/components/assistant/guideAnchor';
  10. import EmptyMessage from 'sentry/components/emptyMessage';
  11. import FloatingFeedbackWidget from 'sentry/components/feedback/widget/floatingFeedbackWidget';
  12. import * as Layout from 'sentry/components/layouts/thirds';
  13. import ExternalLink from 'sentry/components/links/externalLink';
  14. import LoadingIndicator from 'sentry/components/loadingIndicator';
  15. import NoProjectMessage from 'sentry/components/noProjectMessage';
  16. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  17. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  18. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  19. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  20. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  21. import Pagination from 'sentry/components/pagination';
  22. import Panel from 'sentry/components/panels/panel';
  23. import SmartSearchBar from 'sentry/components/smartSearchBar';
  24. import {ItemType} from 'sentry/components/smartSearchBar/types';
  25. import {getRelativeSummary} from 'sentry/components/timeRangeSelector/utils';
  26. import {DEFAULT_STATS_PERIOD} from 'sentry/constants';
  27. import {ALL_ACCESS_PROJECTS} from 'sentry/constants/pageFilters';
  28. import {releaseHealth} from 'sentry/data/platformCategories';
  29. import {IconSearch} from 'sentry/icons';
  30. import {t} from 'sentry/locale';
  31. import ProjectsStore from 'sentry/stores/projectsStore';
  32. import {space} from 'sentry/styles/space';
  33. import {
  34. Organization,
  35. PageFilters,
  36. Project,
  37. Release,
  38. ReleaseStatus,
  39. Tag,
  40. } from 'sentry/types';
  41. import {trackAnalytics} from 'sentry/utils/analytics';
  42. import {SEMVER_TAGS} from 'sentry/utils/discover/fields';
  43. import Projects from 'sentry/utils/projects';
  44. import routeTitleGen from 'sentry/utils/routeTitle';
  45. import withApi from 'sentry/utils/withApi';
  46. import withOrganization from 'sentry/utils/withOrganization';
  47. import withPageFilters from 'sentry/utils/withPageFilters';
  48. import withProjects from 'sentry/utils/withProjects';
  49. import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView';
  50. import Header from '../components/header';
  51. import ReleaseFeedbackBanner from '../components/releaseFeedbackBanner';
  52. import ReleaseArchivedNotice from '../detail/overview/releaseArchivedNotice';
  53. import {isMobileRelease} from '../utils';
  54. import {fetchThresholdStatuses} from '../utils/fetchThresholdStatus';
  55. import {ThresholdStatus, ThresholdStatusesQuery} from '../utils/types';
  56. import ReleaseCard from './releaseCard';
  57. import ReleasesAdoptionChart from './releasesAdoptionChart';
  58. import ReleasesDisplayOptions, {ReleasesDisplayOption} from './releasesDisplayOptions';
  59. import ReleasesPromo from './releasesPromo';
  60. import ReleasesRequest from './releasesRequest';
  61. import ReleasesSortOptions, {ReleasesSortOption} from './releasesSortOptions';
  62. import ReleasesStatusOptions, {ReleasesStatusOption} from './releasesStatusOptions';
  63. type RouteParams = {
  64. orgId: string;
  65. };
  66. type Props = RouteComponentProps<RouteParams, {}> & {
  67. api: Client;
  68. organization: Organization;
  69. projects: Project[];
  70. selection: PageFilters;
  71. };
  72. type State = {
  73. releases: Release[];
  74. thresholdStatuses?: {[key: string]: ThresholdStatus[]};
  75. } & DeprecatedAsyncView['state'];
  76. class ReleasesList extends DeprecatedAsyncView<Props, State> {
  77. shouldReload = true;
  78. shouldRenderBadRequests = true;
  79. hasV2ReleaseUIEnabled =
  80. this.props.organization.features.includes('releases-v2') ||
  81. this.props.organization.features.includes('releases-v2-st');
  82. getTitle() {
  83. return routeTitleGen(t('Releases'), this.props.organization.slug, false);
  84. }
  85. getEndpoints(): ReturnType<DeprecatedAsyncView['getEndpoints']> {
  86. const {organization, location} = this.props;
  87. const {statsPeriod} = location.query;
  88. const activeSort = this.getSort();
  89. const activeStatus = this.getStatus();
  90. const query = {
  91. ...pick(location.query, ['project', 'environment', 'cursor', 'query', 'sort']),
  92. summaryStatsPeriod: statsPeriod,
  93. per_page: 20,
  94. flatten: activeSort === ReleasesSortOption.DATE ? 0 : 1,
  95. adoptionStages: 1,
  96. status:
  97. activeStatus === ReleasesStatusOption.ARCHIVED
  98. ? ReleaseStatus.ARCHIVED
  99. : ReleaseStatus.ACTIVE,
  100. };
  101. const endpoints: ReturnType<DeprecatedAsyncView['getEndpoints']> = [
  102. [
  103. 'releases', // stateKey
  104. `/organizations/${organization.slug}/releases/`, // endpoint
  105. {query}, // params
  106. {disableEntireQuery: true}, // options
  107. ],
  108. ];
  109. return endpoints;
  110. }
  111. componentDidUpdate(prevProps: Props, prevState: State) {
  112. super.componentDidUpdate(prevProps, prevState);
  113. if (prevState.releases !== this.state.releases) {
  114. /**
  115. * Manually trigger checking for elements in viewport.
  116. * Helpful when LazyLoad components enter the viewport without resize or scroll events,
  117. * https://github.com/twobin/react-lazyload#forcecheck
  118. *
  119. * HealthStatsCharts are being rendered only when they are scrolled into viewport.
  120. * This is how we re-check them without scrolling once releases change as this view
  121. * uses shouldReload=true and there is no reloading happening.
  122. */
  123. forceCheck();
  124. if (this.hasV2ReleaseUIEnabled) {
  125. // Refetch new threshold statuses if new releases are fetched
  126. this.fetchThresholdStatuses();
  127. }
  128. }
  129. }
  130. fetchThresholdStatuses() {
  131. const {selection, organization, api} = this.props;
  132. const {releases} = this.state;
  133. if (releases.length < 1) {
  134. return;
  135. }
  136. // Grab earliest release and latest release - then fetch all statuses within
  137. const fuzzSec = 30;
  138. const initialRelease = releases[0];
  139. let start = new Date(new Date(initialRelease.dateCreated).getTime() - fuzzSec * 1000);
  140. let end = new Date(new Date(initialRelease.dateCreated).getTime() + fuzzSec * 1000);
  141. const releaseVersions: string[] = [];
  142. releases.forEach(release => {
  143. const created = new Date(release.dateCreated);
  144. if (created < start) {
  145. start = created;
  146. }
  147. if (created > end) {
  148. end = created;
  149. }
  150. releaseVersions.push(release.version);
  151. });
  152. const query: ThresholdStatusesQuery = {
  153. start: start.toISOString(),
  154. end: end.toISOString(),
  155. release: releaseVersions,
  156. };
  157. if (selection.projects.length) {
  158. query.project = this.getSelectedProjectSlugs();
  159. }
  160. if (selection.environments.length) {
  161. query.environment = selection.environments;
  162. }
  163. fetchThresholdStatuses(organization, api, query).then(thresholdStatuses => {
  164. this.setState({thresholdStatuses});
  165. });
  166. }
  167. getQuery() {
  168. const {query} = this.props.location.query;
  169. return typeof query === 'string' ? query : undefined;
  170. }
  171. getSort(): ReleasesSortOption {
  172. const {environments} = this.props.selection;
  173. const {sort} = this.props.location.query;
  174. // Require 1 environment for date adopted
  175. if (sort === ReleasesSortOption.ADOPTION && environments.length !== 1) {
  176. return ReleasesSortOption.DATE;
  177. }
  178. const sortExists = Object.values(ReleasesSortOption).includes(sort);
  179. if (sortExists) {
  180. return sort;
  181. }
  182. return ReleasesSortOption.DATE;
  183. }
  184. getDisplay(): ReleasesDisplayOption {
  185. const {display} = this.props.location.query;
  186. switch (display) {
  187. case ReleasesDisplayOption.USERS:
  188. return ReleasesDisplayOption.USERS;
  189. default:
  190. return ReleasesDisplayOption.SESSIONS;
  191. }
  192. }
  193. getStatus(): ReleasesStatusOption {
  194. const {status} = this.props.location.query;
  195. switch (status) {
  196. case ReleasesStatusOption.ARCHIVED:
  197. return ReleasesStatusOption.ARCHIVED;
  198. default:
  199. return ReleasesStatusOption.ACTIVE;
  200. }
  201. }
  202. getSelectedProject(): Project | undefined {
  203. const {selection, projects} = this.props;
  204. const selectedProjectId =
  205. selection.projects && selection.projects.length === 1 && selection.projects[0];
  206. return projects?.find(p => p.id === `${selectedProjectId}`);
  207. }
  208. getSelectedProjectSlugs(): string[] {
  209. const {selection, projects} = this.props;
  210. const projIdSet = new Set(selection.projects);
  211. return projects.reduce((result: string[], proj) => {
  212. if (projIdSet.has(Number(proj.id))) {
  213. result.push(proj.slug);
  214. }
  215. return result;
  216. }, []);
  217. }
  218. get projectHasSessions() {
  219. return this.getSelectedProject()?.hasSessions ?? null;
  220. }
  221. handleSearch = (query: string) => {
  222. const {location, router} = this.props;
  223. router.push({
  224. ...location,
  225. query: {...location.query, cursor: undefined, query},
  226. });
  227. };
  228. handleSortBy = (sort: string) => {
  229. const {location, router} = this.props;
  230. router.push({
  231. ...location,
  232. query: {...location.query, cursor: undefined, sort},
  233. });
  234. };
  235. handleDisplay = (display: string) => {
  236. const {location, router} = this.props;
  237. let sort = location.query.sort;
  238. if (
  239. sort === ReleasesSortOption.USERS_24_HOURS &&
  240. display === ReleasesDisplayOption.SESSIONS
  241. ) {
  242. sort = ReleasesSortOption.SESSIONS_24_HOURS;
  243. } else if (
  244. sort === ReleasesSortOption.SESSIONS_24_HOURS &&
  245. display === ReleasesDisplayOption.USERS
  246. ) {
  247. sort = ReleasesSortOption.USERS_24_HOURS;
  248. } else if (
  249. sort === ReleasesSortOption.CRASH_FREE_USERS &&
  250. display === ReleasesDisplayOption.SESSIONS
  251. ) {
  252. sort = ReleasesSortOption.CRASH_FREE_SESSIONS;
  253. } else if (
  254. sort === ReleasesSortOption.CRASH_FREE_SESSIONS &&
  255. display === ReleasesDisplayOption.USERS
  256. ) {
  257. sort = ReleasesSortOption.CRASH_FREE_USERS;
  258. }
  259. router.push({
  260. ...location,
  261. query: {...location.query, cursor: undefined, display, sort},
  262. });
  263. };
  264. handleStatus = (status: string) => {
  265. const {location, router} = this.props;
  266. router.push({
  267. ...location,
  268. query: {...location.query, cursor: undefined, status},
  269. });
  270. };
  271. trackAddReleaseHealth = () => {
  272. const {organization, selection} = this.props;
  273. if (organization.id && selection.projects[0]) {
  274. trackAnalytics('releases_list.click_add_release_health', {
  275. organization,
  276. project_id: selection.projects[0],
  277. });
  278. }
  279. };
  280. tagValueLoader = (key: string, search: string) => {
  281. const {location, organization} = this.props;
  282. const {project: projectId} = location.query;
  283. return fetchTagValues({
  284. api: this.api,
  285. orgSlug: organization.slug,
  286. tagKey: key,
  287. search,
  288. projectIds: projectId ? [projectId] : undefined,
  289. endpointParams: location.query,
  290. });
  291. };
  292. getTagValues = async (tag: Tag, currentQuery: string): Promise<string[]> => {
  293. const values = await this.tagValueLoader(tag.key, currentQuery);
  294. return values.map(({value}) => value);
  295. };
  296. shouldShowLoadingIndicator() {
  297. const {loading, releases, reloading} = this.state;
  298. return (loading && !reloading) || (loading && !releases?.length);
  299. }
  300. renderLoading() {
  301. return this.renderBody();
  302. }
  303. renderError() {
  304. return this.renderBody();
  305. }
  306. get shouldShowQuickstart() {
  307. const {releases} = this.state;
  308. const selectedProject = this.getSelectedProject();
  309. const hasReleasesSetup = selectedProject?.features.includes('releases');
  310. return !releases?.length && !hasReleasesSetup && selectedProject;
  311. }
  312. renderEmptyMessage() {
  313. const {location} = this.props;
  314. const {statsPeriod, start, end} = location.query;
  315. const searchQuery = this.getQuery();
  316. const activeSort = this.getSort();
  317. const activeStatus = this.getStatus();
  318. const selectedPeriod =
  319. !!start && !!end
  320. ? t('time range')
  321. : getRelativeSummary(statsPeriod || DEFAULT_STATS_PERIOD).toLowerCase();
  322. if (searchQuery && searchQuery.length) {
  323. return (
  324. <Panel>
  325. <EmptyMessage icon={<IconSearch size="xl" />} size="large">{`${t(
  326. 'There are no releases that match'
  327. )}: '${searchQuery}'.`}</EmptyMessage>
  328. </Panel>
  329. );
  330. }
  331. if (activeSort === ReleasesSortOption.USERS_24_HOURS) {
  332. return (
  333. <Panel>
  334. <EmptyMessage icon={<IconSearch size="xl" />} size="large">
  335. {t(
  336. 'There are no releases with active user data (users in the last 24 hours).'
  337. )}
  338. </EmptyMessage>
  339. </Panel>
  340. );
  341. }
  342. if (activeSort === ReleasesSortOption.SESSIONS_24_HOURS) {
  343. return (
  344. <Panel>
  345. <EmptyMessage icon={<IconSearch size="xl" />} size="large">
  346. {t(
  347. 'There are no releases with active session data (sessions in the last 24 hours).'
  348. )}
  349. </EmptyMessage>
  350. </Panel>
  351. );
  352. }
  353. if (
  354. activeSort === ReleasesSortOption.BUILD ||
  355. activeSort === ReleasesSortOption.SEMVER
  356. ) {
  357. return (
  358. <Panel>
  359. <EmptyMessage icon={<IconSearch size="xl" />} size="large">
  360. {t('There are no releases with semantic versioning.')}
  361. </EmptyMessage>
  362. </Panel>
  363. );
  364. }
  365. if (activeSort !== ReleasesSortOption.DATE) {
  366. return (
  367. <Panel>
  368. <EmptyMessage icon={<IconSearch size="xl" />} size="large">
  369. {`${t('There are no releases with data in the')} ${selectedPeriod}.`}
  370. </EmptyMessage>
  371. </Panel>
  372. );
  373. }
  374. if (activeStatus === ReleasesStatusOption.ARCHIVED) {
  375. return (
  376. <Panel>
  377. <EmptyMessage icon={<IconSearch size="xl" />} size="large">
  378. {t('There are no archived releases.')}
  379. </EmptyMessage>
  380. </Panel>
  381. );
  382. }
  383. return (
  384. <Panel>
  385. <EmptyMessage icon={<IconSearch size="xl" />} size="large">
  386. {`${t('There are no releases with data in the')} ${selectedPeriod}.`}
  387. </EmptyMessage>
  388. </Panel>
  389. );
  390. }
  391. renderHealthCta() {
  392. const {organization} = this.props;
  393. const {releases} = this.state;
  394. const selectedProject = this.getSelectedProject();
  395. if (!selectedProject || this.projectHasSessions !== false || !releases?.length) {
  396. return null;
  397. }
  398. return (
  399. <Projects orgId={organization.slug} slugs={[selectedProject.slug]}>
  400. {({projects, initiallyLoaded, fetchError}) => {
  401. const project = projects && projects.length === 1 && projects[0];
  402. const projectCanHaveReleases =
  403. project && project.platform && releaseHealth.includes(project.platform);
  404. if (!initiallyLoaded || fetchError || !projectCanHaveReleases) {
  405. return null;
  406. }
  407. return (
  408. <Alert type="info" showIcon>
  409. <AlertText>
  410. <div>
  411. {t(
  412. 'To track user adoption, crash rates, session data and more, add Release Health to your current setup.'
  413. )}
  414. </div>
  415. <ExternalLink
  416. href="https://docs.sentry.io/product/releases/setup/#release-health"
  417. onClick={this.trackAddReleaseHealth}
  418. >
  419. {t('Add Release Health')}
  420. </ExternalLink>
  421. </AlertText>
  422. </Alert>
  423. );
  424. }}
  425. </Projects>
  426. );
  427. }
  428. renderInnerBody(
  429. activeDisplay: ReleasesDisplayOption,
  430. showReleaseAdoptionStages: boolean
  431. ) {
  432. const {location, selection, organization, router} = this.props;
  433. const {releases, reloading, releasesPageLinks, thresholdStatuses} = this.state;
  434. const selectedProject = this.getSelectedProject();
  435. const hasReleasesSetup = selectedProject?.features.includes('releases');
  436. if (this.shouldShowLoadingIndicator()) {
  437. return <LoadingIndicator />;
  438. }
  439. if (!releases?.length && hasReleasesSetup) {
  440. return this.renderEmptyMessage();
  441. }
  442. if (this.shouldShowQuickstart) {
  443. return <ReleasesPromo organization={organization} project={selectedProject!} />;
  444. }
  445. return (
  446. <ReleasesRequest
  447. releases={releases.map(({version}) => version)}
  448. organization={organization}
  449. selection={selection}
  450. location={location}
  451. display={[this.getDisplay()]}
  452. releasesReloading={reloading}
  453. healthStatsPeriod={location.query.healthStatsPeriod}
  454. >
  455. {({isHealthLoading, getHealthData}) => {
  456. const singleProjectSelected =
  457. selection.projects?.length === 1 &&
  458. selection.projects[0] !== ALL_ACCESS_PROJECTS;
  459. // TODO: project specific chart should live on the project details page.
  460. const isMobileProject =
  461. selectedProject?.platform && isMobileRelease(selectedProject.platform);
  462. return (
  463. <Fragment>
  464. {singleProjectSelected && this.projectHasSessions && isMobileProject && (
  465. <ReleasesAdoptionChart
  466. organization={organization}
  467. selection={selection}
  468. location={location}
  469. router={router}
  470. activeDisplay={activeDisplay}
  471. />
  472. )}
  473. {releases.map((release, index) => (
  474. <ReleaseCard
  475. key={`${release.projects[0].slug}-${release.version}`}
  476. activeDisplay={activeDisplay}
  477. release={release}
  478. organization={organization}
  479. location={location}
  480. selection={selection}
  481. reloading={reloading}
  482. showHealthPlaceholders={isHealthLoading}
  483. isTopRelease={index === 0}
  484. getHealthData={getHealthData}
  485. showReleaseAdoptionStages={showReleaseAdoptionStages}
  486. thresholdStatuses={thresholdStatuses || {}}
  487. />
  488. ))}
  489. <Pagination pageLinks={releasesPageLinks} />
  490. </Fragment>
  491. );
  492. }}
  493. </ReleasesRequest>
  494. );
  495. }
  496. renderBody() {
  497. const {organization, selection, router} = this.props;
  498. const {releases, reloading, error} = this.state;
  499. const activeSort = this.getSort();
  500. const activeStatus = this.getStatus();
  501. const activeDisplay = this.getDisplay();
  502. const hasAnyMobileProject = selection.projects
  503. .map(id => `${id}`)
  504. .map(ProjectsStore.getById)
  505. .some(project => project?.platform && isMobileRelease(project.platform));
  506. const showReleaseAdoptionStages =
  507. hasAnyMobileProject && selection.environments.length === 1;
  508. const hasReleasesSetup = releases && releases.length > 0;
  509. return (
  510. <PageFiltersContainer showAbsolute={false}>
  511. <NoProjectMessage organization={organization}>
  512. <Header
  513. router={router}
  514. hasV2ReleaseUIEnabled={this.hasV2ReleaseUIEnabled}
  515. organization={organization}
  516. />
  517. <Layout.Body>
  518. <Layout.Main fullWidth>
  519. {organization.features.includes('releases-v2-banner') && (
  520. <ReleaseFeedbackBanner />
  521. )}
  522. {this.renderHealthCta()}
  523. <ReleasesPageFilterBar condensed>
  524. <GuideAnchor target="release_projects">
  525. <ProjectPageFilter />
  526. </GuideAnchor>
  527. <EnvironmentPageFilter />
  528. <DatePageFilter
  529. disallowArbitraryRelativeRanges
  530. menuFooterMessage={t(
  531. 'Changing this date range will recalculate the release metrics.'
  532. )}
  533. />
  534. </ReleasesPageFilterBar>
  535. {this.shouldShowQuickstart ? null : (
  536. <SortAndFilterWrapper>
  537. <GuideAnchor
  538. target="releases_search"
  539. position="bottom"
  540. disabled={!hasReleasesSetup}
  541. >
  542. <StyledSmartSearchBar
  543. searchSource="releases"
  544. query={this.getQuery()}
  545. placeholder={t('Search by version, build, package, or stage')}
  546. hasRecentSearches={false}
  547. supportedTags={{
  548. ...SEMVER_TAGS,
  549. release: {
  550. key: 'release',
  551. name: 'release',
  552. },
  553. }}
  554. maxMenuHeight={500}
  555. supportedTagType={ItemType.PROPERTY}
  556. onSearch={this.handleSearch}
  557. onGetTagValues={this.getTagValues}
  558. />
  559. </GuideAnchor>
  560. <ReleasesStatusOptions
  561. selected={activeStatus}
  562. onSelect={this.handleStatus}
  563. />
  564. <ReleasesSortOptions
  565. selected={activeSort}
  566. selectedDisplay={activeDisplay}
  567. onSelect={this.handleSortBy}
  568. environments={selection.environments}
  569. />
  570. <ReleasesDisplayOptions
  571. selected={activeDisplay}
  572. onSelect={this.handleDisplay}
  573. />
  574. </SortAndFilterWrapper>
  575. )}
  576. {!reloading &&
  577. activeStatus === ReleasesStatusOption.ARCHIVED &&
  578. !!releases?.length && <ReleaseArchivedNotice multi />}
  579. {error
  580. ? super.renderError()
  581. : this.renderInnerBody(activeDisplay, showReleaseAdoptionStages)}
  582. <FloatingFeedbackWidget />
  583. </Layout.Main>
  584. </Layout.Body>
  585. </NoProjectMessage>
  586. </PageFiltersContainer>
  587. );
  588. }
  589. }
  590. const AlertText = styled('div')`
  591. display: flex;
  592. align-items: flex-start;
  593. justify-content: flex-start;
  594. gap: ${space(2)};
  595. > *:nth-child(1) {
  596. flex: 1;
  597. }
  598. flex-direction: column;
  599. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  600. flex-direction: row;
  601. }
  602. `;
  603. const ReleasesPageFilterBar = styled(PageFilterBar)`
  604. margin-bottom: ${space(2)};
  605. `;
  606. const SortAndFilterWrapper = styled('div')`
  607. display: grid;
  608. grid-template-columns: 1fr repeat(3, max-content);
  609. gap: ${space(2)};
  610. margin-bottom: ${space(2)};
  611. @media (max-width: ${p => p.theme.breakpoints.medium}) {
  612. grid-template-columns: repeat(3, 1fr);
  613. & > div {
  614. width: auto;
  615. }
  616. }
  617. @media (max-width: ${p => p.theme.breakpoints.small}) {
  618. grid-template-columns: minmax(0, 1fr);
  619. }
  620. `;
  621. const StyledSmartSearchBar = styled(SmartSearchBar)`
  622. @media (max-width: ${p => p.theme.breakpoints.medium}) {
  623. grid-column: 1 / -1;
  624. }
  625. `;
  626. export default withApi(withProjects(withOrganization(withPageFilters(ReleasesList))));