fix build, migrate test backend
This commit is contained in:
parent
2e7406862e
commit
040dd6859c
@ -16,9 +16,10 @@
|
|||||||
],
|
],
|
||||||
"pre-commit": "lint:staged",
|
"pre-commit": "lint:staged",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "lerna run --parallel watch",
|
"bootstrap": "lerna bootstrap && lerna link --force-local",
|
||||||
"clean": "cd packages && rimraf */.cache */*.js */*.css */*.svg */*.map",
|
"start": "yarn bootstrap && yarn watch",
|
||||||
"reset": "yarn clean && lerna clean --yes && lerna bootstrap && cd packages/netlify-cms-core && yarn link netlify-cms-lib-auth netlify-cms-lib-util netlify-cms-ui-default netlify-cms-editor-component-image"
|
"watch": "lerna run watch --parallel",
|
||||||
|
"clean": "cd packages && rimraf */.cache */*.js */*.css */*.svg */*.map"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
|
30
packages/netlify-cms-backend-github/package.json
Normal file
30
packages/netlify-cms-backend-github/package.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "netlify-cms-backend-github",
|
||||||
|
"description": "GitHub backend for Netlify CMS",
|
||||||
|
"version": "2.0.0-alpha.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"netlify",
|
||||||
|
"netlify-cms",
|
||||||
|
"backend",
|
||||||
|
"github"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"watch": "parcel watch src/*.js --out-dir . --no-cache",
|
||||||
|
"build": "parcel build src/*.js --out-dir . --no-cache"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"js-base64": "^2.4.8",
|
||||||
|
"lodash": "^4.17.10",
|
||||||
|
"netlify-cms-lib-auth": "file:../netlify-cms-lib-auth",
|
||||||
|
"netlify-cms-lib-util": "file:../netlify-cms-lib-util",
|
||||||
|
"netlify-cms-ui-default": "file:../netlify-cms-ui-default",
|
||||||
|
"prop-types": "^15.6.2",
|
||||||
|
"react": "^16.4.1",
|
||||||
|
"react-emotion": "^9.2.6",
|
||||||
|
"semaphore": "^1.1.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"parcel-bundler": "^1.9.4"
|
||||||
|
}
|
||||||
|
}
|
@ -2,8 +2,6 @@ import localForage from "netlify-cms-lib-util/localForage";
|
|||||||
import { Base64 } from "js-base64";
|
import { Base64 } from "js-base64";
|
||||||
import { uniq, initial, last, get, find, hasIn, partial } from "lodash";
|
import { uniq, initial, last, get, find, hasIn, partial } from "lodash";
|
||||||
import { filterPromises, resolvePromiseProperties } from "netlify-cms-lib-util/promise";
|
import { filterPromises, resolvePromiseProperties } from "netlify-cms-lib-util/promise";
|
||||||
import AssetProxy from "ValueObjects/AssetProxy";
|
|
||||||
import { SIMPLE, EDITORIAL_WORKFLOW, status } from "Constants/publishModes";
|
|
||||||
import APIError from "netlify-cms-lib-util/APIError";
|
import APIError from "netlify-cms-lib-util/APIError";
|
||||||
import EditorialWorkflowError from "netlify-cms-lib-util/EditorialWorkflowError";
|
import EditorialWorkflowError from "netlify-cms-lib-util/EditorialWorkflowError";
|
||||||
|
|
||||||
@ -17,6 +15,8 @@ export default class API {
|
|||||||
this.repo = config.repo || "";
|
this.repo = config.repo || "";
|
||||||
this.repoURL = `/repos/${ this.repo }`;
|
this.repoURL = `/repos/${ this.repo }`;
|
||||||
this.merge_method = config.squash_merges ? "squash" : "merge";
|
this.merge_method = config.squash_merges ? "squash" : "merge";
|
||||||
|
this.initialStatus = config.initialStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
user() {
|
user() {
|
||||||
@ -287,13 +287,13 @@ export default class API {
|
|||||||
const fileTree = this.composeFileTree(files);
|
const fileTree = this.composeFileTree(files);
|
||||||
|
|
||||||
return Promise.all(uploadPromises).then(() => {
|
return Promise.all(uploadPromises).then(() => {
|
||||||
if (!options.mode || (options.mode && options.mode === SIMPLE)) {
|
if (!options.useWorkflow) {
|
||||||
return this.getBranch()
|
return this.getBranch()
|
||||||
.then(branchData => this.updateTree(branchData.commit.sha, "/", fileTree))
|
.then(branchData => this.updateTree(branchData.commit.sha, "/", fileTree))
|
||||||
.then(changeTree => this.commit(options.commitMessage, changeTree))
|
.then(changeTree => this.commit(options.commitMessage, changeTree))
|
||||||
.then(response => this.patchBranch(this.branch, response.sha));
|
.then(response => this.patchBranch(this.branch, response.sha));
|
||||||
|
|
||||||
} else if (options.mode && options.mode === EDITORIAL_WORKFLOW) {
|
} else {
|
||||||
const mediaFilesList = mediaFiles.map(file => ({ path: file.path, sha: file.sha }));
|
const mediaFilesList = mediaFiles.map(file => ({ path: file.path, sha: file.sha }));
|
||||||
return this.editorialWorkflowGit(fileTree, entry, mediaFilesList, options);
|
return this.editorialWorkflowGit(fileTree, entry, mediaFilesList, options);
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ export default class API {
|
|||||||
head: prResponse.head && prResponse.head.sha,
|
head: prResponse.head && prResponse.head.sha,
|
||||||
},
|
},
|
||||||
user: user.name || user.login,
|
user: user.name || user.login,
|
||||||
status: status.first(),
|
status: this.initialStatus,
|
||||||
branch: branchName,
|
branch: branchName,
|
||||||
collection: options.collectionName,
|
collection: options.collectionName,
|
||||||
title: options.parsedData && options.parsedData.title,
|
title: options.parsedData && options.parsedData.title,
|
@ -1,7 +1,39 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import styled from 'react-emotion';
|
||||||
import Authenticator from 'netlify-cms-lib-auth/netlify-auth';
|
import Authenticator from 'netlify-cms-lib-auth/netlify-auth';
|
||||||
import Icon from 'netlify-cms-ui-default/Icon';
|
import Icon from 'netlify-cms-ui-default/Icon';
|
||||||
|
import { buttons, shadows } from 'netlify-cms-ui-default/styles';
|
||||||
|
|
||||||
|
const StyledAuthenticationPage = styled.section`
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
`
|
||||||
|
|
||||||
|
const AuthenticationPageLogo = styled(Icon)`
|
||||||
|
color: #c4c6d2;
|
||||||
|
margin-top: -300px;
|
||||||
|
`
|
||||||
|
|
||||||
|
const LoginButton = styled.button`
|
||||||
|
${buttons.button};
|
||||||
|
${shadows.dropDeep};
|
||||||
|
${buttons.default};
|
||||||
|
${buttons.gray};
|
||||||
|
|
||||||
|
padding: 0 30px;
|
||||||
|
margin-top: -80px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
${Icon} {
|
||||||
|
margin-right: 18px;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
export default class AuthenticationPage extends React.Component {
|
export default class AuthenticationPage extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -37,17 +69,13 @@ export default class AuthenticationPage extends React.Component {
|
|||||||
const { inProgress } = this.props;
|
const { inProgress } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="nc-githubAuthenticationPage-root">
|
<StyledAuthenticationPage>
|
||||||
<Icon className="nc-githubAuthenticationPage-logo" size="500px" type="netlify-cms"/>
|
<AuthenticationPageLogo size="500px" type="netlify-cms"/>
|
||||||
{loginError && <p>{loginError}</p>}
|
{loginError ? <p>{loginError}</p> : null}
|
||||||
<button
|
<LoginButton disabled={inProgress} onClick={this.handleLogin}>
|
||||||
className="nc-githubAuthenticationPage-button"
|
|
||||||
disabled={inProgress}
|
|
||||||
onClick={this.handleLogin}
|
|
||||||
>
|
|
||||||
<Icon type="github" /> {inProgress ? "Logging in..." : "Login with GitHub"}
|
<Icon type="github" /> {inProgress ? "Logging in..." : "Login with GitHub"}
|
||||||
</button>
|
</LoginButton>
|
||||||
</section>
|
</StyledAuthenticationPage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,3 @@
|
|||||||
import AssetProxy from "ValueObjects/AssetProxy";
|
|
||||||
import API from "../API";
|
import API from "../API";
|
||||||
|
|
||||||
describe('github API', () => {
|
describe('github API', () => {
|
30
packages/netlify-cms-backend-test/package.json
Normal file
30
packages/netlify-cms-backend-test/package.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "netlify-cms-backend-test",
|
||||||
|
"description": "Development testing backend for Netlify CMS",
|
||||||
|
"version": "2.0.0-alpha.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"netlify",
|
||||||
|
"netlify-cms",
|
||||||
|
"backend"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"watch": "parcel watch src/*.js --out-dir . --no-cache",
|
||||||
|
"build": "parcel build src/*.js --out-dir . --no-cache"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"immutable": "^3.8.2",
|
||||||
|
"lodash": "^4.17.10",
|
||||||
|
"netlify": "^1.2.0",
|
||||||
|
"netlify-cms-lib-util": "file:../netlify-cms-lib-util",
|
||||||
|
"netlify-cms-ui-default": "file:../netlify-cms-ui-default",
|
||||||
|
"prop-types": "^15.6.2",
|
||||||
|
"react": "^16.4.1",
|
||||||
|
"react-emotion": "^9.2.6",
|
||||||
|
"react-immutable-proptypes": "^2.1.0",
|
||||||
|
"uuid": "^3.3.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"parcel-bundler": "^1.9.4"
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import React from 'react';
|
|
||||||
import Icon from 'netlify-cms-ui-default/Icon';
|
import Icon from 'netlify-cms-ui-default/Icon';
|
||||||
|
|
||||||
export default class AuthenticationPage extends React.Component {
|
export default class AuthenticationPage extends React.Component {
|
@ -1,9 +1,8 @@
|
|||||||
|
import { fromJS } from 'immutable';
|
||||||
import { remove, attempt, isError, take } from 'lodash';
|
import { remove, attempt, isError, take } from 'lodash';
|
||||||
import uuid from 'uuid/v4';
|
import uuid from 'uuid/v4';
|
||||||
import { fromJS } from 'immutable';
|
|
||||||
import { EDITORIAL_WORKFLOW, status } from 'Constants/publishModes';
|
|
||||||
import EditorialWorkflowError from 'netlify-cms-lib-util/EditorialWorkflowError';
|
import EditorialWorkflowError from 'netlify-cms-lib-util/EditorialWorkflowError';
|
||||||
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from 'ValueObjects/Cursor'
|
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from 'netlify-cms-lib-util/Cursor'
|
||||||
import AuthenticationPage from './AuthenticationPage';
|
import AuthenticationPage from './AuthenticationPage';
|
||||||
|
|
||||||
window.repoFiles = window.repoFiles || {};
|
window.repoFiles = window.repoFiles || {};
|
||||||
@ -47,6 +46,7 @@ export default class TestRepo {
|
|||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.assets = [];
|
this.assets = [];
|
||||||
|
this.initialStatus = config.initialStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
authComponent() {
|
authComponent() {
|
||||||
@ -135,7 +135,7 @@ export default class TestRepo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
persistEntry({ path, raw, slug }, mediaFiles = [], options = {}) {
|
persistEntry({ path, raw, slug }, mediaFiles = [], options = {}) {
|
||||||
if (options.mode === EDITORIAL_WORKFLOW) {
|
if (options.useWorkflow) {
|
||||||
const unpubStore = window.repoFilesUnpublished;
|
const unpubStore = window.repoFilesUnpublished;
|
||||||
const existingEntryIndex = unpubStore.findIndex(e => e.file.path === path);
|
const existingEntryIndex = unpubStore.findIndex(e => e.file.path === path);
|
||||||
if (existingEntryIndex >= 0) {
|
if (existingEntryIndex >= 0) {
|
||||||
@ -151,7 +151,7 @@ export default class TestRepo {
|
|||||||
},
|
},
|
||||||
metaData: {
|
metaData: {
|
||||||
collection: options.collectionName,
|
collection: options.collectionName,
|
||||||
status: status.first(),
|
status: this.initialStatus,
|
||||||
title: options.parsedData && options.parsedData.title,
|
title: options.parsedData && options.parsedData.title,
|
||||||
description: options.parsedData && options.parsedData.description,
|
description: options.parsedData && options.parsedData.description,
|
||||||
},
|
},
|
@ -16,7 +16,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "cross-env NETLIFY_CMS_VERSION=$npm_package_version parcel example/index.html --no-cache --open",
|
"watch": "cross-env NETLIFY_CMS_VERSION=$npm_package_version parcel example/index.html --no-cache --open",
|
||||||
"build": "cross-env NETLIFY_CMS_VERSION=$npm_package_version parcel build example/index.html --no-cache"
|
"build": "cross-env NETLIFY_CMS_VERSION=$npm_package_version parcel build example/index.html --no-cache "
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"netlify",
|
"netlify",
|
||||||
|
@ -6,7 +6,7 @@ import { getIntegrationProvider } from 'Integrations';
|
|||||||
import { getAsset, selectIntegration } from 'Reducers';
|
import { getAsset, selectIntegration } from 'Reducers';
|
||||||
import { selectFields } from 'Reducers/collections';
|
import { selectFields } from 'Reducers/collections';
|
||||||
import { selectCollectionEntriesCursor } from 'Reducers/cursors';
|
import { selectCollectionEntriesCursor } from 'Reducers/cursors';
|
||||||
import Cursor from 'ValueObjects/Cursor';
|
import Cursor from 'netlify-cms-lib-util/Cursor'
|
||||||
import { createEntry } from 'ValueObjects/Entry';
|
import { createEntry } from 'ValueObjects/Entry';
|
||||||
import ValidationErrorTypes from 'Constants/validationErrorTypes';
|
import ValidationErrorTypes from 'Constants/validationErrorTypes';
|
||||||
import isArray from 'lodash/isArray';
|
import isArray from 'lodash/isArray';
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { attempt, flatten, isError } from 'lodash';
|
import { attempt, flatten, isError } from 'lodash';
|
||||||
import { fromJS, Map } from 'immutable';
|
import { fromJS, Map } from 'immutable';
|
||||||
import fuzzy from 'fuzzy';
|
import fuzzy from 'fuzzy';
|
||||||
|
import GitHubBackend from "netlify-cms-backend-github";
|
||||||
|
import TestRepoBackend from "netlify-cms-backend-test";
|
||||||
import { resolveFormat } from "Formats/formats";
|
import { resolveFormat } from "Formats/formats";
|
||||||
import { selectIntegration } from 'Reducers/integrations';
|
import { selectIntegration } from 'Reducers/integrations';
|
||||||
import {
|
import {
|
||||||
@ -15,13 +17,12 @@ import {
|
|||||||
} from "Reducers/collections";
|
} from "Reducers/collections";
|
||||||
import { createEntry } from "ValueObjects/Entry";
|
import { createEntry } from "ValueObjects/Entry";
|
||||||
import { sanitizeSlug } from "Lib/urlHelper";
|
import { sanitizeSlug } from "Lib/urlHelper";
|
||||||
import TestRepoBackend from "./test-repo/implementation";
|
|
||||||
import GitHubBackend from "./github/implementation";
|
|
||||||
import GitLabBackend from "./gitlab/implementation";
|
import GitLabBackend from "./gitlab/implementation";
|
||||||
import BitBucketBackend from "./bitbucket/implementation";
|
import BitBucketBackend from "./bitbucket/implementation";
|
||||||
import GitGatewayBackend from "./git-gateway/implementation";
|
import GitGatewayBackend from "./git-gateway/implementation";
|
||||||
import { registerBackend, getBackend } from 'Lib/registry';
|
import { registerBackend, getBackend } from 'Lib/registry';
|
||||||
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from '../valueObjects/Cursor';
|
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from 'netlify-cms-lib-util/Cursor'
|
||||||
|
import { EDITORIAL_WORKFLOW, status } from 'Constants/publishModes';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register internal backends
|
* Register internal backends
|
||||||
@ -395,7 +396,7 @@ class Backend {
|
|||||||
|
|
||||||
const commitMessage = commitMessageFormatter(newEntry ? 'create' : 'update', config, { collection, slug: entryObj.slug, path: entryObj.path });
|
const commitMessage = commitMessageFormatter(newEntry ? 'create' : 'update', config, { collection, slug: entryObj.slug, path: entryObj.path });
|
||||||
|
|
||||||
const mode = config.get("publish_mode");
|
const useWorkflow = config.get("publish_mode") === EDITORIAL_WORKFLOW;
|
||||||
|
|
||||||
const collectionName = collection.get("name");
|
const collectionName = collection.get("name");
|
||||||
|
|
||||||
@ -404,7 +405,15 @@ class Backend {
|
|||||||
*/
|
*/
|
||||||
const hasAssetStore = integrations && !!selectIntegration(integrations, null, 'assetStore');
|
const hasAssetStore = integrations && !!selectIntegration(integrations, null, 'assetStore');
|
||||||
const updatedOptions = { ...options, hasAssetStore };
|
const updatedOptions = { ...options, hasAssetStore };
|
||||||
const opts = { newEntry, parsedData, commitMessage, collectionName, mode, ...updatedOptions };
|
const opts = {
|
||||||
|
newEntry,
|
||||||
|
parsedData,
|
||||||
|
commitMessage,
|
||||||
|
collectionName,
|
||||||
|
useWorkflow,
|
||||||
|
initialStatus: status.first(),
|
||||||
|
...updatedOptions
|
||||||
|
};
|
||||||
|
|
||||||
return this.implementation.persistEntry(entryObj, MediaFiles, opts)
|
return this.implementation.persistEntry(entryObj, MediaFiles, opts)
|
||||||
.then(() => entryObj.slug);
|
.then(() => entryObj.slug);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import GithubAPI from "Backends/github/API";
|
import GithubAPI from "netlify-cms-backend-github/API";
|
||||||
import APIError from "netlify-cms-lib-util/APIError";
|
import APIError from "netlify-cms-lib-util/APIError";
|
||||||
|
|
||||||
export default class API extends GithubAPI {
|
export default class API extends GithubAPI {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import GithubAPI from "Backends/github/API";
|
import GithubAPI from "netlify-cms-backend-github/API";
|
||||||
import APIError from "netlify-cms-lib-util/APIError";
|
import APIError from "netlify-cms-lib-util/APIError";
|
||||||
|
|
||||||
export default class API extends GithubAPI {
|
export default class API extends GithubAPI {
|
||||||
|
@ -2,8 +2,8 @@ import GoTrue from "gotrue-js";
|
|||||||
import jwtDecode from 'jwt-decode';
|
import jwtDecode from 'jwt-decode';
|
||||||
import {List} from 'immutable';
|
import {List} from 'immutable';
|
||||||
import { get, pick, intersection } from "lodash";
|
import { get, pick, intersection } from "lodash";
|
||||||
import unsentRequest from "Lib/unsentRequest";
|
import { unsentRequest } from "netlify-cms-lib-util";
|
||||||
import GitHubBackend from "Backends/github/implementation";
|
import GitHubBackend from "netlify-cms-backend-github";
|
||||||
import GitLabBackend from "Backends/gitlab/implementation";
|
import GitLabBackend from "Backends/gitlab/implementation";
|
||||||
import BitBucketBackend from "Backends/bitbucket/implementation";
|
import BitBucketBackend from "Backends/bitbucket/implementation";
|
||||||
import GitHubAPI from "./GitHubAPI";
|
import GitHubAPI from "./GitHubAPI";
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
.nc-githubAuthenticationPage-root {
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column nowrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nc-githubAuthenticationPage-logo {
|
|
||||||
color: #c4c6d2;
|
|
||||||
margin-top: -300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nc-githubAuthenticationPage-button {
|
|
||||||
@apply(--button);
|
|
||||||
@apply(--dropShadowDeep);
|
|
||||||
@apply(--buttonDefault);
|
|
||||||
@apply(--buttonGray);
|
|
||||||
|
|
||||||
padding: 0 30px;
|
|
||||||
margin-top: -80px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
& .nc-icon {
|
|
||||||
margin-right: 18px;
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,8 +5,8 @@ import { cond, flow, isString, partial, partialRight, pick, omit, set, update, g
|
|||||||
import unsentRequest from "netlify-cms-lib-util/unsentRequest";
|
import unsentRequest from "netlify-cms-lib-util/unsentRequest";
|
||||||
import { then } from "netlify-cms-lib-util/promise";
|
import { then } from "netlify-cms-lib-util/promise";
|
||||||
import APIError from "netlify-cms-lib-util/APIError";
|
import APIError from "netlify-cms-lib-util/APIError";
|
||||||
|
import Cursor from 'netlify-cms-lib-util/Cursor'
|
||||||
import AssetProxy from "ValueObjects/AssetProxy";
|
import AssetProxy from "ValueObjects/AssetProxy";
|
||||||
import Cursor from "ValueObjects/Cursor"
|
|
||||||
|
|
||||||
export default class API {
|
export default class API {
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import trimStart from 'lodash/trimStart';
|
import trimStart from 'lodash/trimStart';
|
||||||
import semaphore from "semaphore";
|
import semaphore from "semaphore";
|
||||||
|
import { fileExtension } from 'netlify-cms-lib-util/path';
|
||||||
|
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from 'netlify-cms-lib-util/Cursor'
|
||||||
import AuthenticationPage from "./AuthenticationPage";
|
import AuthenticationPage from "./AuthenticationPage";
|
||||||
import API from "./API";
|
import API from "./API";
|
||||||
import { CURSOR_COMPATIBILITY_SYMBOL } from 'ValueObjects/Cursor';
|
|
||||||
import { EDITORIAL_WORKFLOW } from "Constants/publishModes";
|
import { EDITORIAL_WORKFLOW } from "Constants/publishModes";
|
||||||
|
|
||||||
const MAX_CONCURRENT_DOWNLOADS = 10;
|
const MAX_CONCURRENT_DOWNLOADS = 10;
|
||||||
|
@ -3,13 +3,13 @@ import PropTypes from 'prop-types';
|
|||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { partial } from 'lodash';
|
import { partial } from 'lodash';
|
||||||
|
import Cursor from 'netlify-cms-lib-util/Cursor'
|
||||||
import {
|
import {
|
||||||
loadEntries as actionLoadEntries,
|
loadEntries as actionLoadEntries,
|
||||||
traverseCollectionCursor as actionTraverseCollectionCursor,
|
traverseCollectionCursor as actionTraverseCollectionCursor,
|
||||||
} from 'Actions/entries';
|
} from 'Actions/entries';
|
||||||
import { selectEntries } from 'Reducers';
|
import { selectEntries } from 'Reducers';
|
||||||
import { selectCollectionEntriesCursor } from 'Reducers/cursors';
|
import { selectCollectionEntriesCursor } from 'Reducers/cursors';
|
||||||
import Cursor from 'ValueObjects/Cursor';
|
|
||||||
import Entries from './Entries';
|
import Entries from './Entries';
|
||||||
|
|
||||||
class EntriesCollection extends React.Component {
|
class EntriesCollection extends React.Component {
|
||||||
|
@ -2,12 +2,12 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import Cursor from 'netlify-cms-lib-util/Cursor'
|
||||||
import { selectSearchedEntries } from 'Reducers';
|
import { selectSearchedEntries } from 'Reducers';
|
||||||
import {
|
import {
|
||||||
searchEntries as actionSearchEntries,
|
searchEntries as actionSearchEntries,
|
||||||
clearSearch as actionClearSearch
|
clearSearch as actionClearSearch
|
||||||
} from 'Actions/search';
|
} from 'Actions/search';
|
||||||
import Cursor from 'ValueObjects/Cursor';
|
|
||||||
import Entries from './Entries';
|
import Entries from './Entries';
|
||||||
|
|
||||||
class EntriesSearch extends React.Component {
|
class EntriesSearch extends React.Component {
|
||||||
|
@ -4,9 +4,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import Waypoint from 'react-waypoint';
|
import Waypoint from 'react-waypoint';
|
||||||
import { Map } from 'immutable';
|
import { Map } from 'immutable';
|
||||||
|
import Cursor from 'netlify-cms-lib-util/Cursor';
|
||||||
import { selectFields, selectInferedField } from 'Reducers/collections';
|
import { selectFields, selectInferedField } from 'Reducers/collections';
|
||||||
import EntryCard from './EntryCard';
|
import EntryCard from './EntryCard';
|
||||||
import Cursor from 'ValueObjects/Cursor';
|
|
||||||
|
|
||||||
const CardsGrid = styled.div`
|
const CardsGrid = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -7,4 +7,3 @@
|
|||||||
* Backend auth pages
|
* Backend auth pages
|
||||||
*/
|
*/
|
||||||
@import "./backends/git-gateway/AuthenticationPage.css";
|
@import "./backends/git-gateway/AuthenticationPage.css";
|
||||||
@import "./backends/github/AuthenticationPage.css";
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { fromJS, Map } from 'immutable';
|
import { fromJS, Map } from 'immutable';
|
||||||
import Cursor from "ValueObjects/Cursor";
|
import Cursor from 'netlify-cms-lib-util/Cursor'
|
||||||
import {
|
import {
|
||||||
ENTRIES_SUCCESS,
|
ENTRIES_SUCCESS,
|
||||||
} from 'Actions/entries';
|
} from 'Actions/entries';
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
import implicitOauth from './implicit-oauth';
|
|
||||||
import netlifyAuth from './netlify-auth';
|
|
||||||
|
|
||||||
export { implicitOauth, netlifyAuth };
|
|
38
yarn.lock
38
yarn.lock
@ -1152,7 +1152,7 @@ balanced-match@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||||
|
|
||||||
base64-js@^1.0.2:
|
base64-js@>=0.0.4, base64-js@^1.0.2:
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
|
||||||
|
|
||||||
@ -3180,7 +3180,7 @@ glob-parent@^3.1.0:
|
|||||||
is-glob "^3.1.0"
|
is-glob "^3.1.0"
|
||||||
path-dirname "^1.0.0"
|
path-dirname "^1.0.0"
|
||||||
|
|
||||||
glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2:
|
glob@>=3.2.6, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2:
|
||||||
version "7.1.2"
|
version "7.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -3234,6 +3234,12 @@ gotrue-js@^0.9.15:
|
|||||||
dependencies:
|
dependencies:
|
||||||
micro-api-client "^3.2.1"
|
micro-api-client "^3.2.1"
|
||||||
|
|
||||||
|
graceful-fs@^3.0.4:
|
||||||
|
version "3.0.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818"
|
||||||
|
dependencies:
|
||||||
|
natives "^1.1.0"
|
||||||
|
|
||||||
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6:
|
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6:
|
||||||
version "4.1.11"
|
version "4.1.11"
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||||
@ -3551,7 +3557,7 @@ immediate@~3.0.5:
|
|||||||
version "3.0.6"
|
version "3.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
|
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
|
||||||
|
|
||||||
immutable@^3.7.6:
|
immutable@^3.7.6, immutable@^3.8.2:
|
||||||
version "3.8.2"
|
version "3.8.2"
|
||||||
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
|
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
|
||||||
|
|
||||||
@ -4347,6 +4353,10 @@ js-base64@^2.1.9:
|
|||||||
version "2.4.5"
|
version "2.4.5"
|
||||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.5.tgz#e293cd3c7c82f070d700fc7a1ca0a2e69f101f92"
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.5.tgz#e293cd3c7c82f070d700fc7a1ca0a2e69f101f92"
|
||||||
|
|
||||||
|
js-base64@^2.4.8:
|
||||||
|
version "2.4.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.8.tgz#57a9b130888f956834aa40c5b165ba59c758f033"
|
||||||
|
|
||||||
js-beautify@^1.7.5:
|
js-beautify@^1.7.5:
|
||||||
version "1.7.5"
|
version "1.7.5"
|
||||||
resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.7.5.tgz#69d9651ef60dbb649f65527b53674950138a7919"
|
resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.7.5.tgz#69d9651ef60dbb649f65527b53674950138a7919"
|
||||||
@ -5051,6 +5061,10 @@ nanomatch@^1.2.9:
|
|||||||
snapdragon "^0.8.1"
|
snapdragon "^0.8.1"
|
||||||
to-regex "^3.0.1"
|
to-regex "^3.0.1"
|
||||||
|
|
||||||
|
natives@^1.1.0:
|
||||||
|
version "1.1.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58"
|
||||||
|
|
||||||
natural-compare@^1.4.0:
|
natural-compare@^1.4.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
@ -5104,6 +5118,16 @@ needle@^2.2.0:
|
|||||||
react-toggled "^1.1.2"
|
react-toggled "^1.1.2"
|
||||||
react-transition-group "^2.2.1"
|
react-transition-group "^2.2.1"
|
||||||
|
|
||||||
|
netlify@^1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/netlify/-/netlify-1.2.0.tgz#ebf89b94b01b478d539630174decb496c2bbe315"
|
||||||
|
dependencies:
|
||||||
|
base64-js ">=0.0.4"
|
||||||
|
glob ">=3.2.6"
|
||||||
|
graceful-fs "^3.0.4"
|
||||||
|
semaphore "^1.0.5"
|
||||||
|
when "^3.7.5"
|
||||||
|
|
||||||
nice-try@^1.0.4:
|
nice-try@^1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"
|
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"
|
||||||
@ -7239,7 +7263,7 @@ selection-is-backward@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/selection-is-backward/-/selection-is-backward-1.0.0.tgz#97a54633188a511aba6419fc5c1fa91b467e6be1"
|
resolved "https://registry.yarnpkg.com/selection-is-backward/-/selection-is-backward-1.0.0.tgz#97a54633188a511aba6419fc5c1fa91b467e6be1"
|
||||||
|
|
||||||
semaphore@^1.0.5:
|
semaphore@^1.0.5, semaphore@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa"
|
resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa"
|
||||||
|
|
||||||
@ -8266,7 +8290,7 @@ uuid@^2.0.1:
|
|||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
|
||||||
|
|
||||||
uuid@^3.0.1, uuid@^3.1.0:
|
uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2:
|
||||||
version "3.3.2"
|
version "3.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
|
||||||
|
|
||||||
@ -8403,6 +8427,10 @@ whatwg-url@^6.4.0, whatwg-url@^6.4.1:
|
|||||||
tr46 "^1.0.1"
|
tr46 "^1.0.1"
|
||||||
webidl-conversions "^4.0.2"
|
webidl-conversions "^4.0.2"
|
||||||
|
|
||||||
|
when@^3.7.5:
|
||||||
|
version "3.7.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
|
||||||
|
|
||||||
whet.extend@~0.9.9:
|
whet.extend@~0.9.9:
|
||||||
version "0.9.9"
|
version "0.9.9"
|
||||||
resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1"
|
resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user