@plusscommunities/pluss-newsletter-web-sharing 1.4.39 → 1.4.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -711,6 +711,7 @@ var COLOUR_BRANDING_MAIN = Colours.COLOUR_BRANDING_MAIN;
711
711
  var COLOUR_BRANDING_OFF = Colours.COLOUR_BRANDING_OFF;
712
712
  Colours.COLOUR_BRANDING_ACTION;
713
713
  var COLOUR_BRANDING_APP = Colours.COLOUR_BRANDING_APP;
714
+ var COLOUR_GREEN = Colours.COLOUR_GREEN;
714
715
  var TEXT_LIGHT = Colours.TEXT_LIGHT;
715
716
  var hexToRGBAstring = Colours.hexToRGBAstring; // Misc
716
717
 
@@ -2651,7 +2652,8 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
2651
2652
  featuredExpiryDateText: moment__default['default'](update.FeaturedExpiry || undefined).format("DD/MM/YYYY"),
2652
2653
  authorDisplay: update.AuthorDisplay,
2653
2654
  audienceType: update.AudienceType || "",
2654
- audienceTypeSelection: update.AudienceTypeSelection || []
2655
+ audienceTypeSelection: update.AudienceTypeSelection || [],
2656
+ shouldNotify: Boolean(update.Notification)
2655
2657
  };
2656
2658
 
2657
2659
  if (update.AuthorDisplay === "custom") {
@@ -3649,10 +3651,28 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
3649
3651
  value: function renderNotify() {
3650
3652
  var _this15 = this;
3651
3653
 
3652
- if (this.state.eventId || ___default['default'].includes(this.props.auth.hidden, "eventNotifications")) {
3654
+ if (___default['default'].includes(this.props.auth.hidden, "eventNotifications")) {
3653
3655
  return null;
3654
3656
  }
3655
3657
 
3658
+ if (this.state.updateId != null) {
3659
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3660
+ className: "marginTop-16"
3661
+ }, /*#__PURE__*/React__default['default'].createElement(Text, {
3662
+ type: "formLabel"
3663
+ }, "Notification"), /*#__PURE__*/React__default['default'].createElement(Text, {
3664
+ type: "body"
3665
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
3666
+ className: "userStatusIcon",
3667
+ style: this.state.shouldNotify ? {
3668
+ color: COLOUR_GREEN
3669
+ } : null,
3670
+ name: this.state.shouldNotify ? "check-circle" : "times-circle"
3671
+ }), " ", /*#__PURE__*/React__default['default'].createElement("b", null, this.state.shouldNotify ? "Yes" : "No"), " - Notifications were", " ", this.state.shouldNotify ? "" : "not", " sent when this post was created."), /*#__PURE__*/React__default['default'].createElement(Text, {
3672
+ type: "help"
3673
+ }, "Notifications can only be sent when creating a new post."));
3674
+ }
3675
+
3656
3676
  return /*#__PURE__*/React__default['default'].createElement("div", {
3657
3677
  className: "marginTop-16"
3658
3678
  }, /*#__PURE__*/React__default['default'].createElement(RadioButton, {
package/dist/index.esm.js CHANGED
@@ -667,6 +667,7 @@ var COLOUR_BRANDING_MAIN = Colours.COLOUR_BRANDING_MAIN;
667
667
  var COLOUR_BRANDING_OFF = Colours.COLOUR_BRANDING_OFF;
668
668
  Colours.COLOUR_BRANDING_ACTION;
669
669
  var COLOUR_BRANDING_APP = Colours.COLOUR_BRANDING_APP;
670
+ var COLOUR_GREEN = Colours.COLOUR_GREEN;
670
671
  var TEXT_LIGHT = Colours.TEXT_LIGHT;
671
672
  var hexToRGBAstring = Colours.hexToRGBAstring; // Misc
672
673
 
@@ -2607,7 +2608,8 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
2607
2608
  featuredExpiryDateText: moment(update.FeaturedExpiry || undefined).format("DD/MM/YYYY"),
2608
2609
  authorDisplay: update.AuthorDisplay,
2609
2610
  audienceType: update.AudienceType || "",
2610
- audienceTypeSelection: update.AudienceTypeSelection || []
2611
+ audienceTypeSelection: update.AudienceTypeSelection || [],
2612
+ shouldNotify: Boolean(update.Notification)
2611
2613
  };
2612
2614
 
2613
2615
  if (update.AuthorDisplay === "custom") {
@@ -3605,10 +3607,28 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
3605
3607
  value: function renderNotify() {
3606
3608
  var _this15 = this;
3607
3609
 
3608
- if (this.state.eventId || _.includes(this.props.auth.hidden, "eventNotifications")) {
3610
+ if (_.includes(this.props.auth.hidden, "eventNotifications")) {
3609
3611
  return null;
3610
3612
  }
3611
3613
 
3614
+ if (this.state.updateId != null) {
3615
+ return /*#__PURE__*/React.createElement("div", {
3616
+ className: "marginTop-16"
3617
+ }, /*#__PURE__*/React.createElement(Text, {
3618
+ type: "formLabel"
3619
+ }, "Notification"), /*#__PURE__*/React.createElement(Text, {
3620
+ type: "body"
3621
+ }, /*#__PURE__*/React.createElement(FontAwesome, {
3622
+ className: "userStatusIcon",
3623
+ style: this.state.shouldNotify ? {
3624
+ color: COLOUR_GREEN
3625
+ } : null,
3626
+ name: this.state.shouldNotify ? "check-circle" : "times-circle"
3627
+ }), " ", /*#__PURE__*/React.createElement("b", null, this.state.shouldNotify ? "Yes" : "No"), " - Notifications were", " ", this.state.shouldNotify ? "" : "not", " sent when this post was created."), /*#__PURE__*/React.createElement(Text, {
3628
+ type: "help"
3629
+ }, "Notifications can only be sent when creating a new post."));
3630
+ }
3631
+
3612
3632
  return /*#__PURE__*/React.createElement("div", {
3613
3633
  className: "marginTop-16"
3614
3634
  }, /*#__PURE__*/React.createElement(RadioButton, {
package/dist/index.umd.js CHANGED
@@ -689,6 +689,7 @@
689
689
  var COLOUR_BRANDING_OFF = Colours.COLOUR_BRANDING_OFF;
690
690
  Colours.COLOUR_BRANDING_ACTION;
691
691
  var COLOUR_BRANDING_APP = Colours.COLOUR_BRANDING_APP;
692
+ var COLOUR_GREEN = Colours.COLOUR_GREEN;
692
693
  var TEXT_LIGHT = Colours.TEXT_LIGHT;
693
694
  var hexToRGBAstring = Colours.hexToRGBAstring; // Misc
694
695
 
@@ -2629,7 +2630,8 @@
2629
2630
  featuredExpiryDateText: moment__default['default'](update.FeaturedExpiry || undefined).format("DD/MM/YYYY"),
2630
2631
  authorDisplay: update.AuthorDisplay,
2631
2632
  audienceType: update.AudienceType || "",
2632
- audienceTypeSelection: update.AudienceTypeSelection || []
2633
+ audienceTypeSelection: update.AudienceTypeSelection || [],
2634
+ shouldNotify: Boolean(update.Notification)
2633
2635
  };
2634
2636
 
2635
2637
  if (update.AuthorDisplay === "custom") {
@@ -3627,10 +3629,28 @@
3627
3629
  value: function renderNotify() {
3628
3630
  var _this15 = this;
3629
3631
 
3630
- if (this.state.eventId || ___default['default'].includes(this.props.auth.hidden, "eventNotifications")) {
3632
+ if (___default['default'].includes(this.props.auth.hidden, "eventNotifications")) {
3631
3633
  return null;
3632
3634
  }
3633
3635
 
3636
+ if (this.state.updateId != null) {
3637
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3638
+ className: "marginTop-16"
3639
+ }, /*#__PURE__*/React__default['default'].createElement(Text, {
3640
+ type: "formLabel"
3641
+ }, "Notification"), /*#__PURE__*/React__default['default'].createElement(Text, {
3642
+ type: "body"
3643
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
3644
+ className: "userStatusIcon",
3645
+ style: this.state.shouldNotify ? {
3646
+ color: COLOUR_GREEN
3647
+ } : null,
3648
+ name: this.state.shouldNotify ? "check-circle" : "times-circle"
3649
+ }), " ", /*#__PURE__*/React__default['default'].createElement("b", null, this.state.shouldNotify ? "Yes" : "No"), " - Notifications were", " ", this.state.shouldNotify ? "" : "not", " sent when this post was created."), /*#__PURE__*/React__default['default'].createElement(Text, {
3650
+ type: "help"
3651
+ }, "Notifications can only be sent when creating a new post."));
3652
+ }
3653
+
3634
3654
  return /*#__PURE__*/React__default['default'].createElement("div", {
3635
3655
  className: "marginTop-16"
3636
3656
  }, /*#__PURE__*/React__default['default'].createElement(RadioButton, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-newsletter-web-sharing",
3
- "version": "1.4.39",
3
+ "version": "1.4.40",
4
4
  "description": "Extension package to enable newsletter on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
package/src/js/index.js CHANGED
@@ -12,6 +12,7 @@ export const COLOUR_BRANDING_MAIN = Colours.COLOUR_BRANDING_MAIN;
12
12
  export const COLOUR_BRANDING_OFF = Colours.COLOUR_BRANDING_OFF;
13
13
  export const COLOUR_BRANDING_ACTION = Colours.COLOUR_BRANDING_ACTION;
14
14
  export const COLOUR_BRANDING_APP = Colours.COLOUR_BRANDING_APP;
15
+ export const COLOUR_GREEN = Colours.COLOUR_GREEN;
15
16
  export const TEXT_LIGHT = Colours.TEXT_LIGHT;
16
17
  export const hexToRGBAstring = Colours.hexToRGBAstring;
17
18
 
@@ -41,6 +41,7 @@ import {
41
41
  import { newsHaveTags, DEFAULT_ALLOW_COMMENTS } from "../../config";
42
42
  import { checkLoggedIn, isTVEnabled, validateAccess } from "../../session";
43
43
  import { Text } from "../../components/text";
44
+ import { COLOUR_GREEN } from "../../js";
44
45
  import { values } from "../../values.config";
45
46
 
46
47
  class AddNewsletterEntry extends Component {
@@ -157,6 +158,7 @@ class AddNewsletterEntry extends Component {
157
158
  authorDisplay: update.AuthorDisplay,
158
159
  audienceType: update.AudienceType || "",
159
160
  audienceTypeSelection: update.AudienceTypeSelection || [],
161
+ shouldNotify: Boolean(update.Notification),
160
162
  };
161
163
  if (update.AuthorDisplay === "custom") {
162
164
  newState.customAuthorInput = update.Author
@@ -1297,12 +1299,29 @@ class AddNewsletterEntry extends Component {
1297
1299
  }
1298
1300
 
1299
1301
  renderNotify() {
1300
- if (
1301
- this.state.eventId ||
1302
- _.includes(this.props.auth.hidden, "eventNotifications")
1303
- ) {
1302
+ if (_.includes(this.props.auth.hidden, "eventNotifications")) {
1304
1303
  return null;
1305
1304
  }
1305
+ if (this.state.updateId != null) {
1306
+ return (
1307
+ <div className="marginTop-16">
1308
+ <Text type="formLabel">Notification</Text>
1309
+ <Text type="body">
1310
+ <FontAwesome
1311
+ className={`userStatusIcon`}
1312
+ style={this.state.shouldNotify ? { color: COLOUR_GREEN } : null}
1313
+ name={this.state.shouldNotify ? "check-circle" : "times-circle"}
1314
+ />{" "}
1315
+ <b>{this.state.shouldNotify ? "Yes" : "No"}</b> - Notifications were{" "}
1316
+ {this.state.shouldNotify ? "" : "not"} sent when this post was
1317
+ created.
1318
+ </Text>
1319
+ <Text type="help">
1320
+ Notifications can only be sent when creating a new post.
1321
+ </Text>
1322
+ </div>
1323
+ );
1324
+ }
1306
1325
  return (
1307
1326
  <div className="marginTop-16">
1308
1327
  <RadioButton