Skip to content

Commit

Permalink
fix(bitbucket): fix rebasing mistakes in bitbucket backend and deps (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart committed Jul 26, 2018
1 parent 6eb8695 commit bdfd944
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/netlify-cms-backend-bitbucket/src/API.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { flow } from "lodash";
import { flow, has } from "lodash";
import {
LocalForage,
localForage,
unsentRequest,
responseParser,
then,
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ export default class GitGatewayAuthenticationPage extends React.Component {
);
}

console.log('returning');

return (
<AuthenticationPage renderPageContent={() => (
<AuthForm onSubmit={this.handleLogin}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

Expand Down
1 change: 0 additions & 1 deletion packages/netlify-cms-lib-auth/src/netlify-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions packages/netlify-cms-lib-util/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
1 change: 0 additions & 1 deletion packages/netlify-cms-ui-default/src/AuthenticationPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const AuthenticationPage = ({
renderButtonContent,
renderPageContent,
}) => {
console.log(renderPageContent);
return (
<StyledAuthenticationPage>
<PageLogoIcon size="300px" type="netlify-cms"/>
Expand Down

0 comments on commit bdfd944

Please sign in to comment.