Browse Source

ref(js): Avoid relative imports on unrelated components (#43582)

Evan Purkhiser 2 years ago
parent
commit
f3fc570c21

+ 2 - 2
static/app/components/calendar/index.tsx

@@ -1,7 +1,7 @@
 import {lazy, Suspense} from 'react';
 
-import LoadingIndicator from '../loadingIndicator';
-import Placeholder from '../placeholder';
+import LoadingIndicator from 'sentry/components/loadingIndicator';
+import Placeholder from 'sentry/components/placeholder';
 
 import type {DatePickerProps} from './datePicker';
 import type {DateRangePickerProps} from './dateRangePicker';

+ 5 - 2
static/app/components/contextPickerModal.spec.tsx

@@ -3,13 +3,16 @@ import selectEvent from 'react-select-event';
 import {render, screen, waitFor} from 'sentry-test/reactTestingLibrary';
 
 import ContextPickerModal from 'sentry/components/contextPickerModal';
+import {
+  makeCloseButton,
+  ModalBody,
+  ModalFooter,
+} from 'sentry/components/globalModal/components';
 import ConfigStore from 'sentry/stores/configStore';
 import OrganizationsStore from 'sentry/stores/organizationsStore';
 import OrganizationStore from 'sentry/stores/organizationStore';
 import ProjectsStore from 'sentry/stores/projectsStore';
 
-import {makeCloseButton, ModalBody, ModalFooter} from './globalModal/components';
-
 describe('ContextPickerModal', function () {
   let project, project2, project4, org, org2;
   const onFinish = jest.fn();

+ 3 - 4
static/app/components/discover/quickContextCommitRow.tsx

@@ -2,16 +2,15 @@ import styled from '@emotion/styled';
 
 import UserAvatar from 'sentry/components/avatar/userAvatar';
 import CommitLink from 'sentry/components/commitLink';
+import {CommitRowProps, formatCommitMessage} from 'sentry/components/commitRow';
+import ExternalLink from 'sentry/components/links/externalLink';
 import {PanelItem} from 'sentry/components/panels';
 import TextOverflow from 'sentry/components/textOverflow';
+import Tooltip from 'sentry/components/tooltip';
 import {t, tct} from 'sentry/locale';
 import ConfigStore from 'sentry/stores/configStore';
 import space from 'sentry/styles/space';
 
-import {CommitRowProps, formatCommitMessage} from '../commitRow';
-import ExternalLink from '../links/externalLink';
-import Tooltip from '../tooltip';
-
 function QuickContextCommitRow({commit}: CommitRowProps) {
   const user = ConfigStore.get('user');
   const isUser = user?.id === commit.author?.id;

+ 1 - 2
static/app/components/events/errorItem.tsx

@@ -6,13 +6,12 @@ import moment from 'moment';
 import {Button} from 'sentry/components/button';
 import KeyValueList from 'sentry/components/events/interfaces/keyValueList';
 import {AnnotatedText} from 'sentry/components/events/meta/annotatedText';
+import ExternalLink from 'sentry/components/links/externalLink';
 import ListItem from 'sentry/components/list/listItem';
 import {JavascriptProcessingErrors} from 'sentry/constants/eventErrors';
 import {t, tct} from 'sentry/locale';
 import space from 'sentry/styles/space';
 
-import ExternalLink from '../links/externalLink';
-
 type Error = {
   message: React.ReactNode;
   type: string;

+ 1 - 2
static/app/components/events/eventAttachmentsCrashReportsNotice.tsx

@@ -1,11 +1,10 @@
 import {Location} from 'history';
 
 import {Alert} from 'sentry/components/alert';
+import Link from 'sentry/components/links/link';
 import {tct} from 'sentry/locale';
 import {crashReportTypes} from 'sentry/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter';
 
-import Link from '../links/link';
-
 type Props = {
   groupId: string;
   location: Location;

+ 1 - 2
static/app/components/events/eventEntries.tsx

@@ -5,6 +5,7 @@ import {Location} from 'history';
 import uniq from 'lodash/uniq';
 
 import {addErrorMessage} from 'sentry/actionCreators/indicator';
+import {CommitRow} from 'sentry/components/commitRow';
 import ErrorBoundary from 'sentry/components/errorBoundary';
 import ExternalLink from 'sentry/components/links/externalLink';
 import {t, tct} from 'sentry/locale';
@@ -30,8 +31,6 @@ import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAna
 import useApi from 'sentry/utils/useApi';
 import {projectProcessingIssuesMessages} from 'sentry/views/settings/project/projectProcessingIssues';
 
-import {CommitRow} from '../commitRow';
-
 import findBestThread from './interfaces/threads/threadSelector/findBestThread';
 import getThreadException from './interfaces/threads/threadSelector/getThreadException';
 import {EventContexts} from './contexts';

+ 1 - 2
static/app/components/featureFeedback/feedbackModal.spec.tsx

@@ -19,10 +19,9 @@ import {
 import * as indicators from 'sentry/actionCreators/indicator';
 import {openModal} from 'sentry/actionCreators/modal';
 import {FeedbackModal} from 'sentry/components/featureFeedback/feedbackModal';
+import {TextField} from 'sentry/components/forms';
 import {RouteContext} from 'sentry/views/routeContext';
 
-import {TextField} from '../forms';
-
 function ComponentProviders({children}: {children: React.ReactNode}) {
   const {router} = initializeOrg();
 

+ 1 - 2
static/app/components/group/sidebar.tsx

@@ -11,6 +11,7 @@ import AvatarList from 'sentry/components/avatar/avatarList';
 import DateTime from 'sentry/components/dateTime';
 import EnvironmentPageFilter from 'sentry/components/environmentPageFilter';
 import ErrorBoundary from 'sentry/components/errorBoundary';
+import FeatureBadge from 'sentry/components/featureBadge';
 import AssignedTo from 'sentry/components/group/assignedTo';
 import ExternalIssueList from 'sentry/components/group/externalIssuesList';
 import OwnedBy from 'sentry/components/group/ownedBy';
@@ -42,8 +43,6 @@ import withApi from 'sentry/utils/withApi';
 // eslint-disable-next-line no-restricted-imports
 import withSentryRouter from 'sentry/utils/withSentryRouter';
 
-import FeatureBadge from '../featureBadge';
-
 import TagFacets, {
   BACKEND_TAGS,
   DEFAULT_TAGS,

+ 1 - 2
static/app/components/pluginList.tsx

@@ -1,11 +1,10 @@
 import {disablePlugin, enablePlugin} from 'sentry/actionCreators/plugins';
 import InactivePlugins from 'sentry/components/inactivePlugins';
+import {Panel, PanelItem} from 'sentry/components/panels';
 import PluginConfig from 'sentry/components/pluginConfig';
 import {t} from 'sentry/locale';
 import {Organization, Plugin, Project} from 'sentry/types';
 
-import {Panel, PanelItem} from './panels';
-
 type Props = {
   organization: Organization;
   pluginList: Plugin[];

+ 4 - 1
static/app/components/radioGroupRating.spec.tsx

@@ -1,6 +1,9 @@
 import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
 
-import {RadioGroupRating, RadioGroupRatingProps} from './radioGroupRating';
+import {
+  RadioGroupRating,
+  RadioGroupRatingProps,
+} from 'sentry/components/radioGroupRating';
 
 const options: RadioGroupRatingProps['options'] = {
   0: {

Some files were not shown because too many files changed in this diff