mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Switched Portal components to use explicit path imports
- `compilerOptions.baseUrl` is nice but it means we end up with two different styles of import paths for project files - relative and from `src/` - to fix this, we're going to standardize on relative imports and remove the ability to import relative to the top-level project folder - this removes the jsconfig line and fixes all existing imports
This commit is contained in:
parent
d04b43aeee
commit
e280925a8b
@ -1,6 +1,3 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import AppContext from 'AppContext';
|
||||
import {getSupportAddress} from 'utils/helpers';
|
||||
import AppContext from '../../../AppContext';
|
||||
import {getSupportAddress} from '../../../utils/helpers';
|
||||
|
||||
import AccountFooter from './components/AccountFooter';
|
||||
import AccountMain from './components/AccountMain';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import {render, fireEvent} from 'utils/test-utils';
|
||||
import {render, fireEvent} from '../../../utils/test-utils';
|
||||
import AccountHomePage from './AccountHomePage';
|
||||
import {site} from 'utils/fixtures';
|
||||
import {site} from '../../../utils/fixtures';
|
||||
|
||||
const setup = (overrides) => {
|
||||
const {mockOnActionFn, ...utils} = render(
|
||||
|
@ -1,6 +1,6 @@
|
||||
import AppContext from 'AppContext';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import {useContext} from 'react';
|
||||
import {hasCommentsEnabled, hasMultipleNewsletters, isEmailSuppressed} from 'utils/helpers';
|
||||
import {hasCommentsEnabled, hasMultipleNewsletters, isEmailSuppressed} from '../../../../utils/helpers';
|
||||
|
||||
import PaidAccountActions from './PaidAccountActions';
|
||||
import EmailNewsletterAction from './EmailNewsletterAction';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import CloseButton from 'components/common/CloseButton';
|
||||
import CloseButton from '../../../../components/common/CloseButton';
|
||||
|
||||
import UserHeader from './UserHeader';
|
||||
import AccountWelcome from './AccountWelcome';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import AppContext from 'AppContext';
|
||||
import {getCompExpiry, getMemberSubscription, hasOnlyFreePlan, isComplimentaryMember, subscriptionHasFreeTrial} from 'utils/helpers';
|
||||
import {getDateString} from 'utils/date-time';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import {getCompExpiry, getMemberSubscription, hasOnlyFreePlan, isComplimentaryMember, subscriptionHasFreeTrial} from '../../../../utils/helpers';
|
||||
import {getDateString} from '../../../../utils/date-time';
|
||||
import {useContext} from 'react';
|
||||
|
||||
import SubscribeButton from './SubscribeButton';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import AppContext from 'AppContext';
|
||||
import ActionButton from 'components/common/ActionButton';
|
||||
import {getMemberSubscription} from 'utils/helpers';
|
||||
import {getDateString} from 'utils/date-time';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import ActionButton from '../../../common/ActionButton';
|
||||
import {getMemberSubscription} from '../../../../utils/helpers';
|
||||
import {getDateString} from '../../../../utils/date-time';
|
||||
import {useContext} from 'react';
|
||||
|
||||
const ContinueSubscriptionButton = () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import AppContext from 'AppContext';
|
||||
import Switch from 'components/common/Switch';
|
||||
import {getSiteNewsletters, hasMemberGotEmailSuppression} from 'utils/helpers';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import Switch from '../../../common/Switch';
|
||||
import {getSiteNewsletters, hasMemberGotEmailSuppression} from '../../../../utils/helpers';
|
||||
import {useContext} from 'react';
|
||||
|
||||
function EmailNewsletterAction() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import AppContext from 'AppContext';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import {useContext} from 'react';
|
||||
import {isEmailSuppressed} from 'utils/helpers';
|
||||
import {ReactComponent as EmailDeliveryFailedIcon} from 'images/icons/email-delivery-failed.svg';
|
||||
import {isEmailSuppressed} from '../../../../utils/helpers';
|
||||
import {ReactComponent as EmailDeliveryFailedIcon} from '../../../../images/icons/email-delivery-failed.svg';
|
||||
|
||||
function EmailPreferencesAction() {
|
||||
const {onAction, member, t} = useContext(AppContext);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import AppContext from 'AppContext';
|
||||
import {allowCompMemberUpgrade, getCompExpiry, getMemberSubscription, getMemberTierName, getUpdatedOfferPrice, hasMultipleProductsFeature, hasOnlyFreePlan, isComplimentaryMember, isInThePast, subscriptionHasFreeTrial} from 'utils/helpers';
|
||||
import {getDateString} from 'utils/date-time';
|
||||
import {ReactComponent as LoaderIcon} from 'images/icons/loader.svg';
|
||||
import {ReactComponent as OfferTagIcon} from 'images/icons/offer-tag.svg';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import {allowCompMemberUpgrade, getCompExpiry, getMemberSubscription, getMemberTierName, getUpdatedOfferPrice, hasMultipleProductsFeature, hasOnlyFreePlan, isComplimentaryMember, isInThePast, subscriptionHasFreeTrial} from '../../../../utils/helpers';
|
||||
import {getDateString} from '../../../../utils/date-time';
|
||||
import {ReactComponent as LoaderIcon} from '../../../../images/icons/loader.svg';
|
||||
import {ReactComponent as OfferTagIcon} from '../../../../images/icons/offer-tag.svg';
|
||||
import {useContext} from 'react';
|
||||
|
||||
const PaidAccountActions = () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import AppContext from 'AppContext';
|
||||
import ActionButton from 'components/common/ActionButton';
|
||||
import {hasOnlyFreePlan} from 'utils/helpers';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import ActionButton from '../../../common/ActionButton';
|
||||
import {hasOnlyFreePlan} from '../../../../utils/helpers';
|
||||
import {useContext} from 'react';
|
||||
|
||||
const SubscribeButton = () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import AppContext from 'AppContext';
|
||||
import MemberAvatar from 'components/common/MemberGravatar';
|
||||
import AppContext from '../../../../AppContext';
|
||||
import MemberAvatar from '../../../common/MemberGravatar';
|
||||
import React, {useContext} from 'react';
|
||||
|
||||
const UserHeader = () => {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import AppContext from 'AppContext';
|
||||
import AppContext from '../../AppContext';
|
||||
import {useContext} from 'react';
|
||||
import BackButton from 'components/common/BackButton';
|
||||
import CloseButton from 'components/common/CloseButton';
|
||||
import {getDefaultNewsletterSender, getSupportAddress} from 'utils/helpers';
|
||||
import BackButton from '../../components/common/BackButton';
|
||||
import CloseButton from '../../components/common/CloseButton';
|
||||
import {getDefaultNewsletterSender, getSupportAddress} from '../../utils/helpers';
|
||||
|
||||
export default function EmailReceivingPage() {
|
||||
const {brandColor, onAction, site, lastPage, member} = useContext(AppContext);
|
||||
|
@ -1,10 +1,10 @@
|
||||
import AppContext from 'AppContext';
|
||||
import AppContext from '../../AppContext';
|
||||
import {useContext, useEffect} from 'react';
|
||||
import {hasCommentsEnabled, hasMultipleNewsletters} from 'utils/helpers';
|
||||
import CloseButton from 'components/common/CloseButton';
|
||||
import BackButton from 'components/common/BackButton';
|
||||
import ActionButton from 'components/common/ActionButton';
|
||||
import {ReactComponent as EmailDeliveryFailedIcon} from 'images/icons/email-delivery-failed.svg';
|
||||
import {hasCommentsEnabled, hasMultipleNewsletters} from '../../utils/helpers';
|
||||
import CloseButton from '../../components/common/CloseButton';
|
||||
import BackButton from '../../components/common/BackButton';
|
||||
import ActionButton from '../../components/common/ActionButton';
|
||||
import {ReactComponent as EmailDeliveryFailedIcon} from '../../images/icons/email-delivery-failed.svg';
|
||||
|
||||
export default function EmailSuppressedPage() {
|
||||
const {brandColor, lastPage, onAction, action, site, t} = useContext(AppContext);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import {render, fireEvent} from 'utils/test-utils';
|
||||
import {render, fireEvent} from '../../utils/test-utils';
|
||||
import EmailSuppressedPage from './EmailSuppressedPage';
|
||||
|
||||
const setup = (overrides) => {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import AppContext from 'AppContext';
|
||||
import AppContext from '../../AppContext';
|
||||
import {useContext} from 'react';
|
||||
import BackButton from 'components/common/BackButton';
|
||||
import CloseButton from 'components/common/CloseButton';
|
||||
import {getSupportAddress} from 'utils/helpers';
|
||||
import BackButton from '../../components/common/BackButton';
|
||||
import CloseButton from '../../components/common/CloseButton';
|
||||
import {getSupportAddress} from '../../utils/helpers';
|
||||
|
||||
export default function EmailSuppressedPage() {
|
||||
const {brandColor, onAction, site} = useContext(AppContext);
|
||||
|
Loading…
Reference in New Issue
Block a user