@plusscommunities/pluss-maintenance-web-forms 1.1.20-beta.0 → 1.1.21

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
@@ -1143,7 +1143,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1143
1143
  label: "".concat(values.textEntityName, " No."),
1144
1144
  key: 'jobId'
1145
1145
  }, {
1146
- label: 'Type',
1146
+ label: values.textJobType,
1147
1147
  key: 'type'
1148
1148
  }, {
1149
1149
  label: 'Status',
@@ -1207,7 +1207,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1207
1207
 
1208
1208
  if (this.state.filterOpen === 'type') {
1209
1209
  return /*#__PURE__*/React__default['default'].createElement(Components$6.Popup, {
1210
- title: "Select Type",
1210
+ title: "Select ".concat(values.textJobType),
1211
1211
  maxWidth: 600,
1212
1212
  minWidth: 400,
1213
1213
  hasPadding: true,
@@ -1478,7 +1478,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1478
1478
  onClick: function onClick() {
1479
1479
  _this4.sortByCol('title');
1480
1480
  }
1481
- }, "Request title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1481
+ }, "Title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1482
1482
  className: "".concat(this.sortIsActive('type')),
1483
1483
  style: {
1484
1484
  cursor: 'pointer',
@@ -1487,7 +1487,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1487
1487
  onClick: function onClick() {
1488
1488
  _this4.sortByCol('type');
1489
1489
  }
1490
- }, "Type", this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1490
+ }, values.textJobType, this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1491
1491
  className: "".concat(this.sortIsActive('createdUnix')),
1492
1492
  style: {
1493
1493
  cursor: 'pointer',
@@ -1534,7 +1534,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1534
1534
  onClick: function onClick() {
1535
1535
  _this5.openFilter('type');
1536
1536
  },
1537
- text: "Type"
1537
+ text: values.textJobType
1538
1538
  });
1539
1539
  var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$6.Tag, {
1540
1540
  className: "marginRight-10",
@@ -3807,6 +3807,10 @@ var AddJob = /*#__PURE__*/function (_Component) {
3807
3807
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
3808
3808
  };
3809
3809
 
3810
+ if (!___default['default'].isEmpty(update.customFields) && !___default['default'].some(update.customFields, 'isTitle')) {
3811
+ update.title = _this.state.selectedUser ? _this.state.selectedUser.displayName : '';
3812
+ }
3813
+
3810
3814
  _this.setState(update);
3811
3815
  });
3812
3816
 
@@ -3830,20 +3834,32 @@ var AddJob = /*#__PURE__*/function (_Component) {
3830
3834
  });
3831
3835
 
3832
3836
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectUser", function (user) {
3833
- _this.setState({
3837
+ var update = {
3834
3838
  selectedUser: user,
3835
3839
  userID: user.userId,
3836
3840
  userName: user.displayName,
3837
3841
  userFilterOpen: false
3838
- });
3842
+ };
3843
+
3844
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3845
+ update.title = user.displayName;
3846
+ }
3847
+
3848
+ _this.setState(update);
3839
3849
  });
3840
3850
 
3841
3851
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onUnselectUser", function () {
3842
- _this.setState({
3852
+ var update = {
3843
3853
  selectedUser: null,
3844
3854
  userID: '',
3845
3855
  userName: ''
3846
- });
3856
+ };
3857
+
3858
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3859
+ update.title = '';
3860
+ }
3861
+
3862
+ _this.setState(update);
3847
3863
  });
3848
3864
 
3849
3865
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onChangeAnswer", function (qId, answer) {
@@ -4625,7 +4641,7 @@ var AddJob = /*#__PURE__*/function (_Component) {
4625
4641
  }
4626
4642
  }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
4627
4643
  type: "formLabel"
4628
- }, values.textJobType, " Type"), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4644
+ }, values.textJobType), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4629
4645
  style: {
4630
4646
  minWidth: 80
4631
4647
  },
@@ -5083,7 +5099,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5083
5099
  hasCustomFields: true ,
5084
5100
  customFields: [___default['default'].cloneDeep(DEFAULT_FIELD)],
5085
5101
  jobTypeLevel: 1,
5086
- warnings: ['this is a test warning'],
5102
+ warnings: [],
5087
5103
  showWarnings: false,
5088
5104
  submitting: false,
5089
5105
  success: false
@@ -5140,9 +5156,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5140
5156
  warnings.push('There must be at least one required input');
5141
5157
  }
5142
5158
 
5143
- if (titleFieldCount === 0) {
5144
- warnings.push('One of the required inputs must be selected as title for the request');
5145
- } else if (titleFieldCount > 1) {
5159
+ if (titleFieldCount > 1) {
5146
5160
  warnings.push('Only one required input can be selected as title for the request');
5147
5161
  }
5148
5162
  }
@@ -5251,7 +5265,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5251
5265
 
5252
5266
  return /*#__PURE__*/React__default['default'].createElement(Components$1.CheckBox, {
5253
5267
  id: "fieldTitle".concat(fieldIndex),
5254
- label: "Use this field as the title for any ".concat(values.textSingularName, " of this type"),
5268
+ label: "Use this field as the ".concat(values.textSingularName, " title"),
5255
5269
  isActive: field.isTitle,
5256
5270
  onChange: function onChange(e) {
5257
5271
  return _this4.onFieldIsTitleChanged(fieldIndex, e);
@@ -5638,7 +5652,13 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5638
5652
  if (success || !hasCustomFields) return null;
5639
5653
  return /*#__PURE__*/React__default['default'].createElement("div", {
5640
5654
  className: "padding-60 paddingTop-8 paddingLeft-20"
5641
- }, /*#__PURE__*/React__default['default'].createElement("div", {
5655
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
5656
+ type: "bodyLarge",
5657
+ className: "marginBottom-24 paddingLeft-40",
5658
+ style: {
5659
+ color: PlussCore.Colours.COLOUR_LIGHTGREY
5660
+ }
5661
+ }, "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", {
5642
5662
  className: "fields"
5643
5663
  }, customFields.map(function (field, fieldIndex) {
5644
5664
  return _this15.renderField(field, fieldIndex);
@@ -5664,7 +5684,10 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5664
5684
  warnings = _this$state6.warnings;
5665
5685
  if (!showWarnings || !warnings || warnings.length === 0) return null;
5666
5686
  return /*#__PURE__*/React__default['default'].createElement("div", {
5667
- className: "padding-40 paddingBottom-8 text-help"
5687
+ className: "padding-60 paddingVertical-8 text-bodyLarge",
5688
+ style: {
5689
+ color: PlussCore.Colours.COLOUR_RED
5690
+ }
5668
5691
  }, "To save the form", /*#__PURE__*/React__default['default'].createElement("ul", {
5669
5692
  style: {
5670
5693
  padding: 0,
@@ -5682,8 +5705,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5682
5705
  var _this$state7 = this.state,
5683
5706
  success = _this$state7.success,
5684
5707
  jobTypeId = _this$state7.jobTypeId;
5685
- if (!success) return null; // TODO: Replace name with configuration
5686
-
5708
+ if (!success) return null;
5687
5709
  return /*#__PURE__*/React__default['default'].createElement(Components$1.SuccessPopup, {
5688
5710
  text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
5689
5711
  buttons: [{
@@ -5724,7 +5746,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5724
5746
  return /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPage, null, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageContents, {
5725
5747
  noBottomButtons: success
5726
5748
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageSection, {
5727
- className: "pageSectionWrapper--newPopup"
5749
+ className: "pageSectionWrapper--newPopup pageSectionWrapper--newPopup950"
5728
5750
  }, /*#__PURE__*/React__default['default'].createElement("div", {
5729
5751
  className: "addForm"
5730
5752
  }, 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
@@ -1100,7 +1100,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1100
1100
  label: "".concat(values.textEntityName, " No."),
1101
1101
  key: 'jobId'
1102
1102
  }, {
1103
- label: 'Type',
1103
+ label: values.textJobType,
1104
1104
  key: 'type'
1105
1105
  }, {
1106
1106
  label: 'Status',
@@ -1164,7 +1164,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1164
1164
 
1165
1165
  if (this.state.filterOpen === 'type') {
1166
1166
  return /*#__PURE__*/React.createElement(Components$6.Popup, {
1167
- title: "Select Type",
1167
+ title: "Select ".concat(values.textJobType),
1168
1168
  maxWidth: 600,
1169
1169
  minWidth: 400,
1170
1170
  hasPadding: true,
@@ -1435,7 +1435,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1435
1435
  onClick: function onClick() {
1436
1436
  _this4.sortByCol('title');
1437
1437
  }
1438
- }, "Request title", this.renderSort('title')), /*#__PURE__*/React.createElement("th", {
1438
+ }, "Title", this.renderSort('title')), /*#__PURE__*/React.createElement("th", {
1439
1439
  className: "".concat(this.sortIsActive('type')),
1440
1440
  style: {
1441
1441
  cursor: 'pointer',
@@ -1444,7 +1444,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1444
1444
  onClick: function onClick() {
1445
1445
  _this4.sortByCol('type');
1446
1446
  }
1447
- }, "Type", this.renderSort('type')), /*#__PURE__*/React.createElement("th", {
1447
+ }, values.textJobType, this.renderSort('type')), /*#__PURE__*/React.createElement("th", {
1448
1448
  className: "".concat(this.sortIsActive('createdUnix')),
1449
1449
  style: {
1450
1450
  cursor: 'pointer',
@@ -1491,7 +1491,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1491
1491
  onClick: function onClick() {
1492
1492
  _this5.openFilter('type');
1493
1493
  },
1494
- text: "Type"
1494
+ text: values.textJobType
1495
1495
  });
1496
1496
  var statusFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1497
1497
  className: "marginRight-10",
@@ -3764,6 +3764,10 @@ var AddJob = /*#__PURE__*/function (_Component) {
3764
3764
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
3765
3765
  };
3766
3766
 
3767
+ if (!_.isEmpty(update.customFields) && !_.some(update.customFields, 'isTitle')) {
3768
+ update.title = _this.state.selectedUser ? _this.state.selectedUser.displayName : '';
3769
+ }
3770
+
3767
3771
  _this.setState(update);
3768
3772
  });
3769
3773
 
@@ -3787,20 +3791,32 @@ var AddJob = /*#__PURE__*/function (_Component) {
3787
3791
  });
3788
3792
 
3789
3793
  _defineProperty(_assertThisInitialized(_this), "onSelectUser", function (user) {
3790
- _this.setState({
3794
+ var update = {
3791
3795
  selectedUser: user,
3792
3796
  userID: user.userId,
3793
3797
  userName: user.displayName,
3794
3798
  userFilterOpen: false
3795
- });
3799
+ };
3800
+
3801
+ if (!_.isEmpty(_this.state.customFields) && !_.some(_this.state.customFields, 'isTitle')) {
3802
+ update.title = user.displayName;
3803
+ }
3804
+
3805
+ _this.setState(update);
3796
3806
  });
3797
3807
 
3798
3808
  _defineProperty(_assertThisInitialized(_this), "onUnselectUser", function () {
3799
- _this.setState({
3809
+ var update = {
3800
3810
  selectedUser: null,
3801
3811
  userID: '',
3802
3812
  userName: ''
3803
- });
3813
+ };
3814
+
3815
+ if (!_.isEmpty(_this.state.customFields) && !_.some(_this.state.customFields, 'isTitle')) {
3816
+ update.title = '';
3817
+ }
3818
+
3819
+ _this.setState(update);
3804
3820
  });
3805
3821
 
3806
3822
  _defineProperty(_assertThisInitialized(_this), "onChangeAnswer", function (qId, answer) {
@@ -4582,7 +4598,7 @@ var AddJob = /*#__PURE__*/function (_Component) {
4582
4598
  }
4583
4599
  }, /*#__PURE__*/React.createElement(Components$2.Text, {
4584
4600
  type: "formLabel"
4585
- }, values.textJobType, " Type"), /*#__PURE__*/React.createElement(DropdownButton, {
4601
+ }, values.textJobType), /*#__PURE__*/React.createElement(DropdownButton, {
4586
4602
  style: {
4587
4603
  minWidth: 80
4588
4604
  },
@@ -5040,7 +5056,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5040
5056
  hasCustomFields: true ,
5041
5057
  customFields: [_.cloneDeep(DEFAULT_FIELD)],
5042
5058
  jobTypeLevel: 1,
5043
- warnings: ['this is a test warning'],
5059
+ warnings: [],
5044
5060
  showWarnings: false,
5045
5061
  submitting: false,
5046
5062
  success: false
@@ -5097,9 +5113,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5097
5113
  warnings.push('There must be at least one required input');
5098
5114
  }
5099
5115
 
5100
- if (titleFieldCount === 0) {
5101
- warnings.push('One of the required inputs must be selected as title for the request');
5102
- } else if (titleFieldCount > 1) {
5116
+ if (titleFieldCount > 1) {
5103
5117
  warnings.push('Only one required input can be selected as title for the request');
5104
5118
  }
5105
5119
  }
@@ -5208,7 +5222,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5208
5222
 
5209
5223
  return /*#__PURE__*/React.createElement(Components$1.CheckBox, {
5210
5224
  id: "fieldTitle".concat(fieldIndex),
5211
- label: "Use this field as the title for any ".concat(values.textSingularName, " of this type"),
5225
+ label: "Use this field as the ".concat(values.textSingularName, " title"),
5212
5226
  isActive: field.isTitle,
5213
5227
  onChange: function onChange(e) {
5214
5228
  return _this4.onFieldIsTitleChanged(fieldIndex, e);
@@ -5595,7 +5609,13 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5595
5609
  if (success || !hasCustomFields) return null;
5596
5610
  return /*#__PURE__*/React.createElement("div", {
5597
5611
  className: "padding-60 paddingTop-8 paddingLeft-20"
5598
- }, /*#__PURE__*/React.createElement("div", {
5612
+ }, /*#__PURE__*/React.createElement(Components$1.Text, {
5613
+ type: "bodyLarge",
5614
+ className: "marginBottom-24 paddingLeft-40",
5615
+ style: {
5616
+ color: Colours$2.COLOUR_LIGHTGREY
5617
+ }
5618
+ }, "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", {
5599
5619
  className: "fields"
5600
5620
  }, customFields.map(function (field, fieldIndex) {
5601
5621
  return _this15.renderField(field, fieldIndex);
@@ -5621,7 +5641,10 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5621
5641
  warnings = _this$state6.warnings;
5622
5642
  if (!showWarnings || !warnings || warnings.length === 0) return null;
5623
5643
  return /*#__PURE__*/React.createElement("div", {
5624
- className: "padding-40 paddingBottom-8 text-help"
5644
+ className: "padding-60 paddingVertical-8 text-bodyLarge",
5645
+ style: {
5646
+ color: Colours$2.COLOUR_RED
5647
+ }
5625
5648
  }, "To save the form", /*#__PURE__*/React.createElement("ul", {
5626
5649
  style: {
5627
5650
  padding: 0,
@@ -5639,8 +5662,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5639
5662
  var _this$state7 = this.state,
5640
5663
  success = _this$state7.success,
5641
5664
  jobTypeId = _this$state7.jobTypeId;
5642
- if (!success) return null; // TODO: Replace name with configuration
5643
-
5665
+ if (!success) return null;
5644
5666
  return /*#__PURE__*/React.createElement(Components$1.SuccessPopup, {
5645
5667
  text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
5646
5668
  buttons: [{
@@ -5681,7 +5703,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5681
5703
  return /*#__PURE__*/React.createElement(Components$1.OverlayPage, null, /*#__PURE__*/React.createElement(Components$1.OverlayPageContents, {
5682
5704
  noBottomButtons: success
5683
5705
  }, /*#__PURE__*/React.createElement(Components$1.OverlayPageSection, {
5684
- className: "pageSectionWrapper--newPopup"
5706
+ className: "pageSectionWrapper--newPopup pageSectionWrapper--newPopup950"
5685
5707
  }, /*#__PURE__*/React.createElement("div", {
5686
5708
  className: "addForm"
5687
5709
  }, this.renderBaseForm(), this.renderWarnings(), this.renderCustomForm()), this.renderSuccess())), /*#__PURE__*/React.createElement(Components$1.OverlayPageBottomButtons, null, this.renderSubmit()));
package/dist/index.umd.js CHANGED
@@ -1122,7 +1122,7 @@
1122
1122
  label: "".concat(values.textEntityName, " No."),
1123
1123
  key: 'jobId'
1124
1124
  }, {
1125
- label: 'Type',
1125
+ label: values.textJobType,
1126
1126
  key: 'type'
1127
1127
  }, {
1128
1128
  label: 'Status',
@@ -1186,7 +1186,7 @@
1186
1186
 
1187
1187
  if (this.state.filterOpen === 'type') {
1188
1188
  return /*#__PURE__*/React__default['default'].createElement(Components$6.Popup, {
1189
- title: "Select Type",
1189
+ title: "Select ".concat(values.textJobType),
1190
1190
  maxWidth: 600,
1191
1191
  minWidth: 400,
1192
1192
  hasPadding: true,
@@ -1457,7 +1457,7 @@
1457
1457
  onClick: function onClick() {
1458
1458
  _this4.sortByCol('title');
1459
1459
  }
1460
- }, "Request title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1460
+ }, "Title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1461
1461
  className: "".concat(this.sortIsActive('type')),
1462
1462
  style: {
1463
1463
  cursor: 'pointer',
@@ -1466,7 +1466,7 @@
1466
1466
  onClick: function onClick() {
1467
1467
  _this4.sortByCol('type');
1468
1468
  }
1469
- }, "Type", this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1469
+ }, values.textJobType, this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1470
1470
  className: "".concat(this.sortIsActive('createdUnix')),
1471
1471
  style: {
1472
1472
  cursor: 'pointer',
@@ -1513,7 +1513,7 @@
1513
1513
  onClick: function onClick() {
1514
1514
  _this5.openFilter('type');
1515
1515
  },
1516
- text: "Type"
1516
+ text: values.textJobType
1517
1517
  });
1518
1518
  var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$6.Tag, {
1519
1519
  className: "marginRight-10",
@@ -3786,6 +3786,10 @@
3786
3786
  customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
3787
3787
  };
3788
3788
 
3789
+ if (!___default['default'].isEmpty(update.customFields) && !___default['default'].some(update.customFields, 'isTitle')) {
3790
+ update.title = _this.state.selectedUser ? _this.state.selectedUser.displayName : '';
3791
+ }
3792
+
3789
3793
  _this.setState(update);
3790
3794
  });
3791
3795
 
@@ -3809,20 +3813,32 @@
3809
3813
  });
3810
3814
 
3811
3815
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectUser", function (user) {
3812
- _this.setState({
3816
+ var update = {
3813
3817
  selectedUser: user,
3814
3818
  userID: user.userId,
3815
3819
  userName: user.displayName,
3816
3820
  userFilterOpen: false
3817
- });
3821
+ };
3822
+
3823
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3824
+ update.title = user.displayName;
3825
+ }
3826
+
3827
+ _this.setState(update);
3818
3828
  });
3819
3829
 
3820
3830
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onUnselectUser", function () {
3821
- _this.setState({
3831
+ var update = {
3822
3832
  selectedUser: null,
3823
3833
  userID: '',
3824
3834
  userName: ''
3825
- });
3835
+ };
3836
+
3837
+ if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
3838
+ update.title = '';
3839
+ }
3840
+
3841
+ _this.setState(update);
3826
3842
  });
3827
3843
 
3828
3844
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onChangeAnswer", function (qId, answer) {
@@ -4604,7 +4620,7 @@
4604
4620
  }
4605
4621
  }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
4606
4622
  type: "formLabel"
4607
- }, values.textJobType, " Type"), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4623
+ }, values.textJobType), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.DropdownButton, {
4608
4624
  style: {
4609
4625
  minWidth: 80
4610
4626
  },
@@ -5062,7 +5078,7 @@
5062
5078
  hasCustomFields: true ,
5063
5079
  customFields: [___default['default'].cloneDeep(DEFAULT_FIELD)],
5064
5080
  jobTypeLevel: 1,
5065
- warnings: ['this is a test warning'],
5081
+ warnings: [],
5066
5082
  showWarnings: false,
5067
5083
  submitting: false,
5068
5084
  success: false
@@ -5119,9 +5135,7 @@
5119
5135
  warnings.push('There must be at least one required input');
5120
5136
  }
5121
5137
 
5122
- if (titleFieldCount === 0) {
5123
- warnings.push('One of the required inputs must be selected as title for the request');
5124
- } else if (titleFieldCount > 1) {
5138
+ if (titleFieldCount > 1) {
5125
5139
  warnings.push('Only one required input can be selected as title for the request');
5126
5140
  }
5127
5141
  }
@@ -5230,7 +5244,7 @@
5230
5244
 
5231
5245
  return /*#__PURE__*/React__default['default'].createElement(Components$1.CheckBox, {
5232
5246
  id: "fieldTitle".concat(fieldIndex),
5233
- label: "Use this field as the title for any ".concat(values.textSingularName, " of this type"),
5247
+ label: "Use this field as the ".concat(values.textSingularName, " title"),
5234
5248
  isActive: field.isTitle,
5235
5249
  onChange: function onChange(e) {
5236
5250
  return _this4.onFieldIsTitleChanged(fieldIndex, e);
@@ -5617,7 +5631,13 @@
5617
5631
  if (success || !hasCustomFields) return null;
5618
5632
  return /*#__PURE__*/React__default['default'].createElement("div", {
5619
5633
  className: "padding-60 paddingTop-8 paddingLeft-20"
5620
- }, /*#__PURE__*/React__default['default'].createElement("div", {
5634
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
5635
+ type: "bodyLarge",
5636
+ className: "marginBottom-24 paddingLeft-40",
5637
+ style: {
5638
+ color: PlussCore.Colours.COLOUR_LIGHTGREY
5639
+ }
5640
+ }, "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", {
5621
5641
  className: "fields"
5622
5642
  }, customFields.map(function (field, fieldIndex) {
5623
5643
  return _this15.renderField(field, fieldIndex);
@@ -5643,7 +5663,10 @@
5643
5663
  warnings = _this$state6.warnings;
5644
5664
  if (!showWarnings || !warnings || warnings.length === 0) return null;
5645
5665
  return /*#__PURE__*/React__default['default'].createElement("div", {
5646
- className: "padding-40 paddingBottom-8 text-help"
5666
+ className: "padding-60 paddingVertical-8 text-bodyLarge",
5667
+ style: {
5668
+ color: PlussCore.Colours.COLOUR_RED
5669
+ }
5647
5670
  }, "To save the form", /*#__PURE__*/React__default['default'].createElement("ul", {
5648
5671
  style: {
5649
5672
  padding: 0,
@@ -5661,8 +5684,7 @@
5661
5684
  var _this$state7 = this.state,
5662
5685
  success = _this$state7.success,
5663
5686
  jobTypeId = _this$state7.jobTypeId;
5664
- if (!success) return null; // TODO: Replace name with configuration
5665
-
5687
+ if (!success) return null;
5666
5688
  return /*#__PURE__*/React__default['default'].createElement(Components$1.SuccessPopup, {
5667
5689
  text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
5668
5690
  buttons: [{
@@ -5703,7 +5725,7 @@
5703
5725
  return /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPage, null, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageContents, {
5704
5726
  noBottomButtons: success
5705
5727
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPageSection, {
5706
- className: "pageSectionWrapper--newPopup"
5728
+ className: "pageSectionWrapper--newPopup pageSectionWrapper--newPopup950"
5707
5729
  }, /*#__PURE__*/React__default['default'].createElement("div", {
5708
5730
  className: "addForm"
5709
5731
  }, 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-forms",
3
- "version": "1.1.20-beta.0",
3
+ "version": "1.1.21",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -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()}