refactor: convert absolute imports to relative ones (#5438)

This commit is contained in:
Vladislav Shkodin
2021-05-30 18:49:33 +02:00
committed by GitHub
parent 1b78edadf0
commit 3a826b43a2
47 changed files with 136 additions and 203 deletions

View File

@ -6,7 +6,7 @@ import {
expandSearchEntries,
mergeExpandedEntries,
} from '../backend';
import registry from '../lib/registry';
import { getBackend } from '../lib/registry';
import { FOLDER, FILES } from '../constants/collectionTypes';
jest.mock('../lib/registry');
@ -18,7 +18,7 @@ describe('Backend', () => {
let backend;
beforeEach(() => {
registry.getBackend.mockReturnValue({
getBackend.mockReturnValue({
init: jest.fn(),
});
backend = resolveBackend({

View File

@ -4,7 +4,7 @@ import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { fromJS } from 'immutable';
jest.mock('coreSrc/backend');
jest.mock('../../backend');
jest.mock('../../valueObjects/AssetProxy');
jest.mock('netlify-cms-lib-util');
jest.mock('uuid/v4', () => {
@ -33,8 +33,8 @@ describe('editorialWorkflow actions', () => {
describe('loadUnpublishedEntry', () => {
it('should load unpublished entry', () => {
const { currentBackend } = require('coreSrc/backend');
const { createAssetProxy } = require('ValueObjects/AssetProxy');
const { currentBackend } = require('../../backend');
const { createAssetProxy } = require('../../valueObjects/AssetProxy');
const assetProxy = { name: 'name', path: 'path' };
const entry = { mediaFiles: [{ file: { name: 'name' }, id: '1', draft: true }] };
@ -91,7 +91,7 @@ describe('editorialWorkflow actions', () => {
describe('publishUnpublishedEntry', () => {
it('should publish unpublished entry and report success', () => {
const { currentBackend } = require('coreSrc/backend');
const { currentBackend } = require('../../backend');
const entry = {};
const backend = {
@ -176,7 +176,7 @@ describe('editorialWorkflow actions', () => {
});
it('should publish unpublished entry and report error', () => {
const { currentBackend } = require('coreSrc/backend');
const { currentBackend } = require('../../backend');
const error = new Error('failed to publish entry');
const backend = {

View File

@ -11,7 +11,7 @@ import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import AssetProxy from '../../valueObjects/AssetProxy';
jest.mock('coreSrc/backend');
jest.mock('../../backend');
jest.mock('netlify-cms-lib-util');
jest.mock('../mediaLibrary');
jest.mock('../../reducers/entries');
@ -22,7 +22,7 @@ const mockStore = configureMockStore(middlewares);
describe('entries', () => {
describe('createEmptyDraft', () => {
const { currentBackend } = require('coreSrc/backend');
const { currentBackend } = require('../../backend');
const backend = {
processEntry: jest.fn((_state, _collection, entry) => Promise.resolve(entry)),
};
@ -319,7 +319,7 @@ describe('entries', () => {
});
it('should persist local backup with media files', () => {
const { currentBackend } = require('coreSrc/backend');
const { currentBackend } = require('../../backend');
const backend = {
persistLocalDraftBackup: jest.fn(() => Promise.resolve()),
@ -351,7 +351,7 @@ describe('entries', () => {
});
it('should retrieve media files with local backup', () => {
const { currentBackend } = require('coreSrc/backend');
const { currentBackend } = require('../../backend');
const { createAssetProxy } = require('../../valueObjects/AssetProxy');
const backend = {

View File

@ -59,7 +59,7 @@ describe('mediaLibrary', () => {
});
});
const { currentBackend } = require('coreSrc/backend');
const { currentBackend } = require('../../backend');
const backend = {
persistMedia: jest.fn(() => ({ id: 'id' })),

View File

@ -1,4 +1,4 @@
import history from '../routing/history';
import { history } from '../routing/history';
import { getCollectionUrl, getNewEntryUrl } from '../lib/urlHelper';
export function searchCollections(query: string, collection: string) {

View File

@ -2,18 +2,18 @@ import React from 'react';
import { render } from 'react-dom';
import { Provider, connect } from 'react-redux';
import { Route, Router } from 'react-router-dom';
import store from 'ReduxStore';
import history from 'Routing/history';
import { loadConfig } from 'Actions/config';
import { authenticateUser } from 'Actions/auth';
import { getPhrases } from 'Lib/phrases';
import { selectLocale } from 'Reducers/config';
import { I18n } from 'react-polyglot';
import { GlobalStyles } from 'netlify-cms-ui-default';
import { ErrorBoundary } from 'UI';
import App from 'App/App';
import 'EditorWidgets';
import 'coreSrc/mediaLibrary';
import { I18n } from 'react-polyglot';
import { store } from './redux';
import { history } from './routing/history';
import { loadConfig } from './actions/config';
import { authenticateUser } from './actions/auth';
import { getPhrases } from './lib/phrases';
import { selectLocale } from './reducers/config';
import { ErrorBoundary } from './components/UI';
import App from './components/App/App';
import './components/EditorWidgets';
import './mediaLibrary';
import 'what-input';
const ROOT_ID = 'nc-root';

View File

@ -8,18 +8,18 @@ import { connect } from 'react-redux';
import { Route, Switch, Redirect } from 'react-router-dom';
import { Notifs } from 'redux-notifications';
import TopBarProgress from 'react-topbar-progress-indicator';
import { loginUser, logoutUser } from 'Actions/auth';
import { currentBackend } from 'coreSrc/backend';
import { createNewEntry } from 'Actions/collections';
import { openMediaLibrary } from 'Actions/mediaLibrary';
import MediaLibrary from 'MediaLibrary/MediaLibrary';
import { Toast } from 'UI';
import { loginUser, logoutUser } from '../../actions/auth';
import { currentBackend } from '../../backend';
import { createNewEntry } from '../../actions/collections';
import { openMediaLibrary } from '../../actions/mediaLibrary';
import MediaLibrary from '../MediaLibrary/MediaLibrary';
import { Toast } from '../UI';
import { Loader, colors } from 'netlify-cms-ui-default';
import history from 'Routing/history';
import { SIMPLE, EDITORIAL_WORKFLOW } from 'Constants/publishModes';
import Collection from 'Collection/Collection';
import Workflow from 'Workflow/Workflow';
import Editor from 'Editor/Editor';
import { history } from '../../routing/history';
import { SIMPLE, EDITORIAL_WORKFLOW } from '../../constants/publishModes';
import Collection from '../Collection/Collection';
import Workflow from '../Workflow/Workflow';
import Editor from '../Editor/Editor';
import NotFoundPage from './NotFoundPage';
import Header from './Header';

View File

@ -16,7 +16,7 @@ import {
buttons,
zIndex,
} from 'netlify-cms-ui-default';
import SettingsDropdown from 'UI/SettingsDropdown';
import { SettingsDropdown } from '../UI';
import { connect } from 'react-redux';
import { checkBackendStatus } from '../../actions/status';

View File

@ -5,7 +5,7 @@ import styled from '@emotion/styled';
import { connect } from 'react-redux';
import { translate } from 'react-polyglot';
import { lengths, components } from 'netlify-cms-ui-default';
import { getNewEntryUrl } from 'Lib/urlHelper';
import { getNewEntryUrl } from '../../lib/urlHelper';
import Sidebar from './Sidebar';
import CollectionTop from './CollectionTop';
import EntriesCollection from './Entries/EntriesCollection';

View File

@ -10,14 +10,14 @@ import { colors } from 'netlify-cms-ui-default';
import {
loadEntries as actionLoadEntries,
traverseCollectionCursor as actionTraverseCollectionCursor,
} from 'Actions/entries';
} from '../../../actions/entries';
import {
selectEntries,
selectEntriesLoaded,
selectIsFetching,
selectGroups,
} from '../../../reducers/entries';
import { selectCollectionEntriesCursor } from 'Reducers/cursors';
import { selectCollectionEntriesCursor } from '../../../reducers/cursors';
import Entries from './Entries';
const GroupHeading = styled.h2`

View File

@ -4,11 +4,11 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { isEqual } from 'lodash';
import { Cursor } from 'netlify-cms-lib-util';
import { selectSearchedEntries } from 'Reducers';
import { selectSearchedEntries } from '../../../reducers';
import {
searchEntries as actionSearchEntries,
clearSearch as actionClearSearch,
} from 'Actions/search';
} from '../../../actions/search';
import Entries from './Entries';
class EntriesSearch extends React.Component {

View File

@ -1,12 +1,12 @@
import React from 'react';
import styled from '@emotion/styled';
import { connect } from 'react-redux';
import { boundGetAsset } from 'Actions/media';
import { boundGetAsset } from '../../../actions/media';
import { Link } from 'react-router-dom';
import { colors, colorsRaw, components, lengths, zIndex } from 'netlify-cms-ui-default';
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from 'Constants/collectionViews';
import { selectIsLoadingAsset } from 'Reducers/medias';
import { selectEntryCollectionTitle } from 'Reducers/collections';
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from '../../../constants/collectionViews';
import { selectIsLoadingAsset } from '../../../reducers/medias';
import { selectEntryCollectionTitle } from '../../../reducers/collections';
const ListCard = styled.li`
${components.card};

View File

@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import styled from '@emotion/styled';
import { Waypoint } from 'react-waypoint';
import { Map } from 'immutable';
import { selectFields, selectInferedField } from 'Reducers/collections';
import { selectFields, selectInferedField } from '../../../reducers/collections';
import EntryCard from './EntryCard';
const CardsGrid = styled.ul`

View File

@ -6,7 +6,7 @@ import { css } from '@emotion/core';
import { translate } from 'react-polyglot';
import { NavLink } from 'react-router-dom';
import { Icon, components, colors } from 'netlify-cms-ui-default';
import { searchCollections } from 'Actions/collections';
import { searchCollections } from '../../actions/collections';
import CollectionSearch from './CollectionSearch';
import NestedCollection from './NestedCollection';

View File

@ -1,7 +1,7 @@
import React from 'react';
import styled from '@emotion/styled';
import { Icon, buttons, colors } from 'netlify-cms-ui-default';
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from 'Constants/collectionViews';
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from '../../constants/collectionViews';
const ViewControlsSection = styled.div`
display: flex;

View File

@ -14,7 +14,7 @@ jest.mock('netlify-cms-ui-default', () => {
jest.mock('../NestedCollection', () => 'nested-collection');
jest.mock('../CollectionSearch', () => 'collection-search');
jest.mock('Actions/collections');
jest.mock('../../../actions/collections');
describe('Sidebar', () => {
const props = {

View File

@ -5,8 +5,8 @@ import { connect } from 'react-redux';
import { Loader } from 'netlify-cms-ui-default';
import { translate } from 'react-polyglot';
import { debounce } from 'lodash';
import history from 'Routing/history';
import { logoutUser } from 'Actions/auth';
import { history, navigateToCollection, navigateToNewEntry } from '../../routing/history';
import { logoutUser } from '../../actions/auth';
import {
loadEntry,
loadEntries,
@ -21,20 +21,19 @@ import {
loadLocalBackup,
retrieveLocalBackup,
deleteLocalBackup,
} from 'Actions/entries';
} from '../../actions/entries';
import {
updateUnpublishedEntryStatus,
publishUnpublishedEntry,
unpublishPublishedEntry,
deleteUnpublishedEntry,
} from 'Actions/editorialWorkflow';
import { loadDeployPreview } from 'Actions/deploys';
import { selectEntry, selectUnpublishedEntry, selectDeployPreview } from 'Reducers';
import { selectFields } from 'Reducers/collections';
import { status, EDITORIAL_WORKFLOW } from 'Constants/publishModes';
} from '../../actions/editorialWorkflow';
import { loadDeployPreview } from '../../actions/deploys';
import { selectEntry, selectUnpublishedEntry, selectDeployPreview } from '../../reducers';
import { selectFields } from '../../reducers/collections';
import { status, EDITORIAL_WORKFLOW } from '../../constants/publishModes';
import EditorInterface from './EditorInterface';
import withWorkflow from './withWorkflow';
import { navigateToCollection, navigateToNewEntry } from '../../routing/history';
export class Editor extends React.Component {
static propTypes = {

View File

@ -8,20 +8,19 @@ import styled from '@emotion/styled';
import { partial, uniqueId } from 'lodash';
import { connect } from 'react-redux';
import { FieldLabel, colors, transitions, lengths, borders } from 'netlify-cms-ui-default';
import { resolveWidget, getEditorComponents } from 'Lib/registry';
import { clearFieldErrors, tryLoadEntry } from 'Actions/entries';
import { addAsset, boundGetAsset } from 'Actions/media';
import { selectIsLoadingAsset } from 'Reducers/medias';
import { query, clearSearch } from 'Actions/search';
import { resolveWidget, getEditorComponents } from '../../../lib/registry';
import { clearFieldErrors, tryLoadEntry, validateMetaField } from '../../../actions/entries';
import { addAsset, boundGetAsset } from '../../../actions/media';
import { selectIsLoadingAsset } from '../../../reducers/medias';
import { query, clearSearch } from '../../../actions/search';
import {
openMediaLibrary,
removeInsertedMedia,
clearMediaControl,
removeMediaControl,
persistMedia,
} from 'Actions/mediaLibrary';
} from '../../../actions/mediaLibrary';
import Widget from './Widget';
import { validateMetaField } from '../../../actions/entries';
/**
* This is a necessary bridge as we are still passing classnames to widgets

View File

@ -3,7 +3,7 @@ import React, { Component } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { Map, List } from 'immutable';
import { oneLine } from 'common-tags';
import ValidationErrorTypes from 'Constants/validationErrorTypes';
import ValidationErrorTypes from '../../../constants/validationErrorTypes';
function truthy() {
return { error: false };

View File

@ -5,13 +5,13 @@ import { List, Map } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Frame, { FrameContextConsumer } from 'react-frame-component';
import { lengths } from 'netlify-cms-ui-default';
import { resolveWidget, getPreviewTemplate, getPreviewStyles } from 'Lib/registry';
import { ErrorBoundary } from 'UI';
import { selectTemplateName, selectInferedField, selectField } from 'Reducers/collections';
import { resolveWidget, getPreviewTemplate, getPreviewStyles } from '../../../lib/registry';
import { ErrorBoundary } from '../../UI';
import { selectTemplateName, selectInferedField, selectField } from '../../../reducers/collections';
import { connect } from 'react-redux';
import { boundGetAsset } from 'Actions/media';
import { selectIsLoadingAsset } from 'Reducers/medias';
import { INFERABLE_FIELDS } from 'Constants/fieldInference';
import { boundGetAsset } from '../../../actions/media';
import { selectIsLoadingAsset } from '../../../reducers/medias';
import { INFERABLE_FIELDS } from '../../../constants/fieldInference';
import EditorPreviewContent from './EditorPreviewContent.js';
import PreviewHOC from './PreviewHOC';
import EditorPreview from './EditorPreview';

View File

@ -16,8 +16,8 @@ import {
buttons,
zIndex,
} from 'netlify-cms-ui-default';
import { status } from 'Constants/publishModes';
import SettingsDropdown from 'UI/SettingsDropdown';
import { status } from '../../constants/publishModes';
import { SettingsDropdown } from '../UI';
const styles = {
noOverflow: css`

View File

@ -18,7 +18,7 @@ jest.mock('netlify-cms-ui-default', () => {
Loader: props => <mock-loader {...props} />,
};
});
jest.mock('Routing/history');
jest.mock('../../../routing/history');
describe('Editor', () => {
const props = {

View File

@ -1,9 +1,9 @@
import React from 'react';
import { connect } from 'react-redux';
import { EDITORIAL_WORKFLOW } from 'Constants/publishModes';
import { selectUnpublishedEntry } from 'Reducers';
import { selectAllowDeletion } from 'Reducers/collections';
import { loadUnpublishedEntry, persistUnpublishedEntry } from 'Actions/editorialWorkflow';
import { EDITORIAL_WORKFLOW } from '../../constants/publishModes';
import { selectUnpublishedEntry } from '../../reducers';
import { selectAllowDeletion } from '../../reducers/collections';
import { loadUnpublishedEntry, persistUnpublishedEntry } from '../../actions/editorialWorkflow';
function mapStateToProps(state, ownProps) {
const { collections } = state;

View File

@ -1,4 +1,4 @@
import { registerWidget } from 'Lib/registry';
import { registerWidget } from '../../lib/registry';
import UnknownControl from './Unknown/UnknownControl';
import UnknownPreview from './Unknown/UnknownPreview';

View File

@ -13,8 +13,8 @@ import {
insertMedia as insertMediaAction,
loadMediaDisplayURL as loadMediaDisplayURLAction,
closeMediaLibrary as closeMediaLibraryAction,
} from 'Actions/mediaLibrary';
import { selectMediaFiles } from 'Reducers/mediaLibrary';
} from '../../actions/mediaLibrary';
import { selectMediaFiles } from '../../reducers/mediaLibrary';
import MediaLibraryModal, { fileShape } from './MediaLibraryModal';
/**

View File

@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { css } from '@emotion/core';
import styled from '@emotion/styled';
import { FileUploadButton } from 'UI';
import { FileUploadButton } from '../UI';
import copyToClipboard from 'copy-text-to-clipboard';
import { isAbsolutePath } from 'netlify-cms-lib-util';
import { buttons, shadows, zIndex } from 'netlify-cms-ui-default';

View File

@ -4,7 +4,7 @@ import styled from '@emotion/styled';
import { Map } from 'immutable';
import { isEmpty } from 'lodash';
import { translate } from 'react-polyglot';
import { Modal } from 'UI';
import { Modal } from '../UI';
import MediaLibraryTop from './MediaLibraryTop';
import MediaLibraryCardGrid from './MediaLibraryCardGrid';
import EmptyMessage from './EmptyMessage';

View File

@ -4,7 +4,7 @@ import { css } from '@emotion/core';
import styled from '@emotion/styled';
import { translate } from 'react-polyglot';
import { Icon, Dropdown, DropdownItem, DropdownButton, colors } from 'netlify-cms-ui-default';
import { stripProtocol } from 'Lib/urlHelper';
import { stripProtocol } from '../../lib/urlHelper';
const styles = {
avatarImage: css`

View File

@ -3,3 +3,4 @@ export { default as ErrorBoundary } from './ErrorBoundary';
export { FileUploadButton } from './FileUploadButton';
export { Modal } from './Modal';
export { default as Toast } from './Toast';
export { default as SettingsDropdown } from './SettingsDropdown';

View File

@ -14,15 +14,15 @@ import {
components,
shadows,
} from 'netlify-cms-ui-default';
import { createNewEntry } from 'Actions/collections';
import { createNewEntry } from '../../actions/collections';
import {
loadUnpublishedEntries,
updateUnpublishedEntryStatus,
publishUnpublishedEntry,
deleteUnpublishedEntry,
} from 'Actions/editorialWorkflow';
import { selectUnpublishedEntriesByStatus } from 'Reducers';
import { EDITORIAL_WORKFLOW, status } from 'Constants/publishModes';
} from '../../actions/editorialWorkflow';
import { selectUnpublishedEntriesByStatus } from '../../reducers';
import { EDITORIAL_WORKFLOW, status } from '../../constants/publishModes';
import WorkflowList from './WorkflowList';
const WorkflowContainer = styled.div`

View File

@ -6,10 +6,10 @@ import styled from '@emotion/styled';
import moment from 'moment';
import { translate } from 'react-polyglot';
import { colors, lengths } from 'netlify-cms-ui-default';
import { status } from 'Constants/publishModes';
import { DragSource, DropTarget, HTML5DragDrop } from 'UI';
import { status } from '../../constants/publishModes';
import { DragSource, DropTarget, HTML5DragDrop } from '../UI';
import WorkflowCard from './WorkflowCard';
import { selectEntryCollectionTitle } from 'Reducers/collections';
import { selectEntryCollectionTitle } from '../../reducers/collections';
const WorkflowListContainer = styled.div`
min-height: 60%;

View File

@ -6,8 +6,8 @@ import {
prohibited,
} from 'ajv-keywords/dist/keywords';
import ajvErrors from 'ajv-errors';
import { formatExtensions, frontmatterFormats, extensionFormatters } from 'Formats/formats';
import { getWidgets } from 'Lib/registry';
import { formatExtensions, frontmatterFormats, extensionFormatters } from '../formats/formats';
import { getWidgets } from '../lib/registry';
import uuid from 'uuid/v4';
import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n';

View File

@ -1,5 +1,5 @@
import bootstrap from './bootstrap';
import Registry from 'Lib/registry';
import Registry from './lib/registry';
export const NetlifyCmsCore = {
...Registry,

View File

@ -1,6 +1,6 @@
import _ from 'lodash';
import { createEntry } from 'ValueObjects/Entry';
import { selectEntrySlug } from 'Reducers/collections';
import { createEntry } from '../../../valueObjects/Entry';
import { selectEntrySlug } from '../../../reducers/collections';
import { unsentRequest } from 'netlify-cms-lib-util';
const { fetchWithTimeout: fetch } = unsentRequest;

View File

@ -1,5 +1,5 @@
import { pickBy, trimEnd } from 'lodash';
import { addParams } from 'Lib/urlHelper';
import { addParams } from '../../../lib/urlHelper';
import { unsentRequest } from 'netlify-cms-lib-util';
const { fetchWithTimeout: fetch } = unsentRequest;

View File

@ -1,7 +1,7 @@
import { Map } from 'immutable';
import produce from 'immer';
import { oneLine } from 'common-tags';
import EditorComponent from 'ValueObjects/EditorComponent';
import EditorComponent from '../valueObjects/EditorComponent';
const allowedEvents = [
'prePublish',

View File

@ -4,7 +4,7 @@
*/
import { once } from 'lodash';
import { getMediaLibrary } from './lib/registry';
import store from './redux';
import { store } from './redux';
import { configFailed } from './actions/config';
import { createMediaLibrary, insertMedia } from './actions/mediaLibrary';
import { MediaLibraryInstance } from './types/redux';

View File

@ -1,5 +1,5 @@
import { Map, fromJS } from 'immutable';
import * as actions from 'Actions/entries';
import * as actions from '../../actions/entries';
import reducer from '../entryDraft';
jest.mock('uuid/v4', () => jest.fn(() => '1'));

View File

@ -1,5 +1,5 @@
import { Map, fromJS } from 'immutable';
import { mediaDeleted } from 'Actions/mediaLibrary';
import { mediaDeleted } from '../../actions/mediaLibrary';
import mediaLibrary, {
selectMediaFiles,
selectMediaFileByPath,
@ -7,8 +7,8 @@ import mediaLibrary, {
} from '../mediaLibrary';
jest.mock('uuid/v4');
jest.mock('Reducers/entries');
jest.mock('Reducers');
jest.mock('../entries');
jest.mock('../');
describe('mediaLibrary', () => {
it('should remove media file by key', () => {
@ -44,7 +44,7 @@ describe('mediaLibrary', () => {
});
it('should select draft media files from field when editing a draft', () => {
const { selectEditingDraft, selectMediaFolder } = require('Reducers/entries');
const { selectEditingDraft, selectMediaFolder } = require('../../reducers/entries');
selectEditingDraft.mockReturnValue(true);
selectMediaFolder.mockReturnValue('/static/images/posts/logos');
@ -76,7 +76,7 @@ describe('mediaLibrary', () => {
});
it('should select draft media files from collection when editing a draft', () => {
const { selectEditingDraft, selectMediaFolder } = require('Reducers/entries');
const { selectEditingDraft, selectMediaFolder } = require('../../reducers/entries');
selectEditingDraft.mockReturnValue(true);
selectMediaFolder.mockReturnValue('/static/images/posts');
@ -108,7 +108,7 @@ describe('mediaLibrary', () => {
});
it('should select global media files when not editing a draft', () => {
const { selectEditingDraft } = require('Reducers/entries');
const { selectEditingDraft } = require('../../reducers/entries');
selectEditingDraft.mockReturnValue(false);
@ -120,7 +120,7 @@ describe('mediaLibrary', () => {
});
it('should select global media files when not using asset store integration', () => {
const { selectIntegration } = require('Reducers');
const { selectIntegration } = require('../../reducers');
selectIntegration.mockReturnValue({});
@ -132,7 +132,7 @@ describe('mediaLibrary', () => {
});
it('should return media file by path', () => {
const { selectEditingDraft } = require('Reducers/entries');
const { selectEditingDraft } = require('../../reducers/entries');
selectEditingDraft.mockReturnValue(false);

View File

@ -5,7 +5,7 @@ import {
SORT_ENTRIES_SUCCESS,
FILTER_ENTRIES_SUCCESS,
GROUP_ENTRIES_SUCCESS,
} from 'Actions/entries';
} from '../actions/entries';
// Since pagination can be used for a variety of views (collections
// and searches are the most common examples), we namespace cursors by

View File

@ -16,12 +16,12 @@ import {
ENTRY_DELETE_SUCCESS,
ADD_DRAFT_ENTRY_MEDIA_FILE,
REMOVE_DRAFT_ENTRY_MEDIA_FILE,
} from 'Actions/entries';
} from '../actions/entries';
import {
UNPUBLISHED_ENTRY_PERSIST_REQUEST,
UNPUBLISHED_ENTRY_PERSIST_SUCCESS,
UNPUBLISHED_ENTRY_PERSIST_FAILURE,
} from 'Actions/editorialWorkflow';
} from '../actions/editorialWorkflow';
import { get } from 'lodash';
import { selectFolderEntryExtension, selectHasMetaPath } from './collections';
import { join } from 'path';

View File

@ -11,4 +11,4 @@ const store = createStore<State | undefined, AnyAction, unknown, unknown>(
composeWithDevTools(applyMiddleware(thunkMiddleware as ThunkMiddleware<State>, waitUntilAction)),
);
export default store;
export { store };

View File

@ -14,4 +14,4 @@ export function navigateToEntry(collectionName: string, slug: string) {
return history.replace(`/collections/${collectionName}/entries/${slug}`);
}
export default history;
export { history };