@plusscommunities/pluss-newsletter-web-sharing 1.3.7 → 1.3.8
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 +20 -3
- package/dist/index.esm.js +20 -3
- package/dist/index.umd.js +20 -3
- package/package.json +2 -2
- package/src/helper/index.js +1 -0
- package/src/screens/Newsletter/AddNewsletterEntry.js +33 -9
package/dist/index.cjs.js
CHANGED
|
@@ -988,6 +988,7 @@ var getSiteNameFromRoles = Helper.getSiteNameFromRoles;
|
|
|
988
988
|
var onlyAlphanumeric = Helper.onlyAlphanumeric;
|
|
989
989
|
var setLocalStorage = Helper.setLocalStorage;
|
|
990
990
|
var readJSONFromStorage = Helper.readJSONFromStorage;
|
|
991
|
+
var getSiteSettingFromState = Helper.getSiteSettingFromState;
|
|
991
992
|
|
|
992
993
|
function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
993
994
|
|
|
@@ -2323,6 +2324,7 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
2323
2324
|
differentPublish: false,
|
|
2324
2325
|
isTvMode: false,
|
|
2325
2326
|
allowComments: DEFAULT_ALLOW_COMMENTS,
|
|
2327
|
+
commentVisibilityLimited: _this.props.commentVisibilityLimited,
|
|
2326
2328
|
shouldNotify: false,
|
|
2327
2329
|
publishDate: moment__default['default']().format('YYYY-MM-DD'),
|
|
2328
2330
|
publishDateText: moment__default['default']().format('DD/MM/YYYY'),
|
|
@@ -2561,6 +2563,7 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
2561
2563
|
isTvMode: Boolean(update.TVMode),
|
|
2562
2564
|
isFeatured: Boolean(update.IsFeatured),
|
|
2563
2565
|
allowComments: Boolean(update.AllowComments),
|
|
2566
|
+
commentVisibilityLimited: Boolean(update.CommentVisibilityLimited),
|
|
2564
2567
|
featuredExpiryDate: moment__default['default'](update.FeaturedExpiry || undefined).format('YYYY-MM-DD'),
|
|
2565
2568
|
featuredExpiryDateText: moment__default['default'](update.FeaturedExpiry || undefined).format('DD/MM/YYYY'),
|
|
2566
2569
|
authorDisplay: update.AuthorDisplay,
|
|
@@ -2916,6 +2919,10 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
2916
2919
|
if (!___default['default'].isEmpty(result.Images)) {
|
|
2917
2920
|
result.Thumbnail = getThumb300(result.Images[0]);
|
|
2918
2921
|
result.Image = get1400(result.Images[0]);
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
if (result.AllowComments) {
|
|
2925
|
+
result.CommentVisibilityLimited = this.state.commentVisibilityLimited;
|
|
2919
2926
|
} // if (baseClient === 'pluss60') {
|
|
2920
2927
|
// const publisherImage = this.refs.publisherImage.getWrappedInstance().getValue();
|
|
2921
2928
|
// if (!_.isEmpty(publisherImage) || !_.isEmpty(this.state.publisherTitleInput)) {
|
|
@@ -3514,7 +3521,7 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
3514
3521
|
var _this13 = this;
|
|
3515
3522
|
|
|
3516
3523
|
if (___default['default'].includes(this.props.auth.hidden, values.optionNewsComments)) return null;
|
|
3517
|
-
return /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
3524
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
3518
3525
|
className: "marginTop-16",
|
|
3519
3526
|
label: "Allow comments",
|
|
3520
3527
|
isActive: this.state.allowComments,
|
|
@@ -3523,7 +3530,16 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
3523
3530
|
allowComments: !_this13.state.allowComments
|
|
3524
3531
|
});
|
|
3525
3532
|
}
|
|
3526
|
-
})
|
|
3533
|
+
}), this.state.allowComments && /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
3534
|
+
className: "marginTop-16",
|
|
3535
|
+
label: "Users can only see their own comments",
|
|
3536
|
+
isActive: this.state.commentVisibilityLimited,
|
|
3537
|
+
onChange: function onChange() {
|
|
3538
|
+
_this13.setState({
|
|
3539
|
+
commentVisibilityLimited: !_this13.state.commentVisibilityLimited
|
|
3540
|
+
});
|
|
3541
|
+
}
|
|
3542
|
+
}));
|
|
3527
3543
|
}
|
|
3528
3544
|
}, {
|
|
3529
3545
|
key: "renderTags",
|
|
@@ -3850,7 +3866,8 @@ var mapStateToProps$4 = function mapStateToProps(state) {
|
|
|
3850
3866
|
return {
|
|
3851
3867
|
auth: auth,
|
|
3852
3868
|
users: allUsers,
|
|
3853
|
-
forceNewsAuthorName:
|
|
3869
|
+
forceNewsAuthorName: getSiteSettingFromState(state, values.optionForceNewsAuthorName),
|
|
3870
|
+
commentVisibilityLimited: getSiteSettingFromState(state, 'CommentVisibilityLimited')
|
|
3854
3871
|
};
|
|
3855
3872
|
};
|
|
3856
3873
|
|
package/dist/index.esm.js
CHANGED
|
@@ -944,6 +944,7 @@ var getSiteNameFromRoles = Helper.getSiteNameFromRoles;
|
|
|
944
944
|
var onlyAlphanumeric = Helper.onlyAlphanumeric;
|
|
945
945
|
var setLocalStorage = Helper.setLocalStorage;
|
|
946
946
|
var readJSONFromStorage = Helper.readJSONFromStorage;
|
|
947
|
+
var getSiteSettingFromState = Helper.getSiteSettingFromState;
|
|
947
948
|
|
|
948
949
|
function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
949
950
|
|
|
@@ -2279,6 +2280,7 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
2279
2280
|
differentPublish: false,
|
|
2280
2281
|
isTvMode: false,
|
|
2281
2282
|
allowComments: DEFAULT_ALLOW_COMMENTS,
|
|
2283
|
+
commentVisibilityLimited: _this.props.commentVisibilityLimited,
|
|
2282
2284
|
shouldNotify: false,
|
|
2283
2285
|
publishDate: moment().format('YYYY-MM-DD'),
|
|
2284
2286
|
publishDateText: moment().format('DD/MM/YYYY'),
|
|
@@ -2517,6 +2519,7 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
2517
2519
|
isTvMode: Boolean(update.TVMode),
|
|
2518
2520
|
isFeatured: Boolean(update.IsFeatured),
|
|
2519
2521
|
allowComments: Boolean(update.AllowComments),
|
|
2522
|
+
commentVisibilityLimited: Boolean(update.CommentVisibilityLimited),
|
|
2520
2523
|
featuredExpiryDate: moment(update.FeaturedExpiry || undefined).format('YYYY-MM-DD'),
|
|
2521
2524
|
featuredExpiryDateText: moment(update.FeaturedExpiry || undefined).format('DD/MM/YYYY'),
|
|
2522
2525
|
authorDisplay: update.AuthorDisplay,
|
|
@@ -2872,6 +2875,10 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
2872
2875
|
if (!_.isEmpty(result.Images)) {
|
|
2873
2876
|
result.Thumbnail = getThumb300(result.Images[0]);
|
|
2874
2877
|
result.Image = get1400(result.Images[0]);
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
if (result.AllowComments) {
|
|
2881
|
+
result.CommentVisibilityLimited = this.state.commentVisibilityLimited;
|
|
2875
2882
|
} // if (baseClient === 'pluss60') {
|
|
2876
2883
|
// const publisherImage = this.refs.publisherImage.getWrappedInstance().getValue();
|
|
2877
2884
|
// if (!_.isEmpty(publisherImage) || !_.isEmpty(this.state.publisherTitleInput)) {
|
|
@@ -3470,7 +3477,7 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
3470
3477
|
var _this13 = this;
|
|
3471
3478
|
|
|
3472
3479
|
if (_.includes(this.props.auth.hidden, values.optionNewsComments)) return null;
|
|
3473
|
-
return /*#__PURE__*/React.createElement(CheckBox, {
|
|
3480
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CheckBox, {
|
|
3474
3481
|
className: "marginTop-16",
|
|
3475
3482
|
label: "Allow comments",
|
|
3476
3483
|
isActive: this.state.allowComments,
|
|
@@ -3479,7 +3486,16 @@ var AddNewsletterEntry = /*#__PURE__*/function (_Component) {
|
|
|
3479
3486
|
allowComments: !_this13.state.allowComments
|
|
3480
3487
|
});
|
|
3481
3488
|
}
|
|
3482
|
-
})
|
|
3489
|
+
}), this.state.allowComments && /*#__PURE__*/React.createElement(CheckBox, {
|
|
3490
|
+
className: "marginTop-16",
|
|
3491
|
+
label: "Users can only see their own comments",
|
|
3492
|
+
isActive: this.state.commentVisibilityLimited,
|
|
3493
|
+
onChange: function onChange() {
|
|
3494
|
+
_this13.setState({
|
|
3495
|
+
commentVisibilityLimited: !_this13.state.commentVisibilityLimited
|
|
3496
|
+
});
|
|
3497
|
+
}
|
|
3498
|
+
}));
|
|
3483
3499
|
}
|
|
3484
3500
|
}, {
|
|
3485
3501
|
key: "renderTags",
|
|
@@ -3806,7 +3822,8 @@ var mapStateToProps$4 = function mapStateToProps(state) {
|
|
|
3806
3822
|
return {
|
|
3807
3823
|
auth: auth,
|
|
3808
3824
|
users: allUsers,
|
|
3809
|
-
forceNewsAuthorName:
|
|
3825
|
+
forceNewsAuthorName: getSiteSettingFromState(state, values.optionForceNewsAuthorName),
|
|
3826
|
+
commentVisibilityLimited: getSiteSettingFromState(state, 'CommentVisibilityLimited')
|
|
3810
3827
|
};
|
|
3811
3828
|
};
|
|
3812
3829
|
|
package/dist/index.umd.js
CHANGED
|
@@ -967,6 +967,7 @@
|
|
|
967
967
|
var onlyAlphanumeric = Helper.onlyAlphanumeric;
|
|
968
968
|
var setLocalStorage = Helper.setLocalStorage;
|
|
969
969
|
var readJSONFromStorage = Helper.readJSONFromStorage;
|
|
970
|
+
var getSiteSettingFromState = Helper.getSiteSettingFromState;
|
|
970
971
|
|
|
971
972
|
function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
972
973
|
|
|
@@ -2302,6 +2303,7 @@
|
|
|
2302
2303
|
differentPublish: false,
|
|
2303
2304
|
isTvMode: false,
|
|
2304
2305
|
allowComments: DEFAULT_ALLOW_COMMENTS,
|
|
2306
|
+
commentVisibilityLimited: _this.props.commentVisibilityLimited,
|
|
2305
2307
|
shouldNotify: false,
|
|
2306
2308
|
publishDate: moment__default['default']().format('YYYY-MM-DD'),
|
|
2307
2309
|
publishDateText: moment__default['default']().format('DD/MM/YYYY'),
|
|
@@ -2540,6 +2542,7 @@
|
|
|
2540
2542
|
isTvMode: Boolean(update.TVMode),
|
|
2541
2543
|
isFeatured: Boolean(update.IsFeatured),
|
|
2542
2544
|
allowComments: Boolean(update.AllowComments),
|
|
2545
|
+
commentVisibilityLimited: Boolean(update.CommentVisibilityLimited),
|
|
2543
2546
|
featuredExpiryDate: moment__default['default'](update.FeaturedExpiry || undefined).format('YYYY-MM-DD'),
|
|
2544
2547
|
featuredExpiryDateText: moment__default['default'](update.FeaturedExpiry || undefined).format('DD/MM/YYYY'),
|
|
2545
2548
|
authorDisplay: update.AuthorDisplay,
|
|
@@ -2895,6 +2898,10 @@
|
|
|
2895
2898
|
if (!___default['default'].isEmpty(result.Images)) {
|
|
2896
2899
|
result.Thumbnail = getThumb300(result.Images[0]);
|
|
2897
2900
|
result.Image = get1400(result.Images[0]);
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
if (result.AllowComments) {
|
|
2904
|
+
result.CommentVisibilityLimited = this.state.commentVisibilityLimited;
|
|
2898
2905
|
} // if (baseClient === 'pluss60') {
|
|
2899
2906
|
// const publisherImage = this.refs.publisherImage.getWrappedInstance().getValue();
|
|
2900
2907
|
// if (!_.isEmpty(publisherImage) || !_.isEmpty(this.state.publisherTitleInput)) {
|
|
@@ -3493,7 +3500,7 @@
|
|
|
3493
3500
|
var _this13 = this;
|
|
3494
3501
|
|
|
3495
3502
|
if (___default['default'].includes(this.props.auth.hidden, values.optionNewsComments)) return null;
|
|
3496
|
-
return /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
3503
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
3497
3504
|
className: "marginTop-16",
|
|
3498
3505
|
label: "Allow comments",
|
|
3499
3506
|
isActive: this.state.allowComments,
|
|
@@ -3502,7 +3509,16 @@
|
|
|
3502
3509
|
allowComments: !_this13.state.allowComments
|
|
3503
3510
|
});
|
|
3504
3511
|
}
|
|
3505
|
-
})
|
|
3512
|
+
}), this.state.allowComments && /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
3513
|
+
className: "marginTop-16",
|
|
3514
|
+
label: "Users can only see their own comments",
|
|
3515
|
+
isActive: this.state.commentVisibilityLimited,
|
|
3516
|
+
onChange: function onChange() {
|
|
3517
|
+
_this13.setState({
|
|
3518
|
+
commentVisibilityLimited: !_this13.state.commentVisibilityLimited
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3521
|
+
}));
|
|
3506
3522
|
}
|
|
3507
3523
|
}, {
|
|
3508
3524
|
key: "renderTags",
|
|
@@ -3829,7 +3845,8 @@
|
|
|
3829
3845
|
return {
|
|
3830
3846
|
auth: auth,
|
|
3831
3847
|
users: allUsers,
|
|
3832
|
-
forceNewsAuthorName:
|
|
3848
|
+
forceNewsAuthorName: getSiteSettingFromState(state, values.optionForceNewsAuthorName),
|
|
3849
|
+
commentVisibilityLimited: getSiteSettingFromState(state, 'CommentVisibilityLimited')
|
|
3833
3850
|
};
|
|
3834
3851
|
};
|
|
3835
3852
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-newsletter-web-sharing",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Extension package to enable newsletter on Pluss Communities Platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.14.0",
|
|
36
|
-
"@plusscommunities/pluss-core-web": "^1.2.
|
|
36
|
+
"@plusscommunities/pluss-core-web": "^1.2.11",
|
|
37
37
|
"lodash": "^4.17.4",
|
|
38
38
|
"moment": "^2.18.1",
|
|
39
39
|
"react": "^16.14.0",
|
package/src/helper/index.js
CHANGED
|
@@ -16,3 +16,4 @@ export const getSiteNameFromRoles = Helper.getSiteNameFromRoles;
|
|
|
16
16
|
export const onlyAlphanumeric = Helper.onlyAlphanumeric;
|
|
17
17
|
export const setLocalStorage = Helper.setLocalStorage;
|
|
18
18
|
export const readJSONFromStorage = Helper.readJSONFromStorage;
|
|
19
|
+
export const getSiteSettingFromState = Helper.getSiteSettingFromState;
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
isVideo,
|
|
37
37
|
isUrl,
|
|
38
38
|
getFileName,
|
|
39
|
+
getSiteSettingFromState,
|
|
39
40
|
} from '../../helper';
|
|
40
41
|
import { newsHaveTags, DEFAULT_ALLOW_COMMENTS } from '../../config';
|
|
41
42
|
import { checkLoggedIn, validateAccess } from '../../session';
|
|
@@ -65,6 +66,7 @@ class AddNewsletterEntry extends Component {
|
|
|
65
66
|
differentPublish: false,
|
|
66
67
|
isTvMode: false,
|
|
67
68
|
allowComments: DEFAULT_ALLOW_COMMENTS,
|
|
69
|
+
commentVisibilityLimited: this.props.commentVisibilityLimited,
|
|
68
70
|
shouldNotify: false,
|
|
69
71
|
publishDate: moment().format('YYYY-MM-DD'),
|
|
70
72
|
publishDateText: moment().format('DD/MM/YYYY'),
|
|
@@ -134,6 +136,7 @@ class AddNewsletterEntry extends Component {
|
|
|
134
136
|
isTvMode: Boolean(update.TVMode),
|
|
135
137
|
isFeatured: Boolean(update.IsFeatured),
|
|
136
138
|
allowComments: Boolean(update.AllowComments),
|
|
139
|
+
commentVisibilityLimited: Boolean(update.CommentVisibilityLimited),
|
|
137
140
|
featuredExpiryDate: moment(update.FeaturedExpiry || undefined).format('YYYY-MM-DD'),
|
|
138
141
|
featuredExpiryDateText: moment(update.FeaturedExpiry || undefined).format('DD/MM/YYYY'),
|
|
139
142
|
authorDisplay: update.AuthorDisplay,
|
|
@@ -536,6 +539,10 @@ class AddNewsletterEntry extends Component {
|
|
|
536
539
|
result.Image = get1400(result.Images[0]);
|
|
537
540
|
}
|
|
538
541
|
|
|
542
|
+
if (result.AllowComments) {
|
|
543
|
+
result.CommentVisibilityLimited = this.state.commentVisibilityLimited;
|
|
544
|
+
}
|
|
545
|
+
|
|
539
546
|
// if (baseClient === 'pluss60') {
|
|
540
547
|
// const publisherImage = this.refs.publisherImage.getWrappedInstance().getValue();
|
|
541
548
|
// if (!_.isEmpty(publisherImage) || !_.isEmpty(this.state.publisherTitleInput)) {
|
|
@@ -1089,14 +1096,26 @@ class AddNewsletterEntry extends Component {
|
|
|
1089
1096
|
if (_.includes(this.props.auth.hidden, values.optionNewsComments)) return null;
|
|
1090
1097
|
|
|
1091
1098
|
return (
|
|
1092
|
-
<
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1099
|
+
<div>
|
|
1100
|
+
<CheckBox
|
|
1101
|
+
className="marginTop-16"
|
|
1102
|
+
label="Allow comments"
|
|
1103
|
+
isActive={this.state.allowComments}
|
|
1104
|
+
onChange={() => {
|
|
1105
|
+
this.setState({ allowComments: !this.state.allowComments });
|
|
1106
|
+
}}
|
|
1107
|
+
/>
|
|
1108
|
+
{this.state.allowComments && (
|
|
1109
|
+
<CheckBox
|
|
1110
|
+
className="marginTop-16"
|
|
1111
|
+
label="Users can only see their own comments"
|
|
1112
|
+
isActive={this.state.commentVisibilityLimited}
|
|
1113
|
+
onChange={() => {
|
|
1114
|
+
this.setState({ commentVisibilityLimited: !this.state.commentVisibilityLimited });
|
|
1115
|
+
}}
|
|
1116
|
+
/>
|
|
1117
|
+
)}
|
|
1118
|
+
</div>
|
|
1100
1119
|
);
|
|
1101
1120
|
}
|
|
1102
1121
|
|
|
@@ -1350,7 +1369,12 @@ class AddNewsletterEntry extends Component {
|
|
|
1350
1369
|
const mapStateToProps = (state) => {
|
|
1351
1370
|
const { auth } = state;
|
|
1352
1371
|
const { allUsers } = state.users;
|
|
1353
|
-
return {
|
|
1372
|
+
return {
|
|
1373
|
+
auth,
|
|
1374
|
+
users: allUsers,
|
|
1375
|
+
forceNewsAuthorName: getSiteSettingFromState(state, values.optionForceNewsAuthorName),
|
|
1376
|
+
commentVisibilityLimited: getSiteSettingFromState(state, 'CommentVisibilityLimited'),
|
|
1377
|
+
};
|
|
1354
1378
|
};
|
|
1355
1379
|
|
|
1356
1380
|
export default connect(mapStateToProps, { newsUpdate, usersLoaded, addRecentlyCreated })(AddNewsletterEntry);
|