@plusscommunities/pluss-maintenance-web 1.1.20 → 1.1.22-auth.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
@@ -1149,7 +1149,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1149
1149
  label: "".concat(values.textEntityName, " No."),
1150
1150
  key: 'jobId'
1151
1151
  }, {
1152
- label: 'Type',
1152
+ label: values.textJobType,
1153
1153
  key: 'type'
1154
1154
  }, {
1155
1155
  label: 'Status',
@@ -1213,7 +1213,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1213
1213
 
1214
1214
  if (this.state.filterOpen === 'type') {
1215
1215
  return /*#__PURE__*/React__default['default'].createElement(Components$6.Popup, {
1216
- title: "Select Type",
1216
+ title: "Select ".concat(values.textJobType),
1217
1217
  maxWidth: 600,
1218
1218
  minWidth: 400,
1219
1219
  hasPadding: true,
@@ -1484,7 +1484,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1484
1484
  onClick: function onClick() {
1485
1485
  _this4.sortByCol('title');
1486
1486
  }
1487
- }, "Request title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1487
+ }, "Title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1488
1488
  className: "".concat(this.sortIsActive('type')),
1489
1489
  style: {
1490
1490
  cursor: 'pointer',
@@ -1493,7 +1493,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1493
1493
  onClick: function onClick() {
1494
1494
  _this4.sortByCol('type');
1495
1495
  }
1496
- }, "Type", this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1496
+ }, values.textJobType, this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1497
1497
  className: "".concat(this.sortIsActive('createdUnix')),
1498
1498
  style: {
1499
1499
  cursor: 'pointer',
@@ -1540,7 +1540,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1540
1540
  onClick: function onClick() {
1541
1541
  _this5.openFilter('type');
1542
1542
  },
1543
- text: "Type"
1543
+ text: values.textJobType
1544
1544
  });
1545
1545
  var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$6.Tag, {
1546
1546
  className: "marginRight-10",
@@ -3817,6 +3817,10 @@ var AddJob = /*#__PURE__*/function (_Component) {
3817
3817
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
3818
3818
  };
3819
3819
 
3820
+ if (!___default['default'].isEmpty(update.customFields) && !___default['default'].some(update.customFields, 'isTitle')) {
3821
+ update.title = _this.state.selectedUser ? _this.state.selectedUser.displayName : '';
3822
+ }
3823
+
3820
3824
  _this.setState(update);
3821
3825
  });
3822
3826
 
@@ -3840,20 +3844,32 @@ var AddJob = /*#__PURE__*/function (_Component) {
3840
3844
  });
3841
3845
 
3842
3846
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectUser", function (user) {
3843
- _this.setState({
3847
+ var update = {
3844
3848
  selectedUser: user,
3845
3849
  userID: user.userId,
3846
3850
  userName: user.displayName,
3847
3851
  userFilterOpen: false
3848
- });
3852
+ };
3853
+
3854
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3855
+ update.title = user.displayName;
3856
+ }
3857
+
3858
+ _this.setState(update);
3849
3859
  });
3850
3860
 
3851
3861
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onUnselectUser", function () {
3852
- _this.setState({
3862
+ var update = {
3853
3863
  selectedUser: null,
3854
3864
  userID: '',
3855
3865
  userName: ''
3856
- });
3866
+ };
3867
+
3868
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3869
+ update.title = '';
3870
+ }
3871
+
3872
+ _this.setState(update);
3857
3873
  });
3858
3874
 
3859
3875
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onChangeAnswer", function (qId, answer) {
@@ -4635,7 +4651,7 @@ var AddJob = /*#__PURE__*/function (_Component) {
4635
4651
  }
4636
4652
  }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
4637
4653
  type: "formLabel"
4638
- }, values.textJobType, " Type"), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4654
+ }, values.textJobType), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4639
4655
  style: {
4640
4656
  minWidth: 80
4641
4657
  },
@@ -5093,7 +5109,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5093
5109
  hasCustomFields: false,
5094
5110
  customFields: [___default['default'].cloneDeep(DEFAULT_FIELD)],
5095
5111
  jobTypeLevel: 1,
5096
- warnings: ['this is a test warning'],
5112
+ warnings: [],
5097
5113
  showWarnings: false,
5098
5114
  submitting: false,
5099
5115
  success: false
@@ -5150,9 +5166,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5150
5166
  warnings.push('There must be at least one required input');
5151
5167
  }
5152
5168
 
5153
- if (titleFieldCount === 0) {
5154
- warnings.push('One of the required inputs must be selected as title for the request');
5155
- } else if (titleFieldCount > 1) {
5169
+ if (titleFieldCount > 1) {
5156
5170
  warnings.push('Only one required input can be selected as title for the request');
5157
5171
  }
5158
5172
  }
@@ -5281,7 +5295,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5281
5295
 
5282
5296
  return /*#__PURE__*/React__default['default'].createElement(Components$1.CheckBox, {
5283
5297
  id: "fieldTitle".concat(fieldIndex),
5284
- label: "Use this field as the title for any ".concat(values.textSingularName, " of this type"),
5298
+ label: "Use this field as the ".concat(values.textSingularName, " title"),
5285
5299
  isActive: field.isTitle,
5286
5300
  onChange: function onChange(e) {
5287
5301
  return _this4.onFieldIsTitleChanged(fieldIndex, e);
@@ -5668,7 +5682,13 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5668
5682
  if (success || !hasCustomFields) return null;
5669
5683
  return /*#__PURE__*/React__default['default'].createElement("div", {
5670
5684
  className: "padding-60 paddingTop-8 paddingLeft-20"
5671
- }, /*#__PURE__*/React__default['default'].createElement("div", {
5685
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
5686
+ type: "bodyLarge",
5687
+ className: "marginBottom-24 paddingLeft-40",
5688
+ style: {
5689
+ color: PlussCore.Colours.COLOUR_LIGHTGREY
5690
+ }
5691
+ }, "By default, the form submission title will be the name of the person submitting the form. You can choose to select a different field to use as the title for the form submission."), /*#__PURE__*/React__default['default'].createElement("div", {
5672
5692
  className: "fields"
5673
5693
  }, customFields.map(function (field, fieldIndex) {
5674
5694
  return _this15.renderField(field, fieldIndex);
@@ -5694,7 +5714,10 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5694
5714
  warnings = _this$state6.warnings;
5695
5715
  if (!showWarnings || !warnings || warnings.length === 0) return null;
5696
5716
  return /*#__PURE__*/React__default['default'].createElement("div", {
5697
- className: "padding-40 paddingBottom-8 text-help"
5717
+ className: "padding-60 paddingVertical-8 text-bodyLarge",
5718
+ style: {
5719
+ color: PlussCore.Colours.COLOUR_RED
5720
+ }
5698
5721
  }, "To save the form", /*#__PURE__*/React__default['default'].createElement("ul", {
5699
5722
  style: {
5700
5723
  padding: 0,
@@ -5712,8 +5735,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5712
5735
  var _this$state7 = this.state,
5713
5736
  success = _this$state7.success,
5714
5737
  jobTypeId = _this$state7.jobTypeId;
5715
- if (!success) return null; // TODO: Replace name with configuration
5716
-
5738
+ if (!success) return null;
5717
5739
  return /*#__PURE__*/React__default['default'].createElement(Components$1.SuccessPopup, {
5718
5740
  text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
5719
5741
  buttons: [{
@@ -5754,7 +5776,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5754
5776
  return /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPage, null, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageContents, {
5755
5777
  noBottomButtons: success
5756
5778
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageSection, {
5757
- className: "pageSectionWrapper--newPopup"
5779
+ className: "pageSectionWrapper--newPopup pageSectionWrapper--newPopup950"
5758
5780
  }, /*#__PURE__*/React__default['default'].createElement("div", {
5759
5781
  className: "addForm"
5760
5782
  }, this.renderBaseForm(), this.renderWarnings(), this.renderCustomForm()), this.renderSuccess())), /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageBottomButtons, null, this.renderSubmit()));
package/dist/index.esm.js CHANGED
@@ -1106,7 +1106,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1106
1106
  label: "".concat(values.textEntityName, " No."),
1107
1107
  key: 'jobId'
1108
1108
  }, {
1109
- label: 'Type',
1109
+ label: values.textJobType,
1110
1110
  key: 'type'
1111
1111
  }, {
1112
1112
  label: 'Status',
@@ -1170,7 +1170,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1170
1170
 
1171
1171
  if (this.state.filterOpen === 'type') {
1172
1172
  return /*#__PURE__*/React.createElement(Components$6.Popup, {
1173
- title: "Select Type",
1173
+ title: "Select ".concat(values.textJobType),
1174
1174
  maxWidth: 600,
1175
1175
  minWidth: 400,
1176
1176
  hasPadding: true,
@@ -1441,7 +1441,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1441
1441
  onClick: function onClick() {
1442
1442
  _this4.sortByCol('title');
1443
1443
  }
1444
- }, "Request title", this.renderSort('title')), /*#__PURE__*/React.createElement("th", {
1444
+ }, "Title", this.renderSort('title')), /*#__PURE__*/React.createElement("th", {
1445
1445
  className: "".concat(this.sortIsActive('type')),
1446
1446
  style: {
1447
1447
  cursor: 'pointer',
@@ -1450,7 +1450,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1450
1450
  onClick: function onClick() {
1451
1451
  _this4.sortByCol('type');
1452
1452
  }
1453
- }, "Type", this.renderSort('type')), /*#__PURE__*/React.createElement("th", {
1453
+ }, values.textJobType, this.renderSort('type')), /*#__PURE__*/React.createElement("th", {
1454
1454
  className: "".concat(this.sortIsActive('createdUnix')),
1455
1455
  style: {
1456
1456
  cursor: 'pointer',
@@ -1497,7 +1497,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1497
1497
  onClick: function onClick() {
1498
1498
  _this5.openFilter('type');
1499
1499
  },
1500
- text: "Type"
1500
+ text: values.textJobType
1501
1501
  });
1502
1502
  var statusFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1503
1503
  className: "marginRight-10",
@@ -3774,6 +3774,10 @@ var AddJob = /*#__PURE__*/function (_Component) {
3774
3774
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
3775
3775
  };
3776
3776
 
3777
+ if (!_.isEmpty(update.customFields) && !_.some(update.customFields, 'isTitle')) {
3778
+ update.title = _this.state.selectedUser ? _this.state.selectedUser.displayName : '';
3779
+ }
3780
+
3777
3781
  _this.setState(update);
3778
3782
  });
3779
3783
 
@@ -3797,20 +3801,32 @@ var AddJob = /*#__PURE__*/function (_Component) {
3797
3801
  });
3798
3802
 
3799
3803
  _defineProperty(_assertThisInitialized(_this), "onSelectUser", function (user) {
3800
- _this.setState({
3804
+ var update = {
3801
3805
  selectedUser: user,
3802
3806
  userID: user.userId,
3803
3807
  userName: user.displayName,
3804
3808
  userFilterOpen: false
3805
- });
3809
+ };
3810
+
3811
+ if (!_.isEmpty(_this.state.customFields) && !_.some(_this.state.customFields, 'isTitle')) {
3812
+ update.title = user.displayName;
3813
+ }
3814
+
3815
+ _this.setState(update);
3806
3816
  });
3807
3817
 
3808
3818
  _defineProperty(_assertThisInitialized(_this), "onUnselectUser", function () {
3809
- _this.setState({
3819
+ var update = {
3810
3820
  selectedUser: null,
3811
3821
  userID: '',
3812
3822
  userName: ''
3813
- });
3823
+ };
3824
+
3825
+ if (!_.isEmpty(_this.state.customFields) && !_.some(_this.state.customFields, 'isTitle')) {
3826
+ update.title = '';
3827
+ }
3828
+
3829
+ _this.setState(update);
3814
3830
  });
3815
3831
 
3816
3832
  _defineProperty(_assertThisInitialized(_this), "onChangeAnswer", function (qId, answer) {
@@ -4592,7 +4608,7 @@ var AddJob = /*#__PURE__*/function (_Component) {
4592
4608
  }
4593
4609
  }, /*#__PURE__*/React.createElement(Components$2.Text, {
4594
4610
  type: "formLabel"
4595
- }, values.textJobType, " Type"), /*#__PURE__*/React.createElement(DropdownButton, {
4611
+ }, values.textJobType), /*#__PURE__*/React.createElement(DropdownButton, {
4596
4612
  style: {
4597
4613
  minWidth: 80
4598
4614
  },
@@ -5050,7 +5066,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5050
5066
  hasCustomFields: false,
5051
5067
  customFields: [_.cloneDeep(DEFAULT_FIELD)],
5052
5068
  jobTypeLevel: 1,
5053
- warnings: ['this is a test warning'],
5069
+ warnings: [],
5054
5070
  showWarnings: false,
5055
5071
  submitting: false,
5056
5072
  success: false
@@ -5107,9 +5123,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5107
5123
  warnings.push('There must be at least one required input');
5108
5124
  }
5109
5125
 
5110
- if (titleFieldCount === 0) {
5111
- warnings.push('One of the required inputs must be selected as title for the request');
5112
- } else if (titleFieldCount > 1) {
5126
+ if (titleFieldCount > 1) {
5113
5127
  warnings.push('Only one required input can be selected as title for the request');
5114
5128
  }
5115
5129
  }
@@ -5238,7 +5252,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5238
5252
 
5239
5253
  return /*#__PURE__*/React.createElement(Components$1.CheckBox, {
5240
5254
  id: "fieldTitle".concat(fieldIndex),
5241
- label: "Use this field as the title for any ".concat(values.textSingularName, " of this type"),
5255
+ label: "Use this field as the ".concat(values.textSingularName, " title"),
5242
5256
  isActive: field.isTitle,
5243
5257
  onChange: function onChange(e) {
5244
5258
  return _this4.onFieldIsTitleChanged(fieldIndex, e);
@@ -5625,7 +5639,13 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5625
5639
  if (success || !hasCustomFields) return null;
5626
5640
  return /*#__PURE__*/React.createElement("div", {
5627
5641
  className: "padding-60 paddingTop-8 paddingLeft-20"
5628
- }, /*#__PURE__*/React.createElement("div", {
5642
+ }, /*#__PURE__*/React.createElement(Components$1.Text, {
5643
+ type: "bodyLarge",
5644
+ className: "marginBottom-24 paddingLeft-40",
5645
+ style: {
5646
+ color: Colours$2.COLOUR_LIGHTGREY
5647
+ }
5648
+ }, "By default, the form submission title will be the name of the person submitting the form. You can choose to select a different field to use as the title for the form submission."), /*#__PURE__*/React.createElement("div", {
5629
5649
  className: "fields"
5630
5650
  }, customFields.map(function (field, fieldIndex) {
5631
5651
  return _this15.renderField(field, fieldIndex);
@@ -5651,7 +5671,10 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5651
5671
  warnings = _this$state6.warnings;
5652
5672
  if (!showWarnings || !warnings || warnings.length === 0) return null;
5653
5673
  return /*#__PURE__*/React.createElement("div", {
5654
- className: "padding-40 paddingBottom-8 text-help"
5674
+ className: "padding-60 paddingVertical-8 text-bodyLarge",
5675
+ style: {
5676
+ color: Colours$2.COLOUR_RED
5677
+ }
5655
5678
  }, "To save the form", /*#__PURE__*/React.createElement("ul", {
5656
5679
  style: {
5657
5680
  padding: 0,
@@ -5669,8 +5692,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5669
5692
  var _this$state7 = this.state,
5670
5693
  success = _this$state7.success,
5671
5694
  jobTypeId = _this$state7.jobTypeId;
5672
- if (!success) return null; // TODO: Replace name with configuration
5673
-
5695
+ if (!success) return null;
5674
5696
  return /*#__PURE__*/React.createElement(Components$1.SuccessPopup, {
5675
5697
  text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
5676
5698
  buttons: [{
@@ -5711,7 +5733,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5711
5733
  return /*#__PURE__*/React.createElement(Components$1.OverlayPage, null, /*#__PURE__*/React.createElement(Components$1.OverlayPageContents, {
5712
5734
  noBottomButtons: success
5713
5735
  }, /*#__PURE__*/React.createElement(Components$1.OverlayPageSection, {
5714
- className: "pageSectionWrapper--newPopup"
5736
+ className: "pageSectionWrapper--newPopup pageSectionWrapper--newPopup950"
5715
5737
  }, /*#__PURE__*/React.createElement("div", {
5716
5738
  className: "addForm"
5717
5739
  }, this.renderBaseForm(), this.renderWarnings(), this.renderCustomForm()), this.renderSuccess())), /*#__PURE__*/React.createElement(Components$1.OverlayPageBottomButtons, null, this.renderSubmit()));
package/dist/index.umd.js CHANGED
@@ -1128,7 +1128,7 @@
1128
1128
  label: "".concat(values.textEntityName, " No."),
1129
1129
  key: 'jobId'
1130
1130
  }, {
1131
- label: 'Type',
1131
+ label: values.textJobType,
1132
1132
  key: 'type'
1133
1133
  }, {
1134
1134
  label: 'Status',
@@ -1192,7 +1192,7 @@
1192
1192
 
1193
1193
  if (this.state.filterOpen === 'type') {
1194
1194
  return /*#__PURE__*/React__default['default'].createElement(Components$6.Popup, {
1195
- title: "Select Type",
1195
+ title: "Select ".concat(values.textJobType),
1196
1196
  maxWidth: 600,
1197
1197
  minWidth: 400,
1198
1198
  hasPadding: true,
@@ -1463,7 +1463,7 @@
1463
1463
  onClick: function onClick() {
1464
1464
  _this4.sortByCol('title');
1465
1465
  }
1466
- }, "Request title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1466
+ }, "Title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1467
1467
  className: "".concat(this.sortIsActive('type')),
1468
1468
  style: {
1469
1469
  cursor: 'pointer',
@@ -1472,7 +1472,7 @@
1472
1472
  onClick: function onClick() {
1473
1473
  _this4.sortByCol('type');
1474
1474
  }
1475
- }, "Type", this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1475
+ }, values.textJobType, this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1476
1476
  className: "".concat(this.sortIsActive('createdUnix')),
1477
1477
  style: {
1478
1478
  cursor: 'pointer',
@@ -1519,7 +1519,7 @@
1519
1519
  onClick: function onClick() {
1520
1520
  _this5.openFilter('type');
1521
1521
  },
1522
- text: "Type"
1522
+ text: values.textJobType
1523
1523
  });
1524
1524
  var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$6.Tag, {
1525
1525
  className: "marginRight-10",
@@ -3796,6 +3796,10 @@
3796
3796
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
3797
3797
  };
3798
3798
 
3799
+ if (!___default['default'].isEmpty(update.customFields) && !___default['default'].some(update.customFields, 'isTitle')) {
3800
+ update.title = _this.state.selectedUser ? _this.state.selectedUser.displayName : '';
3801
+ }
3802
+
3799
3803
  _this.setState(update);
3800
3804
  });
3801
3805
 
@@ -3819,20 +3823,32 @@
3819
3823
  });
3820
3824
 
3821
3825
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectUser", function (user) {
3822
- _this.setState({
3826
+ var update = {
3823
3827
  selectedUser: user,
3824
3828
  userID: user.userId,
3825
3829
  userName: user.displayName,
3826
3830
  userFilterOpen: false
3827
- });
3831
+ };
3832
+
3833
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3834
+ update.title = user.displayName;
3835
+ }
3836
+
3837
+ _this.setState(update);
3828
3838
  });
3829
3839
 
3830
3840
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onUnselectUser", function () {
3831
- _this.setState({
3841
+ var update = {
3832
3842
  selectedUser: null,
3833
3843
  userID: '',
3834
3844
  userName: ''
3835
- });
3845
+ };
3846
+
3847
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3848
+ update.title = '';
3849
+ }
3850
+
3851
+ _this.setState(update);
3836
3852
  });
3837
3853
 
3838
3854
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onChangeAnswer", function (qId, answer) {
@@ -4614,7 +4630,7 @@
4614
4630
  }
4615
4631
  }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
4616
4632
  type: "formLabel"
4617
- }, values.textJobType, " Type"), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4633
+ }, values.textJobType), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4618
4634
  style: {
4619
4635
  minWidth: 80
4620
4636
  },
@@ -5072,7 +5088,7 @@
5072
5088
  hasCustomFields: false,
5073
5089
  customFields: [___default['default'].cloneDeep(DEFAULT_FIELD)],
5074
5090
  jobTypeLevel: 1,
5075
- warnings: ['this is a test warning'],
5091
+ warnings: [],
5076
5092
  showWarnings: false,
5077
5093
  submitting: false,
5078
5094
  success: false
@@ -5129,9 +5145,7 @@
5129
5145
  warnings.push('There must be at least one required input');
5130
5146
  }
5131
5147
 
5132
- if (titleFieldCount === 0) {
5133
- warnings.push('One of the required inputs must be selected as title for the request');
5134
- } else if (titleFieldCount > 1) {
5148
+ if (titleFieldCount > 1) {
5135
5149
  warnings.push('Only one required input can be selected as title for the request');
5136
5150
  }
5137
5151
  }
@@ -5260,7 +5274,7 @@
5260
5274
 
5261
5275
  return /*#__PURE__*/React__default['default'].createElement(Components$1.CheckBox, {
5262
5276
  id: "fieldTitle".concat(fieldIndex),
5263
- label: "Use this field as the title for any ".concat(values.textSingularName, " of this type"),
5277
+ label: "Use this field as the ".concat(values.textSingularName, " title"),
5264
5278
  isActive: field.isTitle,
5265
5279
  onChange: function onChange(e) {
5266
5280
  return _this4.onFieldIsTitleChanged(fieldIndex, e);
@@ -5647,7 +5661,13 @@
5647
5661
  if (success || !hasCustomFields) return null;
5648
5662
  return /*#__PURE__*/React__default['default'].createElement("div", {
5649
5663
  className: "padding-60 paddingTop-8 paddingLeft-20"
5650
- }, /*#__PURE__*/React__default['default'].createElement("div", {
5664
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
5665
+ type: "bodyLarge",
5666
+ className: "marginBottom-24 paddingLeft-40",
5667
+ style: {
5668
+ color: PlussCore.Colours.COLOUR_LIGHTGREY
5669
+ }
5670
+ }, "By default, the form submission title will be the name of the person submitting the form. You can choose to select a different field to use as the title for the form submission."), /*#__PURE__*/React__default['default'].createElement("div", {
5651
5671
  className: "fields"
5652
5672
  }, customFields.map(function (field, fieldIndex) {
5653
5673
  return _this15.renderField(field, fieldIndex);
@@ -5673,7 +5693,10 @@
5673
5693
  warnings = _this$state6.warnings;
5674
5694
  if (!showWarnings || !warnings || warnings.length === 0) return null;
5675
5695
  return /*#__PURE__*/React__default['default'].createElement("div", {
5676
- className: "padding-40 paddingBottom-8 text-help"
5696
+ className: "padding-60 paddingVertical-8 text-bodyLarge",
5697
+ style: {
5698
+ color: PlussCore.Colours.COLOUR_RED
5699
+ }
5677
5700
  }, "To save the form", /*#__PURE__*/React__default['default'].createElement("ul", {
5678
5701
  style: {
5679
5702
  padding: 0,
@@ -5691,8 +5714,7 @@
5691
5714
  var _this$state7 = this.state,
5692
5715
  success = _this$state7.success,
5693
5716
  jobTypeId = _this$state7.jobTypeId;
5694
- if (!success) return null; // TODO: Replace name with configuration
5695
-
5717
+ if (!success) return null;
5696
5718
  return /*#__PURE__*/React__default['default'].createElement(Components$1.SuccessPopup, {
5697
5719
  text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
5698
5720
  buttons: [{
@@ -5733,7 +5755,7 @@
5733
5755
  return /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPage, null, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageContents, {
5734
5756
  noBottomButtons: success
5735
5757
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageSection, {
5736
- className: "pageSectionWrapper--newPopup"
5758
+ className: "pageSectionWrapper--newPopup pageSectionWrapper--newPopup950"
5737
5759
  }, /*#__PURE__*/React__default['default'].createElement("div", {
5738
5760
  className: "addForm"
5739
5761
  }, this.renderBaseForm(), this.renderWarnings(), this.renderCustomForm()), this.renderSuccess())), /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageBottomButtons, null, this.renderSubmit()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-web",
3
- "version": "1.1.20",
3
+ "version": "1.1.22-auth.0",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -9,12 +9,16 @@
9
9
  "patch": "npm version patch",
10
10
  "betaupload": "npm run build && npm publish --access public --tag beta && rm -rf node_modules",
11
11
  "betaupload:p": "npm run betapatch && npm run betaupload",
12
+ "authpatch": "npm version prepatch --preid=auth",
13
+ "authupload": "npm run build && npm publish --access public --tag auth && rm -rf node_modules",
14
+ "authupload:p": "npm run authpatch && npm run authupload",
12
15
  "upload": "npm run build && npm publish --access public && rm -rf node_modules",
13
16
  "upload:p": "npm run patch && npm run upload",
14
17
  "copy:add": "run(){ ext=${1:-default}; test -f src/values.config.$ext.js || cp src/values.config.default.js src/values.config.$ext.js; }; run",
15
18
  "copy:get": "echo $npm_package_name",
16
19
  "copy:set": "run(){ target='\\@plusscommunities\\/pluss-maintenance-web'; ext=${1:-default}; [ $ext == 'default' ] && replace=$target || replace=$target'-'$ext; echo 'Setting target to '$replace; test -f src/values.config.$ext.js && cp -f src/values.config.$ext.js src/values.config.js; sed -i '' -e 's/'$target'.*\"/'$replace'\"/g' package.json; }; run",
17
20
  "copy:betaupload": "npm run betapatch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run betaupload; done; npm run copy:set;",
21
+ "copy:authupload": "npm run authpatch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run authupload; done; npm run copy:set;",
18
22
  "copy:upload": "npm run patch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run upload; done; npm run copy:set;"
19
23
  },
20
24
  "author": "Phillip Suh",
@@ -37,7 +41,7 @@
37
41
  "@babel/runtime": "^7.14.0"
38
42
  },
39
43
  "peerDependencies": {
40
- "@plusscommunities/pluss-core-web": "^1.4.33",
44
+ "@plusscommunities/pluss-core-web": "^1.6.5-auth.0",
41
45
  "@fortawesome/fontawesome-svg-core": "^6.4.0",
42
46
  "@fortawesome/free-solid-svg-icons": "^6.4.0",
43
47
  "@fortawesome/react-fontawesome": "^0.2.0",
@@ -48,7 +52,7 @@
48
52
  "react-bootstrap": "^0.31.2",
49
53
  "react-dom": "^16.14.0",
50
54
  "react-fontawesome": "^1.6.1",
51
- "react-redux": "^5.0.6",
55
+ "react-redux": "^7.2.9",
52
56
  "react-router-dom": "^4.2.2",
53
57
  "react-textarea-autosize": "^7.1.0-1"
54
58
  },
@@ -30,7 +30,7 @@ class JobList extends Component {
30
30
  { label: 'Select All', key: '' },
31
31
  { label: 'System Id', key: 'id' },
32
32
  { label: `${values.textEntityName} No.`, key: 'jobId' },
33
- { label: 'Type', key: 'type' },
33
+ { label: values.textJobType, key: 'type' },
34
34
  { label: 'Status', key: 'status' },
35
35
  { label: 'Title', key: 'title' },
36
36
  { label: 'Address', key: 'room' },
@@ -381,7 +381,7 @@ class JobList extends Component {
381
381
  }
382
382
  if (this.state.filterOpen === 'type') {
383
383
  return (
384
- <Components.Popup title="Select Type" maxWidth={600} minWidth={400} hasPadding onClose={this.closeFilter}>
384
+ <Components.Popup title={`Select ${values.textJobType}`} maxWidth={600} minWidth={400} hasPadding onClose={this.closeFilter}>
385
385
  {_.sortBy(_.uniq(this.props.source.map((r) => r.type)), (t) => t.toLowerCase()).map((type) => {
386
386
  return (
387
387
  <Components.Tag
@@ -624,7 +624,7 @@ class JobList extends Component {
624
624
  this.sortByCol('title');
625
625
  }}
626
626
  >
627
- Request title{this.renderSort('title')}
627
+ Title{this.renderSort('title')}
628
628
  </th>
629
629
  <th
630
630
  className={`${this.sortIsActive('type')}`}
@@ -633,7 +633,8 @@ class JobList extends Component {
633
633
  this.sortByCol('type');
634
634
  }}
635
635
  >
636
- Type{this.renderSort('type')}
636
+ {values.textJobType}
637
+ {this.renderSort('type')}
637
638
  </th>
638
639
  <th
639
640
  className={`${this.sortIsActive('createdUnix')}`}
@@ -679,7 +680,7 @@ class JobList extends Component {
679
680
  onClick={() => {
680
681
  this.openFilter('type');
681
682
  }}
682
- text="Type"
683
+ text={values.textJobType}
683
684
  />
684
685
  );
685
686
  let statusFilter = (
@@ -157,6 +157,10 @@ class AddJob extends Component {
157
157
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : [],
158
158
  };
159
159
 
160
+ if (!_.isEmpty(update.customFields) && !_.some(update.customFields, 'isTitle')) {
161
+ update.title = this.state.selectedUser ? this.state.selectedUser.displayName : '';
162
+ }
163
+
160
164
  this.setState(update);
161
165
  };
162
166
 
@@ -189,11 +193,19 @@ class AddJob extends Component {
189
193
  };
190
194
 
191
195
  onSelectUser = (user) => {
192
- this.setState({ selectedUser: user, userID: user.userId, userName: user.displayName, userFilterOpen: false });
196
+ const update = { selectedUser: user, userID: user.userId, userName: user.displayName, userFilterOpen: false };
197
+ if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields, 'isTitle')) {
198
+ update.title = user.displayName;
199
+ }
200
+ this.setState(update);
193
201
  };
194
202
 
195
203
  onUnselectUser = () => {
196
- this.setState({ selectedUser: null, userID: '', userName: '' });
204
+ const update = { selectedUser: null, userID: '', userName: '' };
205
+ if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields, 'isTitle')) {
206
+ update.title = '';
207
+ }
208
+ this.setState(update);
197
209
  };
198
210
 
199
211
  onChangeAnswer = (qId, answer) => {
@@ -763,7 +775,7 @@ class AddJob extends Component {
763
775
  }}
764
776
  />
765
777
  <div style={{ marginBottom: 15 }}>
766
- <Components.Text type="formLabel">{values.textJobType} Type</Components.Text>
778
+ <Components.Text type="formLabel">{values.textJobType}</Components.Text>
767
779
  <DropdownButton style={{ minWidth: 80 }} bsStyle="default" title={this.state.type} id="typeSelect" onSelect={this.onSelectType}>
768
780
  {this.renderTypeOptions()}
769
781
  </DropdownButton>
@@ -8,6 +8,7 @@ import { PlussCore } from '../feature.config';
8
8
  import { jobTypesUpdate } from '../actions';
9
9
  import { maintenanceActions } from '../apis';
10
10
  import { values } from '../values.config';
11
+ import { Colours } from '@plusscommunities/pluss-core-web';
11
12
 
12
13
  const { Components, Session, Helper } = PlussCore;
13
14
  const DEFAULT_FIELD = { type: 'text', label: '', mandatory: false, isTitle: false, values: [''] };
@@ -72,7 +73,7 @@ class AddJobType extends Component {
72
73
  hasCustomFields: values.forceCustomFields ? true : false,
73
74
  customFields: [_.cloneDeep(DEFAULT_FIELD)],
74
75
  jobTypeLevel: 1,
75
- warnings: ['this is a test warning'],
76
+ warnings: [],
76
77
  showWarnings: false,
77
78
  submitting: false,
78
79
  success: false,
@@ -153,9 +154,7 @@ class AddJobType extends Component {
153
154
  if (!hasMandatoryField) {
154
155
  warnings.push('There must be at least one required input');
155
156
  }
156
- if (titleFieldCount === 0) {
157
- warnings.push('One of the required inputs must be selected as title for the request');
158
- } else if (titleFieldCount > 1) {
157
+ if (titleFieldCount > 1) {
159
158
  warnings.push('Only one required input can be selected as title for the request');
160
159
  }
161
160
  }
@@ -406,7 +405,7 @@ class AddJobType extends Component {
406
405
  return (
407
406
  <Components.CheckBox
408
407
  id={`fieldTitle${fieldIndex}`}
409
- label={`Use this field as the title for any ${values.textSingularName} of this type`}
408
+ label={`Use this field as the ${values.textSingularName} title`}
410
409
  isActive={field.isTitle}
411
410
  onChange={(e) => this.onFieldIsTitleChanged(fieldIndex, e)}
412
411
  />
@@ -748,6 +747,10 @@ class AddJobType extends Component {
748
747
 
749
748
  return (
750
749
  <div className="padding-60 paddingTop-8 paddingLeft-20">
750
+ <Components.Text type="bodyLarge" className="marginBottom-24 paddingLeft-40" style={{ color: Colours.COLOUR_LIGHTGREY }}>
751
+ By default, the form submission title will be the name of the person submitting the form. You can choose to select a different
752
+ field to use as the title for the form submission.
753
+ </Components.Text>
751
754
  <div className="fields">
752
755
  {customFields.map((field, fieldIndex) => this.renderField(field, fieldIndex))}
753
756
  <div className="clearfix addoption addField" onClick={() => this.onAddNewField()}>
@@ -766,7 +769,7 @@ class AddJobType extends Component {
766
769
  if (!showWarnings || !warnings || warnings.length === 0) return null;
767
770
 
768
771
  return (
769
- <div className="padding-40 paddingBottom-8 text-help">
772
+ <div className="padding-60 paddingVertical-8 text-bodyLarge" style={{ color: Colours.COLOUR_RED }}>
770
773
  To save the form
771
774
  <ul style={{ padding: 0, paddingLeft: 16 }}>
772
775
  {warnings.map((warn, index) => (
@@ -781,7 +784,6 @@ class AddJobType extends Component {
781
784
  const { success, jobTypeId } = this.state;
782
785
  if (!success) return null;
783
786
 
784
- // TODO: Replace name with configuration
785
787
  return (
786
788
  <Components.SuccessPopup
787
789
  text={`${`${values.textJobType}`} has been ${!jobTypeId ? 'added' : 'edited'}`}
@@ -818,7 +820,7 @@ class AddJobType extends Component {
818
820
  return (
819
821
  <Components.OverlayPage>
820
822
  <Components.OverlayPageContents noBottomButtons={success}>
821
- <Components.OverlayPageSection className="pageSectionWrapper--newPopup">
823
+ <Components.OverlayPageSection className="pageSectionWrapper--newPopup pageSectionWrapper--newPopup950">
822
824
  <div className="addForm">
823
825
  {this.renderBaseForm()}
824
826
  {this.renderWarnings()}
@@ -148,7 +148,7 @@ class RequestsHub extends Component {
148
148
  const helpGuide = values.hasHelpButton
149
149
  ? {
150
150
  text: `Help with ${values.textTitleRequests}`,
151
- url: Urls.HelpGuide.Maintenance,
151
+ url: values.helpGuideURL || Urls.HelpGuide.Maintenance,
152
152
  }
153
153
  : null;
154
154
 
@@ -61,7 +61,8 @@ const values = {
61
61
  hiddenKeyMoreSectionMaintenance: 'maintenanceRequestForms',
62
62
  forceCustomFields: true,
63
63
  textEntityName: 'Form Submission',
64
- hasHelpButton: false,
64
+ hasHelpButton: true,
65
+ helpGuideURL: 'https://www.plusscommunities.com/forms-feature',
65
66
  };
66
67
 
67
68
  export { values };