From 3cc744940618d4a6cb0bd26490f756abd88bfcca Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Tue, 15 Aug 2017 12:10:31 +1200 Subject: [PATCH] fix injector on test react form --- client/dist/legacy.js | 24 ++++++++++++----------- client/src/legacy/TestReactFormBuilder.js | 6 ++++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/client/dist/legacy.js b/client/dist/legacy.js index 66b976b..9c757ea 100644 --- a/client/dist/legacy.js +++ b/client/dist/legacy.js @@ -1,13 +1,15 @@ -!function(t){function e(r){if(n[r])return n[r].exports +!function(e){function t(r){if(n[r])return n[r].exports var o=n[r]={exports:{},id:r,loaded:!1} -return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={} -return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict" -n(1)},function(t,e,n){"use strict" -function r(t){return t&&t.__esModule?t:{default:t}}var o=n(2),i=r(o),u=n(3),c=r(u),s=n(4),a=r(s),f=n(5),l=n(6),d=r(l),m="TestReactFormBuilder" -i.default.entwine("ss",function(t){t(".TestReactFormBuilder").entwine({onmatch:function t(){var e=this -setTimeout(function(){return e._renderForm()},100),this[0].style.setProperty("overflow-y","scroll","important")},onunmatch:function t(){this._clearForm(),this.css("overflow-y",!1)},open:function t(){this._renderForm() +return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={} +return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict" +n(1)},function(e,t,n){"use strict" +function r(e){return e&&e.__esModule?e:{default:e}}var o=n(2),i=r(o),u=n(3),c=r(u),s=n(4),a=r(s),f=n(5),l=n(6),d=r(l),m=n(7),p="TestReactFormBuilder",h=(0,m.provideInjector)(d.default) +i.default.entwine("ss",function(e){e(".TestReactFormBuilder").entwine({onmatch:function e(){var t=this +setTimeout(function(){return t._renderForm()},100),this[0].style.setProperty("overflow-y","scroll","important")},onunmatch:function e(){this._clearForm(),this.css("overflow-y",!1)},open:function e(){this._renderForm() -},close:function t(){this._clearForm()},_renderForm:function t(){var e=this,n=window.ss.store,r=n.getState().config.sections.find(function(t){return t.name===m}),o=r.form.TestEditForm.schemaUrl -a.default.render(c.default.createElement(f.Provider,{store:n},c.default.createElement(d.default,{schemaUrl:o,handleSubmit:function t(){return e._handleSubmit.apply(e,arguments)}})),this[0])},_clearForm:function t(){ -a.default.unmountComponentAtNode(this[0])},_handleSubmit:function t(e,n,r){return e.preventDefault(),r()}}),t(".TestReactFormBuilder .nav-link").entwine({onclick:function t(e){e.preventDefault()}})})},function(t,e){ -t.exports=jQuery},function(t,e){t.exports=React},function(t,e){t.exports=ReactDom},function(t,e){t.exports=ReactRedux},function(t,e){t.exports=FormBuilderLoader}]) +},close:function e(){this._clearForm()},_renderForm:function e(){var t=this,n=window.ss.store,r=n.getState().config.sections.find(function(e){return e.name===p}),o=r.form.TestEditForm.schemaUrl +a.default.render(c.default.createElement(f.Provider,{store:n},c.default.createElement(h,{identifier:"TestReactForm",schemaUrl:o,handleSubmit:function e(){return t._handleSubmit.apply(t,arguments)}})),this[0]) + +},_clearForm:function e(){a.default.unmountComponentAtNode(this[0])},_handleSubmit:function e(t,n,r){return t.preventDefault(),r()}}),e(".TestReactFormBuilder .nav-link").entwine({onclick:function e(t){ +t.preventDefault()}})})},function(e,t){e.exports=jQuery},function(e,t){e.exports=React},function(e,t){e.exports=ReactDom},function(e,t){e.exports=ReactRedux},function(e,t){e.exports=FormBuilderLoader},function(e,t){ +e.exports=Injector}]) diff --git a/client/src/legacy/TestReactFormBuilder.js b/client/src/legacy/TestReactFormBuilder.js index d3ea52a..ee8141d 100644 --- a/client/src/legacy/TestReactFormBuilder.js +++ b/client/src/legacy/TestReactFormBuilder.js @@ -3,9 +3,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader'; +import { provideInjector } from 'lib/Injector'; const sectionConfigKey = 'TestReactFormBuilder'; - +const InjectedFormBuilderLoader = provideInjector(FormBuilderLoader); jQuery.entwine('ss', ($) => { /** * Kick off Test React FormBuilder admin section. @@ -39,7 +40,8 @@ jQuery.entwine('ss', ($) => { ReactDOM.render( - this._handleSubmit(...args)} />