fix(bitbucket): fix rebasing mistakes in bitbucket backend and deps (#1522)

This commit is contained in:
Shawn Erquhart 2018-07-26 13:42:19 -04:00 committed by GitHub
parent 6eb86957d0
commit bdfd9443db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import { flow } from "lodash";
import { flow, has } from "lodash";
import {
LocalForage,
localForage,
unsentRequest,
responseParser,
then,
@ -67,13 +67,13 @@ export default class API {
readFile = async (path, sha, { ref = this.branch, parseText = true } = {}) => {
const cacheKey = parseText ? `bb.${ sha }` : `bb.${ sha }.blob`;
const cachedFile = sha ? await LocalForage.getItem(cacheKey) : null;
const cachedFile = sha ? await localForage.getItem(cacheKey) : null;
if (cachedFile) { return cachedFile; }
const result = await this.request({
url: `${ this.repoURL }/src/${ ref }/${ path }`,
cache: "no-store",
}).then(parseText ? responseParser({ format: "text" }) : responseParser({ format: "blob" }));
if (sha) { LocalForage.setItem(cacheKey, result); }
if (sha) { localForage.setItem(cacheKey, result); }
return result;
}

View File

@ -35,10 +35,12 @@ export default class BitbucketAuthenticationPage extends React.Component {
};
render() {
const { inProgress } = this.props;
return (
<AuthenticationPage
onLogin={this.handleLogin}
loginDisabled={this.props.inProgress}
loginDisabled={inProgress}
loginErrorMessage={this.state.loginError}
renderButtonContent={() => (
<React.Fragment>

View File

@ -81,7 +81,7 @@ export default class Bitbucket {
base_url: this.base_url,
site_id: this.site_id,
};
this.authenticator = new Authenticator(cfg);
this.authenticator = new NetlifyAuthenticator(cfg);
}
this.refreshedTokenPromise = this.authenticator.refresh({ provider: "bitbucket", refresh_token: this.refreshToken })

View File

@ -147,8 +147,6 @@ export default class GitGatewayAuthenticationPage extends React.Component {
);
}
console.log('returning');
return (
<AuthenticationPage renderPageContent={() => (
<AuthForm onSubmit={this.handleLogin}>

View File

@ -113,7 +113,6 @@ export default class GitGateway {
requestFunction: this.requestFunction,
hasWriteAccess: async () => true,
});
console.log(this.api);
this.backend = new BitBucketBackend(this.config, { proxied: true, API: this.api });
}

View File

@ -61,7 +61,6 @@ class Authenticator {
cb(null, data);
}
if (e.data.indexOf('authorization:' + options.provider + ':error:') === 0) {
console.log('Got authorization error');
const err = JSON.parse(e.data.match(new RegExp('^authorization:' + options.provider + ':error:(.+)$'))[1]);
window.removeEventListener('message', fn, false);
this.authWindow.close();

View File

@ -5,3 +5,4 @@ export localForage from './localForage';
export { resolvePath, basename, fileExtensionWithSeparator, fileExtension } from './path';
export { filterPromises, resolvePromiseProperties, then } from './promise';
export unsentRequest from './unsentRequest';
export { filterByPropExtension, parseResponse, responseParser } from './backendUtil';

View File

@ -37,7 +37,6 @@ const AuthenticationPage = ({
renderButtonContent,
renderPageContent,
}) => {
console.log(renderPageContent);
return (
<StyledAuthenticationPage>
<PageLogoIcon size="300px" type="netlify-cms"/>