diff --git a/.eslintrc b/.eslintrc index 211e286f..0fa85062 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,5 +5,10 @@ }, "rules": { "init-declarations": 1 + }, + "parserOptions": { + "ecmaFeatures": { + "experimentalObjectRestSpread": true + } } } diff --git a/client/dist/images/empty-campaign-preview.png b/client/dist/images/empty-campaign-preview.png new file mode 100644 index 00000000..45c758ab Binary files /dev/null and b/client/dist/images/empty-campaign-preview.png differ diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 15a0e152..8ebeba7f 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t){e.exports=React},function(e,t){e.exports=SilverStripeComponent},function(e,t){e.exports=i18n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SET_CAMPAIGN_ACTIVE_CHANGESET:"SET_CAMPAIGN_ACTIVE_CHANGESET",SET_CAMPAIGN_SELECTED_CHANGESETITEM:"SET_CAMPAIGN_SELECTED_CHANGESETITEM",PUBLISH_CAMPAIGN_REQUEST:"PUBLISH_CAMPAIGN_REQUEST",PUBLISH_CAMPAIGN_SUCCESS:"PUBLISH_CAMPAIGN_SUCCESS",PUBLISH_CAMPAIGN_FAILURE:"PUBLISH_CAMPAIGN_FAILURE"}},function(e,t){e.exports=Breadcrumb},function(e,t){e.exports=BreadcrumbsActions},function(e,t){e.exports=FormAction},function(e,t){e.exports=ReactRedux},function(e,t){e.exports=ReactRouter},function(e,t){e.exports=Redux},function(e,t){e.exports=Toolbar},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var r=n(8),i=n(21),o=a(i),l=n(24),s=a(l),u=n(28),c=a(u),p=n(13),d=a(p),f=n(17),m=a(f);document.addEventListener("DOMContentLoaded",function(){var e=o.default.getSection("SilverStripe\\CampaignAdmin\\CampaignAdmin");c.default.add({path:e.url,component:(0,r.withRouter)(d.default),childRoutes:[{path:":type/:id/:view",component:d.default},{path:"set/:id/:view",component:d.default}]}),s.default.reducer.register("campaign",m.default)})},function(e,t,n){"use strict";n(11)},function(e,t,n){"use strict";function a(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 i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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)}function l(e,t){var n=null,a=e.config.sections.find(function(e){return e.name===D});return t.params.id>0&&(n=(0,m.formValueSelector)("Campaign.EditView",y.default)(e,"Name")),{config:e.config,campaignId:e.campaign.campaignId,view:e.campaign.view,breadcrumbs:e.breadcrumbs,sectionConfig:a,securityId:e.config.SecurityID,title:n}}function s(e){return{breadcrumbsActions:(0,h.bindActionCreators)(E,e)}}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t1){var t=this.props.breadcrumbs[this.props.breadcrumbs.length-2];t&&t.href&&(e.preventDefault(),this.props.router.push(t.href))}}},{key:"handleCreateCampaignSubmit",value:function(e,t,n){var a=this,r=n();if(!r)throw new Error("Promise was not returned for submitting");return r.then(function(e){var n=e.errors&&e.errors.length>0;if("action_save"===t&&!n){var r=a.props.sectionConfig.url,i=e.record.id;a.props.router.push(r+"/set/"+i+"/edit")}return e})}},{key:"handleFormAction",value:function(e){if("action_cancel"===e.currentTarget.name){var t=this.props.sectionConfig.url;this.props.router.push(t),e.preventDefault()}}},{key:"render",value:function(){var e=null;switch(this.props.params.view){case"show":e=this.renderItemListView();break;case"edit":e=this.renderDetailEditView();break;case"create":e=this.renderCreateView();break;default:e=this.renderIndexView()}return e}},{key:"renderIndexView",value:function(){var e=this.props.sectionConfig.form.EditForm.schemaUrl,t={title:N.default._t("CampaignAdmin.ADDCAMPAIGN"),icon:"plus",handleClick:this.addCampaign.bind(this)},n={createFn:this.campaignListCreateFn.bind(this),schemaUrl:e,identifier:"Campaign.IndexView"};return d.default.createElement("div",{className:"fill-height","aria-expanded":"true"},d.default.createElement(O.default,null,d.default.createElement(A.default,{multiline:!0})),d.default.createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow"},d.default.createElement("div",{className:"toolbar toolbar--content"},d.default.createElement("div",{className:"btn-toolbar"},d.default.createElement(S.default,t))),d.default.createElement(x.default,n)))}},{key:"renderItemListView",value:function(){var e={sectionConfig:this.props.sectionConfig,campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,handleBackButtonClick:this.handleBackButtonClick.bind(this)};return d.default.createElement(M.default,e)}},{key:"renderDetailEditView",value:function(){if(this.props.params.id<=0)return this.renderCreateView();var e=this.props.sectionConfig.form.campaignEditForm.schemaUrl,t=e+"/"+this.props.params.id;return d.default.createElement("div",{className:"fill-height"},d.default.createElement(O.default,{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},d.default.createElement(A.default,{multiline:!0})),d.default.createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},d.default.createElement(x.default,{handleAction:this.handleFormAction,schemaUrl:t,identifier:"Campaign.EditView"})))}},{key:"renderCreateView",value:function(){var e=this.props.sectionConfig.form.campaignCreateForm.schemaUrl;return d.default.createElement("div",{className:"fill-height"},d.default.createElement(O.default,{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},d.default.createElement(A.default,{multiline:!0})),d.default.createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},d.default.createElement(x.default,{handleSubmit:this.handleCreateCampaignSubmit,handleAction:this.handleFormAction,schemaUrl:e,identifier:"Campaign.CreateView"})))}},{key:"campaignEditCreateFn",value:function(e,t){var n=this,a=this.props.sectionConfig.url;if("action_cancel"===t.name){var r=Object.assign({},t,{handleClick:function(e){e.preventDefault(),n.props.router.push(a)}});return d.default.createElement(e,u({key:t.id},r))}return d.default.createElement(e,u({key:t.id},t))}},{key:"campaignAddCreateFn",value:function(e,t){var n=this,a=this.props.sectionConfig.url;if("action_cancel"===t.name){var r=Object.assign({},t,{handleClick:function(e){e.preventDefault(),n.props.router.push(a)}});return d.default.createElement(e,u({key:t.name},r))}return d.default.createElement(e,u({key:t.name},t))}},{key:"campaignListCreateFn",value:function(e,t){var n=this,a=this.props.sectionConfig.url;if("GridField"===t.schemaComponent){var r=Object.assign({},t,{data:Object.assign({},t.data,{handleDrillDown:function(e,t){n.props.router.push(a+"/set/"+t.ID+"/show")},handleEditRecord:function(e,t){n.props.router.push(a+"/set/"+t+"/edit")}})});return d.default.createElement(e,u({key:r.name},r))}return d.default.createElement(e,u({key:t.name},t))}},{key:"addCampaign",value:function(){var e=this.getActionRoute(0,"create");this.props.router.push(e)}},{key:"getActionRoute",value:function(e,t){return this.props.sectionConfig.url+"/set/"+e+"/"+t}}]),t}(T.default);L.propTypes={breadcrumbsActions:d.default.PropTypes.object.isRequired,campaignId:d.default.PropTypes.string,sectionConfig:d.default.PropTypes.shape({publishEndpoint:d.default.PropTypes.shape({url:d.default.PropTypes.string,method:d.default.PropTypes.string}),form:d.default.PropTypes.shape({EditForm:d.default.PropTypes.shape({schemaUrl:d.default.PropTypes.string}),campaignEditForm:d.default.PropTypes.shape({schemaUrl:d.default.PropTypes.string}),campaignCreateForm:d.default.PropTypes.shape({schemaUrl:d.default.PropTypes.string})})}),securityId:d.default.PropTypes.string.isRequired,view:d.default.PropTypes.string},t.default=(0,g.withRouter)((0,f.connect)(l,s)(L))},function(e,t,n){"use strict";function a(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 i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 l=function(){function e(e,t){for(var n=0;n0&&n.push(this.getReferToTooltipText()),t>0&&n.push(f.default.sprintf(0===n.length?this.getReferredByTooltipText():this.getReferredByTooltipText().toLocaleLowerCase(),(0,g.default)(t)));var a=u.default.createElement(m.Tooltip,{id:"campaign-tooltip-"+this.props.item.ID},n.join(", ")),r=null;if(this.props.selected&&e+t>0||this.props.isLinked){var i=["list-group-item__info","campaign-admin__item-links",this.props.isLinked?"campaign-admin__item-links--is-linked":"campaign-admin__item-links--has-links"];r=u.default.createElement("div",{className:i.join(" ")},u.default.createElement(m.OverlayTrigger,{placement:"left",overlay:a},u.default.createElement("span",null,u.default.createElement("span",{className:"campaign-admin__item-links__number"},e+t),u.default.createElement("span",{className:"font-icon-link"}))))}return r}}]),t}(p.default);b.propTypes={campaign:u.default.PropTypes.object.isRequired,item:u.default.PropTypes.object.isRequired,isLinked:u.default.PropTypes.bool},t.default=b},function(e,t,n){"use strict";function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function i(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");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(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)}function s(e,t){var n=null,a=t.sectionConfig.treeClass;return e.records&&e.records[a]&&t.campaignId&&(n=e.records[a][parseInt(t.campaignId,10)]),{config:e.config,record:n||{},campaign:e.campaign,treeClass:a}}function u(e){return{breadcrumbsActions:(0,m.bindActionCreators)(b,e),recordActions:(0,m.bindActionCreators)(_,e),campaignActions:(0,m.bindActionCreators)(C,e)}}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n0&&(n=t[0]),n}},{key:"render",value:function(){var e=this,t=this.props.campaign.changeSetItemId,n=null,a=t?"":"campaign-admin__campaign--hide-preview",r=this.props.campaignId,i=this.props.record,o=this.groupItemsForSet(),l=[],s=this.getSelectedItem(),u=s&&s._links&&s._links.references||[],c=s&&s._links&&s._links.referenced_by||[];Object.keys(o).forEach(function(a){var s=o[a],p=s.items.length,d=[],m=p+" "+(1===p?s.singular:s.plural),h="Set_"+r+"_Group_"+a;s.items.forEach(function(a){t||(t=a.ID);var r=t===a.ID;r&&a._links&&(n=a._links);var o=[];"none"!==a.ChangeType&&"published"!==i.State||o.push("list-group-item--inactive"),r&&o.push("active");var l=!!u.find(function(e){return e.ChangeSetItemID===parseInt(a.ID,10)});l=l||c.find(function(e){return e.ChangeSetItemID===a.ID}),d.push(f.default.createElement(w.default,{key:a.ID,className:o.join(" "),handleClick:e.handleItemSelected,handleClickArg:a.ID},f.default.createElement(j.default,{item:a,campaign:e.props.record,selected:r,isLinked:l})))}),l.push(f.default.createElement(P.default,{key:h,groupid:h,title:m},d))});var p=[this.props.config.absoluteBaseUrl,this.props.config.sections.find(function(e){return"SilverStripe\\CMS\\Controllers\\CMSPagesController"===e.name}).url].join(""),d=l.length?f.default.createElement(k.default,null,l):f.default.createElement("div",{className:"alert alert-warning",role:"alert"},f.default.createElement("strong",null,"This campaign is empty.")," You can add items to a campaign by selecting ",f.default.createElement("em",null,"Add to campaign")," from within the ",f.default.createElement("em",null,"More Options "),"popup on ",f.default.createElement("a",{href:p},"pages")," and files."),m=["panel","panel--padded","panel--scrollable","flexbox-area-grow"];return f.default.createElement("div",{className:"fill-width campaign-admin__campaign "+a},f.default.createElement("div",{className:"fill-height campaign-admin__campaign-items","aria-expanded":"true"},f.default.createElement(B.default,{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},f.default.createElement(D.default,{multiline:!0})),f.default.createElement("div",{className:m.join(" ")},d),f.default.createElement("div",{className:"toolbar toolbar--south"},this.renderButtonToolbar())),f.default.createElement(G.default,{itemLinks:n,itemId:t,onBack:this.handleCloseItem}))}},{key:"handleItemSelected",value:function(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"handleCloseItem",value:function(){this.props.campaignActions.selectChangeSetItem(null)}},{key:"renderButtonToolbar",value:function(){var e=this.getItems();if(!e||!e.length)return f.default.createElement("div",{className:"btn-toolbar"});var t={};return"open"===this.props.record.State?t=Object.assign(t,{title:F.default._t("CampaignAdmin.PUBLISHCAMPAIGN"),buttonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(t=Object.assign(t,{title:F.default._t("CampaignAdmin.REVERTCAMPAIGN"),buttonStyle:"secondary-outline",icon:"back-in-time",disabled:!0})),f.default.createElement("div",{className:"btn-toolbar"},f.default.createElement(R.default,t))}},{key:"getItems",value:function(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{key:"groupItemsForSet",value:function(){var e={},t=this.getItems();return t?(t.forEach(function(t){var n=t.BaseClass;e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId)}}]),t}(I.default);V.propTypes={campaign:f.default.PropTypes.shape({isPublishing:f.default.PropTypes.bool.isRequired,changeSetItemId:f.default.PropTypes.number}),breadcrumbsActions:f.default.PropTypes.object.isRequired,campaignActions:f.default.PropTypes.object.isRequired,publishApi:f.default.PropTypes.func.isRequired,record:f.default.PropTypes.object.isRequired,recordActions:f.default.PropTypes.object.isRequired,sectionConfig:f.default.PropTypes.object.isRequired,handleBackButtonClick:f.default.PropTypes.func},t.default=(0,h.connect)(s,u)(V)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){return{type:s.default.SET_CAMPAIGN_SELECTED_CHANGESETITEM,payload:{changeSetItemId:e}}}function i(e,t){return function(n){n({type:s.default.SET_CAMPAIGN_ACTIVE_CHANGESET,payload:{campaignId:e,view:t}})}}function o(e,t,n){return function(a){a({type:s.default.PUBLISH_CAMPAIGN_REQUEST,payload:{campaignId:n}}),e({id:n}).then(function(e){a({type:s.default.PUBLISH_CAMPAIGN_SUCCESS,payload:{campaignId:n}}),a({type:c.default.FETCH_RECORD_SUCCESS,payload:{recordType:t,data:e}})}).catch(function(e){a({type:s.default.PUBLISH_CAMPAIGN_FAILURE,payload:{error:e}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.selectChangeSetItem=r,t.showCampaignView=i,t.publishCampaign=o;var l=n(3),s=a(l),u=n(29),c=a(u)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1];switch(t.type){case s.default.SET_CAMPAIGN_SELECTED_CHANGESETITEM:return(0,o.default)(Object.assign({},e,{changeSetItemId:t.payload.changeSetItemId}));case s.default.SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,o.default)(Object.assign({},e,{campaignId:t.payload.campaignId,view:t.payload.view,changeSetItemId:null}));case s.default.PUBLISH_CAMPAIGN_REQUEST:return(0,o.default)(Object.assign({},e,{isPublishing:!0}));case s.default.PUBLISH_CAMPAIGN_SUCCESS:case s.default.PUBLISH_CAMPAIGN_FAILURE:return(0,o.default)(Object.assign({},e,{isPublishing:!1}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(22),o=a(i),l=n(3),s=a(l),u=(0,o.default)({campaignId:null,changeSetItemId:null,isPublishing:!1,view:null});t.default=r},function(e,t){e.exports=Accordion},function(e,t){e.exports=AccordionBlock},function(e,t){e.exports=Backend},function(e,t){e.exports=Config},function(e,t){e.exports=DeepFreezeStrict},function(e,t){e.exports=FormBuilderLoader},function(e,t){e.exports=Injector},function(e,t){e.exports=ListGroupItem},function(e,t){e.exports=Preview},function(e,t){e.exports=ReactBootstrap},function(e,t){e.exports=ReactRouteRegister},function(e,t){e.exports=RecordsActionTypes},function(e,t){e.exports=RecordsActions},function(e,t){e.exports=ReduxForm},function(e,t){e.exports=formatWrittenNumber},function(e,t){e.exports=getFormState}]); \ No newline at end of file +!function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t){e.exports=React},function(e,t){e.exports=SilverStripeComponent},function(e,t){e.exports=i18n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SET_CAMPAIGN_ACTIVE_CHANGESET:"SET_CAMPAIGN_ACTIVE_CHANGESET",SET_CAMPAIGN_SELECTED_CHANGESETITEM:"SET_CAMPAIGN_SELECTED_CHANGESETITEM",PUBLISH_CAMPAIGN_REQUEST:"PUBLISH_CAMPAIGN_REQUEST",PUBLISH_CAMPAIGN_SUCCESS:"PUBLISH_CAMPAIGN_SUCCESS",PUBLISH_CAMPAIGN_FAILURE:"PUBLISH_CAMPAIGN_FAILURE",SET_NEW_CAMPAIGN:"SET_NEW_CAMPAIGN"}},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){return{type:u.default.SET_CAMPAIGN_SELECTED_CHANGESETITEM,payload:{changeSetItemId:e}}}function i(e,t){return function(n){n({type:u.default.SET_CAMPAIGN_ACTIVE_CHANGESET,payload:{campaignId:e,view:t}})}}function o(e,t,n){return function(a){a({type:u.default.PUBLISH_CAMPAIGN_REQUEST,payload:{campaignId:n}}),e({id:n}).then(function(e){a({type:u.default.PUBLISH_CAMPAIGN_SUCCESS,payload:{campaignId:n}}),a({type:p.default.FETCH_RECORD_SUCCESS,payload:{recordType:t,data:e}})}).catch(function(e){a({type:u.default.PUBLISH_CAMPAIGN_FAILURE,payload:{error:e}})})}}function s(e){return{type:u.default.SET_NEW_CAMPAIGN,payload:{newItem:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.selectChangeSetItem=r,t.showCampaignView=i,t.publishCampaign=o,t.setNewItem=s;var l=n(3),u=a(l),c=n(29),p=a(c)},function(e,t){e.exports=Breadcrumb},function(e,t){e.exports=BreadcrumbsActions},function(e,t){e.exports=FormAction},function(e,t){e.exports=ReactRedux},function(e,t){e.exports=ReactRouter},function(e,t){e.exports=Redux},function(e,t){e.exports=Toolbar},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var r=n(9),i=n(21),o=a(i),s=n(24),l=a(s),u=n(28),c=a(u),p=n(14),d=a(p),f=n(17),m=a(f);document.addEventListener("DOMContentLoaded",function(){var e=o.default.getSection("SilverStripe\\CampaignAdmin\\CampaignAdmin");c.default.add({path:e.url,component:(0,r.withRouter)(d.default),childRoutes:[{path:":type/:id/:view",component:d.default},{path:"set/:id/:view",component:d.default}]}),l.default.reducer.register("campaign",m.default)})},function(e,t,n){"use strict";n(12)},function(e,t,n){"use strict";function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function i(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");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(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)}function l(e,t){var n=null,a=e.config.sections.find(function(e){return e.name===U});return t.params.id>0&&(n=(0,h.formValueSelector)("Campaign.EditView",_.default)(e,"Name")),{config:e.config,campaignId:e.campaign.campaignId,view:e.campaign.view,breadcrumbs:e.breadcrumbs,sectionConfig:a,securityId:e.config.SecurityID,title:n}}function u(e){return{breadcrumbsActions:(0,g.bindActionCreators)(k,e),campaignActions:(0,g.bindActionCreators)(A,e)}}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t1){var t=this.props.breadcrumbs[this.props.breadcrumbs.length-2];t&&t.href&&(e.preventDefault(),this.props.router.push(t.href))}}},{key:"handleCreateCampaignSubmit",value:function(e,t,n){var a=this,r=n();if(!r)throw new Error("Promise was not returned for submitting");return r.then(function(e){var n=e.errors&&e.errors.length>0;if("action_save"===t&&!n){var r=a.props.sectionConfig.url,i=e.record.id;a.props.campaignActions.setNewItem(i),a.props.router.push(r+"/set/"+i+"/show")}return e})}},{key:"handleFormAction",value:function(e){if("action_cancel"===e.currentTarget.name){var t=this.props.sectionConfig.url;this.props.router.push(t),e.preventDefault()}}},{key:"render",value:function(){var e=null;switch(this.props.params.view){case"show":e=this.renderItemListView();break;case"edit":e=this.renderDetailEditView();break;case"create":e=this.renderCreateView();break;default:e=this.renderIndexView()}return e}},{key:"renderIndexView",value:function(){var e=this.props.sectionConfig.form.EditForm.schemaUrl,t={title:B.default._t("CampaignAdmin.ADDCAMPAIGN"),icon:"plus",extraClass:"btn-primary",handleClick:this.addCampaign.bind(this)},n={createFn:this.campaignListCreateFn.bind(this),schemaUrl:e,identifier:"Campaign.IndexView"};return f.default.createElement("div",{className:"fill-height","aria-expanded":"true"},f.default.createElement(j.default,null,f.default.createElement(S.default,{multiline:!0})),f.default.createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow"},f.default.createElement("div",{className:"toolbar toolbar--content"},f.default.createElement("div",{className:"btn-toolbar"},f.default.createElement(O.default,t))),f.default.createElement(G.default,n)))}},{key:"renderItemListView",value:function(){var e={sectionConfig:this.props.sectionConfig,campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,handleBackButtonClick:this.handleBackButtonClick.bind(this)};return f.default.createElement(D.default,e)}},{key:"renderDetailEditView",value:function(){if(this.props.params.id<=0)return this.renderCreateView();var e=this.props.sectionConfig.form.campaignEditForm.schemaUrl,t=e+"/"+this.props.params.id;return f.default.createElement("div",{className:"fill-height"},f.default.createElement(j.default,{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},f.default.createElement(S.default,{multiline:!0})),f.default.createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},f.default.createElement(G.default,{handleAction:this.handleFormAction,schemaUrl:t,identifier:"Campaign.EditView"})))}},{key:"renderCreateView",value:function(){var e=this.props.sectionConfig.form.campaignCreateForm.schemaUrl;return f.default.createElement("div",{className:"fill-height"},f.default.createElement(j.default,{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},f.default.createElement(S.default,{multiline:!0})),f.default.createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},f.default.createElement(G.default,{handleSubmit:this.handleCreateCampaignSubmit,handleAction:this.handleFormAction,schemaUrl:e,identifier:"Campaign.CreateView"})))}},{key:"campaignEditCreateFn",value:function(e,t){var n=this,a=this.props.sectionConfig.url;if("action_cancel"===t.name){var r=Object.assign({},t,{handleClick:function(e){e.preventDefault(),n.props.router.push(a)}});return f.default.createElement(e,c({key:t.id},r))}return f.default.createElement(e,c({key:t.id},t))}},{key:"campaignAddCreateFn",value:function(e,t){var n=this,a=this.props.sectionConfig.url;if("action_cancel"===t.name){var r=Object.assign({},t,{handleClick:function(e){e.preventDefault(),n.props.router.push(a)}});return f.default.createElement(e,c({key:t.name},r))}return f.default.createElement(e,c({key:t.name},t))}},{key:"campaignListCreateFn",value:function(e,t){var n=this,a=this.props.sectionConfig.url;if("GridField"===t.schemaComponent){var r=Object.assign({},t,{data:Object.assign({},t.data,{handleDrillDown:function(e,t){n.props.router.push(a+"/set/"+t.ID+"/show")},handleEditRecord:function(e,t){n.props.router.push(a+"/set/"+t+"/edit")}})});return f.default.createElement(e,c({key:r.name},r))}return f.default.createElement(e,c({key:t.name},t))}},{key:"addCampaign",value:function(){var e=this.getActionRoute(0,"create");this.props.router.push(e)}},{key:"getActionRoute",value:function(e,t){return this.props.sectionConfig.url+"/set/"+e+"/"+t}}]),t}(w.default);F.propTypes={breadcrumbsActions:f.default.PropTypes.object.isRequired,campaignId:f.default.PropTypes.string,sectionConfig:f.default.PropTypes.shape({publishEndpoint:f.default.PropTypes.shape({url:f.default.PropTypes.string,method:f.default.PropTypes.string}),form:f.default.PropTypes.shape({EditForm:f.default.PropTypes.shape({schemaUrl:f.default.PropTypes.string}),campaignEditForm:f.default.PropTypes.shape({schemaUrl:f.default.PropTypes.string}),campaignCreateForm:f.default.PropTypes.shape({schemaUrl:f.default.PropTypes.string})})}),securityId:f.default.PropTypes.string.isRequired,view:f.default.PropTypes.string},t.default=(0,b.withRouter)((0,m.connect)(l,u)(F))},function(e,t,n){"use strict";function a(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 i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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=function(){function e(e,t){for(var n=0;n0&&n.push(this.getReferToTooltipText()),t>0&&n.push(f.default.sprintf(0===n.length?this.getReferredByTooltipText():this.getReferredByTooltipText().toLocaleLowerCase(),(0,g.default)(t)));var a=u.default.createElement(m.Tooltip,{id:"campaign-tooltip-"+this.props.item.ID},n.join(", ")),r=null;if(this.props.selected&&e+t>0||this.props.isLinked){var i=["list-group-item__info","campaign-admin__item-links",this.props.isLinked?"campaign-admin__item-links--is-linked":"campaign-admin__item-links--has-links"];r=u.default.createElement("div",{className:i.join(" ")},u.default.createElement(m.OverlayTrigger,{placement:"left",overlay:a},u.default.createElement("span",null,u.default.createElement("span",{className:"campaign-admin__item-links__number"},e+t),u.default.createElement("span",{className:"font-icon-link"}))))}return r}}]),t}(p.default);b.propTypes={campaign:u.default.PropTypes.object.isRequired,item:u.default.PropTypes.object.isRequired,isLinked:u.default.PropTypes.bool},t.default=b},function(e,t,n){"use strict";function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:this.props;return 0!==Object.keys(e.record).length}},{key:"setBreadcrumbs",value:function(){if(this.props.record){var e=[{text:V.default._t("CampaignAdmin.CAMPAIGN","Campaigns"),href:this.props.sectionConfig.url}];e.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(e)}}},{key:"getSelectedItem",value:function(){var e=this.props.campaign.changeSetItemId,t=this.getItems()||[],n=null;return e&&(n=t.find(function(t){return e===t.ID})),!n&&t.length>0&&(n=t[0]),n}},{key:"render",value:function(){var e=this,t=this.props.campaign.changeSetItemId,n=null,a=t?"":"campaign-admin__campaign--hide-preview",r=this.props.campaignId,i=this.props.record,o=this.props.newItem,s=this.groupItemsForSet(),l=[],u=this.getSelectedItem(),c=u&&u._links&&u._links.references||[],p=u&&u._links&&u._links.referenced_by||[];Object.keys(s).forEach(function(a){var o=s[a],u=o.items.length,d=[],f="\n "+(0===u?"":u)+"\n "+(1===u?o.singular:o.plural)+"\n ",m="Set_"+r+"_Group_"+a;o.items.forEach(function(a){t||(t=a.ID);var r=t===a.ID;r&&a._links&&(n=a._links);var o=[];"none"!==a.ChangeType&&"published"!==i.State||o.push("list-group-item--inactive"),r&&o.push("active");var s=!!c.find(function(e){return e.ChangeSetItemID===parseInt(a.ID,10)});s=s||p.find(function(e){return e.ChangeSetItemID===a.ID}),d.push(h.default.createElement(O.default,{key:a.ID,className:o.join(" "),handleClick:e.handleItemSelected,handleClickArg:a.ID},h.default.createElement(G.default,{item:a,campaign:e.props.record,selected:r,isLinked:s})))});var g=(0,W.default)("list-group-wrapper",{"list-group-wrapper--empty":0===d.length});l.push(h.default.createElement("div",{className:g},h.default.createElement(w.default,{key:m,groupid:m,title:f},d.length>0?d:h.default.createElement("p",{className:"list-group-item"},o.noItemsText))))});var d=o?h.default.createElement("p",{className:"alert alert-success alert--no-border",role:"alert"},V.default._t("CampaignAdmin.NEWCAMPAIGNSUCCESS","Nice one! You have successfully created a campaign.")):null,f=h.default.createElement(S.default,null,l),m=["panel","panel--padded","panel--scrollable","flexbox-area-grow"];return h.default.createElement("div",{className:"fill-width campaign-admin__campaign "+a},h.default.createElement("div",{className:"fill-height campaign-admin__campaign-items","aria-expanded":"true"},h.default.createElement(B.default,{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h.default.createElement(D.default,{multiline:!0})),d,h.default.createElement("div",{className:m.join(" ")},f),h.default.createElement("div",{className:"toolbar toolbar--south"},this.renderButtonToolbar())),this.renderPreview(n,t))}},{key:"renderPreview",value:function(e,t){var n=null,a=(0,W.default)(["flexbox-area-grow","fill-height","preview","campaign-admin__campaign-preview","campaign-admin__campaign-preview--empty"]);if(this.state.loading)n=h.default.createElement("div",{className:a},h.default.createElement("p",null,V.default._t("CampaignAdmin.LOADING","Loading...")));else if(this.getItems()&&0!==this.getItems().length)n=h.default.createElement(F.default,{itemLinks:e,itemId:t,onBack:this.handleCloseItem});else{var r=V.default._t("CampaignAdmin.SELECTFROMSECTIONS",'Select "Add to Campaign" from pages, files, and other admin sections with content types');n=h.default.createElement("div",{className:a},h.default.createElement("h2",{className:"campaign-admin__empty-heading"},"Getting started"),h.default.createElement("p",{className:"campaign-admin__empty-info"},r))}return n}},{key:"handleItemSelected",value:function(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"handleCloseItem",value:function(){this.props.campaignActions.selectChangeSetItem(null)}},{key:"renderButtonToolbar",value:function(){var e=this.getItems(),t={};return e&&0!==e.length?"open"===this.props.record.State?t=Object.assign(t,{title:V.default._t("CampaignAdmin.PUBLISHCAMPAIGN","Publish campaign"),buttonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(t=Object.assign(t,{title:V.default._t("CampaignAdmin.REVERTCAMPAIGN","Revert"),buttonStyle:"secondary-outline",icon:"back-in-time",disabled:!0})):t=Object.assign(t,{title:V.default._t("CampaignAdmin.PUBLISHCAMPAIGN","Publish campaign"),buttonStyle:"secondary-outline",icon:"rocket",disabled:!0}),h.default.createElement("div",{className:"btn-toolbar"},h.default.createElement(j.default,t))}},{key:"getItems",value:function(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{key:"groupItemsForSet",value:function(){var e=this.getPlaceholderGroups(),t=this.getItems();return t?(t.forEach(function(t){var n=t.BaseClass;e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"getPlaceholderGroups",value:function(){var e={};return this.props.record&&this.props.record.placeholderGroups&&this.props.record.placeholderGroups.forEach(function(t){e[t.baseClass]=p({},t),e[t.baseClass].items=[].concat(i(t.items))}),e}},{key:"handlePublish",value:function(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId)}}]),t}(k.default);Q.propTypes={campaign:h.default.PropTypes.shape({isPublishing:h.default.PropTypes.bool.isRequired,changeSetItemId:h.default.PropTypes.number}),breadcrumbsActions:h.default.PropTypes.object.isRequired,campaignActions:h.default.PropTypes.object.isRequired,publishApi:h.default.PropTypes.func.isRequired,record:h.default.PropTypes.object.isRequired,recordActions:h.default.PropTypes.object.isRequired,sectionConfig:h.default.PropTypes.object.isRequired,handleBackButtonClick:h.default.PropTypes.func},t.default=(0,b.connect)(u,c)(Q)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments[1];switch(t.type){case u.default.SET_CAMPAIGN_SELECTED_CHANGESETITEM:return(0,s.default)(Object.assign({},e,{changeSetItemId:t.payload.changeSetItemId}));case u.default.SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,s.default)(Object.assign({},e,{campaignId:t.payload.campaignId,view:t.payload.view,changeSetItemId:null}));case u.default.PUBLISH_CAMPAIGN_REQUEST:return(0,s.default)(Object.assign({},e,{isPublishing:!0}));case u.default.PUBLISH_CAMPAIGN_SUCCESS:case u.default.PUBLISH_CAMPAIGN_FAILURE:return(0,s.default)(Object.assign({},e,{isPublishing:!1}));case u.default.SET_NEW_CAMPAIGN:return(0,s.default)(i({},e,{newItem:t.payload.newItem}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t> breakpoint-next(sm)\n// md\n// >> breakpoint-next(sm, (xs: 0, sm: 544px, md: 768px))\n// md\n// >> breakpoint-next(sm, $breakpoint-names: (xs sm md))\n// md\n@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {\n $n: index($breakpoint-names, $name);\n @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);\n}\n\n// Minimum breakpoint width. Null for the smallest (first) breakpoint.\n//\n// >> breakpoint-min(sm, (xs: 0, sm: 544px, md: 768px))\n// 544px\n@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {\n $min: map-get($breakpoints, $name);\n @return if($min != 0, $min, null);\n}\n\n// Maximum breakpoint width. Null for the largest (last) breakpoint.\n// The maximum value is calculated as the minimum of the next one less 0.1.\n//\n// >> breakpoint-max(sm, (xs: 0, sm: 544px, md: 768px))\n// 767px\n@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {\n $next: breakpoint-next($name, $breakpoints);\n @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);\n}\n\n// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n// Makes the @content apply to the given breakpoint and wider.\n@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n @if $min {\n @media (min-width: $min) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n// Makes the @content apply to the given breakpoint and narrower.\n@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {\n $max: breakpoint-max($name, $breakpoints);\n @if $max {\n @media (max-width: $max) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media between the breakpoint's minimum and maximum widths.\n// No minimum for the smallest breakpoint, and no maximum for the largest one.\n// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {\n @include media-breakpoint-up($name, $breakpoints) {\n @include media-breakpoint-down($name, $breakpoints) {\n @content;\n }\n }\n}\n\n// Media that spans multiple breakpoint widths.\n// Makes the @content apply between the min and max breakpoints\n@mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {\n @include media-breakpoint-up($lower, $breakpoints) {\n @include media-breakpoint-down($upper, $breakpoints) {\n @content;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./~/bootstrap/scss/mixins/_breakpoints.scss",".campaign-admin__campaign {\n position: relative;\n height: 100%;\n}\n\n@media (max-width: 991px) {\n .campaign-admin__campaign.campaign-admin__campaign--hide-preview .campaign-admin__campaign-preview {\n display: none;\n }\n\n .campaign-admin__campaign .list-group-item.active {\n background-color: #fff;\n color: #4f5861;\n z-index: 0;\n }\n}\n\n@media (max-width: 991px) and (max-width: 1199px) {\n .campaign-admin__campaign .list-group-item.active {\n border: none;\n }\n}\n\n@media (max-width: 991px) {\n .campaign-admin__campaign .list-group-item.active:hover {\n background-color: #f5f5f5;\n color: #4f5861;\n border-color: #e5e8eb;\n }\n}\n\n.campaign-admin__campaign-items {\n width: 100%;\n z-index: 1;\n position: relative;\n}\n\n@media (min-width: 992px) {\n .campaign-admin__campaign-items {\n width: 300px;\n }\n}\n\n.campaign-admin__item-links,\n.campaign-admin__item-links--has-links,\n.campaign-admin__item-links--is-linked {\n display: flex;\n align-items: center;\n color: #29abe2;\n position: absolute;\n right: 1.2308rem;\n bottom: 0.82053rem;\n font-size: 0.923rem;\n}\n\n.campaign-admin__item-links .font-icon-link,\n.campaign-admin__item-links--has-links .font-icon-link,\n.campaign-admin__item-links--is-linked .font-icon-link {\n font-size: 16px;\n position: relative;\n top: 3px;\n margin-right: 1px;\n margin-left: 3px;\n}\n\n.campaign-admin__item-links .campaign-admin__item-links__number,\n.campaign-admin__item-links--has-links .campaign-admin__item-links__number,\n.campaign-admin__item-links--is-linked .campaign-admin__item-links__number {\n opacity: 0;\n}\n\n.list-group-item.active .campaign-admin__item-links--has-links {\n opacity: 1;\n}\n\n@media (min-width: 992px) {\n .list-group-item.active .campaign-admin__item-links--has-links {\n color: #fff;\n }\n}\n\n.list-group-item.active .campaign-admin__item-links__number {\n opacity: 1;\n}\n\n.campaign-admin__item-links--is-linked {\n opacity: 1;\n}\n\n.campaign-admin__item-links--is-linked .campaign-admin__item-links__number {\n display: none;\n}\n\n.list-group-item:hover .campaign-admin__item-links--is-linked {\n opacity: 1;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./bundle.scss"],"sourceRoot":""} \ No newline at end of file diff --git a/client/lang/en.js b/client/lang/en.js index b85bf8de..2f9307ab 100644 --- a/client/lang/en.js +++ b/client/lang/en.js @@ -6,7 +6,7 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') { } } else { ss.i18n.addDictionary('en', { - "CampaignAdmin.ADDCAMPAIGN": "Add campaign", + "CampaignAdmin.ADDCAMPAIGN": "Add new", "CampaignAdmin.DELETECAMPAIGN": "Are you sure you want to delete this record?", "CampaignAdmin.DRAFT": "Draft", "CampaignAdmin.ITEM_SUMMARY_PLURAL": "%s items", @@ -15,6 +15,9 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') { "CampaignAdmin.NO_CHANGES": "No changes", "CampaignAdmin.PUBLISHCAMPAIGN": "Publish campaign", "CampaignAdmin.REMOVED": "Removed", - "CampaignAdmin.REVERTCAMPAIGN": "Revert" + "CampaignAdmin.REVERTCAMPAIGN": "Revert", + "CampaignAdmin.NEWCAMPAIGNSUCCESS": "Nice one! You have successfully created a campaign.", + "CampaignAdmin.SELECTFROMSECTIONS": "Select \"Add to Campaign\" from pages, files, and other admin sections with content types", + "CampaignAdmin.LOADING": "Loading..." }); -} \ No newline at end of file +} diff --git a/client/lang/src/en.json b/client/lang/src/en.json index 3201d381..bc0263e0 100644 --- a/client/lang/src/en.json +++ b/client/lang/src/en.json @@ -1,5 +1,5 @@ { - "CampaignAdmin.ADDCAMPAIGN": "Add campaign", + "CampaignAdmin.ADDCAMPAIGN": "Add new", "CampaignAdmin.DELETECAMPAIGN": "Are you sure you want to delete this record?", "CampaignAdmin.DRAFT": "Draft", "CampaignAdmin.ITEM_SUMMARY_PLURAL": "%s items", @@ -8,5 +8,8 @@ "CampaignAdmin.NO_CHANGES": "No changes", "CampaignAdmin.PUBLISHCAMPAIGN": "Publish campaign", "CampaignAdmin.REMOVED": "Removed", - "CampaignAdmin.REVERTCAMPAIGN": "Revert" -} \ No newline at end of file + "CampaignAdmin.REVERTCAMPAIGN": "Revert", + "CampaignAdmin.NEWCAMPAIGNSUCCESS": "Nice one! You have successfully created a campaign.", + "CampaignAdmin.SELECTFROMSECTIONS": "Select \"Add to Campaign\" from pages, files, and other admin sections with content types", + "CampaignAdmin.LOADING": "Loading..." +} diff --git a/client/src/containers/CampaignAdmin/CampaignAdmin.js b/client/src/containers/CampaignAdmin/CampaignAdmin.js index 412c7e14..aa543537 100644 --- a/client/src/containers/CampaignAdmin/CampaignAdmin.js +++ b/client/src/containers/CampaignAdmin/CampaignAdmin.js @@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux'; import { withRouter } from 'react-router'; import getFormState from 'lib/getFormState'; import backend from 'lib/Backend'; +import * as campaignActions from 'state/campaign/CampaignActions'; import * as breadcrumbsActions from 'state/breadcrumbs/BreadcrumbsActions'; import Breadcrumb from 'components/Breadcrumb/Breadcrumb'; import SilverStripeComponent from 'lib/SilverStripeComponent'; @@ -119,7 +120,8 @@ class CampaignAdmin extends SilverStripeComponent { // open the new campaign in edit mode after save completes const sectionUrl = this.props.sectionConfig.url; const id = response.record.id; - this.props.router.push(`${sectionUrl}/set/${id}/edit`); + this.props.campaignActions.setNewItem(id); + this.props.router.push(`${sectionUrl}/set/${id}/show`); } return response; @@ -166,6 +168,7 @@ class CampaignAdmin extends SilverStripeComponent { const formActionProps = { title: i18n._t('CampaignAdmin.ADDCAMPAIGN'), icon: 'plus', + extraClass: 'btn-primary', handleClick: this.addCampaign.bind(this), }; const formBuilderProps = { @@ -410,6 +413,7 @@ function mapStateToProps(state, ownProps) { function mapDispatchToProps(dispatch) { return { breadcrumbsActions: bindActionCreators(breadcrumbsActions, dispatch), + campaignActions: bindActionCreators(campaignActions, dispatch), }; } diff --git a/client/src/containers/CampaignAdmin/CampaignAdmin.scss b/client/src/containers/CampaignAdmin/CampaignAdmin.scss index ac6b2562..6707f2c1 100644 --- a/client/src/containers/CampaignAdmin/CampaignAdmin.scss +++ b/client/src/containers/CampaignAdmin/CampaignAdmin.scss @@ -25,6 +25,24 @@ } } } + + .campaign-admin__campaign-preview--empty { + align-items: center; + justify-content: center; + } + + .campaign-admin__empty-heading { + font-size: $font-size-h1; + margin-bottom: 1em; + } + + .campaign-admin__empty-info { + padding-top: calc(270px + 0.5em); + background-image: url('empty-campaign-preview.png'); + background-repeat: no-repeat; + background-position: 50% 0; + font-size: $font-size-lg; + } } .campaign-admin__campaign-items { @@ -77,6 +95,27 @@ } } +.list-group-wrapper--empty { + .list-group { + border-bottom: 0; + } + + .list-group-item { + background: transparent; + font-style: italic; + border-bottom: 0; + cursor: default; + } + + .accordion__title { + cursor: default; + + &:before { + display: none; + } + } +} + .campaign-admin__item-links--is-linked { opacity: 1; diff --git a/client/src/containers/CampaignAdmin/CampaignAdminList.js b/client/src/containers/CampaignAdmin/CampaignAdminList.js index 9f5e57b7..e6070409 100644 --- a/client/src/containers/CampaignAdmin/CampaignAdminList.js +++ b/client/src/containers/CampaignAdmin/CampaignAdminList.js @@ -14,8 +14,7 @@ import CampaignAdminItem from './CampaignAdminItem'; import Breadcrumb from 'components/Breadcrumb/Breadcrumb'; import Preview from 'components/Preview/Preview'; import i18n from 'i18n'; - -const sectionConfigKey = 'SilverStripe\\CMS\\Controllers\\CMSPagesController'; +import classnames from 'classnames'; /** * Represents a campaign list view @@ -29,6 +28,16 @@ class CampaignAdminList extends SilverStripeComponent { this.handleItemSelected = this.handleItemSelected.bind(this); this.setBreadcrumbs = this.setBreadcrumbs.bind(this); this.handleCloseItem = this.handleCloseItem.bind(this); + + if (!this.isRecordLoaded(props)) { + this.state = { + loading: true, + }; + } else { + this.state = { + loading: false, + }; + } } componentDidMount() { @@ -37,13 +46,28 @@ class CampaignAdminList extends SilverStripeComponent { this.setBreadcrumbs(); // Only load record if not already present - if (!Object.keys(this.props.record).length) { + if (!this.isRecordLoaded()) { this.props.recordActions .fetchRecord(this.props.treeClass, 'get', fetchURL) - .then(this.setBreadcrumbs); + .then(() => { + this.setBreadcrumbs(); + this.setState({ loading: false }); + }); } } + componentWillUnmount() { + // Reset new create flag + this.props.campaignActions.setNewItem(null); + } + + /** + * @return {boolean} + */ + isRecordLoaded(props = this.props) { + return Object.keys(props.record).length !== 0; + } + /** * Update breadcrumbs for this view */ @@ -94,6 +118,7 @@ class CampaignAdminList extends SilverStripeComponent { const selectedClass = (!itemId) ? 'campaign-admin__campaign--hide-preview' : ''; const campaignId = this.props.campaignId; const campaign = this.props.record; + const newItem = this.props.newItem; // Trigger different layout when preview is enabled const itemGroups = this.groupItemsForSet(); @@ -113,9 +138,12 @@ class CampaignAdminList extends SilverStripeComponent { const group = itemGroups[className]; const groupCount = group.items.length; - let listGroupItems = []; - let title = `${groupCount} ${groupCount === 1 ? group.singular : group.plural}`; - let groupid = `Set_${campaignId}_Group_${className}`; + const listGroupItems = []; + const title = ` + ${groupCount === 0 ? '' : groupCount} + ${groupCount === 1 ? group.singular : group.plural} + `; + const groupid = `Set_${campaignId}_Group_${className}`; // Create items for this group group.items.forEach(item => { @@ -163,29 +191,36 @@ class CampaignAdminList extends SilverStripeComponent { ); }); + const wrapperClassnames = classnames('list-group-wrapper', { + 'list-group-wrapper--empty': listGroupItems.length === 0, + }); + // Merge into group accordionBlocks.push( - - {listGroupItems} - +
+ + { + listGroupItems.length > 0 + ? listGroupItems + :

{group.noItemsText}

+ } +
+
); }); - // Set body - const pagesLink = [ - this.props.config.absoluteBaseUrl, - this.props.config.sections.find((section) => section.name === sectionConfigKey).url, - ].join(''); - - const body = accordionBlocks.length - ? ({accordionBlocks}) - : ( -
- This campaign is empty. You can add items to a campaign by - selecting Add to campaign from within the More Options - popup on pages and files. -
- ); + const newItemInfo = newItem + ? ( +

+ {i18n._t( + 'CampaignAdmin.NEWCAMPAIGNSUCCESS', + 'Nice one! You have successfully created a campaign.' + )} +

+ ) + : null; + + const body = {accordionBlocks}; const bodyClass = [ 'panel', 'panel--padded', 'panel--scrollable', 'flexbox-area-grow', ]; @@ -196,6 +231,7 @@ class CampaignAdminList extends SilverStripeComponent { + {newItemInfo}
{body}
@@ -203,11 +239,47 @@ class CampaignAdminList extends SilverStripeComponent { {this.renderButtonToolbar()} - + {this.renderPreview(itemLinks, itemId)} ); } + renderPreview(itemLinks, itemId) { + let preview = null; + let previewClasses = classnames([ + 'flexbox-area-grow', + 'fill-height', + 'preview', + 'campaign-admin__campaign-preview', + 'campaign-admin__campaign-preview--empty', + ]); + + if (this.state.loading) { + preview = ( +
+

{i18n._t('CampaignAdmin.LOADING', 'Loading...')}

+
+ ); + } else if (!this.getItems() || this.getItems().length === 0) { + const message = i18n._t( + 'CampaignAdmin.SELECTFROMSECTIONS', + 'Select "Add to Campaign" from pages, files, and other admin sections with content types' + ); + preview = ( +
+

Getting started

+

+ {message} +

+
+ ); + } else { + preview = ; + } + + return preview; + } + /** * Callback for items being clicked on * @@ -225,23 +297,18 @@ class CampaignAdminList extends SilverStripeComponent { renderButtonToolbar() { const items = this.getItems(); - // let itemSummaryLabel; - if (!items || !items.length) { - return
; - } - - // let itemSummaryLabel = i18n.sprintf( - // items.length === 1 - // ? i18n._t('CampaignAdmin.ITEM_SUMMARY_SINGULAR') - // : i18n._t('CampaignAdmin.ITEM_SUMMARY_PLURAL'), - // items.length - // ); - let actionProps = {}; - if (this.props.record.State === 'open') { + if (!items || items.length === 0) { actionProps = Object.assign(actionProps, { - title: i18n._t('CampaignAdmin.PUBLISHCAMPAIGN'), + title: i18n._t('CampaignAdmin.PUBLISHCAMPAIGN', 'Publish campaign'), + buttonStyle: 'secondary-outline', + icon: 'rocket', + disabled: true, + }); + } else if (this.props.record.State === 'open') { + actionProps = Object.assign(actionProps, { + title: i18n._t('CampaignAdmin.PUBLISHCAMPAIGN', 'Publish campaign'), buttonStyle: 'primary', loading: this.props.campaign.isPublishing, handleClick: this.handlePublish, @@ -250,21 +317,13 @@ class CampaignAdminList extends SilverStripeComponent { } else if (this.props.record.State === 'published') { // TODO Implement "revert" feature actionProps = Object.assign(actionProps, { - title: i18n._t('CampaignAdmin.REVERTCAMPAIGN'), + title: i18n._t('CampaignAdmin.REVERTCAMPAIGN', 'Revert'), buttonStyle: 'secondary-outline', icon: 'back-in-time', disabled: true, }); } - // TODO Fix indicator positioning - // const itemCountIndicator = ( - // - //   - //  {itemSummaryLabel} - // - // ); - return (
@@ -289,7 +348,7 @@ class CampaignAdminList extends SilverStripeComponent { * @return {object} */ groupItemsForSet() { - const groups = {}; + const groups = this.getPlaceholderGroups(); const items = this.getItems(); if (!items) { return groups; @@ -315,6 +374,19 @@ class CampaignAdminList extends SilverStripeComponent { return groups; } + getPlaceholderGroups() { + const groups = {}; + + if (this.props.record && this.props.record.placeholderGroups) { + this.props.record.placeholderGroups.forEach((group) => { + groups[group.baseClass] = { ...group }; + groups[group.baseClass].items = [...group.items]; + }); + } + + return groups; + } + handlePublish(e) { e.preventDefault(); this.props.campaignActions.publishCampaign( @@ -341,17 +413,19 @@ CampaignAdminList.propTypes = { }; function mapStateToProps(state, ownProps) { - // Find record specific to this item - let record = null; const treeClass = ownProps.sectionConfig.treeClass; - if (state.records && state.records[treeClass] && ownProps.campaignId) { - record = state.records[treeClass][parseInt(ownProps.campaignId, 10)]; - } + const id = parseInt(ownProps.campaignId, 10); + // Find record specific to this item + const record = state.records[treeClass] + ? state.records[treeClass][id] + : null; + return { config: state.config, record: record || {}, campaign: state.campaign, treeClass, + newItem: state.campaign.newItem, }; } diff --git a/client/src/containers/CampaignAdmin/images/empty-campaign-preview.png b/client/src/containers/CampaignAdmin/images/empty-campaign-preview.png new file mode 100644 index 00000000..45c758ab Binary files /dev/null and b/client/src/containers/CampaignAdmin/images/empty-campaign-preview.png differ diff --git a/client/src/state/campaign/CampaignActionTypes.js b/client/src/state/campaign/CampaignActionTypes.js index 702c0ba0..6e0830f3 100644 --- a/client/src/state/campaign/CampaignActionTypes.js +++ b/client/src/state/campaign/CampaignActionTypes.js @@ -4,4 +4,5 @@ export default { PUBLISH_CAMPAIGN_REQUEST: 'PUBLISH_CAMPAIGN_REQUEST', PUBLISH_CAMPAIGN_SUCCESS: 'PUBLISH_CAMPAIGN_SUCCESS', PUBLISH_CAMPAIGN_FAILURE: 'PUBLISH_CAMPAIGN_FAILURE', + SET_NEW_CAMPAIGN: 'SET_NEW_CAMPAIGN', }; diff --git a/client/src/state/campaign/CampaignActions.js b/client/src/state/campaign/CampaignActions.js index 788ad0c9..7b04686f 100644 --- a/client/src/state/campaign/CampaignActions.js +++ b/client/src/state/campaign/CampaignActions.js @@ -65,3 +65,16 @@ export function publishCampaign(publishApi, recordType, campaignId) { }); }; } + +/** + * Set new campaign + * + * @param {Number|null} itemId + * @return {Object} + */ +export function setNewItem(itemId) { + return { + type: ACTION_TYPES.SET_NEW_CAMPAIGN, + payload: { newItem: itemId }, + }; +} diff --git a/client/src/state/campaign/CampaignReducer.js b/client/src/state/campaign/CampaignReducer.js index a775156d..8a0134ac 100644 --- a/client/src/state/campaign/CampaignReducer.js +++ b/client/src/state/campaign/CampaignReducer.js @@ -6,6 +6,7 @@ const initialState = deepFreeze({ changeSetItemId: null, isPublishing: false, view: null, + newItem: null, }); function reducer(state = initialState, action) { @@ -34,6 +35,12 @@ function reducer(state = initialState, action) { isPublishing: false, })); + case ACTION_TYPES.SET_NEW_CAMPAIGN: + return deepFreeze({ + ...state, + newItem: action.payload.newItem, + }); + default: return state; diff --git a/lang/en.yml b/lang/en.yml index fef01ff4..9f4b6978 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -17,6 +17,9 @@ en: CANCEL: Cancel ERROR_DUPLICATE_NAME: 'Name "{Name}" already exists' MENUTITLE: Campaigns + NOITEMSTEXT: Add items from the {section} section + CREATE: Create SAVE: Save + SAVED: Saved SAVEDERROR: Error. SAVEDUP: Saved. diff --git a/package.json b/package.json index 51dbd0cd..74d52a33 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "node": "^6.x" }, "scripts": { - "build": "NODE_ENV=production webpack -p --bail --progress", - "watch": "NODE_ENV=development webpack --watch --progress", - "css": "WEBPACK_CHILD=css npm run build", + "build": "yarn && NODE_ENV=production webpack -p --bail --progress", + "watch": "yarn && NODE_ENV=development webpack --watch --progress", + "css": "yarn && WEBPACK_CHILD=css webpack -p --bail --progress", "test": "jest", "coverage": "jest --coverage", "lint": "eslint client/src && sass-lint -v client/src" diff --git a/src/CampaignAdmin.php b/src/CampaignAdmin.php index 9135d1ef..6f6f6b1f 100644 --- a/src/CampaignAdmin.php +++ b/src/CampaignAdmin.php @@ -2,28 +2,30 @@ namespace SilverStripe\CampaignAdmin; +use LogicException; use SilverStripe\Admin\LeftAndMain; use SilverStripe\Admin\LeftAndMainFormRequestHandler; use SilverStripe\Control\Controller; -use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPRequest; +use SilverStripe\Control\HTTPResponse; +use SilverStripe\Core\Config\Config; use SilverStripe\Core\Convert; +use SilverStripe\Core\Injector\Injector; use SilverStripe\Core\Manifest\ModuleLoader; -use SilverStripe\Forms\HiddenField; -use SilverStripe\Forms\FormAction; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Form; +use SilverStripe\Forms\FormAction; +use SilverStripe\Forms\HiddenField; use SilverStripe\Forms\RequiredFields; +use SilverStripe\ORM\DataObject; use SilverStripe\ORM\SS_List; +use SilverStripe\ORM\UnexpectedDataException; use SilverStripe\ORM\ValidationResult; +use SilverStripe\Security\PermissionProvider; use SilverStripe\Security\Security; +use SilverStripe\Security\SecurityToken; use SilverStripe\Versioned\ChangeSet; use SilverStripe\Versioned\ChangeSetItem; -use SilverStripe\ORM\DataObject; -use SilverStripe\ORM\UnexpectedDataException; -use SilverStripe\Security\SecurityToken; -use SilverStripe\Security\PermissionProvider; -use LogicException; use SilverStripe\View\Requirements; /** @@ -80,7 +82,7 @@ class CampaignAdmin extends LeftAndMain implements PermissionProvider private static $thumbnail_height = 64; private static $required_permission_codes = 'CMS_ACCESS_CampaignAdmin'; - + public function getClientConfig() { return array_merge(parent::getClientConfig(), [ @@ -155,6 +157,37 @@ public function readCampaigns() return $response; } + /** + * @return array + */ + protected function getPlaceholderGroups() + { + $groups = []; + + $classes = Config::inst()->get(ChangeSet::class, 'important_classes'); + + foreach ($classes as $class) { + if (!class_exists($class)) { + continue; + } + /** @var DataObject $item */ + $item = Injector::inst()->get($class); + $groups[] = [ + 'baseClass' => DataObject::getSchema()->baseDataClass($class), + 'singular' => $item->i18n_singular_name(), + 'plural' => $item->i18n_plural_name(), + 'noItemsText' => _t(__CLASS__.'.NOITEMSTEXT', 'Add items from the {section} section', [ + 'section' => $item->i18n_plural_name(), + ]), + 'items' => [] + ]; + } + + $this->extend('updatePlaceholderGroups', $groups); + + return $groups; + } + /** * Get list contained as a hal wrapper * @@ -206,7 +239,8 @@ protected function getChangeSetResource(ChangeSet $changeSet) 'IsInferred' => $changeSet->IsInferred, 'canEdit' => $changeSet->canEdit(), 'canPublish' => false, - '_embedded' => ['items' => []] + '_embedded' => ['items' => []], + 'placeholderGroups' => $this->getPlaceholderGroups() ]; // Before presenting the changeset to the client, @@ -485,8 +519,18 @@ public function getCampaignEditForm($id) 'campaignEditForm', $fields, FieldList::create( - FormAction::create('save', _t(__CLASS__.'.SAVE', 'Save')) - ->setIcon('save'), + FormAction::create('save', _t(__CLASS__.'SAVE', 'Save')) + ->setIcon('save') + ->setSchemaState([ + 'data' => [ + 'pristineTitle' => _t(__CLASS__.'SAVED', 'Saved'), + 'pristineIcon' => 'tick', + 'dirtyTitle' => _t(__CLASS__.'SAVE', 'Save'), + 'dirtyIcon' => 'save', + 'pristineClass' => 'btn-primary-outline', + 'dirtyClass' => '', + ], + ]), FormAction::create('cancel', _t(__CLASS__.'.CANCEL', 'Cancel')) ->setUseButtonTag(true) ), @@ -550,7 +594,7 @@ public function getCampaignCreateForm() 'campaignCreateForm', $fields, FieldList::create( - FormAction::create('save', _t(__CLASS__.'.SAVE', 'Save')) + FormAction::create('save', _t(__CLASS__.'.CREATE', 'Create')) ->setIcon('save'), FormAction::create('cancel', _t(__CLASS__.'.CANCEL', 'Cancel')) ->setUseButtonTag(true) diff --git a/yarn.lock b/yarn.lock index 4773cfcb..ed264c7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -298,19 +298,19 @@ babel-code-frame@^6.11.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.0.0, babel-core@^6.24.0, babel-core@^6.7.4: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02" +babel-core@^6.0.0, babel-core@^6.24.0, babel-core@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" dependencies: babel-code-frame "^6.22.0" - babel-generator "^6.24.0" - babel-helpers "^6.23.0" + babel-generator "^6.24.1" + babel-helpers "^6.24.1" babel-messages "^6.23.0" - babel-register "^6.24.0" + babel-register "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.1" - babel-types "^6.23.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -322,19 +322,19 @@ babel-core@^6.0.0, babel-core@^6.24.0, babel-core@^6.7.4: slash "^1.0.0" source-map "^0.5.0" -babel-core@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" +babel-core@^6.7.4: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02" dependencies: babel-code-frame "^6.22.0" - babel-generator "^6.24.1" - babel-helpers "^6.24.1" + babel-generator "^6.24.0" + babel-helpers "^6.23.0" babel-messages "^6.23.0" - babel-register "^6.24.1" + babel-register "^6.24.0" babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" + babel-template "^6.23.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -346,26 +346,26 @@ babel-core@^6.24.1: slash "^1.0.0" source-map "^0.5.0" -babel-generator@^6.18.0, babel-generator@^6.24.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56" +babel-generator@^6.18.0, babel-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" dependencies: babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.23.0" + babel-types "^6.24.1" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" source-map "^0.5.0" trim-right "^1.0.1" -babel-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" +babel-generator@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56" dependencies: babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.24.1" + babel-types "^6.23.0" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" @@ -1112,66 +1112,66 @@ babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" +babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" dependencies: babel-runtime "^6.22.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babylon "^6.11.0" lodash "^4.2.0" -babel-template@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" +babel-template@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" dependencies: babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" + babel-traverse "^6.23.0" + babel-types "^6.23.0" babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: - version "6.23.1" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" +babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" dependencies: babel-code-frame "^6.22.0" babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.23.0" + babel-types "^6.24.1" babylon "^6.15.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-traverse@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" +babel-traverse@^6.23.1: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: babel-code-frame "^6.22.0" babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.24.1" + babel-types "^6.23.0" babylon "^6.15.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" dependencies: babel-runtime "^6.22.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" -babel-types@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" +babel-types@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: babel-runtime "^6.22.0" esutils "^2.0.2" @@ -3591,11 +3591,11 @@ minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.1.x, minimist@^1.1.1, minimist@^1.1.3: +minimist@1.1.x, minimist@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.1.3.tgz#3bedfd91a92d39016fcfaa1c681e8faa1a1efda8" -minimist@^1.2.0: +minimist@^1.1.1, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"