chore: introduce imports ordering (#5463)
This commit is contained in:
committed by
GitHub
parent
30f0e7b031
commit
dbf2920254
@ -1,4 +1,5 @@
|
||||
import { Map, List, fromJS } from 'immutable';
|
||||
|
||||
import {
|
||||
resolveBackend,
|
||||
Backend,
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { stripIndent } from 'common-tags';
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
import {
|
||||
loadConfig,
|
||||
parseConfig,
|
||||
@ -8,8 +10,6 @@ import {
|
||||
handleLocalBackend,
|
||||
} from '../config';
|
||||
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
jest.spyOn(console, 'log').mockImplementation(() => {});
|
||||
jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
jest.mock('../../backend', () => {
|
||||
|
@ -1,9 +1,10 @@
|
||||
import * as actions from '../editorialWorkflow';
|
||||
import { addAssets } from '../media';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import { addAssets } from '../media';
|
||||
import * as actions from '../editorialWorkflow';
|
||||
|
||||
jest.mock('../../backend');
|
||||
jest.mock('../../valueObjects/AssetProxy');
|
||||
jest.mock('netlify-cms-lib-util');
|
||||
|
@ -1,4 +1,7 @@
|
||||
import { fromJS, Map } from 'immutable';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import {
|
||||
createEmptyDraft,
|
||||
createEmptyDraftData,
|
||||
@ -7,8 +10,6 @@ import {
|
||||
getMediaAssets,
|
||||
validateMetaField,
|
||||
} from '../entries';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
import AssetProxy from '../../valueObjects/AssetProxy';
|
||||
|
||||
jest.mock('../../backend');
|
||||
|
@ -1,14 +1,16 @@
|
||||
import { Map } from 'immutable';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import thunk from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import { mocked } from 'ts-jest/utils';
|
||||
|
||||
import { getAsset, ADD_ASSET, LOAD_ASSET_REQUEST } from '../media';
|
||||
import { selectMediaFilePath } from '../../reducers/entries';
|
||||
import type { State } from '../../types/redux';
|
||||
import AssetProxy from '../../valueObjects/AssetProxy';
|
||||
|
||||
import type { State } from '../../types/redux';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
|
||||
const middlewares = [thunk];
|
||||
const mockStore =
|
||||
configureMockStore<Partial<State>, ThunkDispatch<State, {}, AnyAction>>(middlewares);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
import { List, Map } from 'immutable';
|
||||
|
||||
import { insertMedia, persistMedia, deleteMedia } from '../mediaLibrary';
|
||||
|
||||
jest.mock('../../backend');
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { fromJS } from 'immutable';
|
||||
import { searchEntries } from '../search';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import { searchEntries } from '../search';
|
||||
|
||||
const middlewares = [thunk];
|
||||
const mockStore = configureMockStore(middlewares);
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
|
||||
import { currentBackend } from '../backend';
|
||||
|
||||
import type { Credentials, User } from 'netlify-cms-lib-util';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import { currentBackend } from '../backend';
|
||||
import type { State } from '../types/redux';
|
||||
|
||||
const { notifSend, notifClear } = notifActions;
|
||||
|
@ -3,8 +3,7 @@ import { fromJS } from 'immutable';
|
||||
import deepmerge from 'deepmerge';
|
||||
import { produce } from 'immer';
|
||||
import { trimStart, trim, isEmpty } from 'lodash';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
|
||||
import { SIMPLE as SIMPLE_PUBLISH_MODE } from '../constants/publishModes';
|
||||
import { validateConfig } from '../constants/configSchema';
|
||||
import { selectDefaultSortableFields } from '../reducers/collections';
|
||||
@ -12,6 +11,9 @@ import { getIntegrations, selectIntegration } from '../reducers/integrations';
|
||||
import { resolveBackend } from '../backend';
|
||||
import { I18N, I18N_FIELD, I18N_STRUCTURE } from '../lib/i18n';
|
||||
import { FILES, FOLDER } from '../constants/collectionTypes';
|
||||
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type {
|
||||
CmsCollection,
|
||||
CmsConfig,
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
|
||||
import { currentBackend } from '../backend';
|
||||
import { selectDeployPreview } from '../reducers';
|
||||
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { Collection, Entry, State } from '../types/redux';
|
||||
|
||||
const { notifSend } = notifActions;
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { get } from 'lodash';
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import { Map, List } from 'immutable';
|
||||
import { EDITORIAL_WORKFLOW_ERROR } from 'netlify-cms-lib-util';
|
||||
|
||||
import { currentBackend, slugFromCustomPath } from '../backend';
|
||||
import {
|
||||
selectPublishedSlugs,
|
||||
@ -10,9 +11,7 @@ import {
|
||||
selectUnpublishedEntry,
|
||||
} from '../reducers';
|
||||
import { selectEditingDraft } from '../reducers/entries';
|
||||
import type { Status } from '../constants/publishModes';
|
||||
import { EDITORIAL_WORKFLOW, status } from '../constants/publishModes';
|
||||
import { EDITORIAL_WORKFLOW_ERROR } from 'netlify-cms-lib-util';
|
||||
import {
|
||||
loadEntry,
|
||||
entryDeleted,
|
||||
@ -25,6 +24,8 @@ import { createAssetProxy } from '../valueObjects/AssetProxy';
|
||||
import { addAssets } from './media';
|
||||
import { loadMedia } from './mediaLibrary';
|
||||
import ValidationErrorTypes from '../constants/validationErrorTypes';
|
||||
import { navigateToEntry } from '../routing/history';
|
||||
|
||||
import type {
|
||||
Collection,
|
||||
EntryMap,
|
||||
@ -35,7 +36,8 @@ import type {
|
||||
} from '../types/redux';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
import { navigateToEntry } from '../routing/history';
|
||||
import type { Status } from '../constants/publishModes';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
|
||||
const { notifSend } = notifActions;
|
||||
|
||||
|
@ -1,22 +1,30 @@
|
||||
import type { Set } from 'immutable';
|
||||
import { fromJS, List, Map } from 'immutable';
|
||||
import { isEqual } from 'lodash';
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import { serializeValues } from '../lib/serializeEntryValues';
|
||||
import type { Backend } from '../backend';
|
||||
import { currentBackend } from '../backend';
|
||||
import { getIntegrationProvider } from '../integrations';
|
||||
import { selectIntegration, selectPublishedSlugs } from '../reducers';
|
||||
import { selectFields, updateFieldByKey } from '../reducers/collections';
|
||||
import { selectCollectionEntriesCursor } from '../reducers/cursors';
|
||||
import type { ImplementationMediaFile } from 'netlify-cms-lib-util';
|
||||
import { Cursor } from 'netlify-cms-lib-util';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
|
||||
import { selectCollectionEntriesCursor } from '../reducers/cursors';
|
||||
import { selectFields, updateFieldByKey } from '../reducers/collections';
|
||||
import { selectIntegration, selectPublishedSlugs } from '../reducers';
|
||||
import { getIntegrationProvider } from '../integrations';
|
||||
import { currentBackend } from '../backend';
|
||||
import { serializeValues } from '../lib/serializeEntryValues';
|
||||
import { createEntry } from '../valueObjects/Entry';
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
import { createAssetProxy } from '../valueObjects/AssetProxy';
|
||||
import ValidationErrorTypes from '../constants/validationErrorTypes';
|
||||
import { addAssets, getAsset } from './media';
|
||||
import { SortDirection } from '../types/redux';
|
||||
import { waitForMediaLibraryToLoad, loadMedia } from './mediaLibrary';
|
||||
import { waitUntil } from './waitUntil';
|
||||
import { selectIsFetching, selectEntriesSortFields, selectEntryByPath } from '../reducers/entries';
|
||||
import { selectCustomPath } from '../reducers/entryDraft';
|
||||
import { navigateToEntry } from '../routing/history';
|
||||
import { getProcessSegment } from '../lib/formatters';
|
||||
import { hasI18n, duplicateDefaultI18nFields, serializeI18n, I18N, I18N_FIELD } from '../lib/i18n';
|
||||
|
||||
import type { ImplementationMediaFile } from 'netlify-cms-lib-util';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type {
|
||||
Collection,
|
||||
EntryMap,
|
||||
@ -27,17 +35,10 @@ import type {
|
||||
ViewGroup,
|
||||
Entry,
|
||||
} from '../types/redux';
|
||||
import { SortDirection } from '../types/redux';
|
||||
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import { waitForMediaLibraryToLoad, loadMedia } from './mediaLibrary';
|
||||
import { waitUntil } from './waitUntil';
|
||||
import { selectIsFetching, selectEntriesSortFields, selectEntryByPath } from '../reducers/entries';
|
||||
import { selectCustomPath } from '../reducers/entryDraft';
|
||||
import { navigateToEntry } from '../routing/history';
|
||||
import { getProcessSegment } from '../lib/formatters';
|
||||
import { hasI18n, duplicateDefaultI18nFields, serializeI18n, I18N, I18N_FIELD } from '../lib/i18n';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
import type { Backend } from '../backend';
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
import type { Set } from 'immutable';
|
||||
|
||||
const { notifSend } = notifActions;
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
import { createAssetProxy } from '../valueObjects/AssetProxy';
|
||||
import type { Collection, State, EntryMap, EntryField } from '../types/redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import { isAbsolutePath } from 'netlify-cms-lib-util';
|
||||
|
||||
import { createAssetProxy } from '../valueObjects/AssetProxy';
|
||||
import { selectMediaFilePath } from '../reducers/entries';
|
||||
import { selectMediaFileByPath } from '../reducers/mediaLibrary';
|
||||
import { getMediaFile, waitForMediaLibraryToLoad, getMediaDisplayURL } from './mediaLibrary';
|
||||
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
import type { Collection, State, EntryMap, EntryField } from '../types/redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
|
||||
export const ADD_ASSETS = 'ADD_ASSETS';
|
||||
export const ADD_ASSET = 'ADD_ASSET';
|
||||
export const REMOVE_ASSET = 'REMOVE_ASSET';
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { Map } from 'immutable';
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import type { ImplementationMediaFile } from 'netlify-cms-lib-util';
|
||||
import { basename, getBlobSHA } from 'netlify-cms-lib-util';
|
||||
|
||||
import { currentBackend } from '../backend';
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
import { createAssetProxy } from '../valueObjects/AssetProxy';
|
||||
import { selectIntegration } from '../reducers';
|
||||
import {
|
||||
@ -16,6 +15,8 @@ import { getIntegrationProvider } from '../integrations';
|
||||
import { addAsset, removeAsset } from './media';
|
||||
import { addDraftEntryMediaFile, removeDraftEntryMediaFile } from './entries';
|
||||
import { sanitizeSlug } from '../lib/urlHelper';
|
||||
import { waitUntilWithTimeout } from './waitUntil';
|
||||
|
||||
import type {
|
||||
State,
|
||||
MediaFile,
|
||||
@ -25,7 +26,8 @@ import type {
|
||||
} from '../types/redux';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import { waitUntilWithTimeout } from './waitUntil';
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
import type { ImplementationMediaFile } from 'netlify-cms-lib-util';
|
||||
|
||||
const { notifSend } = notifActions;
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import { isEqual } from 'lodash';
|
||||
import type { State } from '../types/redux';
|
||||
|
||||
import { currentBackend } from '../backend';
|
||||
import { getIntegrationProvider } from '../integrations';
|
||||
import { selectIntegration } from '../reducers';
|
||||
|
||||
import type { State } from '../types/redux';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
|
||||
/*
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
|
||||
import { currentBackend } from '../backend';
|
||||
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import type { State } from '../types/redux';
|
||||
import { currentBackend } from '../backend';
|
||||
|
||||
const { notifSend, notifDismiss } = notifActions;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import type { WaitActionArgs } from '../redux/middleware/waitUntilAction';
|
||||
import { WAIT_UNTIL_ACTION } from '../redux/middleware/waitUntilAction';
|
||||
|
||||
import type { WaitActionArgs } from '../redux/middleware/waitUntilAction';
|
||||
import type { ThunkDispatch } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { State } from '../types/redux';
|
||||
|
@ -1,18 +1,6 @@
|
||||
import { attempt, flatten, isError, uniq, trim, sortBy, get, set } from 'lodash';
|
||||
import type { Map } from 'immutable';
|
||||
import { List, fromJS, Set } from 'immutable';
|
||||
import * as fuzzy from 'fuzzy';
|
||||
import type {
|
||||
Implementation as BackendImplementation,
|
||||
DisplayURL,
|
||||
ImplementationEntry,
|
||||
Credentials,
|
||||
User,
|
||||
AsyncLock,
|
||||
UnpublishedEntry,
|
||||
DataFile,
|
||||
UnpublishedEntryDiff,
|
||||
} from 'netlify-cms-lib-util';
|
||||
import {
|
||||
localForage,
|
||||
Cursor,
|
||||
@ -24,6 +12,7 @@ import {
|
||||
} from 'netlify-cms-lib-util';
|
||||
import { basename, join, extname, dirname } from 'path';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
|
||||
import { resolveFormat } from './formats/formats';
|
||||
import { selectUseWorkflow } from './reducers/config';
|
||||
import { selectMediaFilePath, selectEntry } from './reducers/entries';
|
||||
@ -40,24 +29,11 @@ import {
|
||||
selectFieldsComments,
|
||||
selectHasMetaPath,
|
||||
} from './reducers/collections';
|
||||
import type { EntryValue } from './valueObjects/Entry';
|
||||
import { createEntry } from './valueObjects/Entry';
|
||||
import { sanitizeChar } from './lib/urlHelper';
|
||||
import { getBackend, invokeEvent } from './lib/registry';
|
||||
import { commitMessageFormatter, slugFormatter, previewUrlFormatter } from './lib/formatters';
|
||||
import { status } from './constants/publishModes';
|
||||
import type {
|
||||
CmsConfig,
|
||||
EntryMap,
|
||||
FilterRule,
|
||||
EntryDraft,
|
||||
Collection,
|
||||
Collections,
|
||||
CollectionFile,
|
||||
State,
|
||||
EntryField,
|
||||
} from './types/redux';
|
||||
import type AssetProxy from './valueObjects/AssetProxy';
|
||||
import { FOLDER, FILES } from './constants/collectionTypes';
|
||||
import { selectCustomPath } from './reducers/entryDraft';
|
||||
import {
|
||||
@ -72,6 +48,32 @@ import {
|
||||
formatI18nBackup,
|
||||
} from './lib/i18n';
|
||||
|
||||
import type AssetProxy from './valueObjects/AssetProxy';
|
||||
import type {
|
||||
CmsConfig,
|
||||
EntryMap,
|
||||
FilterRule,
|
||||
EntryDraft,
|
||||
Collection,
|
||||
Collections,
|
||||
CollectionFile,
|
||||
State,
|
||||
EntryField,
|
||||
} from './types/redux';
|
||||
import type { EntryValue } from './valueObjects/Entry';
|
||||
import type {
|
||||
Implementation as BackendImplementation,
|
||||
DisplayURL,
|
||||
ImplementationEntry,
|
||||
Credentials,
|
||||
User,
|
||||
AsyncLock,
|
||||
UnpublishedEntry,
|
||||
DataFile,
|
||||
UnpublishedEntryDiff,
|
||||
} from 'netlify-cms-lib-util';
|
||||
import type { Map } from 'immutable';
|
||||
|
||||
const { extractTemplateVars, dateParsers, expandPath } = stringTemplate;
|
||||
|
||||
function updateAssetProxies(
|
||||
|
1
packages/netlify-cms-core/src/bootstrap.js
vendored
1
packages/netlify-cms-core/src/bootstrap.js
vendored
@ -4,6 +4,7 @@ import { Provider, connect } from 'react-redux';
|
||||
import { Route, Router } from 'react-router-dom';
|
||||
import { GlobalStyles } from 'netlify-cms-ui-default';
|
||||
import { I18n } from 'react-polyglot';
|
||||
|
||||
import { store } from './redux';
|
||||
import { history } from './routing/history';
|
||||
import { loadConfig } from './actions/config';
|
||||
|
@ -8,13 +8,14 @@ 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 { Loader, colors } from 'netlify-cms-ui-default';
|
||||
|
||||
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';
|
||||
|
@ -16,8 +16,9 @@ import {
|
||||
buttons,
|
||||
zIndex,
|
||||
} from 'netlify-cms-ui-default';
|
||||
import { SettingsDropdown } from '../UI';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { SettingsDropdown } from '../UI';
|
||||
import { checkBackendStatus } from '../../actions/status';
|
||||
|
||||
const styles = {
|
||||
|
@ -5,6 +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 Sidebar from './Sidebar';
|
||||
import CollectionTop from './CollectionTop';
|
||||
|
@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import { lengths } from 'netlify-cms-ui-default';
|
||||
|
||||
import ViewStyleControl from './ViewStyleControl';
|
||||
import SortControl from './SortControl';
|
||||
import FilterControl from './FilterControl';
|
||||
import { lengths } from 'netlify-cms-ui-default';
|
||||
import GroupControl from './GroupControl';
|
||||
|
||||
const CollectionControlsContainer = styled.div`
|
||||
|
@ -4,6 +4,7 @@ import styled from '@emotion/styled';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Loader, lengths } from 'netlify-cms-ui-default';
|
||||
|
||||
import EntryListing from './EntryListing';
|
||||
|
||||
const PaginationMessage = styled.div`
|
||||
|
@ -7,6 +7,7 @@ import { translate } from 'react-polyglot';
|
||||
import { partial } from 'lodash';
|
||||
import { Cursor } from 'netlify-cms-lib-util';
|
||||
import { colors } from 'netlify-cms-ui-default';
|
||||
|
||||
import {
|
||||
loadEntries as actionLoadEntries,
|
||||
traverseCollectionCursor as actionTraverseCollectionCursor,
|
||||
|
@ -4,6 +4,7 @@ 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 {
|
||||
searchEntries as actionSearchEntries,
|
||||
|
@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import { connect } from 'react-redux';
|
||||
import { boundGetAsset } from '../../../actions/media';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { colors, colorsRaw, components, lengths, zIndex } from 'netlify-cms-ui-default';
|
||||
|
||||
import { boundGetAsset } from '../../../actions/media';
|
||||
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from '../../../constants/collectionViews';
|
||||
import { selectIsLoadingAsset } from '../../../reducers/medias';
|
||||
import { selectEntryCollectionTitle } from '../../../reducers/collections';
|
||||
|
@ -4,6 +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 EntryCard from './EntryCard';
|
||||
|
||||
|
@ -1,13 +1,14 @@
|
||||
import React from 'react';
|
||||
import ConnectedEntriesCollection, {
|
||||
EntriesCollection,
|
||||
filterNestedEntries,
|
||||
} from '../EntriesCollection';
|
||||
import { render } from '@testing-library/react';
|
||||
import { fromJS } from 'immutable';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import ConnectedEntriesCollection, {
|
||||
EntriesCollection,
|
||||
filterNestedEntries,
|
||||
} from '../EntriesCollection';
|
||||
|
||||
jest.mock('../Entries', () => 'mock-entries');
|
||||
|
||||
const middlewares = [];
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Dropdown, DropdownCheckedItem } from 'netlify-cms-ui-default';
|
||||
|
||||
import { ControlButton } from './ControlButton';
|
||||
|
||||
function FilterControl({ viewFilters, t, onFilterClick, filter }) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Dropdown, DropdownItem } from 'netlify-cms-ui-default';
|
||||
|
||||
import { ControlButton } from './ControlButton';
|
||||
|
||||
function GroupControl({ viewGroups, t, onGroupClick, group }) {
|
||||
|
@ -6,13 +6,14 @@ import { connect } from 'react-redux';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { dirname, sep } from 'path';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
import { selectEntryCollectionTitle } from '../../reducers/collections';
|
||||
import { selectEntries } from '../../reducers/entries';
|
||||
import { Icon, colors, components } from 'netlify-cms-ui-default';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { sortBy } from 'lodash';
|
||||
|
||||
import { selectEntries } from '../../reducers/entries';
|
||||
import { selectEntryCollectionTitle } from '../../reducers/collections';
|
||||
|
||||
const { addFileTemplateFields } = stringTemplate;
|
||||
|
||||
const NodeTitleContainer = styled.div`
|
||||
|
@ -6,6 +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 CollectionSearch from './CollectionSearch';
|
||||
import NestedCollection from './NestedCollection';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Dropdown, DropdownItem } from 'netlify-cms-ui-default';
|
||||
|
||||
import { SortDirection } from '../../types/redux';
|
||||
import { ControlButton } from './ControlButton';
|
||||
|
||||
|
@ -1,6 +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';
|
||||
|
||||
const ViewControlsSection = styled.div`
|
||||
|
@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import ConnectedCollection, { Collection } from '../Collection';
|
||||
import { render } from '@testing-library/react';
|
||||
import { fromJS } from 'immutable';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import ConnectedCollection, { Collection } from '../Collection';
|
||||
|
||||
jest.mock('../Entries/EntriesCollection', () => 'mock-entries-collection');
|
||||
jest.mock('../CollectionTop', () => 'mock-collection-top');
|
||||
jest.mock('../CollectionControls', () => 'mock-collection-controls');
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
import { fromJS } from 'immutable';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import ConnectedNestedCollection, {
|
||||
NestedCollection,
|
||||
getTreeData,
|
||||
walk,
|
||||
updateNode,
|
||||
} from '../NestedCollection';
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
import { fromJS } from 'immutable';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
jest.mock('netlify-cms-ui-default', () => {
|
||||
const actual = jest.requireActual('netlify-cms-ui-default');
|
||||
|
@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { Sidebar } from '../Sidebar';
|
||||
import { render } from '@testing-library/react';
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import { Sidebar } from '../Sidebar';
|
||||
|
||||
jest.mock('netlify-cms-ui-default', () => {
|
||||
const actual = jest.requireActual('netlify-cms-ui-default');
|
||||
return {
|
||||
|
@ -5,6 +5,7 @@ import { connect } from 'react-redux';
|
||||
import { Loader } from 'netlify-cms-ui-default';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import { history, navigateToCollection, navigateToNewEntry } from '../../routing/history';
|
||||
import { logoutUser } from '../../actions/auth';
|
||||
import {
|
||||
|
@ -8,6 +8,7 @@ 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, validateMetaField } from '../../../actions/entries';
|
||||
import { addAsset, boundGetAsset } from '../../../actions/media';
|
||||
|
@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { css } from '@emotion/core';
|
||||
import styled from '@emotion/styled';
|
||||
import EditorControl from './EditorControl';
|
||||
import {
|
||||
colors,
|
||||
Dropdown,
|
||||
@ -12,6 +11,8 @@ import {
|
||||
buttons,
|
||||
text,
|
||||
} from 'netlify-cms-ui-default';
|
||||
|
||||
import EditorControl from './EditorControl';
|
||||
import {
|
||||
getI18nInfo,
|
||||
isFieldTranslatable,
|
||||
|
@ -3,6 +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';
|
||||
|
||||
function truthy() {
|
||||
|
@ -13,6 +13,7 @@ import {
|
||||
zIndex,
|
||||
} from 'netlify-cms-ui-default';
|
||||
import { ScrollSync, ScrollSyncPane } from 'react-scroll-sync';
|
||||
|
||||
import EditorControlPane from './EditorControlPane/EditorControlPane';
|
||||
import EditorPreviewPane from './EditorPreviewPane/EditorPreviewPane';
|
||||
import EditorToolbar from './EditorToolbar';
|
||||
|
@ -5,10 +5,11 @@ 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 { connect } from 'react-redux';
|
||||
|
||||
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';
|
||||
|
@ -16,6 +16,7 @@ import {
|
||||
buttons,
|
||||
zIndex,
|
||||
} from 'netlify-cms-ui-default';
|
||||
|
||||
import { status } from '../../constants/publishModes';
|
||||
import { SettingsDropdown } from '../UI';
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
import { Editor } from '../Editor';
|
||||
import { render } from '@testing-library/react';
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import { Editor } from '../Editor';
|
||||
|
||||
jest.mock('lodash/debounce', () => {
|
||||
const flush = jest.fn();
|
||||
return func => {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { EDITORIAL_WORKFLOW } from '../../constants/publishModes';
|
||||
import { selectUnpublishedEntry } from '../../reducers';
|
||||
import { selectAllowDeletion } from '../../reducers/collections';
|
||||
|
@ -6,6 +6,7 @@ import { orderBy, map } from 'lodash';
|
||||
import { translate } from 'react-polyglot';
|
||||
import fuzzy from 'fuzzy';
|
||||
import { fileExtension } from 'netlify-cms-lib-util';
|
||||
|
||||
import {
|
||||
loadMedia as loadMediaAction,
|
||||
persistMedia as persistMediaAction,
|
||||
|
@ -2,11 +2,12 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { css } from '@emotion/core';
|
||||
import styled from '@emotion/styled';
|
||||
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';
|
||||
|
||||
import { FileUploadButton } from '../UI';
|
||||
|
||||
const styles = {
|
||||
button: css`
|
||||
${buttons.button};
|
||||
|
@ -2,12 +2,13 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import styled from '@emotion/styled';
|
||||
import { Waypoint } from 'react-waypoint';
|
||||
import MediaLibraryCard from './MediaLibraryCard';
|
||||
import { Map } from 'immutable';
|
||||
import { colors } from 'netlify-cms-ui-default';
|
||||
import { FixedSizeGrid as Grid } from 'react-window';
|
||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||
|
||||
import MediaLibraryCard from './MediaLibraryCard';
|
||||
|
||||
function CardWrapper(props) {
|
||||
const {
|
||||
rowIndex,
|
||||
|
@ -4,11 +4,12 @@ import styled from '@emotion/styled';
|
||||
import { Map } from 'immutable';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { colors } from 'netlify-cms-ui-default';
|
||||
|
||||
import { Modal } from '../UI';
|
||||
import MediaLibraryTop from './MediaLibraryTop';
|
||||
import MediaLibraryCardGrid from './MediaLibraryCardGrid';
|
||||
import EmptyMessage from './EmptyMessage';
|
||||
import { colors } from 'netlify-cms-ui-default';
|
||||
|
||||
/**
|
||||
* Responsive styling needs to be overhauled. Current setup requires specifying
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import MediaLibrarySearch from './MediaLibrarySearch';
|
||||
import MediaLibraryHeader from './MediaLibraryHeader';
|
||||
import {
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import { CopyToClipBoardButton } from '../MediaLibraryButtons';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
import { CopyToClipBoardButton } from '../MediaLibraryButtons';
|
||||
|
||||
describe('CopyToClipBoardButton', () => {
|
||||
const props = {
|
||||
disabled: false,
|
||||
|
@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
import { Map } from 'immutable';
|
||||
import MediaLibraryCard from '../MediaLibraryCard';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
import MediaLibraryCard from '../MediaLibraryCard';
|
||||
|
||||
describe('MediaLibraryCard', () => {
|
||||
const props = {
|
||||
displayURL: Map({ url: 'url' }),
|
||||
|
@ -4,6 +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';
|
||||
|
||||
const styles = {
|
||||
|
@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
import { ErrorBoundary } from '../ErrorBoundary';
|
||||
import { render } from '@testing-library/react';
|
||||
import { oneLineTrim } from 'common-tags';
|
||||
|
||||
import { ErrorBoundary } from '../ErrorBoundary';
|
||||
|
||||
function WithError() {
|
||||
throw new Error('Some unknown error');
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import {
|
||||
components,
|
||||
shadows,
|
||||
} from 'netlify-cms-ui-default';
|
||||
|
||||
import { createNewEntry } from '../../actions/collections';
|
||||
import {
|
||||
loadUnpublishedEntries,
|
||||
|
@ -6,6 +6,7 @@ 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 WorkflowCard from './WorkflowCard';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { merge } from 'lodash';
|
||||
|
||||
import { validateConfig } from '../configSchema';
|
||||
|
||||
jest.mock('../../lib/registry');
|
||||
|
@ -6,9 +6,10 @@ import {
|
||||
prohibited,
|
||||
} from 'ajv-keywords/dist/keywords';
|
||||
import ajvErrors from 'ajv-errors';
|
||||
import uuid from 'uuid/v4';
|
||||
|
||||
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';
|
||||
|
||||
const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' };
|
||||
|
@ -1,6 +1,7 @@
|
||||
import yaml from '../yaml';
|
||||
import { stripIndent } from 'common-tags';
|
||||
|
||||
import yaml from '../yaml';
|
||||
|
||||
describe('yaml', () => {
|
||||
describe('fromFile', () => {
|
||||
test('loads valid yaml', () => {
|
||||
|
@ -1,10 +1,12 @@
|
||||
import { List } from 'immutable';
|
||||
import { get } from 'lodash';
|
||||
|
||||
import yamlFormatter from './yaml';
|
||||
import tomlFormatter from './toml';
|
||||
import jsonFormatter from './json';
|
||||
import type { Delimiter } from './frontmatter';
|
||||
import { FrontmatterInfer, frontmatterJSON, frontmatterTOML, frontmatterYAML } from './frontmatter';
|
||||
|
||||
import type { Delimiter } from './frontmatter';
|
||||
import type { Collection, EntryObject, Format } from '../types/redux';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import matter from 'gray-matter';
|
||||
|
||||
import tomlFormatter from './toml';
|
||||
import yamlFormatter from './yaml';
|
||||
import jsonFormatter from './json';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import toml from '@iarna/toml';
|
||||
import tomlify from 'tomlify-j0.4';
|
||||
import moment from 'moment';
|
||||
|
||||
import AssetProxy from '../valueObjects/AssetProxy';
|
||||
import { sortKeys } from './helpers';
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
import yaml from 'yaml';
|
||||
|
||||
import { sortKeys } from './helpers';
|
||||
|
||||
import type { YAMLMap, YAMLSeq, Pair, Node } from 'yaml/types';
|
||||
|
||||
function addComments(items: Array<Pair>, comments: Record<string, string>, prefix = '') {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Map } from 'immutable';
|
||||
|
||||
import Algolia from './providers/algolia/implementation';
|
||||
import AssetStore from './providers/assetStore/implementation';
|
||||
import { Map } from 'immutable';
|
||||
|
||||
export function resolveIntegrations(interationsConfig, getToken) {
|
||||
let integrationInstances = Map({});
|
||||
|
@ -1,7 +1,8 @@
|
||||
import _ from 'lodash';
|
||||
import { unsentRequest } from 'netlify-cms-lib-util';
|
||||
|
||||
import { createEntry } from '../../../valueObjects/Entry';
|
||||
import { selectEntrySlug } from '../../../reducers/collections';
|
||||
import { unsentRequest } from 'netlify-cms-lib-util';
|
||||
|
||||
const { fetchWithTimeout: fetch } = unsentRequest;
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { pickBy, trimEnd } from 'lodash';
|
||||
import { addParams } from '../../../lib/urlHelper';
|
||||
import { unsentRequest } from 'netlify-cms-lib-util';
|
||||
|
||||
import { addParams } from '../../../lib/urlHelper';
|
||||
|
||||
const { fetchWithTimeout: fetch } = unsentRequest;
|
||||
|
||||
export default class AssetStore {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { List, Map, fromJS } from 'immutable';
|
||||
|
||||
import {
|
||||
commitMessageFormatter,
|
||||
prepareSlug,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import * as i18n from '../i18n';
|
||||
|
||||
jest.mock('../../reducers/collections', () => {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { serializeValues, deserializeValues } from '../serializeEntryValues';
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import { serializeValues, deserializeValues } from '../serializeEntryValues';
|
||||
|
||||
const values = fromJS({ title: 'New Post', unknown: 'Unknown Field' });
|
||||
const fields = fromJS([{ name: 'title', widget: 'string' }]);
|
||||
|
||||
|
@ -1,18 +1,20 @@
|
||||
import type { Map } from 'immutable';
|
||||
import { flow, partialRight, trimEnd, trimStart } from 'lodash';
|
||||
import { sanitizeSlug } from './urlHelper';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
import { stripIndent } from 'common-tags';
|
||||
|
||||
import {
|
||||
selectIdentifier,
|
||||
selectField,
|
||||
selectInferedField,
|
||||
getFileFromSlug,
|
||||
} from '../reducers/collections';
|
||||
import type { Collection, CmsConfig, CmsSlug, EntryMap } from '../types/redux';
|
||||
import { stripIndent } from 'common-tags';
|
||||
import { sanitizeSlug } from './urlHelper';
|
||||
import { FILES } from '../constants/collectionTypes';
|
||||
import { COMMIT_AUTHOR, COMMIT_DATE } from '../constants/commitProps';
|
||||
|
||||
import type { Collection, CmsConfig, CmsSlug, EntryMap } from '../types/redux';
|
||||
import type { Map } from 'immutable';
|
||||
|
||||
const {
|
||||
compileStringTemplate,
|
||||
parseDateFromEntry,
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { Map, List } from 'immutable';
|
||||
import { set, trimEnd, groupBy, escapeRegExp } from 'lodash';
|
||||
import type { Collection, Entry, EntryDraft, EntryField, EntryMap } from '../types/redux';
|
||||
|
||||
import { selectEntrySlug } from '../reducers/collections';
|
||||
|
||||
import type { Collection, Entry, EntryDraft, EntryField, EntryMap } from '../types/redux';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
|
||||
export const I18N = 'i18n';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { merge } from 'lodash';
|
||||
|
||||
import { getLocale } from './registry';
|
||||
|
||||
export function getPhrases(locale) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Map } from 'immutable';
|
||||
import produce from 'immer';
|
||||
import { oneLine } from 'common-tags';
|
||||
|
||||
import EditorComponent from '../valueObjects/EditorComponent';
|
||||
|
||||
const allowedEvents = [
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { isNil } from 'lodash';
|
||||
import { Map, List } from 'immutable';
|
||||
|
||||
import { getWidgetValueSerializer } from './registry';
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@ import urlJoin from 'url-join';
|
||||
import diacritics from 'diacritics';
|
||||
import sanitizeFilename from 'sanitize-filename';
|
||||
import { isString, escapeRegExp, flow, partialRight } from 'lodash';
|
||||
|
||||
import type { CmsSlug } from '../types/redux';
|
||||
|
||||
function getUrl(urlString: string, direct?: boolean) {
|
||||
|
@ -3,10 +3,12 @@
|
||||
* registered via `registerMediaLibrary`.
|
||||
*/
|
||||
import { once } from 'lodash';
|
||||
|
||||
import { getMediaLibrary } from './lib/registry';
|
||||
import { store } from './redux';
|
||||
import { configFailed } from './actions/config';
|
||||
import { createMediaLibrary, insertMedia } from './actions/mediaLibrary';
|
||||
|
||||
import type { MediaLibraryInstance } from './types/redux';
|
||||
|
||||
type MediaLibraryOptions = {};
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { fromJS, Map } from 'immutable';
|
||||
|
||||
import { configLoaded } from '../../actions/config';
|
||||
import collections, {
|
||||
selectAllowDeletion,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { OrderedMap, fromJS } from 'immutable';
|
||||
|
||||
import * as actions from '../../actions/entries';
|
||||
import reducer, {
|
||||
selectMediaFolder,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Map, fromJS } from 'immutable';
|
||||
|
||||
import * as actions from '../../actions/entries';
|
||||
import reducer from '../entryDraft';
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
import integrations from '../integrations';
|
||||
import type { ConfigAction } from '../../actions/config';
|
||||
import { CONFIG_SUCCESS } from '../../actions/config';
|
||||
import { FOLDER } from '../../constants/collectionTypes';
|
||||
|
||||
import type { ConfigAction } from '../../actions/config';
|
||||
|
||||
describe('integrations', () => {
|
||||
it('should return default state when no integrations', () => {
|
||||
const result = integrations(null, {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Map, fromJS } from 'immutable';
|
||||
|
||||
import { mediaDeleted } from '../../actions/mediaLibrary';
|
||||
import mediaLibrary, {
|
||||
selectMediaFiles,
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { produce } from 'immer';
|
||||
import type { User } from 'netlify-cms-lib-util';
|
||||
import type { AuthAction } from '../actions/auth';
|
||||
|
||||
import {
|
||||
AUTH_REQUEST,
|
||||
AUTH_SUCCESS,
|
||||
@ -9,6 +8,9 @@ import {
|
||||
LOGOUT,
|
||||
} from '../actions/auth';
|
||||
|
||||
import type { User } from 'netlify-cms-lib-util';
|
||||
import type { AuthAction } from '../actions/auth';
|
||||
|
||||
export type Auth = {
|
||||
isFetching: boolean;
|
||||
user: User | undefined;
|
||||
|
@ -1,12 +1,16 @@
|
||||
import { List, Set, fromJS, OrderedMap } from 'immutable';
|
||||
import { get, escapeRegExp } from 'lodash';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
|
||||
import consoleError from '../lib/consoleError';
|
||||
import type { ConfigAction } from '../actions/config';
|
||||
import { CONFIG_SUCCESS } from '../actions/config';
|
||||
import { FILES, FOLDER } from '../constants/collectionTypes';
|
||||
import { COMMIT_DATE, COMMIT_AUTHOR } from '../constants/commitProps';
|
||||
import { INFERABLE_FIELDS, IDENTIFIER_FIELDS, SORTABLE_FIELDS } from '../constants/fieldInference';
|
||||
import { formatExtensions } from '../formats/formats';
|
||||
import { selectMediaFolder } from './entries';
|
||||
import { summaryFormatter } from '../lib/formatters';
|
||||
|
||||
import type {
|
||||
Collection,
|
||||
Collections,
|
||||
@ -17,9 +21,7 @@ import type {
|
||||
ViewGroup,
|
||||
CmsConfig,
|
||||
} from '../types/redux';
|
||||
import { selectMediaFolder } from './entries';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
import { summaryFormatter } from '../lib/formatters';
|
||||
import type { ConfigAction } from '../actions/config';
|
||||
import type { Backend } from '../backend';
|
||||
|
||||
const { keyToPathArray } = stringTemplate;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { combineReducers } from 'redux';
|
||||
import { reducer as notifReducer } from 'redux-notifications';
|
||||
|
||||
import reducers from './index';
|
||||
|
||||
function createRootReducer() {
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { produce } from 'immer';
|
||||
import type { ConfigAction } from '../actions/config';
|
||||
|
||||
import { CONFIG_REQUEST, CONFIG_SUCCESS, CONFIG_FAILURE } from '../actions/config';
|
||||
import { EDITORIAL_WORKFLOW } from '../constants/publishModes';
|
||||
|
||||
import type { ConfigAction } from '../actions/config';
|
||||
import type { CmsConfig } from '../types/redux';
|
||||
|
||||
const defaultState = {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { fromJS } from 'immutable';
|
||||
import { Cursor } from 'netlify-cms-lib-util';
|
||||
|
||||
import {
|
||||
ENTRIES_SUCCESS,
|
||||
SORT_ENTRIES_SUCCESS,
|
||||
|
@ -1,11 +1,13 @@
|
||||
import { produce } from 'immer';
|
||||
import type { DeploysAction } from '../actions/deploys';
|
||||
|
||||
import {
|
||||
DEPLOY_PREVIEW_REQUEST,
|
||||
DEPLOY_PREVIEW_SUCCESS,
|
||||
DEPLOY_PREVIEW_FAILURE,
|
||||
} from '../actions/deploys';
|
||||
|
||||
import type { DeploysAction } from '../actions/deploys';
|
||||
|
||||
export type Deploys = {
|
||||
[key: string]: {
|
||||
isFetching: boolean;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Map, List, fromJS } from 'immutable';
|
||||
import { startsWith } from 'lodash';
|
||||
|
||||
import { EDITORIAL_WORKFLOW } from '../constants/publishModes';
|
||||
import {
|
||||
UNPUBLISHED_ENTRY_REQUEST,
|
||||
@ -19,6 +20,7 @@ import {
|
||||
UNPUBLISHED_ENTRY_DELETE_SUCCESS,
|
||||
} from '../actions/editorialWorkflow';
|
||||
import { CONFIG_SUCCESS } from '../actions/config';
|
||||
|
||||
import type { EditorialWorkflowAction, EditorialWorkflow, Entities } from '../types/redux';
|
||||
|
||||
function unpublishedEntries(state = Map(), action: EditorialWorkflowAction) {
|
||||
|
@ -1,5 +1,13 @@
|
||||
import { Map, List, fromJS, OrderedMap, Set } from 'immutable';
|
||||
import { dirname, join } from 'path';
|
||||
import { isAbsolutePath, basename } from 'netlify-cms-lib-util';
|
||||
import { trim, once, sortBy, set, orderBy, groupBy } from 'lodash';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
|
||||
import { SortDirection } from '../types/redux';
|
||||
import { folderFormatter } from '../lib/formatters';
|
||||
import { selectSortDataPath } from './collections';
|
||||
import { SEARCH_ENTRIES_SUCCESS } from '../actions/search';
|
||||
import {
|
||||
ENTRY_REQUEST,
|
||||
ENTRY_SUCCESS,
|
||||
@ -19,7 +27,9 @@ import {
|
||||
GROUP_ENTRIES_FAILURE,
|
||||
CHANGE_VIEW_STYLE,
|
||||
} from '../actions/entries';
|
||||
import { SEARCH_ENTRIES_SUCCESS } from '../actions/search';
|
||||
import { VIEW_STYLE_LIST } from '../constants/collectionViews';
|
||||
import { joinUrlPath } from '../lib/urlHelper';
|
||||
|
||||
import type {
|
||||
EntriesAction,
|
||||
EntryRequestPayload,
|
||||
@ -52,14 +62,6 @@ import type {
|
||||
EntriesGroupFailurePayload,
|
||||
GroupOfEntries,
|
||||
} from '../types/redux';
|
||||
import { SortDirection } from '../types/redux';
|
||||
import { folderFormatter } from '../lib/formatters';
|
||||
import { isAbsolutePath, basename } from 'netlify-cms-lib-util';
|
||||
import { trim, once, sortBy, set, orderBy, groupBy } from 'lodash';
|
||||
import { selectSortDataPath } from './collections';
|
||||
import { stringTemplate } from 'netlify-cms-lib-widgets';
|
||||
import { VIEW_STYLE_LIST } from '../constants/collectionViews';
|
||||
import { joinUrlPath } from '../lib/urlHelper';
|
||||
|
||||
const { keyToPathArray } = stringTemplate;
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
import { Map, List, fromJS } from 'immutable';
|
||||
import uuid from 'uuid/v4';
|
||||
import { get } from 'lodash';
|
||||
import { join } from 'path';
|
||||
|
||||
import {
|
||||
DRAFT_CREATE_FROM_ENTRY,
|
||||
DRAFT_CREATE_EMPTY,
|
||||
@ -22,9 +25,7 @@ import {
|
||||
UNPUBLISHED_ENTRY_PERSIST_SUCCESS,
|
||||
UNPUBLISHED_ENTRY_PERSIST_FAILURE,
|
||||
} from '../actions/editorialWorkflow';
|
||||
import { get } from 'lodash';
|
||||
import { selectFolderEntryExtension, selectHasMetaPath } from './collections';
|
||||
import { join } from 'path';
|
||||
import { getDataPath, duplicateI18nFields } from '../lib/i18n';
|
||||
|
||||
const initialState = Map({
|
||||
|
@ -1,7 +1,9 @@
|
||||
import type { AnyAction } from 'redux';
|
||||
import { produce } from 'immer';
|
||||
|
||||
import { USE_OPEN_AUTHORING } from '../actions/auth';
|
||||
|
||||
import type { AnyAction } from 'redux';
|
||||
|
||||
export type GlobalUI = {
|
||||
isFetching: boolean;
|
||||
useOpenAuthoring: boolean;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { List } from 'immutable';
|
||||
|
||||
import auth from './auth';
|
||||
import config from './config';
|
||||
import integrations, * as fromIntegrations from './integrations';
|
||||
@ -13,6 +14,7 @@ import mediaLibrary from './mediaLibrary';
|
||||
import deploys, * as fromDeploys from './deploys';
|
||||
import globalUI from './globalUI';
|
||||
import status from './status';
|
||||
|
||||
import type { Status } from '../constants/publishModes';
|
||||
import type { State, Collection } from '../types/redux';
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { fromJS } from 'immutable';
|
||||
import type { ConfigAction } from '../actions/config';
|
||||
|
||||
import { CONFIG_SUCCESS } from '../actions/config';
|
||||
|
||||
import type { ConfigAction } from '../actions/config';
|
||||
import type { Integrations, CmsConfig } from '../types/redux';
|
||||
|
||||
interface Acc {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Map, List } from 'immutable';
|
||||
import uuid from 'uuid/v4';
|
||||
import type { MediaLibraryAction } from '../actions/mediaLibrary';
|
||||
import { dirname } from 'path';
|
||||
|
||||
import {
|
||||
MEDIA_LIBRARY_OPEN,
|
||||
MEDIA_LIBRARY_CLOSE,
|
||||
@ -22,6 +23,8 @@ import {
|
||||
} from '../actions/mediaLibrary';
|
||||
import { selectEditingDraft, selectMediaFolder } from './entries';
|
||||
import { selectIntegration } from './';
|
||||
|
||||
import type { MediaLibraryAction } from '../actions/mediaLibrary';
|
||||
import type {
|
||||
State,
|
||||
MediaLibraryInstance,
|
||||
@ -30,7 +33,6 @@ import type {
|
||||
DisplayURLState,
|
||||
EntryField,
|
||||
} from '../types/redux';
|
||||
import { dirname } from 'path';
|
||||
|
||||
const defaultState: {
|
||||
isVisible: boolean;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { produce } from 'immer';
|
||||
import type { MediasAction } from '../actions/media';
|
||||
|
||||
import {
|
||||
ADD_ASSETS,
|
||||
ADD_ASSET,
|
||||
@ -8,6 +8,8 @@ import {
|
||||
LOAD_ASSET_SUCCESS,
|
||||
LOAD_ASSET_FAILURE,
|
||||
} from '../actions/media';
|
||||
|
||||
import type { MediasAction } from '../actions/media';
|
||||
import type AssetProxy from '../valueObjects/AssetProxy';
|
||||
|
||||
export type Medias = {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { produce } from 'immer';
|
||||
|
||||
import type { SearchAction } from '../actions/search';
|
||||
import {
|
||||
QUERY_FAILURE,
|
||||
QUERY_REQUEST,
|
||||
@ -10,6 +9,8 @@ import {
|
||||
SEARCH_ENTRIES_REQUEST,
|
||||
SEARCH_ENTRIES_SUCCESS,
|
||||
} from '../actions/search';
|
||||
|
||||
import type { SearchAction } from '../actions/search';
|
||||
import type { EntryValue } from '../valueObjects/Entry';
|
||||
|
||||
export type Search = {
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { produce } from 'immer';
|
||||
import type { StatusAction } from '../actions/status';
|
||||
|
||||
import { STATUS_REQUEST, STATUS_SUCCESS, STATUS_FAILURE } from '../actions/status';
|
||||
|
||||
import type { StatusAction } from '../actions/status';
|
||||
|
||||
export type Status = {
|
||||
isFetching: boolean;
|
||||
status: {
|
||||
|
@ -1,10 +1,12 @@
|
||||
import type { AnyAction } from 'redux';
|
||||
import { createStore, applyMiddleware } from 'redux';
|
||||
import { composeWithDevTools } from 'redux-devtools-extension';
|
||||
import type { ThunkMiddleware } from 'redux-thunk';
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
|
||||
import { waitUntilAction } from './middleware/waitUntilAction';
|
||||
import createRootReducer from '../reducers/combinedReducer';
|
||||
|
||||
import type { ThunkMiddleware } from 'redux-thunk';
|
||||
import type { AnyAction } from 'redux';
|
||||
import type { State } from '../types/redux';
|
||||
import type { Reducer } from 'react';
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user