Created
September 22, 2016 02:23
-
-
Save sminnee/0f37812ebc97ac74f53e4ba2d7d3f110 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js | |
| index 15460e8..01aed24 100644 | |
| --- a/admin/client/dist/js/bundle.js | |
| +++ b/admin/client/dist/js/bundle.js | |
| @@ -263,24 +263,25 @@ function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e inst | |
| return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t) | |
| -e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{ | |
| -value:!0}) | |
| -var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t] | |
| -for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n] | |
| -i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=n(4),d=i(u),c=n(20),f=i(c),p=function(e){ | |
| +e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(){return"useless change" | |
| + | |
| +}Object.defineProperty(t,"__esModule",{value:!0}) | |
| +var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t] | |
| +for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n] | |
| +i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=n(4),c=i(d),f=n(20),p=i(f),h=function(e){ | |
| function t(e){r(this,t) | |
| var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)) | |
| -return n.handleSubmit=n.handleSubmit.bind(n),n}return a(t,e),l(t,[{key:"componentWillUnmount",value:function n(){"undefined"!=typeof this.props.componentWillUnmount&&this.props.componentWillUnmount(this.props.formId) | |
| +return n.handleSubmit=n.handleSubmit.bind(n),n}return a(t,e),u(t,[{key:"componentWillUnmount",value:function n(){"undefined"!=typeof this.props.componentWillUnmount&&this.props.componentWillUnmount(this.props.formId) | |
| -}},{key:"render",value:function i(){var e={className:"form",onSubmit:this.handleSubmit},t=s({},e,this.props.attributes),n=this.props.mapFieldsToComponents(this.props.fields),i=this.props.mapActionsToComponents(this.props.actions) | |
| +}},{key:"render",value:function i(){var e={className:"form",onSubmit:this.handleSubmit},t=l({},e,this.props.attributes),n=this.props.mapFieldsToComponents(this.props.fields),i=this.props.mapActionsToComponents(this.props.actions) | |
| -return d["default"].createElement("form",t,n&&d["default"].createElement("fieldset",null,n),i&&d["default"].createElement("div",{className:"btn-toolbar",role:"group"},i))}},{key:"handleSubmit",value:function u(e){ | |
| -"undefined"!=typeof this.props.handleSubmit&&this.props.handleSubmit(e)}}]),t}(f["default"]) | |
| -p.propTypes={actions:d["default"].PropTypes.array,attributes:d["default"].PropTypes.shape({action:d["default"].PropTypes.string.isRequired,className:d["default"].PropTypes.string,encType:d["default"].PropTypes.string, | |
| -id:d["default"].PropTypes.string,method:d["default"].PropTypes.string.isRequired}),componentWillUnmount:d["default"].PropTypes.func,data:d["default"].PropTypes.array,fields:d["default"].PropTypes.array.isRequired, | |
| -formId:d["default"].PropTypes.string.isRequired,handleSubmit:d["default"].PropTypes.func,mapActionsToComponents:d["default"].PropTypes.func.isRequired,mapFieldsToComponents:d["default"].PropTypes.func.isRequired | |
| -},t["default"]=p},function(e,t){e.exports=SilverStripeComponent},function(e,t,n){(function(t){e.exports=t.FormConstants=n(22)}).call(t,function(){return this}())},function(e,t){"use strict" | |
| +return c["default"].createElement("form",l({},t,{anotherVar:s()}),n&&c["default"].createElement("fieldset",null,n),i&&c["default"].createElement("div",{className:"btn-toolbar",role:"group"},i))}},{key:"handleSubmit", | |
| +value:function d(e){"undefined"!=typeof this.props.handleSubmit&&this.props.handleSubmit(e)}}]),t}(p["default"]) | |
| +h.propTypes={actions:c["default"].PropTypes.array,attributes:c["default"].PropTypes.shape({action:c["default"].PropTypes.string.isRequired,className:c["default"].PropTypes.string,encType:c["default"].PropTypes.string, | |
| +id:c["default"].PropTypes.string,method:c["default"].PropTypes.string.isRequired}),componentWillUnmount:c["default"].PropTypes.func,data:c["default"].PropTypes.array,fields:c["default"].PropTypes.array.isRequired, | |
| +formId:c["default"].PropTypes.string.isRequired,handleSubmit:c["default"].PropTypes.func,mapActionsToComponents:c["default"].PropTypes.func.isRequired,mapFieldsToComponents:c["default"].PropTypes.func.isRequired | |
| +},t["default"]=h},function(e,t){e.exports=SilverStripeComponent},function(e,t,n){(function(t){e.exports=t.FormConstants=n(22)}).call(t,function(){return this}())},function(e,t){"use strict" | |
| Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={CSRF_HEADER:"X-SecurityID"}},function(e,t,n){(function(t){e.exports=t.FormAction=n(24)}).call(t,function(){return this}())},function(e,t,n){ | |
| "use strict" | |
| function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") | |
| diff --git a/admin/client/src/components/Form/Form.js b/admin/client/src/components/Form/Form.js | |
| index 26f110d..d7f6016 100644 | |
| --- a/admin/client/src/components/Form/Form.js | |
| +++ b/admin/client/src/components/Form/Form.js | |
| @@ -1,6 +1,10 @@ | |
| import React from 'react'; | |
| import SilverStripeComponent from 'lib/SilverStripeComponent'; | |
| +function anotherFunction() { | |
| + return 'useless change'; | |
| +}; | |
| + | |
| class Form extends SilverStripeComponent { | |
| constructor(props) { | |
| @@ -22,12 +26,13 @@ class Form extends SilverStripeComponent { | |
| className: 'form', | |
| onSubmit: this.handleSubmit, | |
| }; | |
| + | |
| const formProps = Object.assign({}, defaultFormProps, this.props.attributes); | |
| const fields = this.props.mapFieldsToComponents(this.props.fields); | |
| const actions = this.props.mapActionsToComponents(this.props.actions); | |
| return ( | |
| - <form {...formProps}> | |
| + <form {...formProps} anotherVar={anotherFunction()}> | |
| {fields && | |
| <fieldset> | |
| {fields} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment