From 92fa8b96d434065087a9298f074a97b4545c9770 Mon Sep 17 00:00:00 2001 From: Dmitri Pisarev Date: Thu, 3 Jan 2019 18:13:21 +0300 Subject: [PATCH] FEATURE: preview recepients list --- .../Controller/NewsletterController.php | 28 ++- .../Service/DataSource/JsonDataSource.php | 9 +- Configuration/NodeTypes.yaml | 14 ++ Configuration/Settings.yaml | 1 - README.md | 36 ++++ .../NewsletterView/src/ConfirmationDialog.js | 93 +++++++-- .../NewsletterView/src/NewsletterView.js | 11 +- Resources/Private/Translations/en/Main.xlf | 3 + Resources/Private/Translations/ru/Main.xlf | 4 + .../JavaScript/NewsletterView/Plugin.js | 193 +++++++++++++++--- .../JavaScript/NewsletterView/Plugin.js.map | 2 +- 11 files changed, 331 insertions(+), 63 deletions(-) diff --git a/Classes/Psmb/Newsletter/Controller/NewsletterController.php b/Classes/Psmb/Newsletter/Controller/NewsletterController.php index 1ce5e94..d211d0e 100644 --- a/Classes/Psmb/Newsletter/Controller/NewsletterController.php +++ b/Classes/Psmb/Newsletter/Controller/NewsletterController.php @@ -76,7 +76,7 @@ public function getSubscriptionsAction($nodeType) { }); } $subscriptionsJsonArray = array_map(function ($item) { - return ['label' => $item['label'], 'value' => $item['identifier']]; + return ['label' => isset($item['label']) ? $item['label'] : '', 'value' => $item['identifier']]; }, $subscriptions); $this->view->assign('value', array_values($subscriptionsJsonArray)); } @@ -86,20 +86,44 @@ public function getSubscriptionsAction($nodeType) { * * @param string $subscription Subscription id to send newsletter to * @param NodeInterface $node Node of the current newsletter item + * @param array $dataSourceAdditionalArguments * @return void */ - public function sendAction($subscription, NodeInterface $node) + public function sendAction($subscription, NodeInterface $node, array $dataSourceAdditionalArguments = null) { $subscriptions = array_filter($this->subscriptions, function ($item) use ($subscription) { return $item['identifier'] == $subscription; }); array_walk($subscriptions, function ($subscription) use ($node) { $subscription['isSendFromUi'] = true; + if ($dataSourceAdditionalArguments) { + $subscription['dataSourceAdditionalArguments'] = $dataSourceAdditionalArguments; + } $this->sendLettersForSubscription($subscription, $node); }); $this->view->assign('value', ['status' => 'success']); } + /** + * Registers a new subscriber + * + * @param string $subscription Subscription id to send newsletter to + * @param array $dataSourceAdditionalArguments + * @return void + */ + public function previewAction($subscription, $dataSourceAdditionalArguments = null) + { + $subscriptions = array_filter($this->subscriptions, function ($item) use ($subscription) { + return $item['identifier'] == $subscription; + }); + $subscription = reset($subscriptions); + if ($dataSourceAdditionalArguments) { + $subscription['dataSourceAdditionalArguments'] = $dataSourceAdditionalArguments; + } + $subscribers = $this->subscribersService->getSubscribers($subscription); + $this->view->assign('value', $subscribers); + } + /** * Sends a test letter for subscription * diff --git a/Classes/Psmb/Newsletter/Service/DataSource/JsonDataSource.php b/Classes/Psmb/Newsletter/Service/DataSource/JsonDataSource.php index 1ba3ae5..f5d1ce0 100644 --- a/Classes/Psmb/Newsletter/Service/DataSource/JsonDataSource.php +++ b/Classes/Psmb/Newsletter/Service/DataSource/JsonDataSource.php @@ -20,7 +20,12 @@ public function getData(array $subscription) if (!isset($subscription['dataSourceOptions']['uri'])) { throw new \Exception('dataSourceOptions.uri must be set for the Json datasource' . print_r($subscription, 1)); } - $response = file_get_contents($subscription['dataSourceOptions']['uri']); + $uri = $subscription['dataSourceOptions']['uri']; + if (isset($subscription['dataSourceAdditionalArguments'])) { + $uri .= strpos($uri, '?') === false ? '?' : '&'; + $uri .= http_build_query($subscription['dataSourceAdditionalArguments']); + } + $response = file_get_contents($uri); return json_decode($response, true); } -} \ No newline at end of file +} diff --git a/Configuration/NodeTypes.yaml b/Configuration/NodeTypes.yaml index 1115cba..08d1078 100644 --- a/Configuration/NodeTypes.yaml +++ b/Configuration/NodeTypes.yaml @@ -24,3 +24,17 @@ label: 'Newsletter view' group: newsletter view: Psmb.Newsletter/Views/NewsletterView + # viewOptions: + # dataSourceAdditionalArguments: + # startDate: 'ClientEval:node.properties.sampleProperty' + # properties: + # sampleProperty: + # type: DateTime + # ui: + # label: 'Жертвователи с' + # reloadIfChanged: true + # inspector: + # group: newsletter + # position: 1 + # editorOptions: + # format: 'Y-m-d' diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index a9ebcb3..21656ba 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -1,4 +1,3 @@ - Flowpack: JobQueue: Common: diff --git a/README.md b/README.md index 569016f..7c6f445 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,42 @@ Psmb: Alternatively you may provide your custom datasources. See implementation of JsonDataSource.php to see how to do that. +It is also possible to provide some additional arguments for the datasource that would be filled from other properties of a node. +Here is an example NodeTypes.yaml for this: + +``` +'Psmb.Newsletter:NewsletterMixin': + abstract: true + ui: + inspector: + tabs: + newsletter: + label: i18n + position: 100 + icon: icon-send + groups: + newsletter: + label: i18n + tab: newsletter + views: + newsletter: + viewOptions: + dataSourceAdditionalArguments: + sampleArgument: 'ClientEval:node.properties.sampleProperty' + properties: + sampleProperty: + type: DateTime + ui: + label: 'Subscribers since' + inspector: + group: newsletter + position: 1 + editorOptions: + format: 'Y-m-d' +``` + +Then the dataSourceAdditionalArguments would be passed to a datasource. You may check out how Json datasource handles it. + ## Acknowledgements This is my first Flow package, and it wouldn't have been possible without a support of the community by answering dozens of n00b questions on Slack, by Christian Müller in particular. diff --git a/Resources/Private/NewsletterView/src/ConfirmationDialog.js b/Resources/Private/NewsletterView/src/ConfirmationDialog.js index cc43f33..2890817 100644 --- a/Resources/Private/NewsletterView/src/ConfirmationDialog.js +++ b/Resources/Private/NewsletterView/src/ConfirmationDialog.js @@ -1,27 +1,78 @@ -import React from 'react'; +import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import {Button, Dialog} from '@neos-project/react-ui-components'; -const ConfirmationDialog = ({isOpen, translate, close, send}) => { - return ( - {translate('Neos.Neos:Main:cancel')}, - - ]} - > -
{translate('Psmb.Newsletter:Main:js.confirmationDescription')}
-
- ); -}; -ConfirmationDialog.propTypes = { - isOpen: PropTypes.bool, - translate: PropTypes.func.isRequired, - close: PropTypes.func.isRequired, - send: PropTypes.func.isRequired +class ConfirmationDialog extends PureComponent { + static propTypes = { + isOpen: PropTypes.bool, + translate: PropTypes.func.isRequired, + close: PropTypes.func.isRequired, + send: PropTypes.func.isRequired, + subscription: PropTypes.string.isRequired, + dataSourceAdditionalArguments: PropTypes.object + }; + + state = { + isLoading: false, + subscribers: [] + }; + + componentDidUpdate(prevProps) { + if (this.props.subscription !== prevProps.subscription || (prevProps.isOpen === false && this.props.isOpen === true)) { + this.fetchPreview(); + } + } + + fetchPreview() { + if (this.props.subscription && this.props.isOpen) { + this.setState({isLoading: true, subscribers: []}); + const dataSourceAdditionalArguments = this.props.dataSourceAdditionalArguments; + const data = new URLSearchParams(); + if (dataSourceAdditionalArguments) { + Object.keys(dataSourceAdditionalArguments).forEach(option => { + data.set('dataSourceAdditionalArguments[' + option + ']', dataSourceAdditionalArguments[option]); + }); + } + fetch(`/newsletter/preview?subscription=${this.props.subscription}&${data.toString()}`, { + credentials: 'include' + }) + .then(response => response.json()) + .then(subscribers => { + this.setState({subscribers, isLoading: false}); + }); + } + } + render() { + const {isOpen, translate, close, send} = this.props; + + const keys = this.state.subscribers[0] ? Object.keys(this.state.subscribers[0]) : []; + return ( + {translate('Neos.Neos:Main:cancel')}, + + ]} + > +
+
{translate('Psmb.Newsletter:Main:js.confirmationDescription')}
+ {this.state.isLoading ? translate('Psmb.Newsletter:Main:js.loading') : ( +
+
{translate('Psmb.Newsletter:Main:js.recepients')}: {this.state.subscribers.length}
+ + {keys.map(key => )} + {this.state.subscribers.map(subscriber => { + return {keys.map(key => )}; + })} +
{key}
{subscriber[key]}
+
+ )} +
+
+ ); + } }; export default ConfirmationDialog; diff --git a/Resources/Private/NewsletterView/src/NewsletterView.js b/Resources/Private/NewsletterView/src/NewsletterView.js index d155a95..85cd7c3 100644 --- a/Resources/Private/NewsletterView/src/NewsletterView.js +++ b/Resources/Private/NewsletterView/src/NewsletterView.js @@ -12,8 +12,8 @@ const fetchSubscriptions = nodeType => fetch(`/newsletter/getSubscriptions?nodeT credentials: 'include' }).then(response => response.json()); -const sendNewsletter = (focusedNodeContextPath, subscription, isTest, email) => { - const sendEndpointUrl = isTest ? '/newsletter/testSend' : '/newsletter/send'; +const sendNewsletter = (focusedNodeContextPath, subscription, isTest, email, dataSourceAdditionalArguments) => { + let sendEndpointUrl = isTest ? '/newsletter/testSend' : '/newsletter/send'; const csrfToken = document.getElementById('appContainer').dataset.csrfToken; const data = new URLSearchParams(); data.set('node', focusedNodeContextPath.replace(/user-.+\;/, 'live;')); @@ -22,6 +22,11 @@ const sendNewsletter = (focusedNodeContextPath, subscription, isTest, email) => if (isTest && email) { data.set('email', email); } + if (dataSourceAdditionalArguments) { + Object.keys(dataSourceAdditionalArguments).forEach(option => { + data.set('dataSourceAdditionalArguments[' + pair[0] + ']', dataSourceAdditionalArguments[option]); + }); + } return fetch(sendEndpointUrl, { credentials: 'include', method: 'POST', @@ -126,6 +131,8 @@ export default class NewsletterView extends Component { translate={this.props.i18nRegistry.translate.bind(this.props.i18nRegistry)} close={() => this.toggleConfirmationDialog(false)} send={this.sendNewsletter} + subscription={this.state.selectedSubscription} + dataSourceAdditionalArguments={this.props.options && this.props.options.dataSourceAdditionalArguments} /> ); diff --git a/Resources/Private/Translations/en/Main.xlf b/Resources/Private/Translations/en/Main.xlf index 786146b..70babe6 100644 --- a/Resources/Private/Translations/en/Main.xlf +++ b/Resources/Private/Translations/en/Main.xlf @@ -52,6 +52,9 @@ Loading... + + Total number of recepients + Send Newsletter diff --git a/Resources/Private/Translations/ru/Main.xlf b/Resources/Private/Translations/ru/Main.xlf index 48f8970..902bf6f 100644 --- a/Resources/Private/Translations/ru/Main.xlf +++ b/Resources/Private/Translations/ru/Main.xlf @@ -67,6 +67,10 @@ Загрузка... + + Общее количество адресатов + + Send newsletter Отправить рассылку diff --git a/Resources/Public/JavaScript/NewsletterView/Plugin.js b/Resources/Public/JavaScript/NewsletterView/Plugin.js index 1121e51..f43c975 100644 --- a/Resources/Public/JavaScript/NewsletterView/Plugin.js +++ b/Resources/Public/JavaScript/NewsletterView/Plugin.js @@ -243,7 +243,7 @@ }); }; - var _sendNewsletter = function _sendNewsletter(focusedNodeContextPath, subscription, isTest, email) { + var _sendNewsletter = function _sendNewsletter(focusedNodeContextPath, subscription, isTest, email, dataSourceAdditionalArguments) { var sendEndpointUrl = isTest ? '/newsletter/testSend' : '/newsletter/send'; var csrfToken = document.getElementById('appContainer').dataset.csrfToken; var data = new URLSearchParams(); @@ -253,6 +253,11 @@ if (isTest && email) { data.set('email', email); } + if (dataSourceAdditionalArguments) { + Object.keys(dataSourceAdditionalArguments).forEach(function (option) { + data.set('dataSourceAdditionalArguments[' + pair[0] + ']', dataSourceAdditionalArguments[option]); + }); + } return fetch(sendEndpointUrl, { credentials: 'include', method: 'POST', @@ -400,7 +405,9 @@ close: function close() { return _this5.toggleConfirmationDialog(false); }, - send: this.sendNewsletter + send: this.sendNewsletter, + subscription: this.state.selectedSubscription, + dataSourceAdditionalArguments: this.props.options && this.props.options.dataSourceAdditionalArguments }) ); } @@ -621,6 +628,10 @@ value: true }); + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _class, _temp2; + var _react = __webpack_require__(8); var _react2 = _interopRequireDefault(_react); @@ -633,41 +644,155 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var ConfirmationDialog = function ConfirmationDialog(_ref) { - var isOpen = _ref.isOpen, - translate = _ref.translate, - close = _ref.close, - send = _ref.send; - - return _react2.default.createElement( - _reactUiComponents.Dialog, - { - isOpen: isOpen, - title: translate('Psmb.Newsletter:Main:js.testConfirmationTitle'), - onRequestClose: close, - actions: [_react2.default.createElement( - _reactUiComponents.Button, - { onClick: close, style: 'clean' }, - translate('Neos.Neos:Main:cancel') - ), _react2.default.createElement( - _reactUiComponents.Button, - { onClick: send, style: 'brand' }, - translate('Psmb.Newsletter:Main:js.send') - )] - }, - _react2.default.createElement( - 'div', - { style: { padding: '16px' } }, - translate('Psmb.Newsletter:Main:js.confirmationDescription') - ) - ); - }; - ConfirmationDialog.propTypes = { + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ConfirmationDialog = (_temp2 = _class = function (_PureComponent) { + _inherits(ConfirmationDialog, _PureComponent); + + function ConfirmationDialog() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, ConfirmationDialog); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ConfirmationDialog.__proto__ || Object.getPrototypeOf(ConfirmationDialog)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + isLoading: false, + subscribers: [] + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(ConfirmationDialog, [{ + key: 'componentDidUpdate', + value: function componentDidUpdate(prevProps) { + if (this.props.subscription !== prevProps.subscription || prevProps.isOpen === false && this.props.isOpen === true) { + this.fetchPreview(); + } + } + }, { + key: 'fetchPreview', + value: function fetchPreview() { + var _this2 = this; + + if (this.props.subscription && this.props.isOpen) { + this.setState({ isLoading: true, subscribers: [] }); + var dataSourceAdditionalArguments = this.props.dataSourceAdditionalArguments; + var data = new URLSearchParams(); + if (dataSourceAdditionalArguments) { + Object.keys(dataSourceAdditionalArguments).forEach(function (option) { + data.set('dataSourceAdditionalArguments[' + option + ']', dataSourceAdditionalArguments[option]); + }); + } + fetch('/newsletter/preview?subscription=' + this.props.subscription + '&' + data.toString(), { + credentials: 'include' + }).then(function (response) { + return response.json(); + }).then(function (subscribers) { + _this2.setState({ subscribers: subscribers, isLoading: false }); + }); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + isOpen = _props.isOpen, + translate = _props.translate, + close = _props.close, + send = _props.send; + + + var keys = this.state.subscribers[0] ? Object.keys(this.state.subscribers[0]) : []; + return _react2.default.createElement( + _reactUiComponents.Dialog, + { + isOpen: isOpen, + title: translate('Psmb.Newsletter:Main:js.confirmationTitle'), + onRequestClose: close, + actions: [_react2.default.createElement( + _reactUiComponents.Button, + { onClick: close, style: 'clean' }, + translate('Neos.Neos:Main:cancel') + ), _react2.default.createElement( + _reactUiComponents.Button, + { onClick: send, style: 'brand' }, + translate('Psmb.Newsletter:Main:js.send') + )] + }, + _react2.default.createElement( + 'div', + { style: { padding: '16px' } }, + _react2.default.createElement( + 'div', + null, + translate('Psmb.Newsletter:Main:js.confirmationDescription') + ), + this.state.isLoading ? translate('Psmb.Newsletter:Main:js.loading') : _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'div', + { style: { padding: '16px 0' } }, + translate('Psmb.Newsletter:Main:js.recepients'), + ': ', + _react2.default.createElement( + 'strong', + null, + this.state.subscribers.length + ) + ), + _react2.default.createElement( + 'table', + null, + _react2.default.createElement( + 'tr', + null, + keys.map(function (key) { + return _react2.default.createElement( + 'th', + null, + key + ); + }) + ), + this.state.subscribers.map(function (subscriber) { + return _react2.default.createElement( + 'tr', + null, + keys.map(function (key) { + return _react2.default.createElement( + 'td', + null, + subscriber[key] + ); + }) + ); + }) + ) + ) + ) + ); + } + }]); + + return ConfirmationDialog; + }(_react.PureComponent), _class.propTypes = { isOpen: _propTypes2.default.bool, translate: _propTypes2.default.func.isRequired, close: _propTypes2.default.func.isRequired, - send: _propTypes2.default.func.isRequired - }; + send: _propTypes2.default.func.isRequired, + subscription: _propTypes2.default.string.isRequired, + dataSourceAdditionalArguments: _propTypes2.default.object + }, _temp2); + ; exports.default = ConfirmationDialog; diff --git a/Resources/Public/JavaScript/NewsletterView/Plugin.js.map b/Resources/Public/JavaScript/NewsletterView/Plugin.js.map index 9962a48..de61a80 100644 --- a/Resources/Public/JavaScript/NewsletterView/Plugin.js.map +++ b/Resources/Public/JavaScript/NewsletterView/Plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 787a72dbc20e21d60a9b","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","webpack:///./~/@neos-project/neos-ui-extensibility/package.json","webpack:///./~/@neos-project/neos-ui-extensibility/src/manifest.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","webpack:///./src/NewsletterView.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","webpack:///./src/TestConfirmationDialog.js","webpack:///./src/ConfirmationDialog.js"],"names":["require","viewsRegistry","globalRegistry","get","set","component","createConsumerApi","createReadOnlyValue","value","writable","enumerable","configurable","manifests","exposureMap","api","Object","keys","forEach","defineProperty","key","window","manifest","identifier","options","bootstrap","push","readFromConsumerApi","Error","fetchSubscriptions","fetch","nodeType","credentials","then","response","json","sendNewsletter","focusedNodeContextPath","subscription","isTest","email","sendEndpointUrl","csrfToken","document","getElementById","dataset","data","URLSearchParams","replace","method","body","NewsletterView","i18nRegistry","CR","Nodes","focusedNodePathSelector","state","getNodeByContextPath","nodeByContextPath","props","subscriptions","selectedSubscription","confirmationDialogIsOpen","testConfirmationDialogIsOpen","isError","isSent","selectSubscription","bind","sendTestNewsletter","toggleConfirmationDialog","toggleTestConfirmationDialog","node","setState","isOpen","console","log","status","catch","translate","marginTop","color","propTypes","string","func","isRequired","module","exports","React","PropTypes","ReactUiComponents","reactRedux","NeosUiReduxStore","NeosUiDecorators","plow","TestConfirmationDialog","close","send","includes","padding","bool","ConfirmationDialog"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;ACtCA,oBAAAA,CAAQ,CAAR,E;;;;;;;;ACAA;;;;AACA;;;;;;AAEA,oCAAS,gCAAT,EAA2C,EAA3C,EAA+C,0BAAkB;AAC7D,SAAMC,gBAAgBC,eAAeC,GAAf,CAAmB,WAAnB,EAAgCA,GAAhC,CAAoC,OAApC,CAAtB;;AAEAF,mBAAcG,GAAd,CAAkB,sCAAlB,EAA0D;AACtDC;AADsD,MAA1D;AAGH,EAND,E;;;;;;;;;;;;;ACHA;;;;AACA;;;;;;mBAEe,mCAAoB,UAApB,C;SAGXC,iB;;;;;;;;;;;mBCIoBA,iB;;AAVxB;;AACA;;;;;;AAEA,KAAMC,sBAAsB,SAAtBA,mBAAsB;AAAA,YAAU;AAClCC,qBADkC;AAElCC,mBAAU,KAFwB;AAGlC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AAGI,6BAAgBiB,KAHpB;AAII,sBAAS,CACL;AAAA;AAAA,mBAAQ,SAASA,KAAjB,EAAwB,OAAM,OAA9B;AAAuCjB,2BAAU,uBAAV;AAAvC,cADK,EAEL;AAAA;AAAA,mBAAQ,SAASkB,IAAjB,EAAuB,OAAM,OAA7B;AAAsClB,2BAAU,8BAAV;AAAtC,cAFK;AAJb;AASI;AAAA;AAAA,eAAK,OAAO,EAACoB,SAAS,MAAV,EAAZ;AAAgCpB,uBAAU,iDAAV;AAAhC;AATJ,MADJ;AAaH,EAdD;AAeAsB,oBAAmBnB,SAAnB,GAA+B;AAC3BR,aAAQ,oBAAU0B,IADS;AAE3BrB,gBAAW,oBAAUK,IAAV,CAAeC,UAFC;AAG3BW,YAAO,oBAAUZ,IAAV,CAAeC,UAHK;AAI3BY,WAAM,oBAAUb,IAAV,CAAeC;AAJM,EAA/B;;mBAOegB,kB","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 787a72dbc20e21d60a9b","require('./manifest');\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import manifest from '@neos-project/neos-ui-extensibility';\nimport NewsletterView from './NewsletterView';\n\nmanifest('Psmb.Newsletter:NewsletterView', {}, globalRegistry => {\n const viewsRegistry = globalRegistry.get('inspector').get('views');\n\n viewsRegistry.set('Psmb.Newsletter/Views/NewsletterView', {\n component: NewsletterView\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/manifest.js","import createConsumerApi from './createConsumerApi';\nimport readFromConsumerApi from './readFromConsumerApi';\n\nexport default readFromConsumerApi('manifest');\n\nexport {\n createConsumerApi\n};\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/index.js","import {version} from '../package.json';\nimport createManifestFunction from './manifest';\n\nconst createReadOnlyValue = value => ({\n value,\n writable: false,\n enumerable: false,\n configurable: true\n});\n\nexport default function createConsumerApi(manifests, exposureMap) {\n const api = {};\n\n Object.keys(exposureMap).forEach(key => {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n\n Object.defineProperty(api, '@manifest', createReadOnlyValue(\n createManifestFunction(manifests)\n ));\n\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n Object.defineProperty(window['@Neos:HostPluginAPI'], 'VERSION', createReadOnlyValue(version));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","module.exports = {\"name\":\"@neos-project/neos-ui-extensibility\",\"version\":\"1.0.0-beta8\",\"description\":\"Extensibility mechanisms for the Neos CMS UI\",\"main\":\"./src/index.js\",\"scripts\":{\"prebuild\":\"check-dependencies && yarn clean\",\"test\":\"yarn jest\",\"test:watch\":\"yarn jest -- --watch\",\"build\":\"exit 0\",\"build:watch\":\"exit 0\",\"clean\":\"rimraf ./lib ./dist\",\"lint\":\"eslint src\",\"jest\":\"PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage\"},\"dependencies\":{\"@neos-project/build-essentials\":\"1.0.0-beta8\",\"@neos-project/positional-array-sorter\":\"1.0.0-beta8\",\"babel-core\":\"^6.13.2\",\"babel-eslint\":\"^7.1.1\",\"babel-loader\":\"^6.2.4\",\"babel-plugin-transform-decorators-legacy\":\"^1.3.4\",\"babel-plugin-transform-object-rest-spread\":\"^6.20.1\",\"babel-plugin-webpack-alias\":\"^2.1.1\",\"babel-preset-es2015\":\"^6.13.2\",\"babel-preset-react\":\"^6.3.13\",\"babel-preset-stage-0\":\"^6.3.13\",\"chalk\":\"^1.1.3\",\"css-loader\":\"^0.26.0\",\"file-loader\":\"^0.10.0\",\"json-loader\":\"^0.5.4\",\"postcss-loader\":\"^1.0.0\",\"react-dev-utils\":\"^0.5.0\",\"style-loader\":\"^0.13.1\"},\"bin\":{\"neos-react-scripts\":\"./bin/neos-react-scripts.js\"},\"jest\":{\"transformIgnorePatterns\":[],\"setupFiles\":[\"./node_modules/@neos-project/build-essentials/src/setup-browser-env.js\",\"./node_modules/@neos-project/build-essentials/src/enzymeConfiguration.js\"],\"transform\":{\"neos-ui-extensibility/src/.+\\\\.jsx?$\":\"./node_modules/.bin/babel-jest\",\"node_modules/@neos-project/.+\\\\.jsx?$\":\"./node_modules/.bin/babel-jest\"}}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@neos-project/neos-ui-extensibility/package.json\n// module id = 4\n// module chunks = 0","export default manifests => {\n return function manifest(identifier, options, bootstrap) {\n manifests.push({\n [identifier]: {\n options,\n bootstrap\n }\n });\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/manifest.js","export default function readFromConsumerApi(key) {\n return (...args) => {\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][`@${key}`]) {\n return window['@Neos:HostPluginAPI'][`@${key}`](...args);\n }\n\n throw new Error(`You are trying to read from a consumer api that hasn't been initialized yet!`);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SelectBox, Button} from '@neos-project/react-ui-components';\nimport {connect} from 'react-redux';\nimport {selectors} from '@neos-project/neos-ui-redux-store';\nimport {neos} from '@neos-project/neos-ui-decorators';\nimport {$get} from 'plow-js';\nimport TestConfirmationDialog from './TestConfirmationDialog';\nimport ConfirmationDialog from './ConfirmationDialog';\n\nconst fetchSubscriptions = nodeType => fetch(`/newsletter/getSubscriptions?nodeType=${nodeType}`, {\n credentials: 'include'\n}).then(response => response.json());\n\nconst sendNewsletter = (focusedNodeContextPath, subscription, isTest, email) => {\n const sendEndpointUrl = isTest ? '/newsletter/testSend' : '/newsletter/send';\n const csrfToken = document.getElementById('appContainer').dataset.csrfToken;\n const data = new URLSearchParams();\n data.set('node', focusedNodeContextPath.replace(/user-.+\\;/, 'live;'));\n data.set('subscription', subscription);\n data.set('__csrfToken', csrfToken);\n if (isTest && email) {\n data.set('email', email);\n }\n return fetch(sendEndpointUrl, {\n credentials: 'include',\n method: 'POST',\n body: data\n })\n .then(response => response.json());\n};\n\n@neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get('i18n')\n}))\n@connect(state => ({\n focusedNodeContextPath: selectors.CR.Nodes.focusedNodePathSelector(state),\n getNodeByContextPath: selectors.CR.Nodes.nodeByContextPath(state)\n}))\nexport default class NewsletterView extends Component {\n\n static propTypes = {\n focusedNodeContextPath: PropTypes.string,\n getNodeByContextPath: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n subscriptions: [],\n selectedSubscription: null,\n confirmationDialogIsOpen: false,\n testConfirmationDialogIsOpen: false,\n isError: null,\n isSent: null\n };\n this.selectSubscription = this.selectSubscription.bind(this);\n this.sendNewsletter = this.sendNewsletter.bind(this);\n this.sendTestNewsletter = this.sendTestNewsletter.bind(this);\n this.toggleConfirmationDialog = this.toggleConfirmationDialog.bind(this);\n this.toggleTestConfirmationDialog = this.toggleTestConfirmationDialog.bind(this);\n }\n\n componentDidMount() {\n const node = this.props.getNodeByContextPath(this.props.focusedNodeContextPath);\n const nodeType = $get('nodeType', node);\n if (nodeType) {\n fetchSubscriptions(nodeType).then(json => this.setState({subscriptions: json}));\n }\n }\n\n toggleConfirmationDialog(isOpen) {\n this.setState({confirmationDialogIsOpen: isOpen})\n }\n\n toggleTestConfirmationDialog(isOpen) {\n this.setState({testConfirmationDialogIsOpen: isOpen})\n }\n\n selectSubscription(value) {\n this.setState({selectedSubscription: value});\n }\n\n sendNewsletter() {\n const isTest = false;\n sendNewsletter(this.props.focusedNodeContextPath, this.state.selectedSubscription, isTest)\n .then(json => {\n console.log('asdf', json);\n return json.status === 'success' ? this.setState({isSent: true}) : this.setState({isError: true});\n })\n .catch(() => this.setState({isError: true}));\n this.toggleConfirmationDialog(false);\n }\n\n sendTestNewsletter(email) {\n const isTest = true;\n sendNewsletter(this.props.focusedNodeContextPath, this.state.selectedSubscription, isTest, email)\n .then(json => {\n console.log('asdf1', json);\n return json.status === 'success' ? this.setState({isSent: true}) : this.setState({isError: true})\n })\n .catch(() => this.setState({isError: true}));\n this.toggleTestConfirmationDialog(false);\n }\n\n render() {\n return (\n
\n \n \n \n\n {this.state.isError ?
{this.props.i18nRegistry.translate('Psmb.Newsletter:Main:js.error')}
: ''}\n {this.state.isSent ?
{this.props.i18nRegistry.translate('Psmb.Newsletter:Main:js.sent')}
: ''}\n\n this.toggleTestConfirmationDialog(false)}\n send={this.sendTestNewsletter}\n />\n this.toggleConfirmationDialog(false)}\n send={this.sendNewsletter}\n />\n
\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/NewsletterView.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SelectBox, Button, Dialog, TextInput} from '@neos-project/react-ui-components';\n\nexport default class TestConfirmationDialog extends Component {\n\n static propTypes = {\n isOpen: PropTypes.bool,\n translate: PropTypes.func.isRequired,\n close: PropTypes.func.isRequired,\n send: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n email: ''\n };\n }\n\n render() {\n const {isOpen, translate, close, send} = this.props;\n return (\n {translate('Neos.Neos:Main:cancel')},\n \n ]}\n >\n
\n {translate('Psmb.Newsletter:Main:js.testEmailLabel')}\n this.setState({email})}\n value={this.state.email}\n />\n
\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/TestConfirmationDialog.js","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {Button, Dialog} from '@neos-project/react-ui-components';\n\nconst ConfirmationDialog = ({isOpen, translate, close, send}) => {\n return (\n {translate('Neos.Neos:Main:cancel')},\n \n ]}\n >\n
{translate('Psmb.Newsletter:Main:js.confirmationDescription')}
\n \n );\n};\nConfirmationDialog.propTypes = {\n isOpen: PropTypes.bool,\n translate: PropTypes.func.isRequired,\n close: PropTypes.func.isRequired,\n send: PropTypes.func.isRequired\n};\n\nexport default ConfirmationDialog;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ConfirmationDialog.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 9505c3153781d0b81a41","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","webpack:///./~/@neos-project/neos-ui-extensibility/package.json","webpack:///./~/@neos-project/neos-ui-extensibility/src/manifest.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","webpack:///./src/NewsletterView.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:///./~/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","webpack:///./src/TestConfirmationDialog.js","webpack:///./src/ConfirmationDialog.js"],"names":["require","viewsRegistry","globalRegistry","get","set","component","createConsumerApi","createReadOnlyValue","value","writable","enumerable","configurable","manifests","exposureMap","api","Object","keys","forEach","defineProperty","key","window","manifest","identifier","options","bootstrap","push","readFromConsumerApi","Error","fetchSubscriptions","fetch","nodeType","credentials","then","response","json","sendNewsletter","focusedNodeContextPath","subscription","isTest","email","dataSourceAdditionalArguments","sendEndpointUrl","csrfToken","document","getElementById","dataset","data","URLSearchParams","replace","pair","option","method","body","NewsletterView","i18nRegistry","CR","Nodes","focusedNodePathSelector","state","getNodeByContextPath","nodeByContextPath","props","subscriptions","selectedSubscription","confirmationDialogIsOpen","testConfirmationDialogIsOpen","isError","isSent","selectSubscription","bind","sendTestNewsletter","toggleConfirmationDialog","toggleTestConfirmationDialog","node","setState","isOpen","status","catch","translate","marginTop","color","propTypes","string","func","isRequired","module","exports","React","PropTypes","ReactUiComponents","reactRedux","NeosUiReduxStore","NeosUiDecorators","plow","TestConfirmationDialog","close","send","includes","padding","bool","ConfirmationDialog","isLoading","subscribers","prevProps","fetchPreview","toString","length","map","subscriber","object"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;ACtCA,oBAAAA,CAAQ,CAAR,E;;;;;;;;ACAA;;;;AACA;;;;;;AAEA,oCAAS,gCAAT,EAA2C,EAA3C,EAA+C,0BAAkB;AAC7D,SAAMC,gBAAgBC,eAAeC,GAAf,CAAmB,WAAnB,EAAgCA,GAAhC,CAAoC,OAApC,CAAtB;;AAEAF,mBAAcG,GAAd,CAAkB,sCAAlB,EAA0D;AACtDC;AADsD,MAA1D;AAGH,EAND,E;;;;;;;;;;;;;ACHA;;;;AACA;;;;;;mBAEe,mCAAoB,UAApB,C;SAGXC,iB;;;;;;;;;;;mBCIoBA,iB;;AAVxB;;AACA;;;;;;AAEA,KAAMC,sBAAsB,SAAtBA,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AAO;AAAA;AAAA;AAAKC,wDAAWzF,GAAX;AAAL,0CAAP;AAAA,sCAAT;AAAL,kCAAP;AACH,8BAFA;AAFL;AAFJ;AAHR;AATJ,cADJ;AA0BH;;;;iCArEM8D,S,GAAY;AACfN,aAAQ,oBAAUwB,IADH;AAEfrB,gBAAW,oBAAUK,IAAV,CAAeC,UAFX;AAGfW,YAAO,oBAAUZ,IAAV,CAAeC,UAHP;AAIfY,WAAM,oBAAUb,IAAV,CAAeC,UAJN;AAKf/C,mBAAc,oBAAU6C,MAAV,CAAiBE,UALhB;AAMf5C,oCAA+B,oBAAUqE;AAN1B,E;AAsEtB;;mBAEcT,kB","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9505c3153781d0b81a41","require('./manifest');\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import manifest from '@neos-project/neos-ui-extensibility';\nimport NewsletterView from './NewsletterView';\n\nmanifest('Psmb.Newsletter:NewsletterView', {}, globalRegistry => {\n const viewsRegistry = globalRegistry.get('inspector').get('views');\n\n viewsRegistry.set('Psmb.Newsletter/Views/NewsletterView', {\n component: NewsletterView\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/manifest.js","import createConsumerApi from './createConsumerApi';\nimport readFromConsumerApi from './readFromConsumerApi';\n\nexport default readFromConsumerApi('manifest');\n\nexport {\n createConsumerApi\n};\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/index.js","import {version} from '../package.json';\nimport createManifestFunction from './manifest';\n\nconst createReadOnlyValue = value => ({\n value,\n writable: false,\n enumerable: false,\n configurable: true\n});\n\nexport default function createConsumerApi(manifests, exposureMap) {\n const api = {};\n\n Object.keys(exposureMap).forEach(key => {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n\n Object.defineProperty(api, '@manifest', createReadOnlyValue(\n createManifestFunction(manifests)\n ));\n\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n Object.defineProperty(window['@Neos:HostPluginAPI'], 'VERSION', createReadOnlyValue(version));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","module.exports = {\"name\":\"@neos-project/neos-ui-extensibility\",\"version\":\"1.0.0-beta8\",\"description\":\"Extensibility mechanisms for the Neos CMS UI\",\"main\":\"./src/index.js\",\"scripts\":{\"prebuild\":\"check-dependencies && yarn clean\",\"test\":\"yarn jest\",\"test:watch\":\"yarn jest -- --watch\",\"build\":\"exit 0\",\"build:watch\":\"exit 0\",\"clean\":\"rimraf ./lib ./dist\",\"lint\":\"eslint src\",\"jest\":\"PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage\"},\"dependencies\":{\"@neos-project/build-essentials\":\"1.0.0-beta8\",\"@neos-project/positional-array-sorter\":\"1.0.0-beta8\",\"babel-core\":\"^6.13.2\",\"babel-eslint\":\"^7.1.1\",\"babel-loader\":\"^6.2.4\",\"babel-plugin-transform-decorators-legacy\":\"^1.3.4\",\"babel-plugin-transform-object-rest-spread\":\"^6.20.1\",\"babel-plugin-webpack-alias\":\"^2.1.1\",\"babel-preset-es2015\":\"^6.13.2\",\"babel-preset-react\":\"^6.3.13\",\"babel-preset-stage-0\":\"^6.3.13\",\"chalk\":\"^1.1.3\",\"css-loader\":\"^0.26.0\",\"file-loader\":\"^0.10.0\",\"json-loader\":\"^0.5.4\",\"postcss-loader\":\"^1.0.0\",\"react-dev-utils\":\"^0.5.0\",\"style-loader\":\"^0.13.1\"},\"bin\":{\"neos-react-scripts\":\"./bin/neos-react-scripts.js\"},\"jest\":{\"transformIgnorePatterns\":[],\"setupFiles\":[\"./node_modules/@neos-project/build-essentials/src/setup-browser-env.js\",\"./node_modules/@neos-project/build-essentials/src/enzymeConfiguration.js\"],\"transform\":{\"neos-ui-extensibility/src/.+\\\\.jsx?$\":\"./node_modules/.bin/babel-jest\",\"node_modules/@neos-project/.+\\\\.jsx?$\":\"./node_modules/.bin/babel-jest\"}}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@neos-project/neos-ui-extensibility/package.json\n// module id = 4\n// module chunks = 0","export default manifests => {\n return function manifest(identifier, options, bootstrap) {\n manifests.push({\n [identifier]: {\n options,\n bootstrap\n }\n });\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/manifest.js","export default function readFromConsumerApi(key) {\n return (...args) => {\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][`@${key}`]) {\n return window['@Neos:HostPluginAPI'][`@${key}`](...args);\n }\n\n throw new Error(`You are trying to read from a consumer api that hasn't been initialized yet!`);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SelectBox, Button} from '@neos-project/react-ui-components';\nimport {connect} from 'react-redux';\nimport {selectors} from '@neos-project/neos-ui-redux-store';\nimport {neos} from '@neos-project/neos-ui-decorators';\nimport {$get} from 'plow-js';\nimport TestConfirmationDialog from './TestConfirmationDialog';\nimport ConfirmationDialog from './ConfirmationDialog';\n\nconst fetchSubscriptions = nodeType => fetch(`/newsletter/getSubscriptions?nodeType=${nodeType}`, {\n credentials: 'include'\n}).then(response => response.json());\n\nconst sendNewsletter = (focusedNodeContextPath, subscription, isTest, email, dataSourceAdditionalArguments) => {\n let sendEndpointUrl = isTest ? '/newsletter/testSend' : '/newsletter/send';\n const csrfToken = document.getElementById('appContainer').dataset.csrfToken;\n const data = new URLSearchParams();\n data.set('node', focusedNodeContextPath.replace(/user-.+\\;/, 'live;'));\n data.set('subscription', subscription);\n data.set('__csrfToken', csrfToken);\n if (isTest && email) {\n data.set('email', email);\n }\n if (dataSourceAdditionalArguments) {\n Object.keys(dataSourceAdditionalArguments).forEach(option => {\n data.set('dataSourceAdditionalArguments[' + pair[0] + ']', dataSourceAdditionalArguments[option]);\n });\n }\n return fetch(sendEndpointUrl, {\n credentials: 'include',\n method: 'POST',\n body: data\n })\n .then(response => response.json());\n};\n\n@neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get('i18n')\n}))\n@connect(state => ({\n focusedNodeContextPath: selectors.CR.Nodes.focusedNodePathSelector(state),\n getNodeByContextPath: selectors.CR.Nodes.nodeByContextPath(state)\n}))\nexport default class NewsletterView extends Component {\n\n static propTypes = {\n focusedNodeContextPath: PropTypes.string,\n getNodeByContextPath: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n subscriptions: [],\n selectedSubscription: null,\n confirmationDialogIsOpen: false,\n testConfirmationDialogIsOpen: false,\n isError: null,\n isSent: null\n };\n this.selectSubscription = this.selectSubscription.bind(this);\n this.sendNewsletter = this.sendNewsletter.bind(this);\n this.sendTestNewsletter = this.sendTestNewsletter.bind(this);\n this.toggleConfirmationDialog = this.toggleConfirmationDialog.bind(this);\n this.toggleTestConfirmationDialog = this.toggleTestConfirmationDialog.bind(this);\n }\n\n componentDidMount() {\n const node = this.props.getNodeByContextPath(this.props.focusedNodeContextPath);\n const nodeType = $get('nodeType', node);\n if (nodeType) {\n fetchSubscriptions(nodeType).then(json => this.setState({subscriptions: json}));\n }\n }\n\n toggleConfirmationDialog(isOpen) {\n this.setState({confirmationDialogIsOpen: isOpen})\n }\n\n toggleTestConfirmationDialog(isOpen) {\n this.setState({testConfirmationDialogIsOpen: isOpen})\n }\n\n selectSubscription(value) {\n this.setState({selectedSubscription: value});\n }\n\n sendNewsletter() {\n const isTest = false;\n sendNewsletter(this.props.focusedNodeContextPath, this.state.selectedSubscription, isTest)\n .then(json => {\n return json.status === 'success' ? this.setState({isSent: true}) : this.setState({isError: true});\n })\n .catch(() => this.setState({isError: true}));\n this.toggleConfirmationDialog(false);\n }\n\n sendTestNewsletter(email) {\n const isTest = true;\n sendNewsletter(this.props.focusedNodeContextPath, this.state.selectedSubscription, isTest, email)\n .then(json => {\n return json.status === 'success' ? this.setState({isSent: true}) : this.setState({isError: true})\n })\n .catch(() => this.setState({isError: true}));\n this.toggleTestConfirmationDialog(false);\n }\n\n render() {\n return (\n
\n \n \n \n\n {this.state.isError ?
{this.props.i18nRegistry.translate('Psmb.Newsletter:Main:js.error')}
: ''}\n {this.state.isSent ?
{this.props.i18nRegistry.translate('Psmb.Newsletter:Main:js.sent')}
: ''}\n\n this.toggleTestConfirmationDialog(false)}\n send={this.sendTestNewsletter}\n />\n this.toggleConfirmationDialog(false)}\n send={this.sendNewsletter}\n subscription={this.state.selectedSubscription}\n dataSourceAdditionalArguments={this.props.options && this.props.options.dataSourceAdditionalArguments}\n />\n
\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/NewsletterView.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n\n\n\n// WEBPACK FOOTER //\n// ./~/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SelectBox, Button, Dialog, TextInput} from '@neos-project/react-ui-components';\n\nexport default class TestConfirmationDialog extends Component {\n\n static propTypes = {\n isOpen: PropTypes.bool,\n translate: PropTypes.func.isRequired,\n close: PropTypes.func.isRequired,\n send: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n email: ''\n };\n }\n\n render() {\n const {isOpen, translate, close, send} = this.props;\n return (\n {translate('Neos.Neos:Main:cancel')},\n \n ]}\n >\n
\n {translate('Psmb.Newsletter:Main:js.testEmailLabel')}\n this.setState({email})}\n value={this.state.email}\n />\n
\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/TestConfirmationDialog.js","import React, {PureComponent} from 'react';\nimport PropTypes from 'prop-types';\nimport {Button, Dialog} from '@neos-project/react-ui-components';\n\nclass ConfirmationDialog extends PureComponent {\n static propTypes = {\n isOpen: PropTypes.bool,\n translate: PropTypes.func.isRequired,\n close: PropTypes.func.isRequired,\n send: PropTypes.func.isRequired,\n subscription: PropTypes.string.isRequired,\n dataSourceAdditionalArguments: PropTypes.object\n };\n\n state = {\n isLoading: false,\n subscribers: []\n };\n\n componentDidUpdate(prevProps) {\n if (this.props.subscription !== prevProps.subscription || (prevProps.isOpen === false && this.props.isOpen === true)) {\n this.fetchPreview();\n }\n }\n\n fetchPreview() {\n if (this.props.subscription && this.props.isOpen) {\n this.setState({isLoading: true, subscribers: []});\n const dataSourceAdditionalArguments = this.props.dataSourceAdditionalArguments;\n const data = new URLSearchParams();\n if (dataSourceAdditionalArguments) {\n Object.keys(dataSourceAdditionalArguments).forEach(option => {\n data.set('dataSourceAdditionalArguments[' + option + ']', dataSourceAdditionalArguments[option]);\n });\n }\n fetch(`/newsletter/preview?subscription=${this.props.subscription}&${data.toString()}`, {\n credentials: 'include'\n })\n .then(response => response.json())\n .then(subscribers => {\n this.setState({subscribers, isLoading: false});\n });\n }\n }\n render() {\n const {isOpen, translate, close, send} = this.props;\n\n const keys = this.state.subscribers[0] ? Object.keys(this.state.subscribers[0]) : [];\n return (\n {translate('Neos.Neos:Main:cancel')},\n \n ]}\n >\n
\n
{translate('Psmb.Newsletter:Main:js.confirmationDescription')}
\n {this.state.isLoading ? translate('Psmb.Newsletter:Main:js.loading') : (\n
\n
{translate('Psmb.Newsletter:Main:js.recepients')}: {this.state.subscribers.length}
\n \n {keys.map(key => )}\n {this.state.subscribers.map(subscriber => {\n return {keys.map(key => )};\n })}\n
{key}
{subscriber[key]}
\n
\n )}\n
\n \n );\n }\n};\n\nexport default ConfirmationDialog;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ConfirmationDialog.js"],"sourceRoot":""} \ No newline at end of file