import EmptyStateWarning from 'sentry/components/emptyStateWarning'; import ErrorBoundary from 'sentry/components/errorBoundary'; import * as Layout from 'sentry/components/layouts/thirds'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import Pagination from 'sentry/components/pagination'; import Panel from 'sentry/components/panels/panel'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Activity, Organization} from 'sentry/types'; import routeTitle from 'sentry/utils/routeTitle'; import withOrganization from 'sentry/utils/withOrganization'; import type {AsyncViewProps, AsyncViewState} from 'sentry/views/deprecatedAsyncView'; import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView'; import ActivityFeedItem from './activityFeedItem'; interface Props extends AsyncViewProps { organization: Organization; } interface State extends AsyncViewState { activity: Activity[]; } class OrganizationActivity extends DeprecatedAsyncView { getTitle() { const {organization} = this.props; return routeTitle(t('Activity'), organization.slug, false); } getEndpoints(): ReturnType { const {organization} = this.props; return [['activity', `/organizations/${organization.slug}/activity/`]]; } renderLoading() { return this.renderBody(); } renderEmpty() { return (

{t('Nothing to show here, move along.')}

); } renderError(error?: Error, disableLog = false): React.ReactNode { const {errors} = this.state; const notFound = Object.values(errors).find(resp => resp && resp.status === 404); if (notFound) { return this.renderBody(); } return super.renderError(error, disableLog); } renderBody() { const {loading, activity, activityPageLinks} = this.state; return ( {t('Activity')} {loading && } {!loading && !activity?.length && this.renderEmpty()} {!loading && activity?.length > 0 && (
{activity.map(item => ( ))}
)}
{activityPageLinks && ( )}
); } } export default withOrganization(OrganizationActivity);