system_settings 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/app/controllers/system_settings/application_controller.rb +11 -0
- data/app/controllers/system_settings/root_controller.rb +13 -0
- data/app/controllers/system_settings/settings_controller.rb +27 -0
- data/app/models/system_settings/application_record.rb +5 -0
- data/app/models/system_settings/configurator.rb +81 -0
- data/app/models/system_settings/integer_list_setting.rb +8 -0
- data/app/models/system_settings/integer_setting.rb +8 -0
- data/app/models/system_settings/list_of_integers_validator.rb +42 -0
- data/app/models/system_settings/setting.rb +8 -0
- data/app/models/system_settings/string_list_setting.rb +7 -0
- data/app/models/system_settings/string_setting.rb +7 -0
- data/app/models/system_settings/type/integer_list.rb +32 -0
- data/app/models/system_settings/type/string_list.rb +28 -0
- data/config/locales/system_settings.en.yml +32 -0
- data/config/routes.rb +7 -0
- data/db/migrate/20181007125347_create_system_settings_settings.rb +11 -0
- data/frontend/build/asset-manifest.json +11 -0
- data/frontend/build/favicon.ico +0 -0
- data/frontend/build/index.html +1 -0
- data/frontend/build/precache-manifest.130ca067521371497dba783c23aa7e16.js +22 -0
- data/frontend/build/service-worker.js +39 -0
- data/frontend/build/static/css/main.e262560e.chunk.css +1 -0
- data/frontend/build/static/js/2.83a5f4da.chunk.js +1 -0
- data/frontend/build/static/js/main.afaa2372.chunk.js +1 -0
- data/frontend/build/static/js/runtime~main.a09e9b82.js +1 -0
- data/lib/system_settings/engine.rb +17 -0
- data/lib/system_settings/version.rb +3 -0
- data/lib/system_settings.rb +7 -0
- data/lib/tasks/system_settings_tasks.rake +4 -0
- metadata +130 -0
@@ -0,0 +1 @@
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{115:function(e,t,a){e.exports={container:"NotFoundPage_container__35vs4"}},117:function(e,t,a){},118:function(e,t,a){e.exports={container:"ButtonBar_container__21aEr"}},119:function(e,t,a){e.exports={wrap:"ClassicSpinner_wrap__1LF2_"}},121:function(e,t,a){e.exports=a(240)},19:function(e,t,a){e.exports={table:"ListPage_table__2qY_8","empty-tr":"ListPage_empty-tr__2VxYl",name:"ListPage_name__1-Gs-",description:"ListPage_description__1Sci0",value:"ListPage_value__3X3Vq",actions:"ListPage_actions__2iqTu"}},196:function(e,t,a){},239:function(e,t,a){},240:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),s=a(59),c=a(11),i=a(16),o=a(244),u=a(12),l=a(14),m=a.n(l),p=a(27),f=a(45),h=a(112),d=a.n(h),E=a(113);function g(e){var t=new d.a(window.__SYSTEM_SETTINGS_BASENAME__),a=Object(E.join)(t.pathname,"api",e);return t.set("pathname",a),t.href}function b(e,t){var a=new Promise(function(t){return window.setTimeout(function(){return t(e)},e)});return new Promise(function(e,n){t.then(function(t){return a.then(function(){return e(t)})},function(e){return a.then(function(){return n(e)})})})}var v="LIST_FETCH_IN_PROGRESS",y="LIST_FETCH_SUCCESSFUL",_="LIST_FETCH_FAILED",S=5;var j={fetching:!0,fetchErrorMessage:null,fetchSuccessful:null,page:0,items:[]},w=a(120),O="SETTING_FETCH_IN_PROGRESS",N="SETTING_FETCH_SUCCESSFUL",k="SETTING_FETCH_FAILED",T="SETTING_SAVE_IN_PROGRESS",C="SETTING_SAVE_SUCCESSFUL",x="SETTING_SAVE_FAILED";function L(e){return function(){var t=Object(p.a)(m.a.mark(function t(a){var n,r,s,c,i;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=g("settings/".concat(e)),t.prev=1,a({type:O}),t.next=5,b(50,f.a.get(n));case 5:if((r=t.sent).ok){t.next=8;break}throw new Error(r.statusText);case 8:return s=r.headers.get("Authenticity-Token"),t.next=11,r.json();case 11:c=t.sent,a({type:N,authenticityToken:s,attributes:c}),t.next=20;break;case 15:throw t.prev=15,t.t0=t.catch(1),i="HTTPError"===t.t0.name?"Network request status: ".concat(t.t0.response.status," ").concat(t.t0.message):t.t0.message,a({type:k,errorMessage:i}),t.t0;case 20:case"end":return t.stop()}},t,null,[[1,15]])}));return function(e){return t.apply(this,arguments)}}()}function M(e){return function(t){return t.headers.set("X-CSRF-Token",e)}}var A={attributes:{},authenticityToken:null,fetching:!0,fetchErrorMessage:null,fetchSuccessful:null,saving:!1,lastSaveSuccessful:null,saveErrorMessage:null},I=Object(c.b)({list:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v:return Object(u.a)({},e,{fetching:!0});case y:return Object(u.a)({},e,{fetching:!1,fetchSuccessful:!0,items:t.data.map(function(e){return{id:e.id,type:e.type,name:e.name,value:e.value,description:e.description}}),page:t.page});case _:return Object(u.a)({},e,{fetching:!1,fetchSuccessful:!1,items:[],fetchErrorMessage:t.errorMessage,page:t.page});default:return e}},setting:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case O:return Object(u.a)({},e,{fetching:!0,fetchSuccessful:null,fetchErrorMessage:null});case N:return Object(u.a)({},e,{fetching:!1,fetchSuccessful:!0,attributes:t.attributes,authenticityToken:t.authenticityToken});case k:return Object(u.a)({},e,{fetching:!1,fetchSuccessful:!1,fetchErrorMessage:t.errorMessage});case T:return Object(u.a)({},e,{saving:!0,lastSaveSuccessful:null,saveErrorMessage:null});case C:return Object(u.a)({},e,{saving:!1,lastSaveSuccessful:!0});case x:return Object(u.a)({},e,{saving:!1,lastSaveSuccessful:!1,saveErrorMessage:t.errorMessage});default:return e}},form:o.a}),P=a(6),F=a(10),G=a(9),R=a(5),q=a(8),D=a(21),B=a(34),H=a(31),U=a.n(H),V=a(115),Y=a.n(V),X=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){return r.a.createElement("div",{className:Y.a.container},"Page not found")}}]),t}(n.Component),z=";";function J(e){switch(e){case"SystemSettings::StringSetting":return"String";case"SystemSettings::StringListSetting":return"List of strings";case"SystemSettings::IntegerSetting":return"Integer";case"SystemSettings::IntegerListSetting":return"List of integers";default:return"Unknown"}}function K(e,t){switch(e){case"SystemSettings::StringListSetting":case"SystemSettings::IntegerListSetting":return t?t.join(z):t;default:return t}}var W=a(19),Z=a.n(W),Q=a(48),$=a.n(Q),ee=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=this.props.description;return r.a.createElement("div",{className:$.a.wrap},r.a.createElement("div",{className:$.a.container},r.a.createElement("div",{className:$.a["error-large"]},"An error occurred while loading the page"),r.a.createElement("div",{className:$.a["error-small"]},e)))}}]),t}(r.a.Component),te=(a(196),a(64)),ae=a.n(te),ne=ae.a.start,re=ae.a.done,se=(ae.a.inc,function(e){function t(){var e,a;Object(P.a)(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return(a=Object(G.a)(this,(e=Object(R.a)(t)).call.apply(e,[this].concat(r)))).columnCount=4,a}return Object(q.a)(t,e),Object(F.a)(t,[{key:"componentDidMount",value:function(){this.props.fetch(1),ne()}},{key:"componentDidUpdate",value:function(e,t,a){!this.props.fetching&&e.fetching&&re()}},{key:"render",value:function(){var e=this.props,t=e.fetching,a=e.fetchSuccessful,n=e.fetchErrorMessage,s=e.list;return t?null:a?r.a.createElement("table",{className:Z.a.table},r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",{className:Z.a.name},"Name"),r.a.createElement("th",{className:Z.a.description},"Description"),r.a.createElement("th",{className:Z.a.value},"Value"),r.a.createElement("th",{className:Z.a.actions}))),r.a.createElement("tbody",null,0===s.length&&r.a.createElement("tr",{className:Z.a["empty-tr"]},r.a.createElement("td",{colSpan:this.columnCount},"No settings")),s.length>0&&s.map(function(e){return r.a.createElement("tr",{key:e.id},r.a.createElement("td",{className:Z.a.name},r.a.createElement(D.b,{className:"sysname",to:"/settings/".concat(e.id)},e.name)),r.a.createElement("td",{className:Z.a.description},e.description),r.a.createElement("td",{className:Z.a.value},K(e.type,e.value)),r.a.createElement("td",{className:Z.a.actions},r.a.createElement(D.b,{className:Z.a["primary-action"],to:"/settings/".concat(e.id,"/edit")},"Edit")))}))):r.a.createElement(ee,{description:n})}}]),t}(n.Component)),ce=Object(i.b)(function(e){return{page:e.list.page,list:e.list.items,fetching:e.list.fetching,fetchSuccessful:e.list.fetchSuccessful,fetchErrorMessage:e.list.fetchErrorMessage}},function(e){return{fetch:function(t){(function(e){return function(){var t=Object(p.a)(m.a.mark(function t(a){var n,r,s;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=g("settings"),t.prev=1,a({type:v}),t.next=5,b(50,f.a.get(n,{searchParams:{page:e,per:S}}).json());case 5:r=t.sent,a({type:y,data:r,page:e}),t.next=14;break;case 9:throw t.prev=9,t.t0=t.catch(1),s="HTTPError"===t.t0.name?"Network request status: ".concat(t.t0.response.status," ").concat(t.t0.message):t.t0.message,a({type:_,errorMessage:s,page:e}),t.t0;case 14:case"end":return t.stop()}},t,null,[[1,9]])}));return function(e){return t.apply(this,arguments)}}()})(t)(e).catch(function(){})}}})(se),ie=a(1),oe=a.n(ie),ue=a(65),le=a.n(ue),me=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=this.props,t=e.name,a=e.children;return r.a.createElement("div",{className:le.a.wrap},r.a.createElement("div",{className:le.a.name},t),r.a.createElement("div",{className:le.a.value},a))}}]),t}(n.PureComponent),pe=(oe.a.string.isRequired,oe.a.any,a(117)),fe=a.n(pe),he=a(118),de=a.n(he),Ee=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=this.props.children;return r.a.createElement("div",{className:de.a.container},e)}}]),t}(r.a.Component),ge=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"componentDidMount",value:function(){var e=this.props.match.params.id;ne(),this.props.fetch(e)}},{key:"componentDidUpdate",value:function(e,t,a){!this.props.fetching&&e.fetching&&re()}},{key:"render",value:function(){var e=this.props,t=e.fetching,a=e.fetchSuccessful,n=e.fetchErrorMessage,s=e.attributes,c=s.id,i=s.name,o=s.type,u=s.description,l=s.value;return t?null:a?r.a.createElement("div",{className:fe.a.wrap},r.a.createElement(me,{name:"Name"},r.a.createElement("span",{className:"sysname"},i)),r.a.createElement(me,{name:"Type",children:J(o)}),r.a.createElement(me,{name:"Description",children:u}),r.a.createElement(me,{name:"Value",children:K(o,l)}),r.a.createElement(Ee,null,r.a.createElement(D.b,{className:"button primary",to:"/settings/".concat(c,"/edit")},"Edit"),r.a.createElement(D.b,{className:"button",to:"/"},"Back"))):r.a.createElement(ee,{description:n})}}]),t}(n.Component),be=Object(i.b)(function(e){return{attributes:e.setting.attributes,fetching:e.setting.fetching,fetchSuccessful:e.setting.fetchSuccessful,fetchErrorMessage:e.setting.fetchErrorMessage}},function(e,t){return{fetch:function(t){return L(t)(e)}}})(ge),ve=a(243),ye=a(241),_e=a(35),Se=a.n(_e),je=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=this.props,t=e.id,a=e.type,n=e.label,s=e.hint,c=e.placeholder,i=e.input,o=e.meta,u=o.touched,l=o.error,m=Array.isArray(l)?l.join("; "):l;return r.a.createElement("div",{className:Se.a.wrap},r.a.createElement("label",{className:Se.a.label,htmlFor:t},n),r.a.createElement("div",{className:Se.a["input-and-error-wrap"]},r.a.createElement("input",Object.assign({id:t,type:a,placeholder:c},i,{className:Se.a.input,style:{width:"".concat(i.value.length,"ch")}})),u&&m&&r.a.createElement("span",{className:Se.a.error},m)),s&&r.a.createElement("div",{className:Se.a.hint},s))}}]),t}(r.a.Component);je.defaultProps={type:"text"};Object(u.a)({},ye.a,{id:oe.a.string.isRequired,type:oe.a.string.isRequired,label:oe.a.string.isRequired,hint:oe.a.oneOfType([oe.a.string,oe.a.element]),placeholder:oe.a.string});var we=a(49),Oe=a.n(we),Ne=a(63),ke=a(119),Te=a.n(ke),Ce=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=this.props,t=e.size,a=e.color,n=e.title,s=e.wrapperStyle,c=Object(Ne.a)(e,["size","color","title","wrapperStyle"]);return r.a.createElement("span",{className:Te.a.wrap,style:Object(u.a)({},s,{width:t,height:t})},r.a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg"},c,{width:t,height:t,viewBox:"0 0 64 64",fill:"none",stroke:a,"aria-labelledby":"title"}),r.a.createElement("title",{id:"title"},n),r.a.createElement("g",{strokeWidth:"4",strokeLinecap:"round"},r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(180)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:"1;.85;.7;.65;.55;.45;.35;.25;.15;.1;0;1",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(210)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:"0;1;.85;.7;.65;.55;.45;.35;.25;.15;.1;0",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(240)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".1;0;1;.85;.7;.65;.55;.45;.35;.25;.15;.1",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(270)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".15;.1;0;1;.85;.7;.65;.55;.45;.35;.25;.15",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(300)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".25;.15;.1;0;1;.85;.7;.65;.55;.45;.35;.25",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(330)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".35;.25;.15;.1;0;1;.85;.7;.65;.55;.45;.35",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(0)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".45;.35;.25;.15;.1;0;1;.85;.7;.65;.55;.45",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(30)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".55;.45;.35;.25;.15;.1;0;1;.85;.7;.65;.55",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(60)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".65;.55;.45;.35;.25;.15;.1;0;1;.85;.7;.65",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(90)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".7;.65;.55;.45;.35;.25;.15;.1;0;1;.85;.7",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(120)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:".85;.7;.65;.55;.45;.35;.25;.15;.1;0;1;.85",repeatCount:"indefinite"})),r.a.createElement("line",{y1:"12",y2:"20",transform:"translate(32,32) rotate(150)"},r.a.createElement("animate",{attributeName:"stroke-opacity",dur:"750ms",values:"1;.85;.7;.65;.55;.45;.35;.25;.15;.1;0;1",repeatCount:"indefinite"})))))}}]),t}(r.a.Component);Ce.defaultProps={color:"currentColor",size:"1rem",title:"Loading\u2026"};var xe=Ce,Le=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=this.props,t=e.hint,a=e.handleSubmit,n=e.myHandleSubmit,s=e.error,c=e.pristine,i=e.submitting;return r.a.createElement("form",{onSubmit:a(n)},r.a.createElement("div",{className:Oe.a.fields},r.a.createElement(ve.a,{name:"value",label:"Value",id:"secret_value",component:je,hint:t})),s&&r.a.createElement("div",{className:Oe.a["error-wrap"]},r.a.createElement("div",{className:Oe.a["error-message"]},r.a.createElement("div",null,"An error occurred while saving the data"),r.a.createElement("div",{className:Oe.a["error-small"]},"Network request status: ",s))),r.a.createElement(Ee,null,r.a.createElement("button",{className:"primary",type:"submit",disabled:c||i},r.a.createElement("span",{className:"button-wrap"},r.a.createElement("span",{className:"button-text"},"Save"),i&&r.a.createElement(xe,{wrapperStyle:{marginLeft:"5px"},size:"1.5em"}))),r.a.createElement(D.b,{className:"button",to:"/"},"Cancel")))}}]),t}(r.a.Component);Le.defaultProps={};oe.a.number.isRequired,oe.a.string.isRequired,oe.a.string,oe.a.oneOfType([oe.a.string,oe.a.element]),oe.a.func.isRequired,oe.a.func.isRequired,oe.a.bool,oe.a.bool,oe.a.string,oe.a.object,oe.a.string;var Me=a(242),Ae=Object(i.b)(function(e){var t=e.setting,a=t.fetchSuccessful,n=t.attributes;return{initialValues:Object(u.a)({},n,{value:a?K(n.type,n.value):n.value})}},function(e,t){return{myHandleSubmit:function(a){return(n=t.id,r=t.authenticityToken,s={value:a.value},function(){var e=Object(p.a)(m.a.mark(function e(t){var a,c,i,o,u;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=g("settings/".concat(n)),t({type:T}),e.prev=2,e.next=5,b(300,f.a.put(a,{json:s,hooks:{beforeRequest:[M(r)]}}));case 5:return c=e.sent,e.next=8,c.json();case 8:i=e.sent,t({type:C,attributes:i}),e.next=34;break;case 12:if(e.prev=12,e.t0=e.catch(2),t({type:x,errorMessage:e.t0.name}),"HTTPError"!==e.t0.name){e.next=33;break}if(422!==e.t0.response.status){e.next=29;break}return e.prev=17,e.next=20,e.t0.response.json();case 20:throw o=e.sent,new w.a(o.errors);case 24:throw e.prev=24,e.t1=e.catch(17),new w.a({_error:e.t0.message});case 27:e.next=31;break;case 29:throw u="".concat(e.t0.response.status," ").concat(e.t0.message),new w.a({_error:u});case 31:e.next=34;break;case 33:throw new w.a({_error:e.t0.message});case 34:case"end":return e.stop()}},e,null,[[2,12],[17,24]])}));return function(t){return e.apply(this,arguments)}}())(e);var n,r,s}}})(Object(Me.a)({form:"edit-setting"})(Le)),Ie=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"componentDidMount",value:function(){var e=this.props.match.params.id;ne(),this.props.fetch(e)}},{key:"componentDidUpdate",value:function(e,t,a){!this.props.fetching&&e.fetching&&re()}},{key:"hint",value:function(e){switch(e){case"SystemSettings::StringListSetting":case"SystemSettings::IntegerListSetting":return r.a.createElement(r.a.Fragment,null,"Separate values by ",r.a.createElement("code",null,";")," character.");default:return null}}},{key:"render",value:function(){var e=this.props,t=e.fetching,a=e.fetchSuccessful,n=e.fetchErrorMessage,s=e.authenticityToken,c=e.attributes,i=c.id,o=c.name,u=c.description,l=c.type;return t?null:a?r.a.createElement("div",null,r.a.createElement(me,{name:"Name"},r.a.createElement("span",{className:"sysname"},o)),r.a.createElement(me,{name:"Type"},J(l)),r.a.createElement(me,{name:"Description"},u),r.a.createElement(Ae,{id:i,authenticityToken:s,hint:this.hint(l)})):r.a.createElement(ee,{description:n})}}]),t}(n.Component),Pe=Object(i.b)(function(e){return{attributes:e.setting.attributes,authenticityToken:e.setting.authenticityToken,fetching:e.setting.fetching,fetchSuccessful:e.setting.fetchSuccessful,fetchErrorMessage:e.setting.fetchErrorMessage}},function(e){return{fetch:function(t){L(t)(e).catch(function(){})}}})(Ie),Fe=function(e){function t(){return Object(P.a)(this,t),Object(G.a)(this,Object(R.a)(t).apply(this,arguments))}return Object(q.a)(t,e),Object(F.a)(t,[{key:"render",value:function(){var e=window.__SYSTEM_SETTINGS_BASENAME__;return r.a.createElement(D.a,{basename:e},r.a.createElement("div",{className:U.a.container},r.a.createElement("div",{className:U.a["header-wrap"]},r.a.createElement("div",{className:U.a.header},r.a.createElement(D.b,{to:"/",className:U.a["header-name"]},this.props.name))),r.a.createElement("div",{className:U.a["header-spacer"]}),r.a.createElement("div",{className:U.a["content-wrap"]},r.a.createElement("div",{className:U.a.content},r.a.createElement(B.c,null,r.a.createElement(B.a,{exact:!0,path:"/",component:ce}),r.a.createElement(B.a,{path:"/settings/:id/edit",component:Pe}),r.a.createElement(B.a,{path:"/settings/:id",component:be}),r.a.createElement(B.a,{component:X}))))))}}]),t}(n.Component);Fe.defaultProps={name:"System Settings"};var Ge=Fe,Re=(a(239),Object(c.c)(I)),qe=document.getElementById("root");window.__SYSTEM_SETTINGS_BASENAME__||(window.__SYSTEM_SETTINGS_BASENAME__="/system_settings"),Object(s.render)(r.a.createElement(i.a,{store:Re},r.a.createElement(Ge,null)),qe)},31:function(e,t,a){e.exports={container:"App_container__BLGGc","header-wrap":"App_header-wrap__3DnwX",header:"App_header__1o2Y8","header-name":"App_header-name__2XXxc","header-spacer":"App_header-spacer__3F0KU","content-wrap":"App_content-wrap__1oPWs",content:"App_content__3dh9P"}},35:function(e,t,a){e.exports={wrap:"LabeledInput_wrap__2KAyr",label:"LabeledInput_label__1AyjZ","input-and-error-wrap":"LabeledInput_input-and-error-wrap__2iJKd",error:"LabeledInput_error__2QBpW",hint:"LabeledInput_hint__rAeG8"}},48:function(e,t,a){e.exports={wrap:"PageLoadError_wrap__mpF75",container:"PageLoadError_container__kcD9o","error-small":"PageLoadError_error-small__14Fex"}},49:function(e,t,a){e.exports={"error-wrap":"SettingForm_error-wrap__3SdnI","error-message":"SettingForm_error-message__uQK1Y","error-small":"SettingForm_error-small__3owRp"}},65:function(e,t,a){e.exports={wrap:"Attribute_wrap__1Zy9J",name:"Attribute_name__3a-cD",value:"Attribute_value__IxZCj"}}},[[121,1,2]]]);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){function r(r){for(var n,i,f=r[0],l=r[1],a=r[2],c=0,s=[];c<f.length;c++)i=f[c],o[i]&&s.push(o[i][0]),o[i]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var l=t[f];0!==o[l]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/system_settings/";var f=window.webpackJsonp=window.webpackJsonp||[],l=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=l;t()}([]);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SystemSettings
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
class << self
|
4
|
+
def frontend_build_path
|
5
|
+
File.join(root, "frontend", "build")
|
6
|
+
end
|
7
|
+
|
8
|
+
def frontend_build_index_html_path
|
9
|
+
File.join(frontend_build_path, "index.html")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
isolate_namespace SystemSettings
|
14
|
+
config.generators.api_only = true
|
15
|
+
config.middleware.use ActionDispatch::Static, frontend_build_path
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: system_settings
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.pre
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Krists Ozols
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-05-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.2.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.2.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.3.13
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.3.13
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: i18n-debug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Description of SystemSettings.
|
70
|
+
email:
|
71
|
+
- krists.ozols@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- MIT-LICENSE
|
77
|
+
- README.md
|
78
|
+
- app/controllers/system_settings/application_controller.rb
|
79
|
+
- app/controllers/system_settings/root_controller.rb
|
80
|
+
- app/controllers/system_settings/settings_controller.rb
|
81
|
+
- app/models/system_settings/application_record.rb
|
82
|
+
- app/models/system_settings/configurator.rb
|
83
|
+
- app/models/system_settings/integer_list_setting.rb
|
84
|
+
- app/models/system_settings/integer_setting.rb
|
85
|
+
- app/models/system_settings/list_of_integers_validator.rb
|
86
|
+
- app/models/system_settings/setting.rb
|
87
|
+
- app/models/system_settings/string_list_setting.rb
|
88
|
+
- app/models/system_settings/string_setting.rb
|
89
|
+
- app/models/system_settings/type/integer_list.rb
|
90
|
+
- app/models/system_settings/type/string_list.rb
|
91
|
+
- config/locales/system_settings.en.yml
|
92
|
+
- config/routes.rb
|
93
|
+
- db/migrate/20181007125347_create_system_settings_settings.rb
|
94
|
+
- frontend/build/asset-manifest.json
|
95
|
+
- frontend/build/favicon.ico
|
96
|
+
- frontend/build/index.html
|
97
|
+
- frontend/build/precache-manifest.130ca067521371497dba783c23aa7e16.js
|
98
|
+
- frontend/build/service-worker.js
|
99
|
+
- frontend/build/static/css/main.e262560e.chunk.css
|
100
|
+
- frontend/build/static/js/2.83a5f4da.chunk.js
|
101
|
+
- frontend/build/static/js/main.afaa2372.chunk.js
|
102
|
+
- frontend/build/static/js/runtime~main.a09e9b82.js
|
103
|
+
- lib/system_settings.rb
|
104
|
+
- lib/system_settings/engine.rb
|
105
|
+
- lib/system_settings/version.rb
|
106
|
+
- lib/tasks/system_settings_tasks.rake
|
107
|
+
homepage: https://github.com/krists/system_settings
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.3.1
|
125
|
+
requirements: []
|
126
|
+
rubygems_version: 3.0.3
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Summary of SystemSettings.
|
130
|
+
test_files: []
|