@plusscommunities/pluss-newsletter-web-sharing 1.3.10 → 1.4.2

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.
Files changed (43) hide show
  1. package/dist/index.cjs.js +74 -110
  2. package/dist/index.esm.js +74 -110
  3. package/dist/index.umd.js +74 -110
  4. package/package.json +9 -7
  5. package/src/actions/types.js +1 -1
  6. package/src/components/ActivityText.js +1 -1
  7. package/src/components/PreviewFull.js +1 -1
  8. package/src/components/PreviewGrid.js +1 -1
  9. package/src/components/index.js +1 -0
  10. package/src/feature.config.js +2 -96
  11. package/src/index.js +1 -1
  12. package/src/screens/Newsletter/AddNewsletterEntry.js +1 -1
  13. package/src/screens/Newsletter/AvailableNews.js +1 -1
  14. package/src/screens/Newsletter/GenerateNewsletter.js +1 -1
  15. package/src/screens/Newsletter/ListNewsletterEntries.js +1 -1
  16. package/src/screens/Newsletter/NewsHub.js +79 -15
  17. package/src/screens/Newsletter/NewsHubAnalytics.js +1 -1
  18. package/src/screens/Newsletter/NewsletterAnalytics.js +1 -1
  19. package/src/screens/Newsletter/NewsletterSubmission.js +1 -1
  20. package/src/screens/Newsletter/NewsletterSubmissions.js +1 -1
  21. package/src/screens/Newsletter/NewsletterTemplate.js +1 -1
  22. package/src/screens/Newsletter/PublishAvailableNews.js +1 -1
  23. package/src/values.config.awards.js +96 -0
  24. package/src/{feature.config.coaching.js → values.config.coaching.js} +1 -140
  25. package/src/{feature.config.curatedposts.js → values.config.curatedposts.js} +1 -140
  26. package/src/{feature.config.default.js → values.config.default.js} +1 -140
  27. package/src/{feature.config.headoffice.js → values.config.headoffice.js} +1 -140
  28. package/src/{feature.config.sharing.js → values.config.js} +1 -140
  29. package/src/{feature.config.menu.js → values.config.menu.js} +1 -140
  30. package/src/{feature.config.news2.js → values.config.news2.js} +1 -140
  31. package/src/{feature.config.newsa.js → values.config.newsa.js} +1 -140
  32. package/src/{feature.config.newsb.js → values.config.newsb.js} +1 -140
  33. package/src/{feature.config.newsc.js → values.config.newsc.js} +1 -140
  34. package/src/{feature.config.newsd.js → values.config.newsd.js} +1 -140
  35. package/src/{feature.config.noticeboard.js → values.config.noticeboard.js} +1 -140
  36. package/src/{feature.config.personaldev.js → values.config.personaldev.js} +1 -140
  37. package/src/values.config.products.js +96 -0
  38. package/src/values.config.projects.js +100 -0
  39. package/src/{feature.config.sales.js → values.config.sales.js} +1 -140
  40. package/src/values.config.sharing.js +96 -0
  41. package/src/values.config.shifts.js +96 -0
  42. package/src/{feature.config.training.js → values.config.training.js} +1 -140
  43. package/src/webapi/newsletterActions.js +1 -1
package/dist/index.cjs.js CHANGED
@@ -65,7 +65,6 @@ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
65
65
  var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
66
66
  var NewsletterPreview__default = /*#__PURE__*/_interopDefaultLegacy(NewsletterPreview);
67
67
 
68
- // import * as PlussCore from '../../pluss-core/src';
69
68
  var values = {
70
69
  featureKey: 'sharing',
71
70
  serviceKey: 'newsletterSharing',
@@ -159,6 +158,8 @@ var values = {
159
158
  textPermissionNewsletterManagement: 'Sharing Management',
160
159
  textPermissionNewsletterSubmission: 'Sharing Submission (Approval Required)'
161
160
  };
161
+
162
+ // import * as PlussCore from '../../pluss-core/src';
162
163
  var FeatureConfig = {
163
164
  key: values.featureKey,
164
165
  singularName: values.textSingularName,
@@ -328,6 +329,7 @@ var TextFormatPopup = Components$1.TextFormatPopup;
328
329
  var OptionsSection = Components$1.OptionsSection;
329
330
  var FileInput = Components$1.FileInput;
330
331
  var Popup = Components$1.Popup;
332
+ var HubSidebar = Components$1.HubSidebar;
331
333
 
332
334
  var Session = PlussCore__namespace.Session;
333
335
  var isTheBest = Session.isTheBest;
@@ -653,9 +655,9 @@ var getAnalyticsFilterOptions = Analytics.getAnalyticsFilterOptions; // Colours
653
655
 
654
656
  var COLOUR_BRANDING_MAIN = Colours.COLOUR_BRANDING_MAIN;
655
657
  var COLOUR_BRANDING_OFF = Colours.COLOUR_BRANDING_OFF;
656
- var COLOUR_BRANDING_ACTION = Colours.COLOUR_BRANDING_ACTION;
658
+ Colours.COLOUR_BRANDING_ACTION;
657
659
  var COLOUR_BRANDING_APP = Colours.COLOUR_BRANDING_APP;
658
- var TEXT_LIGHT = Colours.TEXT_LIGHT; // Misc
660
+ Colours.TEXT_LIGHT; // Misc
659
661
 
660
662
  var hideChat = Helper$1.hideChat;
661
663
 
@@ -1348,7 +1350,7 @@ var NewsletterSubmissions$1 = reactRedux.connect(mapStateToProps$8, {
1348
1350
 
1349
1351
  var Config = PlussCore__namespace.Config;
1350
1352
  var UTC_OFFSET = Config.env.utcOffset;
1351
- var hasAvailableNews = Config.env.hasAvailableNews;
1353
+ Config.env.hasAvailableNews;
1352
1354
  var newsHaveTags = Config.env.newsHaveTags;
1353
1355
  var DEFAULT_ALLOW_COMMENTS = Config.env.defaultAllowComments;
1354
1356
  var logo = Config.env.logo;
@@ -1914,8 +1916,14 @@ var NewsHub = /*#__PURE__*/function (_Component) {
1914
1916
  _this.props.history.push(values.routeGenerateNewsletter);
1915
1917
  });
1916
1918
 
1919
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "addNew", function () {
1920
+ if (validateAccess(_this.props.auth.site, values.permissionNewsletter, _this.props.auth) || validateAccess(_this.props.auth.site, values.permissionNewsletterSubmit, _this.props.auth)) {
1921
+ _this.props.history.push(values.routeAddNewsletterEntry);
1922
+ }
1923
+ });
1924
+
1917
1925
  var params = getUrlParams();
1918
- var selectedSection = 'thisMonth';
1926
+ var selectedSection = 'all';
1919
1927
 
1920
1928
  if (params.tab) {
1921
1929
  selectedSection = params.tab;
@@ -2014,13 +2022,6 @@ var NewsHub = /*#__PURE__*/function (_Component) {
2014
2022
  });
2015
2023
  });
2016
2024
  }
2017
- }, {
2018
- key: "addNew",
2019
- value: function addNew() {
2020
- if (validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth) || validateAccess(this.props.auth.site, values.permissionNewsletterSubmit, this.props.auth)) {
2021
- this.props.history.push(values.routeAddNewsletterEntry);
2022
- }
2023
- }
2024
2025
  }, {
2025
2026
  key: "canAddNew",
2026
2027
  value: function canAddNew(isClass) {
@@ -2054,105 +2055,78 @@ var NewsHub = /*#__PURE__*/function (_Component) {
2054
2055
  value: function renderLeftBar() {
2055
2056
  var _this4 = this;
2056
2057
 
2057
- if (validateAccess(this.props.auth.site, values.permissionNewsletterSubmit, this.props.auth) && !validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth)) {
2058
- return null;
2058
+ var sectionItems = [];
2059
+
2060
+ if (this.canAddNew()) {
2061
+ sectionItems.push({
2062
+ type: 'newButton',
2063
+ text: 'New Post',
2064
+ onClick: this.addNew
2065
+ });
2059
2066
  }
2060
2067
 
2061
- return /*#__PURE__*/React__default['default'].createElement("div", {
2062
- className: "hub-sideContent"
2063
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2064
- className: "hub-sideContent-topButton"
2065
- }), /*#__PURE__*/React__default['default'].createElement("div", {
2066
- style: {
2067
- paddingLeft: 15,
2068
- width: '100%'
2069
- }
2070
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2071
- className: "fontMedium fontSize-36 text-dark",
2072
- style: styles$4.sideBarTitleSection
2073
- }, values.textTitleNews), /*#__PURE__*/React__default['default'].createElement("div", {
2074
- onClick: function onClick() {
2075
- _this4.setState({
2076
- selectedSection: 'Analytics'
2077
- });
2078
- },
2079
- className: "sideBarSection",
2080
- style: this.getSideBarSectionColour('Analytics')
2081
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2082
- className: "fontMedium fontSize-36 text-dark",
2083
- style: {
2084
- lineHeight: '50px'
2085
- }
2086
- }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
2087
- name: "line-chart",
2088
- className: "sideBarSection__icon"
2089
- })), /*#__PURE__*/React__default['default'].createElement("div", {
2090
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2091
- }, "Analytics")), /*#__PURE__*/React__default['default'].createElement("div", {
2068
+ sectionItems.push({
2069
+ type: 'navItem',
2070
+ text: 'View Posts',
2071
+ icon: 'eye',
2072
+ isFontAwesome: true,
2073
+ selected: this.state.selectedSection === 'all',
2092
2074
  onClick: function onClick() {
2093
2075
  _this4.setState({
2094
2076
  selectedSection: 'all'
2095
2077
  });
2096
- },
2097
- className: "sideBarSection",
2098
- style: this.getSideBarSectionColour('all')
2099
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2100
- className: "fontMedium fontSize-36 text-dark",
2101
- style: {
2102
- lineHeight: '50px'
2103
- }
2104
- }, this.renderStats(this.state.allList.length, this.state.loadingAll)), /*#__PURE__*/React__default['default'].createElement("div", {
2105
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2106
- }, "All posts")), /*#__PURE__*/React__default['default'].createElement("div", {
2107
- onClick: function onClick() {
2108
- _this4.setState({
2109
- selectedSection: 'thisMonth'
2110
- });
2111
- },
2112
- className: "sideBarSection",
2113
- style: this.getSideBarSectionColour('thisMonth')
2114
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2115
- className: "fontMedium fontSize-36 text-dark",
2116
- style: {
2117
- lineHeight: '50px'
2118
2078
  }
2119
- }, this.renderStats(this.state.thisMonth.length, this.state.loadingAll)), /*#__PURE__*/React__default['default'].createElement("div", {
2120
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2121
- }, "This month")), this.props.auth.site !== 'hq' && validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth) && /*#__PURE__*/React__default['default'].createElement("div", {
2079
+ });
2080
+ sectionItems.push({
2081
+ type: 'navItem',
2082
+ text: 'Analytics',
2083
+ icon: 'line-chart',
2084
+ isFontAwesome: true,
2085
+ selected: this.state.selectedSection === 'Analytics',
2122
2086
  onClick: function onClick() {
2123
2087
  _this4.setState({
2124
- selectedSection: 'submissions'
2088
+ selectedSection: 'Analytics'
2125
2089
  });
2126
- },
2127
- className: "sideBarSection",
2128
- style: this.getSideBarSectionColour('submissions')
2129
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2130
- className: "fontMedium fontSize-36",
2131
- style: {
2132
- lineHeight: '50px',
2133
- color: !this.state.loadingSubmissions && this.state.submissionEntries.length > 0 ? COLOUR_BRANDING_ACTION : TEXT_LIGHT
2134
2090
  }
2135
- }, this.renderStats(this.state.submissionEntries.length, this.state.loadingSubmissions)), /*#__PURE__*/React__default['default'].createElement("div", {
2136
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2137
- }, "Submissions")), hasAvailableNews && /*#__PURE__*/React__default['default'].createElement("div", {
2138
- onClick: function onClick() {
2139
- _this4.setState({
2140
- selectedSection: 'available'
2141
- });
2142
- },
2143
- className: "sideBarSection",
2144
- style: this.getSideBarSectionColour('available')
2145
- }, /*#__PURE__*/React__default['default'].createElement("div", {
2146
- className: "fontMedium fontSize-36 text-dark",
2147
- style: {
2148
- lineHeight: '50px'
2091
+ });
2092
+
2093
+ if (validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth)) {
2094
+ var submissionText = 'View Submissions';
2095
+
2096
+ if (!this.state.loadingSubmissions) {
2097
+ submissionText = "View Submission".concat(getPluralS(this.state.submissionEntries.length), " (").concat(this.state.submissionEntries.length, ")");
2149
2098
  }
2150
- }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
2151
- name: "newspaper-o",
2152
- className: "sideBarSection__icon"
2153
- })), /*#__PURE__*/React__default['default'].createElement("div", {
2154
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2155
- }, "Available posts"))));
2099
+
2100
+ sectionItems.push({
2101
+ type: 'navItem',
2102
+ text: submissionText,
2103
+ // icon: 'question-circle-o',
2104
+ // isFontAwesome: true,
2105
+ selected: this.state.selectedSection === 'submissions',
2106
+ onClick: function onClick() {
2107
+ _this4.setState({
2108
+ selectedSection: 'submissions'
2109
+ });
2110
+ }
2111
+ });
2112
+ }
2113
+
2114
+ if (isTheBest(this.props.auth, true)) {
2115
+ sectionItems.push({
2116
+ type: 'navItem',
2117
+ text: values.textPrintNewsletter,
2118
+ // icon: 'print',
2119
+ // isFontAwesome: true,
2120
+ onClick: this.goToGenerate
2121
+ });
2122
+ }
2123
+
2124
+ return /*#__PURE__*/React__default['default'].createElement(HubSidebar, {
2125
+ sections: [{
2126
+ title: values.textTitleNews,
2127
+ items: sectionItems
2128
+ }]
2129
+ });
2156
2130
  }
2157
2131
  }, {
2158
2132
  key: "renderEventSubmitButton",
@@ -2221,17 +2195,7 @@ var NewsHub = /*#__PURE__*/function (_Component) {
2221
2195
  className: "hub-wrapperContainer"
2222
2196
  }, this.renderLeftBar(), /*#__PURE__*/React__default['default'].createElement("div", {
2223
2197
  className: "hub-headerContentWrapper"
2224
- }, /*#__PURE__*/React__default['default'].createElement(Header, null, this.canAddNew() && /*#__PURE__*/React__default['default'].createElement(AddButton, {
2225
- onClick: this.addNew.bind(this),
2226
- text: "NEW POST"
2227
- }), isTheBest(this.props.auth, true) && /*#__PURE__*/React__default['default'].createElement(Button, {
2228
- leftIcon: "print",
2229
- buttonType: "outlined",
2230
- onClick: this.goToGenerate,
2231
- narrow: true,
2232
- isActive: true,
2233
- className: "marginLeft-16"
2234
- }, values.textPrintNewsletter)), /*#__PURE__*/React__default['default'].createElement("div", {
2198
+ }, /*#__PURE__*/React__default['default'].createElement(Header, null), /*#__PURE__*/React__default['default'].createElement("div", {
2235
2199
  className: "hub-contentWrapper"
2236
2200
  }, this.renderRight())));
2237
2201
  }
package/dist/index.esm.js CHANGED
@@ -21,7 +21,6 @@ import { v4 } from 'uuid';
21
21
  import _extends from '@babel/runtime/helpers/extends';
22
22
  import NewsletterPreview from 'make-pluss-newsletter';
23
23
 
24
- // import * as PlussCore from '../../pluss-core/src';
25
24
  var values = {
26
25
  featureKey: 'sharing',
27
26
  serviceKey: 'newsletterSharing',
@@ -115,6 +114,8 @@ var values = {
115
114
  textPermissionNewsletterManagement: 'Sharing Management',
116
115
  textPermissionNewsletterSubmission: 'Sharing Submission (Approval Required)'
117
116
  };
117
+
118
+ // import * as PlussCore from '../../pluss-core/src';
118
119
  var FeatureConfig = {
119
120
  key: values.featureKey,
120
121
  singularName: values.textSingularName,
@@ -284,6 +285,7 @@ var TextFormatPopup = Components$1.TextFormatPopup;
284
285
  var OptionsSection = Components$1.OptionsSection;
285
286
  var FileInput = Components$1.FileInput;
286
287
  var Popup = Components$1.Popup;
288
+ var HubSidebar = Components$1.HubSidebar;
287
289
 
288
290
  var Session = PlussCore.Session;
289
291
  var isTheBest = Session.isTheBest;
@@ -609,9 +611,9 @@ var getAnalyticsFilterOptions = Analytics.getAnalyticsFilterOptions; // Colours
609
611
 
610
612
  var COLOUR_BRANDING_MAIN = Colours.COLOUR_BRANDING_MAIN;
611
613
  var COLOUR_BRANDING_OFF = Colours.COLOUR_BRANDING_OFF;
612
- var COLOUR_BRANDING_ACTION = Colours.COLOUR_BRANDING_ACTION;
614
+ Colours.COLOUR_BRANDING_ACTION;
613
615
  var COLOUR_BRANDING_APP = Colours.COLOUR_BRANDING_APP;
614
- var TEXT_LIGHT = Colours.TEXT_LIGHT; // Misc
616
+ Colours.TEXT_LIGHT; // Misc
615
617
 
616
618
  var hideChat = Helper$1.hideChat;
617
619
 
@@ -1304,7 +1306,7 @@ var NewsletterSubmissions$1 = connect(mapStateToProps$8, {
1304
1306
 
1305
1307
  var Config = PlussCore.Config;
1306
1308
  var UTC_OFFSET = Config.env.utcOffset;
1307
- var hasAvailableNews = Config.env.hasAvailableNews;
1309
+ Config.env.hasAvailableNews;
1308
1310
  var newsHaveTags = Config.env.newsHaveTags;
1309
1311
  var DEFAULT_ALLOW_COMMENTS = Config.env.defaultAllowComments;
1310
1312
  var logo = Config.env.logo;
@@ -1870,8 +1872,14 @@ var NewsHub = /*#__PURE__*/function (_Component) {
1870
1872
  _this.props.history.push(values.routeGenerateNewsletter);
1871
1873
  });
1872
1874
 
1875
+ _defineProperty(_assertThisInitialized(_this), "addNew", function () {
1876
+ if (validateAccess(_this.props.auth.site, values.permissionNewsletter, _this.props.auth) || validateAccess(_this.props.auth.site, values.permissionNewsletterSubmit, _this.props.auth)) {
1877
+ _this.props.history.push(values.routeAddNewsletterEntry);
1878
+ }
1879
+ });
1880
+
1873
1881
  var params = getUrlParams();
1874
- var selectedSection = 'thisMonth';
1882
+ var selectedSection = 'all';
1875
1883
 
1876
1884
  if (params.tab) {
1877
1885
  selectedSection = params.tab;
@@ -1970,13 +1978,6 @@ var NewsHub = /*#__PURE__*/function (_Component) {
1970
1978
  });
1971
1979
  });
1972
1980
  }
1973
- }, {
1974
- key: "addNew",
1975
- value: function addNew() {
1976
- if (validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth) || validateAccess(this.props.auth.site, values.permissionNewsletterSubmit, this.props.auth)) {
1977
- this.props.history.push(values.routeAddNewsletterEntry);
1978
- }
1979
- }
1980
1981
  }, {
1981
1982
  key: "canAddNew",
1982
1983
  value: function canAddNew(isClass) {
@@ -2010,105 +2011,78 @@ var NewsHub = /*#__PURE__*/function (_Component) {
2010
2011
  value: function renderLeftBar() {
2011
2012
  var _this4 = this;
2012
2013
 
2013
- if (validateAccess(this.props.auth.site, values.permissionNewsletterSubmit, this.props.auth) && !validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth)) {
2014
- return null;
2014
+ var sectionItems = [];
2015
+
2016
+ if (this.canAddNew()) {
2017
+ sectionItems.push({
2018
+ type: 'newButton',
2019
+ text: 'New Post',
2020
+ onClick: this.addNew
2021
+ });
2015
2022
  }
2016
2023
 
2017
- return /*#__PURE__*/React.createElement("div", {
2018
- className: "hub-sideContent"
2019
- }, /*#__PURE__*/React.createElement("div", {
2020
- className: "hub-sideContent-topButton"
2021
- }), /*#__PURE__*/React.createElement("div", {
2022
- style: {
2023
- paddingLeft: 15,
2024
- width: '100%'
2025
- }
2026
- }, /*#__PURE__*/React.createElement("div", {
2027
- className: "fontMedium fontSize-36 text-dark",
2028
- style: styles$4.sideBarTitleSection
2029
- }, values.textTitleNews), /*#__PURE__*/React.createElement("div", {
2030
- onClick: function onClick() {
2031
- _this4.setState({
2032
- selectedSection: 'Analytics'
2033
- });
2034
- },
2035
- className: "sideBarSection",
2036
- style: this.getSideBarSectionColour('Analytics')
2037
- }, /*#__PURE__*/React.createElement("div", {
2038
- className: "fontMedium fontSize-36 text-dark",
2039
- style: {
2040
- lineHeight: '50px'
2041
- }
2042
- }, /*#__PURE__*/React.createElement(FontAwesome, {
2043
- name: "line-chart",
2044
- className: "sideBarSection__icon"
2045
- })), /*#__PURE__*/React.createElement("div", {
2046
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2047
- }, "Analytics")), /*#__PURE__*/React.createElement("div", {
2024
+ sectionItems.push({
2025
+ type: 'navItem',
2026
+ text: 'View Posts',
2027
+ icon: 'eye',
2028
+ isFontAwesome: true,
2029
+ selected: this.state.selectedSection === 'all',
2048
2030
  onClick: function onClick() {
2049
2031
  _this4.setState({
2050
2032
  selectedSection: 'all'
2051
2033
  });
2052
- },
2053
- className: "sideBarSection",
2054
- style: this.getSideBarSectionColour('all')
2055
- }, /*#__PURE__*/React.createElement("div", {
2056
- className: "fontMedium fontSize-36 text-dark",
2057
- style: {
2058
- lineHeight: '50px'
2059
- }
2060
- }, this.renderStats(this.state.allList.length, this.state.loadingAll)), /*#__PURE__*/React.createElement("div", {
2061
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2062
- }, "All posts")), /*#__PURE__*/React.createElement("div", {
2063
- onClick: function onClick() {
2064
- _this4.setState({
2065
- selectedSection: 'thisMonth'
2066
- });
2067
- },
2068
- className: "sideBarSection",
2069
- style: this.getSideBarSectionColour('thisMonth')
2070
- }, /*#__PURE__*/React.createElement("div", {
2071
- className: "fontMedium fontSize-36 text-dark",
2072
- style: {
2073
- lineHeight: '50px'
2074
2034
  }
2075
- }, this.renderStats(this.state.thisMonth.length, this.state.loadingAll)), /*#__PURE__*/React.createElement("div", {
2076
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2077
- }, "This month")), this.props.auth.site !== 'hq' && validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth) && /*#__PURE__*/React.createElement("div", {
2035
+ });
2036
+ sectionItems.push({
2037
+ type: 'navItem',
2038
+ text: 'Analytics',
2039
+ icon: 'line-chart',
2040
+ isFontAwesome: true,
2041
+ selected: this.state.selectedSection === 'Analytics',
2078
2042
  onClick: function onClick() {
2079
2043
  _this4.setState({
2080
- selectedSection: 'submissions'
2044
+ selectedSection: 'Analytics'
2081
2045
  });
2082
- },
2083
- className: "sideBarSection",
2084
- style: this.getSideBarSectionColour('submissions')
2085
- }, /*#__PURE__*/React.createElement("div", {
2086
- className: "fontMedium fontSize-36",
2087
- style: {
2088
- lineHeight: '50px',
2089
- color: !this.state.loadingSubmissions && this.state.submissionEntries.length > 0 ? COLOUR_BRANDING_ACTION : TEXT_LIGHT
2090
2046
  }
2091
- }, this.renderStats(this.state.submissionEntries.length, this.state.loadingSubmissions)), /*#__PURE__*/React.createElement("div", {
2092
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2093
- }, "Submissions")), hasAvailableNews && /*#__PURE__*/React.createElement("div", {
2094
- onClick: function onClick() {
2095
- _this4.setState({
2096
- selectedSection: 'available'
2097
- });
2098
- },
2099
- className: "sideBarSection",
2100
- style: this.getSideBarSectionColour('available')
2101
- }, /*#__PURE__*/React.createElement("div", {
2102
- className: "fontMedium fontSize-36 text-dark",
2103
- style: {
2104
- lineHeight: '50px'
2047
+ });
2048
+
2049
+ if (validateAccess(this.props.auth.site, values.permissionNewsletter, this.props.auth)) {
2050
+ var submissionText = 'View Submissions';
2051
+
2052
+ if (!this.state.loadingSubmissions) {
2053
+ submissionText = "View Submission".concat(getPluralS(this.state.submissionEntries.length), " (").concat(this.state.submissionEntries.length, ")");
2105
2054
  }
2106
- }, /*#__PURE__*/React.createElement(FontAwesome, {
2107
- name: "newspaper-o",
2108
- className: "sideBarSection__icon"
2109
- })), /*#__PURE__*/React.createElement("div", {
2110
- className: "fontRegular fontSize-16 text-light lineHeight-22"
2111
- }, "Available posts"))));
2055
+
2056
+ sectionItems.push({
2057
+ type: 'navItem',
2058
+ text: submissionText,
2059
+ // icon: 'question-circle-o',
2060
+ // isFontAwesome: true,
2061
+ selected: this.state.selectedSection === 'submissions',
2062
+ onClick: function onClick() {
2063
+ _this4.setState({
2064
+ selectedSection: 'submissions'
2065
+ });
2066
+ }
2067
+ });
2068
+ }
2069
+
2070
+ if (isTheBest(this.props.auth, true)) {
2071
+ sectionItems.push({
2072
+ type: 'navItem',
2073
+ text: values.textPrintNewsletter,
2074
+ // icon: 'print',
2075
+ // isFontAwesome: true,
2076
+ onClick: this.goToGenerate
2077
+ });
2078
+ }
2079
+
2080
+ return /*#__PURE__*/React.createElement(HubSidebar, {
2081
+ sections: [{
2082
+ title: values.textTitleNews,
2083
+ items: sectionItems
2084
+ }]
2085
+ });
2112
2086
  }
2113
2087
  }, {
2114
2088
  key: "renderEventSubmitButton",
@@ -2177,17 +2151,7 @@ var NewsHub = /*#__PURE__*/function (_Component) {
2177
2151
  className: "hub-wrapperContainer"
2178
2152
  }, this.renderLeftBar(), /*#__PURE__*/React.createElement("div", {
2179
2153
  className: "hub-headerContentWrapper"
2180
- }, /*#__PURE__*/React.createElement(Header, null, this.canAddNew() && /*#__PURE__*/React.createElement(AddButton, {
2181
- onClick: this.addNew.bind(this),
2182
- text: "NEW POST"
2183
- }), isTheBest(this.props.auth, true) && /*#__PURE__*/React.createElement(Button, {
2184
- leftIcon: "print",
2185
- buttonType: "outlined",
2186
- onClick: this.goToGenerate,
2187
- narrow: true,
2188
- isActive: true,
2189
- className: "marginLeft-16"
2190
- }, values.textPrintNewsletter)), /*#__PURE__*/React.createElement("div", {
2154
+ }, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement("div", {
2191
2155
  className: "hub-contentWrapper"
2192
2156
  }, this.renderRight())));
2193
2157
  }