@plusscommunities/pluss-core-web 1.4.16-beta.0 → 1.4.17-beta.0

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
@@ -820,7 +820,10 @@ var getSiteLevelFromState = function getSiteLevelFromState(state) {
820
820
  hasTV: true,
821
821
  hasKiosk: false,
822
822
  hasPayments: true,
823
- hasLinkedContent: true
823
+ hasLinkedContent: true,
824
+ hasPersonalNotes: true,
825
+ hasEmergencyContacts: true,
826
+ hasPersonalDocuments: true
824
827
  };
825
828
 
826
829
  switch (siteType) {
@@ -829,6 +832,9 @@ var getSiteLevelFromState = function getSiteLevelFromState(state) {
829
832
  siteConfig.hasTV = false;
830
833
  siteConfig.hasPayments = false;
831
834
  siteConfig.hasLinkedContent = false;
835
+ siteConfig.hasPersonalNotes = false;
836
+ siteConfig.hasEmergencyContacts = false;
837
+ siteConfig.hasPersonalDocuments = false;
832
838
  break;
833
839
  }
834
840
 
@@ -3250,9 +3256,9 @@ var close = {
3250
3256
  ]
3251
3257
  };
3252
3258
  var check = {
3253
- viewBox: "0 0 512 512",
3259
+ viewBox: "0 0 48 48",
3254
3260
  paths: [
3255
- "M432 56l-240 240-112-112-80 80 192 192 320-320z"
3261
+ "M18.9 35.7 7.7 24.5l2.15-2.15 9.05 9.05 19.2-19.2 2.15 2.15Z"
3256
3262
  ]
3257
3263
  };
3258
3264
  var contractor = {
@@ -9565,11 +9571,10 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
9565
9571
  key: "componentDidMount",
9566
9572
  value: function componentDidMount() {
9567
9573
  var _this$props2 = this.props,
9568
- disallowUserType = _this$props2.disallowUserType,
9569
9574
  custom = _this$props2.custom,
9570
9575
  disallowSingleUsers = _this$props2.disallowSingleUsers,
9571
9576
  allowTags = _this$props2.allowTags;
9572
- if (!disallowUserType || custom) this.getUserTypes();
9577
+ this.getUserTypes();
9573
9578
  if (!disallowSingleUsers) this.getUsers();
9574
9579
  if (allowTags || custom) this.getUserTags();
9575
9580
  }
@@ -9808,10 +9813,19 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
9808
9813
  e.Title = "".concat(shortName, " ").concat(e.Title);
9809
9814
  }
9810
9815
  });
9811
-
9812
- _this7.setState({
9816
+ var newState = {
9813
9817
  types: res.data
9814
- });
9818
+ };
9819
+
9820
+ if (!___default['default'].some(res.data, function (t) {
9821
+ return t.category === 'family';
9822
+ })) {
9823
+ newState.categories = ___default['default'].filter(_this7.state.categories, function (c) {
9824
+ return c.Key !== 'family';
9825
+ });
9826
+ }
9827
+
9828
+ _this7.setState(newState);
9815
9829
  }).catch(function (error) {});
9816
9830
  }
9817
9831
  }, {
@@ -10351,13 +10365,18 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
10351
10365
  }
10352
10366
 
10353
10367
  _createClass__default['default'](OptionsSection, [{
10354
- key: "getTitle",
10355
- value: function getTitle() {
10368
+ key: "getSelectedOption",
10369
+ value: function getSelectedOption() {
10356
10370
  var _this = this;
10357
10371
 
10358
- var selectedOption = ___default['default'].find(this.props.options, function (o) {
10372
+ return ___default['default'].find(this.props.options, function (o) {
10359
10373
  return _this.props.selected === o.key;
10360
10374
  });
10375
+ }
10376
+ }, {
10377
+ key: "getTitle",
10378
+ value: function getTitle() {
10379
+ var selectedOption = this.getSelectedOption();
10361
10380
 
10362
10381
  if (!selectedOption) {
10363
10382
  return '';
@@ -10387,6 +10406,17 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
10387
10406
  className: "optionsButton_text"
10388
10407
  }, o.text));
10389
10408
  }
10409
+ }, {
10410
+ key: "renderContent",
10411
+ value: function renderContent() {
10412
+ var selectedOption = this.getSelectedOption();
10413
+
10414
+ if (selectedOption && selectedOption.content) {
10415
+ return selectedOption.content;
10416
+ }
10417
+
10418
+ return this.props.children;
10419
+ }
10390
10420
  }, {
10391
10421
  key: "render",
10392
10422
  value: function render() {
@@ -10413,7 +10443,7 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
10413
10443
  className: "optionsContent_box_top"
10414
10444
  }, /*#__PURE__*/React__default['default'].createElement(Text, {
10415
10445
  type: "formTitleSmall"
10416
- }, this.getTitle())), this.props.children)));
10446
+ }, this.getTitle())), this.renderContent())));
10417
10447
  }
10418
10448
  }]);
10419
10449
 
package/dist/index.esm.js CHANGED
@@ -790,7 +790,10 @@ var getSiteLevelFromState = function getSiteLevelFromState(state) {
790
790
  hasTV: true,
791
791
  hasKiosk: false,
792
792
  hasPayments: true,
793
- hasLinkedContent: true
793
+ hasLinkedContent: true,
794
+ hasPersonalNotes: true,
795
+ hasEmergencyContacts: true,
796
+ hasPersonalDocuments: true
794
797
  };
795
798
 
796
799
  switch (siteType) {
@@ -799,6 +802,9 @@ var getSiteLevelFromState = function getSiteLevelFromState(state) {
799
802
  siteConfig.hasTV = false;
800
803
  siteConfig.hasPayments = false;
801
804
  siteConfig.hasLinkedContent = false;
805
+ siteConfig.hasPersonalNotes = false;
806
+ siteConfig.hasEmergencyContacts = false;
807
+ siteConfig.hasPersonalDocuments = false;
802
808
  break;
803
809
  }
804
810
 
@@ -3220,9 +3226,9 @@ var close = {
3220
3226
  ]
3221
3227
  };
3222
3228
  var check = {
3223
- viewBox: "0 0 512 512",
3229
+ viewBox: "0 0 48 48",
3224
3230
  paths: [
3225
- "M432 56l-240 240-112-112-80 80 192 192 320-320z"
3231
+ "M18.9 35.7 7.7 24.5l2.15-2.15 9.05 9.05 19.2-19.2 2.15 2.15Z"
3226
3232
  ]
3227
3233
  };
3228
3234
  var contractor = {
@@ -9535,11 +9541,10 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
9535
9541
  key: "componentDidMount",
9536
9542
  value: function componentDidMount() {
9537
9543
  var _this$props2 = this.props,
9538
- disallowUserType = _this$props2.disallowUserType,
9539
9544
  custom = _this$props2.custom,
9540
9545
  disallowSingleUsers = _this$props2.disallowSingleUsers,
9541
9546
  allowTags = _this$props2.allowTags;
9542
- if (!disallowUserType || custom) this.getUserTypes();
9547
+ this.getUserTypes();
9543
9548
  if (!disallowSingleUsers) this.getUsers();
9544
9549
  if (allowTags || custom) this.getUserTags();
9545
9550
  }
@@ -9778,10 +9783,19 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
9778
9783
  e.Title = "".concat(shortName, " ").concat(e.Title);
9779
9784
  }
9780
9785
  });
9781
-
9782
- _this7.setState({
9786
+ var newState = {
9783
9787
  types: res.data
9784
- });
9788
+ };
9789
+
9790
+ if (!_.some(res.data, function (t) {
9791
+ return t.category === 'family';
9792
+ })) {
9793
+ newState.categories = _.filter(_this7.state.categories, function (c) {
9794
+ return c.Key !== 'family';
9795
+ });
9796
+ }
9797
+
9798
+ _this7.setState(newState);
9785
9799
  }).catch(function (error) {});
9786
9800
  }
9787
9801
  }, {
@@ -10321,13 +10335,18 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
10321
10335
  }
10322
10336
 
10323
10337
  _createClass(OptionsSection, [{
10324
- key: "getTitle",
10325
- value: function getTitle() {
10338
+ key: "getSelectedOption",
10339
+ value: function getSelectedOption() {
10326
10340
  var _this = this;
10327
10341
 
10328
- var selectedOption = _.find(this.props.options, function (o) {
10342
+ return _.find(this.props.options, function (o) {
10329
10343
  return _this.props.selected === o.key;
10330
10344
  });
10345
+ }
10346
+ }, {
10347
+ key: "getTitle",
10348
+ value: function getTitle() {
10349
+ var selectedOption = this.getSelectedOption();
10331
10350
 
10332
10351
  if (!selectedOption) {
10333
10352
  return '';
@@ -10357,6 +10376,17 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
10357
10376
  className: "optionsButton_text"
10358
10377
  }, o.text));
10359
10378
  }
10379
+ }, {
10380
+ key: "renderContent",
10381
+ value: function renderContent() {
10382
+ var selectedOption = this.getSelectedOption();
10383
+
10384
+ if (selectedOption && selectedOption.content) {
10385
+ return selectedOption.content;
10386
+ }
10387
+
10388
+ return this.props.children;
10389
+ }
10360
10390
  }, {
10361
10391
  key: "render",
10362
10392
  value: function render() {
@@ -10383,7 +10413,7 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
10383
10413
  className: "optionsContent_box_top"
10384
10414
  }, /*#__PURE__*/React.createElement(Text, {
10385
10415
  type: "formTitleSmall"
10386
- }, this.getTitle())), this.props.children)));
10416
+ }, this.getTitle())), this.renderContent())));
10387
10417
  }
10388
10418
  }]);
10389
10419
 
package/dist/index.umd.js CHANGED
@@ -791,7 +791,10 @@
791
791
  hasTV: true,
792
792
  hasKiosk: false,
793
793
  hasPayments: true,
794
- hasLinkedContent: true
794
+ hasLinkedContent: true,
795
+ hasPersonalNotes: true,
796
+ hasEmergencyContacts: true,
797
+ hasPersonalDocuments: true
795
798
  };
796
799
 
797
800
  switch (siteType) {
@@ -800,6 +803,9 @@
800
803
  siteConfig.hasTV = false;
801
804
  siteConfig.hasPayments = false;
802
805
  siteConfig.hasLinkedContent = false;
806
+ siteConfig.hasPersonalNotes = false;
807
+ siteConfig.hasEmergencyContacts = false;
808
+ siteConfig.hasPersonalDocuments = false;
803
809
  break;
804
810
  }
805
811
 
@@ -3221,9 +3227,9 @@
3221
3227
  ]
3222
3228
  };
3223
3229
  var check = {
3224
- viewBox: "0 0 512 512",
3230
+ viewBox: "0 0 48 48",
3225
3231
  paths: [
3226
- "M432 56l-240 240-112-112-80 80 192 192 320-320z"
3232
+ "M18.9 35.7 7.7 24.5l2.15-2.15 9.05 9.05 19.2-19.2 2.15 2.15Z"
3227
3233
  ]
3228
3234
  };
3229
3235
  var contractor = {
@@ -9536,11 +9542,10 @@
9536
9542
  key: "componentDidMount",
9537
9543
  value: function componentDidMount() {
9538
9544
  var _this$props2 = this.props,
9539
- disallowUserType = _this$props2.disallowUserType,
9540
9545
  custom = _this$props2.custom,
9541
9546
  disallowSingleUsers = _this$props2.disallowSingleUsers,
9542
9547
  allowTags = _this$props2.allowTags;
9543
- if (!disallowUserType || custom) this.getUserTypes();
9548
+ this.getUserTypes();
9544
9549
  if (!disallowSingleUsers) this.getUsers();
9545
9550
  if (allowTags || custom) this.getUserTags();
9546
9551
  }
@@ -9779,10 +9784,19 @@
9779
9784
  e.Title = "".concat(shortName, " ").concat(e.Title);
9780
9785
  }
9781
9786
  });
9782
-
9783
- _this7.setState({
9787
+ var newState = {
9784
9788
  types: res.data
9785
- });
9789
+ };
9790
+
9791
+ if (!___default['default'].some(res.data, function (t) {
9792
+ return t.category === 'family';
9793
+ })) {
9794
+ newState.categories = ___default['default'].filter(_this7.state.categories, function (c) {
9795
+ return c.Key !== 'family';
9796
+ });
9797
+ }
9798
+
9799
+ _this7.setState(newState);
9786
9800
  }).catch(function (error) {});
9787
9801
  }
9788
9802
  }, {
@@ -10322,13 +10336,18 @@
10322
10336
  }
10323
10337
 
10324
10338
  _createClass__default['default'](OptionsSection, [{
10325
- key: "getTitle",
10326
- value: function getTitle() {
10339
+ key: "getSelectedOption",
10340
+ value: function getSelectedOption() {
10327
10341
  var _this = this;
10328
10342
 
10329
- var selectedOption = ___default['default'].find(this.props.options, function (o) {
10343
+ return ___default['default'].find(this.props.options, function (o) {
10330
10344
  return _this.props.selected === o.key;
10331
10345
  });
10346
+ }
10347
+ }, {
10348
+ key: "getTitle",
10349
+ value: function getTitle() {
10350
+ var selectedOption = this.getSelectedOption();
10332
10351
 
10333
10352
  if (!selectedOption) {
10334
10353
  return '';
@@ -10358,6 +10377,17 @@
10358
10377
  className: "optionsButton_text"
10359
10378
  }, o.text));
10360
10379
  }
10380
+ }, {
10381
+ key: "renderContent",
10382
+ value: function renderContent() {
10383
+ var selectedOption = this.getSelectedOption();
10384
+
10385
+ if (selectedOption && selectedOption.content) {
10386
+ return selectedOption.content;
10387
+ }
10388
+
10389
+ return this.props.children;
10390
+ }
10361
10391
  }, {
10362
10392
  key: "render",
10363
10393
  value: function render() {
@@ -10384,7 +10414,7 @@
10384
10414
  className: "optionsContent_box_top"
10385
10415
  }, /*#__PURE__*/React__default['default'].createElement(Text, {
10386
10416
  type: "formTitleSmall"
10387
- }, this.getTitle())), this.props.children)));
10417
+ }, this.getTitle())), this.renderContent())));
10388
10418
  }
10389
10419
  }]);
10390
10420
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-web",
3
- "version": "1.4.16-beta.0",
3
+ "version": "1.4.17-beta.0",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -49,8 +49,8 @@ class AudienceSelector extends Component {
49
49
  }
50
50
 
51
51
  componentDidMount() {
52
- const { disallowUserType, custom, disallowSingleUsers, allowTags } = this.props;
53
- if (!disallowUserType || custom) this.getUserTypes();
52
+ const { custom, disallowSingleUsers, allowTags } = this.props;
53
+ this.getUserTypes();
54
54
  if (!disallowSingleUsers) this.getUsers();
55
55
  if (allowTags || custom) this.getUserTags();
56
56
  }
@@ -250,9 +250,13 @@ class AudienceSelector extends Component {
250
250
  e.Title = `${shortName} ${e.Title}`;
251
251
  }
252
252
  });
253
- this.setState({
253
+ const newState = {
254
254
  types: res.data,
255
- });
255
+ };
256
+ if (!_.some(res.data, (t) => t.category === 'family')) {
257
+ newState.categories = _.filter(this.state.categories, (c) => c.Key !== 'family');
258
+ }
259
+ this.setState(newState);
256
260
  })
257
261
  .catch((error) => {});
258
262
  }
@@ -5,8 +5,12 @@ import { SVGIcon } from './SVGIcon';
5
5
  import { Text } from './Text';
6
6
 
7
7
  class OptionsSection extends Component {
8
+ getSelectedOption() {
9
+ return _.find(this.props.options, (o) => this.props.selected === o.key);
10
+ }
11
+
8
12
  getTitle() {
9
- const selectedOption = _.find(this.props.options, (o) => this.props.selected === o.key);
13
+ const selectedOption = this.getSelectedOption();
10
14
  if (!selectedOption) {
11
15
  return '';
12
16
  }
@@ -33,6 +37,14 @@ class OptionsSection extends Component {
33
37
  );
34
38
  }
35
39
 
40
+ renderContent() {
41
+ const selectedOption = this.getSelectedOption();
42
+ if (selectedOption && selectedOption.content) {
43
+ return selectedOption.content;
44
+ }
45
+ return this.props.children;
46
+ }
47
+
36
48
  render() {
37
49
  return (
38
50
  <div className={`optionsSection${this.props.overflowButtons ? ' optionsSection-overflowButtons' : ''}`}>
@@ -53,7 +65,7 @@ class OptionsSection extends Component {
53
65
  <div className="optionsContent_box_top">
54
66
  <Text type="formTitleSmall">{this.getTitle()}</Text>
55
67
  </div>
56
- {this.props.children}
68
+ {this.renderContent()}
57
69
  </div>
58
70
  </div>
59
71
  </div>
@@ -6,8 +6,8 @@
6
6
  ]
7
7
  },
8
8
  "check": {
9
- "viewBox": "0 0 512 512",
10
- "paths": ["M432 56l-240 240-112-112-80 80 192 192 320-320z"]
9
+ "viewBox": "0 0 48 48",
10
+ "paths": ["M18.9 35.7 7.7 24.5l2.15-2.15 9.05 9.05 19.2-19.2 2.15 2.15Z"]
11
11
  },
12
12
  "contractor": {
13
13
  "viewBox": "0 0 512 512",
@@ -10,6 +10,9 @@ const getSiteLevelFromState = (state) => {
10
10
  hasKiosk: false,
11
11
  hasPayments: true,
12
12
  hasLinkedContent: true,
13
+ hasPersonalNotes: true,
14
+ hasEmergencyContacts: true,
15
+ hasPersonalDocuments: true,
13
16
  };
14
17
 
15
18
  switch (siteType) {
@@ -18,6 +21,9 @@ const getSiteLevelFromState = (state) => {
18
21
  siteConfig.hasTV = false;
19
22
  siteConfig.hasPayments = false;
20
23
  siteConfig.hasLinkedContent = false;
24
+ siteConfig.hasPersonalNotes = false;
25
+ siteConfig.hasEmergencyContacts = false;
26
+ siteConfig.hasPersonalDocuments = false;
21
27
  break;
22
28
  default:
23
29
  break;