text: (window.webpackJsonpnetlify_cms=window.webpackJsonpnetlify_cms||[]).push([[2],{1380:function(e,t,o){"use strict";o.r(t);var r=o(1),l=o.n(r),a=o(0),n=o.n(a),i=o(7),s=o.n(i),c=o(4),d=o(2),u=o(19),p=o(96),b=o(3),h=o(323),f=o(26),w=o(28),g=o(41),m=o(42),k=o.n(m),x=o(72),E=o(997);const y={text:Object(c.css)("font-size:13px;font-weight:normal;margin-top:4px;label:text;"),button:Object(c.css)(b.buttons.button,";width:auto;flex:1 0 0;font-size:13px;padding:6px 0;label:button;")},C=Object(c.default)(E.a,{label:"WorkflowLink",target:"efhhqrt0"})("display:block;padding:0 18px 18px;height:200px;overflow:hidden;"),v=Object(c.default)("div",{label:"CardCollection",target:"efhhqrt1"})("font-size:14px;color:",b.colors.textLead,";text-transform:uppercase;margin-top:12px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"),O=Object(c.default)("h2",{label:"CardTitle",target:"efhhqrt2"})("margin:28px 0 0;color:",b.colors.textLead,";"),j=Object(c.default)("div",{label:"CardDate",target:"efhhqrt3"})(y.text,";"),q=Object(c.default)("p",{label:"CardBody",target:"efhhqrt4"})(y.text,";color:",b.colors.text,";margin:24px 0 0;overflow-wrap:break-word;word-break:break-word;hyphens:auto;"),R=Object(c.default)("div",{label:"CardButtonContainer",target:"efhhqrt5"})("background-color:",b.colors.foreground,";position:absolute;bottom:0;width:100%;padding:12px 18px;display:flex;opacity:0;transition:opacity ",b.transitions.main,";cursor:pointer;"),D=Object(c.default)("button",{label:"DeleteButton",target:"efhhqrt6"})(y.button,";background-color:",b.colorsRaw.redLight,";color:",b.colorsRaw.red,";margin-right:6px;"),L=Object(c.default)("button",{label:"PublishButton",target:"efhhqrt7"})(y.button,";background-color:",b.colorsRaw.teal,";color:",b.colors.textLight,";margin-left:6px;&[disabled]{background-color:",b.colorsRaw.grayLight,";color:",b.colorsRaw.gray,";}"),P=Object(c.default)("div",{label:"WorkflowCardContainer",target:"efhhqrt8"})(b.components.card,";margin-bottom:24px;position:relative;overflow:hidden;&:hover ",R,"{opacity:1;}"),T=({collectionName:e,title:t,authorLastChange:o,body:r,isModification:l,editLink:a,timestamp:i,onDelete:s,canPublish:c,onPublish:d,t:u})=>n.a.createElement(P,null,n.a.createElement(C,{to:a},n.a.createElement(v,null,e),n.a.createElement(O,null,t),n.a.createElement(j,null,u("workflow.workflowCard.lastChange",{date:i||"",author:o||""})),n.a.createElement(q,null,r)),n.a.createElement(R,null,n.a.createElement(D,{onClick:s},u(l?"workflow.workflowCard.deleteChanges":"workflow.workflowCard.deleteNewEntry")),n.a.createElement(L,{disabled:!c,onClick:d},u(l?"workflow.workflowCard.publishChanges":"workflow.workflowCard.publishNewEntry"))));T.propTypes={collectionName:l.a.string.isRequired,title:l.a.string.isRequired,authorLastChange:l.a.string.isRequired,body:l.a.string.isRequired,isModification:l.a.bool,editLink:l.a.string.isRequired,timestamp:l.a.string.isRequired,onDelete:l.a.func.isRequired,canPublish:l.a.bool.isRequired,onPublish:l.a.func.isRequired,t:l.a.func.isRequired};var H=Object(u.translate)()(T);function W(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const M=Object(c.default)("div",{label:"WorkflowListContainer",target:"ezoul850"})("min-height:60%;display:grid;grid-template-columns:33.3% 33.3% 33.3%;"),S={column:Object(c.css)("margin:0 20px;transition:background-color 0.5s ease;border:2px dashed transparent;border-radius:4px;position:relative;&:first-child{margin-left:0;}&:last-child{margin-right:0;}&:not(:first-child):not(:last-child){&:before,&:after{content:'';display:block;position:absolute;width:2px;height:80%;top:76px;background-color:",b.colors.textFieldBorder,";}&:before{left:-23px;}&:after{right:-23px;}}label:column;"),columnHovered:Object(c.css)("border-color:",b.colors.active,";label:columnHovered;")};const U=Object(c.default)("h2",{label:"ColumnHeader",target:"ezoul851"})("font-size:20px;font-weight:normal;padding:4px 14px;border-radius:",b.lengths.borderRadius,";margin-bottom:28px;",e=>"draft"===e.name&&Object(c.css)("background-color:",b.colors.statusDraftBackground,";color:",b.colors.statusDraftText,";label:ColumnHeader;")," ",e=>"pending_review"===e.name&&Object(c.css)("background-color:",b.colors.statusReviewBackground,";color:",b.colors.statusReviewText,";label:ColumnHeader;")," ",e=>"pending_publish"===e.name&&Object(c.css)("background-color:",b.colors.statusReadyBackground,";color:",b.colors.statusReadyText,";label:ColumnHeader;")),z=Object(c.default)("p",{label:"ColumnCount",target:"ezoul852"})("font-size:13px;font-weight:500;color:",b.colors.text,";text-transform:uppercase;margin-bottom:6px;"),_="cms-workflow",B=(e,t)=>{switch(e){case"draft":return t("workflow.workflowList.draftHeader");case"pending_review":return t("workflow.workflowList.inReviewHeader");case"pending_publish":return t("workflow.workflowList.readyHeader")}};class I extends n.a.Component{constructor(...e){super(...e),W(this,"handleChangeStatus",(e,t)=>{const o=t.slug,r=t.collection,l=t.ownStatus;this.props.handleChangeStatus(r,o,l,e)}),W(this,"requestDelete",(e,t,o)=>{window.confirm(this.props.t("workflow.workflowList.onDeleteEntry"))&&this.props.handleDelete(e,t,o)}),W(this,"requestPublish",(e,t,o)=>{o===g.c.last()?window.confirm(this.props.t("workflow.workflowList.onPublishEntry"))&&this.props.handlePublish(e,t):window.alert(this.props.t("workflow.workflowList.onPublishingNotReadyEntry"))}),W(this,"renderColumns",(e,t)=>e?t?n.a.createElement("div",null,e.map(e=>{const t=k()(e.getIn(["metaData","timeStamp"])).format("MMMM D"),o=`collections/${e.getIn(["metaData","collection"])}/entries/${e.get("slug")}`,r=e.get("slug"),l=e.getIn(["metaData","status"]),a=e.getIn(["metaData","collection"]),i=e.get("isModification"),s=l===g.c.last()&&!e.get("isPersisting",!1);return n.a.createElement(x.a,{namespace:_,key:`${a}-${r}`,slug:r,collection:a,ownStatus:l},c=>c(n.a.createElement("div",null,n.a.createElement(H,{collectionName:a,title:e.getIn(["data","title"]),authorLastChange:e.getIn(["metaData","user"]),body:e.getIn(["data","body"]),isModification:i,editLink:o,timestamp:t,onDelete:this.requestDelete.bind(this,a,r,l),canPublish:s,onPublish:this.requestPublish.bind(this,a,r,l)}))))})):e.entrySeq().map(([e,t])=>n.a.createElement(x.b,{namespace:_,key:e,onDrop:this.handleChangeStatus.bind(this,e)},(o,{isHovered:r})=>o(n.a.createElement("div",{className:Object(c.cx)(S.column,{[S.columnHovered]:r})},n.a.createElement(U,{name:e},B(e,this.props.t)),n.a.createElement(z,null,this.props.t("workflow.workflowList.currentEntries",{smart_count:t.size})),this.renderColumns(t,e))))):null)}render(){const e=this.renderColumns(this.props.entries);return n.a.createElement(M,null,e)}}W(I,"propTypes",{entries:s.a.orderedMap,handleChangeStatus:l.a.func.isRequired,handlePublish:l.a.func.isRequired,handleDelete:l.a.func.isRequired,t:l.a.func.isRequired});var N=Object(x.e)(Object(u.translate)()(I));const F=Object(c.default)("div",{label:"WorkflowContainer",target:"e1946lpm0"})("padding:",b.lengths.pageMargin," 0;height:100vh;"),$=Object(c.default)("div",{label:"WorkflowTop",target:"e1946lpm1"})(b.components.cardTop,";"),J=Object(c.default)("div",{label:"WorkflowTopRow",target:"e1946lpm2"})("display:flex;justify-content:space-between;span[role='button']{",b.shadows.dropDeep,";}"),A=Object(c.default)("h1",{label:"WorkflowTopHeading",target:"e1946lpm3"})(b.components.cardTopHeading,";"),G=Object(c.default)("p",{label:"WorkflowTopDescription",target:"e1946lpm4"})(b.components.cardTopDescription,";");class K extends a.Component{componentDidMount(){const e=this.props,t=e.loadUnpublishedEntries,o=e.isEditorialWorkflow,r=e.collections;o&&t(r)}render(){const e=this.props,t=e.isEditorialWorkflow,o=e.isFetching,r=e.unpublishedEntries,l=e.updateUnpublishedEntryStatus,a=e.publishUnpublishedEntry,i=e.deleteUnpublishedEntry,s=e.collections,c=e.t;if(!t)return null;if(o)return n.a.createElement(b.Loader,{active:!0},c("workflow.workflow.loading"));const d=r.get("pending_review").size,u=r.get("pending_publish").size;return n.a.createElement(F,null,n.a.createElement($,null,n.a.createElement(J,null,n.a.createElement(A,null,c("workflow.workflow.workflowHeading")),n.a.createElement(b.Dropdown,{dropdownWidth:"160px",dropdownPosition:"left",dropdownTopOverlap:"40px",renderButton:()=>n.a.createElement(b.StyledDropdownButton,null,c("workflow.workflow.newPost"))},s.filter(e=>e.get("create")).toList().map(e=>n.a.createElement(b.DropdownItem,{key:e.get("name"),label:e.get("label"),onClick:()=>Object(h.a)(e.get("name"))})))),n.a.createElement(G,null,c("workflow.workflow.description",{smart_count:d,readyCount:u}))),n.a.createElement(N,{entries:r,handleChangeStatus:l,handlePublish:a,handleDelete:i}))}}!function(e,t,o){t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o}(K,"propTypes",{collections:s.a.orderedMap,isEditorialWorkflow:l.a.bool.isRequired,isFetching:l.a.bool,unpublishedEntries:s.a.map,loadUnpublishedEntries:l.a.func.isRequired,updateUnpublishedEntryStatus:l.a.func.isRequired,publishUnpublishedEntry:l.a.func.isRequired,deleteUnpublishedEntry:l.a.func.isRequired,t:l.a.func.isRequired});t.default=Object(p.b)(function(e){const t=e.collections,o=e.config.get("publish_mode")===g.a,r={collections:t,isEditorialWorkflow:o};return o&&(r.isFetching=e.editorialWorkflow.getIn(["pages","isFetching"],!1),r.unpublishedEntries=g.c.reduce((t,o)=>{const r=Object(w.g)(e,o);return t.set(o,r)},Object(d.OrderedMap)())),r},{loadUnpublishedEntries:f.q,updateUnpublishedEntryStatus:f.u,publishUnpublishedEntry:f.t,deleteUnpublishedEntry:f.p})(Object(u.translate)()(K))}}]);
  //# sourceMappingURL=2.cms.js.map