Skip to content

Commit

Permalink
Merge branch 'master' into signup_custom_attr
Browse files Browse the repository at this point in the history
  • Loading branch information
mlabieniec authored Jan 17, 2018
2 parents 377f5cf + 635bd5a commit 5e0851a
Show file tree
Hide file tree
Showing 24 changed files with 105 additions and 64 deletions.
52 changes: 34 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# Changelog for AWS Amplify
<!--LATEST=0.1.30-->
<!--LATEST=0.1.35-->
<!--ENTRYINSERT-->

## 12/22/2017
## 01/16/2018
* aws-amplify - v0.1.35
* Improvements to Typescript developer experience. #155
* fix RN props #158
* delete ama #142
* aws-amplify-react-native - v0.1.23
* fix RN props #158

## 01/12/2018
* aws-amplify-react-native - v0.1.22
* bug fix: fix aws-sdk package
## 01/11/2018
* aws-amplify - v0.1.34
* bug fix: fix aws-sdk package
* bug fix: update main script

* aws-amplify - v0.1.30
## 01/09/2018

* aws-amplify - v0.1.32
* aws-amplify-react - v0.1.30
* aws-amplify-react-native - v0.1.20
* aws-ampliify-react-native - v0.1.21

* feature: Federated Authentication with Google and Facebook in React
* bugFix: Federated auth token fixes
* feature: Automatic S3 Analytics tracking with React components
* feature: Increase unit test coverage
* feature: Jest snapshot update
* feature: Update default auth theme
* feature: Export Signer interface for 3rd party HttpModules
* bugFix: aws-amplify-react-native: Update pinpoint region in React Native
* feature: Better support for guest (Unauthenticated) credentials
* bugFix: documentation: Fix broken link (to authentication)
* Enhancement: remove aws-sdk-mobile-analytics dependency from package.json

## 01/08/2018

Expand All @@ -33,10 +40,19 @@
* Bug fix: Doc syntax error fix
* Bug fix: Add charset on default header for API

## 01/09/2018
## 12/22/2017

* aws-amplify - v0.1.32
* aws-amplify - v0.1.30
* aws-amplify-react - v0.1.30
* aws-ampliify-react-native - v0.1.21
* aws-amplify-react-native - v0.1.20

* Enhancement: remove aws-sdk-mobile-analytics dependency from package.json
* feature: Federated Authentication with Google and Facebook in React
* bugFix: Federated auth token fixes
* feature: Automatic S3 Analytics tracking with React components
* feature: Increase unit test coverage
* feature: Jest snapshot update
* feature: Update default auth theme
* feature: Export Signer interface for 3rd party HttpModules
* bugFix: aws-amplify-react-native: Update pinpoint region in React Native
* feature: Better support for guest (Unauthenticated) credentials
* bugFix: documentation: Fix broken link (to authentication)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import VerifyContact from './VerifyContact';
import SignUp from './SignUp';
import ConfirmSignUp from './ConfirmSignUp';
import ForgotPassword from './ForgotPassword';
import RequireNewPassword from './RequireNewPassword';
import Greetings from './Greetings';

const logger = new Logger('Authenticator');
Expand Down Expand Up @@ -57,7 +58,7 @@ export default class Authenticator extends React.Component {
super(props);
this.state = {
authState: props.authState || 'signIn',
authDate: props.authData
authData: props.authData
};

this.handleStateChange = this.handleStateChange.bind(this);
Expand Down Expand Up @@ -106,7 +107,7 @@ export default class Authenticator extends React.Component {

const { hideDefault } = this.props;
const props_children = this.props.children || [];
const default_children = [React.createElement(SignIn, null), React.createElement(ConfirmSignIn, null), React.createElement(VerifyContact, null), React.createElement(SignUp, null), React.createElement(ConfirmSignUp, null), React.createElement(ForgotPassword, null), React.createElement(Greetings, null)];
const default_children = [React.createElement(SignIn, null), React.createElement(ConfirmSignIn, null), React.createElement(VerifyContact, null), React.createElement(SignUp, null), React.createElement(ConfirmSignUp, null), React.createElement(ForgotPassword, null), React.createElement(RequireNewPassword, null), React.createElement(Greetings, null)];
const children = (hideDefault ? [] : default_children).concat(props_children).map((child, index) => {
return React.cloneElement(child, {
key: 'auth_piece_' + index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class RequireNewPassword extends AuthPiece {
React.createElement(Button, {
title: I18n.get('Change Password'),
onPress: this.change,
disabled: !this.state.code
disabled: !this.state.password
})
),
React.createElement(Footer, { theme: theme, onStateChange: this.changeState }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export default class VerifyContact extends AuthPiece {
selectedValue: this.state.pickAttr,
onValueChange: (value, index) => this.setState({ pickAttr: value })
},
email ? React.createElement(Picker.Item, { label: 'Email', value: 'email' }) : null,
phone_number ? React.createElement(Picker.Item, { label: 'Phone Number', value: 'phone_number' }) : null
email ? React.createElement(Picker.Item, { label: I18n.get('Email'), value: 'email' }) : null,
phone_number ? React.createElement(Picker.Item, { label: I18n.get('Phone Number'), value: 'phone_number' }) : null
),
React.createElement(Button, {
title: I18n.get('Verify'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ import ConfirmSignIn from './ConfirmSignIn';
import SignUp from './SignUp';
import ConfirmSignUp from './ConfirmSignUp';
import ForgotPassword from './ForgotPassword';
import RequireNewPassword from './RequireNewPassword';
import VerifyContact from './VerifyContact';
import Greetings from './Greetings';

const logger = new Logger('auth components');

export { Authenticator, AuthPiece, SignIn, ConfirmSignIn, SignUp, ConfirmSignUp, ForgotPassword, VerifyContact, Greetings };
export { Authenticator, AuthPiece, SignIn, ConfirmSignIn, SignUp, ConfirmSignUp, ForgotPassword, RequireNewPassword, VerifyContact, Greetings };

export function withAuthenticator(Comp, includeGreetings = false) {
class Wrapper extends React.Component {
Expand Down
12 changes: 6 additions & 6 deletions packages/aws-amplify-react-native/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/aws-amplify-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-amplify-react-native",
"version": "0.1.22",
"version": "0.1.23",
"description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-amplify-react/__tests__/Storage/S3Album-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('S3Album test', () => {

expect.assertions(2);
expect(spyon).toBeCalledWith({"file": "file", "name": "name", "size": "size", "type": "type"});
expect(spyon2).toBeCalledWith('path', 'file', {contentType: 'type'});
expect(spyon2).toBeCalledWith('path', 'file', {"contentType": "type", "level": "public", "track": undefined});

spyon.mockClear();
spyon2.mockClear();
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('S3Album test', () => {

expect.assertions(3);
expect(spyon).toBeCalledWith({"file": "file", "name": "name", "size": "size", "type": "type"});
expect(spyon2).toBeCalledWith('path', 'file', {contentType: 'type'});
expect(spyon2).toBeCalledWith('path', 'file', {"contentType": "type", "level": "public", "track": undefined});
expect(spyon3).toBeCalledWith([{key: 'path2'}, 'data']);

spyon.mockClear();
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('S3Album test', () => {

expect.assertions(2);
expect(spyon).toBeCalledWith({"file": "file", "name": "name", "size": "size", "type": "type"});
expect(spyon2).toBeCalledWith('path', 'file', {contentType: 'type'});
expect(spyon2).toBeCalledWith('path', 'file', {"contentType": "type", "level": "public", "track": undefined});

spyon.mockClear();
spyon2.mockClear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('S3Image', () => {
await s3Image.handlePick(data);

expect.assertions(2);
expect(spyon).toBeCalledWith('imgKey', 'file', {contentType: 'type'});
expect(spyon).toBeCalledWith('imgKey', 'file', {"contentType": "type", "level": "level", "track": undefined});
expect(spyon2).toBeCalled();

spyon.mockClear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('S3Text test', () => {
await s3Text.handlePick(data);

expect.assertions(2);
expect(spyon).toBeCalledWith('textKey', 'file', { contentType: 'type' });
expect(spyon).toBeCalledWith('textKey', 'file', {"contentType": "type", "level": "level", "track": undefined});
expect(spyon2).toBeCalled();

spyon.mockClear();
Expand Down
9 changes: 7 additions & 2 deletions packages/aws-amplify-react/dist/Storage/S3Album.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ var S3Album = function (_Component) {
onPick = _props.onPick,
onLoad = _props.onLoad,
onError = _props.onError,
track = _props.track;
track = _props.track,
level = _props.level;


if (onPick) {
Expand All @@ -129,7 +130,11 @@ var S3Album = function (_Component) {
type = data.type;

var key = path + this.getKey(data);
_awsAmplify.Storage.put(key, file, { contentType: type, track: track }).then(function (data) {
_awsAmplify.Storage.put(key, file, {
level: level ? level : 'public',
contentType: type,
track: track
}).then(function (data) {
logger.debug('handle pick data', data);
var items = _this2.state.items;

Expand Down
6 changes: 5 additions & 1 deletion packages/aws-amplify-react/dist/Storage/S3Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ var S3Image = function (_Component) {
type = data.type;

var key = imgKey || path + (0, _Common.calcKey)(data, fileToKey);
_awsAmplify.Storage.put(key, file, { contentType: type, track: track }).then(function (data) {
_awsAmplify.Storage.put(key, file, {
level: level ? level : 'public',
contentType: type,
track: track
}).then(function (data) {
logger.debug('handle pick data', data);
that.getImageSource(key, level, track);
})['catch'](function (err) {
Expand Down
6 changes: 5 additions & 1 deletion packages/aws-amplify-react/dist/Storage/S3Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ var S3Text = function (_Component) {
type = data.type;

var key = textKey || path + (0, _Common.calcKey)(data, fileToKey);
_awsAmplify.Storage.put(key, file, { contentType: type, track: track }).then(function (data) {
_awsAmplify.Storage.put(key, file, {
level: level ? level : 'public',
contentType: type,
track: track
}).then(function (data) {
logger.debug('handle pick data', data);
that.getText(key, level, track);
})['catch'](function (err) {
Expand Down
8 changes: 6 additions & 2 deletions packages/aws-amplify-react/src/Storage/S3Album.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,18 @@ export default class S3Album extends Component {

handlePick(data) {
const that = this;
const { onPick, onLoad, onError, track } = this.props;
const { onPick, onLoad, onError, track, level } = this.props;

if (onPick) { onPick(data); }

const path = this.props.path || '';
const { file, name, size, type } = data;
const key = path + this.getKey(data);
Storage.put(key, file, { contentType: type, track })
Storage.put(key, file, {
level: level? level: 'public',
contentType: type,
track
})
.then(data => {
logger.debug('handle pick data', data);
const { items } = this.state;
Expand Down
6 changes: 5 additions & 1 deletion packages/aws-amplify-react/src/Storage/S3Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export default class S3Image extends Component {
const { imgKey, level, fileToKey, track } = this.props;
const { file, name, size, type } = data;
const key = imgKey || (path + calcKey(data, fileToKey));
Storage.put(key, file, { contentType: type, track })
Storage.put(key, file, {
level: level? level: 'public',
contentType: type,
track
})
.then(data => {
logger.debug('handle pick data', data);
that.getImageSource(key, level, track);
Expand Down
6 changes: 5 additions & 1 deletion packages/aws-amplify-react/src/Storage/S3Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export default class S3Text extends Component {
const { textKey, level, fileToKey, track } = this.props;
const { file, name, size, type } = data;
const key = textKey || (path + calcKey(data, fileToKey));
Storage.put(key, file, { contentType: type, track })
Storage.put(key, file, {
level: level? level: 'public',
contentType: type,
track
})
.then(data => {
logger.debug('handle pick data', data);
that.getText(key, level, track);
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-amplify/dist/aws-amplify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ exports.JS = JS_1.default;
var Signer_1 = __webpack_require__(104);
exports.Signer = Signer_1.default;
exports.Constants = {
userAgent: 'aws-amplify/0.1.22 js'
userAgent: 'aws-amplify/0.1.x js'
};
var logger = new Logger_1.ConsoleLogger('Common');
if (Facet_1.AWS['util']) {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-amplify/dist/aws-amplify.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/aws-amplify/dist/aws-amplify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/aws-amplify/dist/aws-amplify.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/aws-amplify/lib/Common/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/aws-amplify/lib/Common/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5e0851a

Please sign in to comment.