@plusscommunities/pluss-maintenance-web-a 1.2.2-beta.0 → 1.2.3-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.umd.js CHANGED
@@ -72,6 +72,9 @@
72
72
  svgPathGridIcon: 'M22.7072 2.33998C20.5868 2.30886 18.2156 3.43862 16.824 4.83022C15.1138 6.54042 15.1486 8.34584 15.7894 10.5065L13.2058 13.0901L7.7566 7.64089C7.75294 7.60976 7.75477 7.5768 7.74927 7.54567L7.48926 6.30605C7.43799 6.06435 7.28968 5.84645 7.08277 5.71279L3.77589 3.56313C3.40601 3.32509 2.91163 3.37636 2.60035 3.68764L1.81116 4.47682C1.50171 4.7881 1.44861 5.28066 1.68848 5.6487L3.80152 8.91713C3.93336 9.12221 4.13843 9.26686 4.3783 9.32179L5.66004 9.61659C5.69483 9.62392 5.72962 9.62209 5.76441 9.62575L11.2155 15.0786L8.03309 18.2647C6.23316 18.0907 4.52112 18.8396 3.417 20.2971C2.0254 22.1373 2.05836 24.7814 3.49756 26.5886C4.41858 27.7459 5.78821 28.4563 7.25123 28.5405C7.34827 28.546 7.44532 28.5479 7.54236 28.5479C8.9065 28.5479 10.2212 28.0059 11.1898 27.0372C12.2866 25.9404 12.8195 24.4445 12.6711 22.9027L14.7311 20.8446C14.8391 21.2035 15.0259 21.5386 15.2987 21.8114L21.5939 28.1102C22.0516 28.5662 22.6522 28.7932 23.2528 28.7932C23.8534 28.7932 24.454 28.5662 24.9099 28.1102L26.2356 26.7827C27.1493 25.869 27.1493 24.3822 26.2356 23.4685L19.9368 17.1697C19.6658 16.8987 19.3307 16.7138 18.9718 16.6039L20.4275 15.1464C22.5881 15.7854 24.3954 15.822 26.1056 14.1118C27.814 12.4035 29.1323 9.21559 28.3834 6.83522C28.3358 6.67958 28.2076 6.55873 28.0483 6.52028C27.889 6.48183 27.7206 6.52944 27.6052 6.64479L24.681 9.56899C24.5638 9.68801 24.3899 9.73561 24.2288 9.68984L23.7161 9.55251C22.5863 9.25038 21.6964 8.36049 21.3943 7.23256L21.257 6.71987C21.213 6.55873 21.2606 6.38478 21.3796 6.2676L24.3093 3.33608C24.4247 3.22072 24.4705 3.05409 24.4338 2.89479C24.3936 2.73549 24.2764 2.60732 24.1189 2.55788C23.6721 2.41506 23.1961 2.34731 22.7072 2.33998ZM22.6669 3.28115C22.7877 3.28298 22.9067 3.28664 23.0239 3.29579L20.7168 5.60292C20.3616 5.95815 20.2242 6.47817 20.3543 6.96157L20.4916 7.47609C20.8798 8.92629 22.0223 10.0689 23.4744 10.4589L23.9871 10.5962C24.4705 10.7262 24.9905 10.5871 25.3439 10.2318L27.6437 7.93202C27.7883 9.80702 26.7318 12.1599 25.4446 13.4472C23.9834 14.9083 22.5021 14.8168 20.4367 14.1686C20.27 14.1173 20.0888 14.1613 19.9661 14.284L11.849 22.401C11.7446 22.5054 11.6952 22.6519 11.7172 22.7984C11.9039 24.1277 11.47 25.4314 10.527 26.3744C9.67737 27.224 8.5055 27.6708 7.30433 27.6049C6.08851 27.5353 4.9972 26.9677 4.22999 26.0045C3.05445 24.5287 3.02698 22.3662 4.16407 20.8648C4.98438 19.7826 6.20936 19.1765 7.52588 19.1765C7.7273 19.1765 7.93238 19.1912 8.13746 19.2186C8.28211 19.2388 8.43043 19.1912 8.53296 19.0868L16.65 10.9716C16.7745 10.8471 16.8203 10.6658 16.7672 10.4973C16.119 8.43373 16.0275 6.95424 17.4887 5.49306C18.7008 4.2809 20.8541 3.27931 22.6669 3.28115ZM3.26319 4.35048L6.57191 6.49831L6.83191 7.73793L5.86695 8.70107L4.58704 8.4081L2.474 5.13967L3.26319 4.35048ZM7.34095 8.55275L12.543 13.7529L11.8801 14.4158L6.67994 9.21559L7.0077 8.88967L7.34095 8.55275ZM18.4811 8.66994C18.3621 8.66994 18.243 8.71572 18.1497 8.80727C17.9666 8.99037 17.9666 9.287 18.1497 9.47011L21.4657 12.7843C21.5573 12.8759 21.6763 12.9216 21.7971 12.9216C21.9161 12.9216 22.037 12.8759 22.1267 12.7843C22.3117 12.6012 22.3117 12.3046 22.1267 12.1215L18.8143 8.80727C18.721 8.71572 18.6019 8.66994 18.4811 8.66994ZM17.1554 12.647C17.0364 12.647 16.9155 12.6928 16.824 12.7843C16.6409 12.9674 16.6409 13.2641 16.824 13.4472L17.4887 14.11C17.5802 14.2016 17.6992 14.2473 17.8201 14.2473C17.9409 14.2473 18.0599 14.2016 18.1515 14.11C18.3346 13.9269 18.3346 13.6303 18.1515 13.4472L17.4887 12.7843C17.3953 12.6928 17.2763 12.647 17.1554 12.647ZM15.4983 14.3041C15.3793 14.3041 15.2603 14.3499 15.1687 14.4433C14.9838 14.6264 14.9838 14.9212 15.1687 15.1043L15.8297 15.7689C15.9213 15.8587 16.0421 15.9063 16.163 15.9063C16.282 15.9063 16.4028 15.8587 16.4944 15.7689C16.6775 15.584 16.6775 15.2892 16.4944 15.1043L15.8297 14.4433C15.7382 14.3499 15.6191 14.3041 15.4983 14.3041ZM13.843 15.9612C13.7222 15.9612 13.6032 16.007 13.5116 16.0985C13.3267 16.2816 13.3267 16.5783 13.5116 16.7632L14.1726 17.4242C14.2642 17.5158 14.385 17.5634 14.504 17.5634C14.6249 17.5634 14.7457 17.5158 14.8373 17.4242C15.0204 17.2429 15.0204 16.9463 14.8373 16.7632L14.1726 16.0985C14.0811 16.007 13.962 15.9612 13.843 15.9612ZM18.4426 17.4444C18.7539 17.4755 19.0487 17.6073 19.2758 17.8344L25.5728 24.1314C26.1221 24.6807 26.1221 25.5706 25.5728 26.1199L24.2452 27.4456C23.6978 27.9949 22.806 27.9949 22.2586 27.4456L15.9597 21.1467C15.6594 20.8465 15.5258 20.4216 15.5734 20.0023L18.1277 17.4462C18.2339 17.4352 18.3383 17.4334 18.4426 17.4444ZM12.1859 17.6201C12.0651 17.6201 11.9461 17.6641 11.8527 17.7556C11.6696 17.9406 11.6696 18.2354 11.8527 18.4203L12.5173 19.0813C12.6071 19.1729 12.7279 19.2186 12.8469 19.2186C12.9678 19.2186 13.0886 19.1729 13.1784 19.0813C13.3633 18.8982 13.3633 18.6034 13.1784 18.4203L12.5173 17.7556C12.424 17.6641 12.3049 17.6201 12.1859 17.6201ZM10.527 19.2772C10.408 19.2772 10.2889 19.323 10.1956 19.4146C10.0125 19.5977 10.0125 19.8925 10.1956 20.0756L10.8584 20.7403C10.95 20.83 11.069 20.8757 11.1898 20.8757C11.3107 20.8757 11.4297 20.83 11.5212 20.7403C11.7044 20.5553 11.7044 20.2605 11.5212 20.0756L10.8584 19.4146C10.7669 19.323 10.646 19.2772 10.527 19.2772ZM19.2758 19.3523C19.1549 19.3523 19.0359 19.3981 18.9425 19.4896C18.7594 19.6746 18.7594 19.9694 18.9425 20.1543L23.5842 24.7942C23.6758 24.8858 23.7948 24.9315 23.9157 24.9315C24.0365 24.9315 24.1555 24.8858 24.2471 24.7942C24.4302 24.6111 24.4302 24.3145 24.2471 24.1314L19.6072 19.4896C19.5138 19.3981 19.3948 19.3523 19.2758 19.3523ZM17.9501 20.678C17.8292 20.678 17.7102 20.7238 17.6168 20.8153C17.4337 21.0003 17.4337 21.2951 17.6168 21.48L22.2586 26.1199C22.3483 26.2114 22.4691 26.2572 22.5881 26.2572C22.709 26.2572 22.8298 26.2114 22.9196 26.1199C23.1045 25.9368 23.1045 25.6402 22.9196 25.457L18.2815 20.8153C18.1881 20.7238 18.0691 20.678 17.9501 20.678ZM8.11182 20.8373C8.07154 20.8373 8.03126 20.8428 7.99097 20.8538L5.89808 21.4141C5.73694 21.458 5.6106 21.5844 5.56666 21.7455L5.00818 23.8366C4.96424 23.9977 5.01002 24.1698 5.1272 24.2888L6.65796 25.8196C6.74769 25.9093 6.86671 25.9569 6.98939 25.9569C7.0315 25.9569 7.07178 25.9514 7.11207 25.9423L9.20313 25.3801C9.36426 25.338 9.49061 25.2117 9.53455 25.0487L10.0949 22.9595C10.1388 22.7965 10.0912 22.6244 9.974 22.5054L8.44324 20.9746C8.35352 20.8867 8.2345 20.8391 8.11182 20.8373ZM7.97083 21.8279L9.1189 22.976L8.69959 24.5452L7.13038 24.9663L5.98231 23.8183L6.40162 22.249L7.97083 21.8279Z',
73
73
  svgPathGridIconViewBox: '0 0 30 30',
74
74
  menuOrder: 10,
75
+ textEmptyDescription: 'allows your users to submit Requests (such as maintenance requests) that all appear in this job board.',
76
+ textEmptyExample: 'Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum.',
77
+ textAreYouSureYouWantToDelete: 'Are you sure you want to delete that request?',
75
78
  textAreYouSureYouWantToDeleteNote: 'Are you sure you want to delete that note?',
76
79
  textChangedRequestStatus: "changed a maintenance request's status:",
77
80
  textAddedRequest: 'added a maintenance request:',
@@ -79,13 +82,14 @@
79
82
  textRemovedRequest: 'removed a maintenance request:',
80
83
  textSingularName: 'Request',
81
84
  textYourRequestHere: 'Your Requests will show here',
82
- textMenuTitle: 'Maintenance',
83
- textPermissionMaintenanceTracking: 'Maintenance Tracking',
84
- textPermissionManageMaintenanceTypes: 'Manage Maintenance Types',
85
- textPermissionManageAssignedMaintenance: 'Manage Assigned Maintenance',
86
- textHiddenSectionMaintenanceRequests: 'Maintenance requests',
87
- keyHiddenSectionMaintenanceRequests: 'maintenanceRequest',
88
- textMoreSectionMaintenance: 'Maintenance',
85
+ textTitleRequests: 'Requests',
86
+ textMenuTitle: 'Maintenance A',
87
+ textPermissionMaintenanceTracking: 'Maintenance Tracking A',
88
+ textPermissionManageMaintenanceTypes: 'Manage Maintenance Types A',
89
+ textPermissionManageAssignedMaintenance: 'Manage Assigned Maintenance A',
90
+ textHiddenSectionMaintenanceRequests: 'Maintenance requests A',
91
+ keyHiddenSectionMaintenanceRequests: 'maintenanceRequestA',
92
+ textMoreSectionMaintenance: 'Maintenance A',
89
93
  featureKeyMoreSectionMaintenance: 'maintenanceA',
90
94
  optionKeyMoreSectionMaintenance: 'maintenanceRequestA',
91
95
  hiddenKeyMoreSectionMaintenance: 'maintenanceRequestA'
@@ -687,7 +691,7 @@
687
691
  while (1) {
688
692
  switch (_context3.prev = _context3.next) {
689
693
  case 0:
690
- if (!window.confirm("Are you sure you want to delete that request?")) {
694
+ if (!window.confirm(values.textAreYouSureYouWantToDelete)) {
691
695
  _context3.next = 12;
692
696
  break;
693
697
  }
@@ -1282,18 +1286,7 @@
1282
1286
  }, {
1283
1287
  key: "renderEmpty",
1284
1288
  value: function renderEmpty() {
1285
- var _this4 = this;
1286
-
1287
- var featureTitle = function (key) {
1288
- var strings = _this4.props.strings;
1289
-
1290
- if (!strings || !strings.sideNav || !strings.sideNav[key]) {
1291
- return values.textMenuTitle;
1292
- }
1293
-
1294
- return strings.sideNav[key];
1295
- }();
1296
-
1289
+ var title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
1297
1290
  return /*#__PURE__*/React__default['default'].createElement("div", {
1298
1291
  style: {
1299
1292
  display: 'flex',
@@ -1315,18 +1308,18 @@
1315
1308
  className: "fontRegular fontSize-13"
1316
1309
  }, /*#__PURE__*/React__default['default'].createElement("span", {
1317
1310
  className: "fontHeavy text-brandingColour"
1318
- }, featureTitle, " "), "allows your users to submit Requests (such as maintenance requests) that all appear in this job board.")), /*#__PURE__*/React__default['default'].createElement("div", {
1311
+ }, title, " "), values.textEmptyDescription)), /*#__PURE__*/React__default['default'].createElement("div", {
1319
1312
  className: "marginTop-8 fontRegular fontSize-13",
1320
1313
  style: {
1321
1314
  maxWidth: 500,
1322
1315
  textAlign: 'center'
1323
1316
  }
1324
- }, "Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum."));
1317
+ }, values.textEmptyExample));
1325
1318
  }
1326
1319
  }, {
1327
1320
  key: "renderContent",
1328
1321
  value: function renderContent() {
1329
- var _this5 = this;
1322
+ var _this4 = this;
1330
1323
 
1331
1324
  if (___default['default'].isEmpty(this.props.source)) return this.renderEmpty();
1332
1325
  return /*#__PURE__*/React__default['default'].createElement(reactBootstrap.Table, {
@@ -1345,7 +1338,7 @@
1345
1338
  width: 70
1346
1339
  },
1347
1340
  onClick: function onClick() {
1348
- _this5.sortByCol('jobId');
1341
+ _this4.sortByCol('jobId');
1349
1342
  }
1350
1343
  }, "Job No.", this.renderSort('jobId')), /*#__PURE__*/React__default['default'].createElement("th", {
1351
1344
  className: "".concat(this.sortIsActive('title')),
@@ -1353,7 +1346,7 @@
1353
1346
  cursor: 'pointer'
1354
1347
  },
1355
1348
  onClick: function onClick() {
1356
- _this5.sortByCol('title');
1349
+ _this4.sortByCol('title');
1357
1350
  }
1358
1351
  }, "Request title", this.renderSort('title')), /*#__PURE__*/React__default['default'].createElement("th", {
1359
1352
  className: "".concat(this.sortIsActive('type')),
@@ -1362,7 +1355,7 @@
1362
1355
  width: 100
1363
1356
  },
1364
1357
  onClick: function onClick() {
1365
- _this5.sortByCol('type');
1358
+ _this4.sortByCol('type');
1366
1359
  }
1367
1360
  }, "Type", this.renderSort('type')), /*#__PURE__*/React__default['default'].createElement("th", {
1368
1361
  className: "".concat(this.sortIsActive('createdUnix')),
@@ -1371,7 +1364,7 @@
1371
1364
  width: 80
1372
1365
  },
1373
1366
  onClick: function onClick() {
1374
- _this5.sortByCol('createdUnix');
1367
+ _this4.sortByCol('createdUnix');
1375
1368
  }
1376
1369
  }, "Date", this.renderSort('createdUnix')), /*#__PURE__*/React__default['default'].createElement("th", {
1377
1370
  className: "".concat(this.sortIsActive('room')),
@@ -1380,7 +1373,7 @@
1380
1373
  width: 100
1381
1374
  },
1382
1375
  onClick: function onClick() {
1383
- _this5.sortByCol('room');
1376
+ _this4.sortByCol('room');
1384
1377
  }
1385
1378
  }, "Location", this.renderSort('room')), /*#__PURE__*/React__default['default'].createElement("th", {
1386
1379
  className: "".concat(this.sortIsActive('assigned')),
@@ -1389,7 +1382,7 @@
1389
1382
  width: 150
1390
1383
  },
1391
1384
  onClick: function onClick() {
1392
- _this5.sortByCol('assigned');
1385
+ _this4.sortByCol('assigned');
1393
1386
  }
1394
1387
  }, "Assigned To", this.renderSort('assigned')), /*#__PURE__*/React__default['default'].createElement("th", {
1395
1388
  style: {
@@ -1404,33 +1397,33 @@
1404
1397
  }, {
1405
1398
  key: "renderFilters",
1406
1399
  value: function renderFilters() {
1407
- var _this6 = this;
1400
+ var _this5 = this;
1408
1401
 
1409
1402
  var typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1410
1403
  className: "marginRight-10",
1411
1404
  onClick: function onClick() {
1412
- _this6.openFilter('type');
1405
+ _this5.openFilter('type');
1413
1406
  },
1414
1407
  text: "Type"
1415
1408
  });
1416
1409
  var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1417
1410
  className: "marginRight-10",
1418
1411
  onClick: function onClick() {
1419
- _this6.openFilter('status');
1412
+ _this5.openFilter('status');
1420
1413
  },
1421
1414
  text: "Status"
1422
1415
  });
1423
1416
  var timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1424
1417
  className: "marginRight-10",
1425
1418
  onClick: function onClick() {
1426
- _this6.openFilter('time');
1419
+ _this5.openFilter('time');
1427
1420
  },
1428
1421
  text: "Time"
1429
1422
  });
1430
1423
  var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1431
1424
  className: "marginRight-10",
1432
1425
  onClick: function onClick() {
1433
- _this6.openFilter('user');
1426
+ _this5.openFilter('user');
1434
1427
  },
1435
1428
  text: "Assigned To"
1436
1429
  });
@@ -1439,13 +1432,13 @@
1439
1432
  typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1440
1433
  className: "marginRight-10",
1441
1434
  onClick: function onClick() {
1442
- _this6.openFilter('type');
1435
+ _this5.openFilter('type');
1443
1436
  },
1444
1437
  rightIcon: "close",
1445
1438
  rightClick: function rightClick(e) {
1446
1439
  e.stopPropagation();
1447
1440
 
1448
- _this6.selectTypeFilter();
1441
+ _this5.selectTypeFilter();
1449
1442
  },
1450
1443
  text: this.state.selectedTypeFilter
1451
1444
  });
@@ -1455,13 +1448,13 @@
1455
1448
  statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1456
1449
  className: "marginRight-10",
1457
1450
  onClick: function onClick() {
1458
- _this6.openFilter('status');
1451
+ _this5.openFilter('status');
1459
1452
  },
1460
1453
  rightIcon: "close",
1461
1454
  rightClick: function rightClick(e) {
1462
1455
  e.stopPropagation();
1463
1456
 
1464
- _this6.selectStatusFilter();
1457
+ _this5.selectStatusFilter();
1465
1458
  },
1466
1459
  text: this.state.selectedStatusFilter === 'incomplete' ? 'All Incomplete' : StatusTypes[this.state.selectedStatusFilter].text
1467
1460
  });
@@ -1471,13 +1464,13 @@
1471
1464
  timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1472
1465
  className: "marginRight-10",
1473
1466
  onClick: function onClick() {
1474
- _this6.openFilter('time');
1467
+ _this5.openFilter('time');
1475
1468
  },
1476
1469
  rightIcon: "close",
1477
1470
  rightClick: function rightClick(e) {
1478
1471
  e.stopPropagation();
1479
1472
 
1480
- _this6.removeTimeFilter();
1473
+ _this5.removeTimeFilter();
1481
1474
  },
1482
1475
  text: this.state.selectedTimeFilterText
1483
1476
  });
@@ -1487,13 +1480,13 @@
1487
1480
  userFilter = /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
1488
1481
  className: "marginRight-10",
1489
1482
  onClick: function onClick() {
1490
- _this6.openFilter('user');
1483
+ _this5.openFilter('user');
1491
1484
  },
1492
1485
  rightIcon: "close",
1493
1486
  rightClick: function rightClick(e) {
1494
1487
  e.stopPropagation();
1495
1488
 
1496
- _this6.removeUserFilter();
1489
+ _this5.removeUserFilter();
1497
1490
  },
1498
1491
  text: this.state.selectedUserFilterText
1499
1492
  });
@@ -1518,7 +1511,7 @@
1518
1511
  placeholder: "Search by Job ID, Location or Title",
1519
1512
  value: this.state.search,
1520
1513
  onChange: function onChange(e) {
1521
- return _this6.onHandleSearchChange(e);
1514
+ return _this5.onHandleSearchChange(e);
1522
1515
  },
1523
1516
  className: "genericInputContainer-rounded marginTop-10",
1524
1517
  style: {
@@ -2344,7 +2337,7 @@
2344
2337
 
2345
2338
  return /*#__PURE__*/React__default['default'].createElement(Components$3.HubSidebar, {
2346
2339
  sections: [{
2347
- title: 'Requests',
2340
+ title: this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests,
2348
2341
  items: sectionItems
2349
2342
  }],
2350
2343
  helpGuide: {
@@ -2408,7 +2401,8 @@
2408
2401
  var auth = state.auth;
2409
2402
  return {
2410
2403
  jobs: state[values.reducerKey].jobs,
2411
- auth: auth
2404
+ auth: auth,
2405
+ strings: state.strings && state.strings.config || {}
2412
2406
  };
2413
2407
  };
2414
2408
 
@@ -3170,6 +3164,32 @@
3170
3164
  }
3171
3165
  }))));
3172
3166
  }
3167
+ }, {
3168
+ key: "renderImages",
3169
+ value: function renderImages() {
3170
+ if (___default['default'].isEmpty(this.state.job.image) && ___default['default'].isEmpty(this.state.job.images)) return null;
3171
+ var imagesToUse = ___default['default'].isEmpty(this.state.job.image) ? this.state.job.images : [this.state.job.image];
3172
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3173
+ className: "padding-60 paddingVertical-40 bottomDivideBorder"
3174
+ }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
3175
+ type: "formTitleSmall",
3176
+ className: "marginBottom-16"
3177
+ }, "Images"), /*#__PURE__*/React__default['default'].createElement("div", {
3178
+ className: "imageGrid"
3179
+ }, imagesToUse.map(function (image, i) {
3180
+ return /*#__PURE__*/React__default['default'].createElement("a", {
3181
+ href: image,
3182
+ target: "_blank",
3183
+ rel: "noopener noreferrer",
3184
+ key: i
3185
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
3186
+ className: "imageGrid_image",
3187
+ style: {
3188
+ backgroundImage: "url('".concat(Helper$1.get1400(image), "')")
3189
+ }
3190
+ }));
3191
+ })));
3192
+ }
3173
3193
  }, {
3174
3194
  key: "renderInner",
3175
3195
  value: function renderInner() {
@@ -3182,8 +3202,11 @@
3182
3202
  className: "padding-60 paddingVertical-40 bottomDivideBorder relative"
3183
3203
  }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
3184
3204
  type: "formTitleLarge",
3205
+ className: "marginBottom-8"
3206
+ }, this.state.job.title || 'Request'), /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
3207
+ type: "formTitleMedium",
3185
3208
  className: "marginBottom-24"
3186
- }, this.state.job.title || 'Request'), /*#__PURE__*/React__default['default'].createElement("div", {
3209
+ }, "Job #", this.state.job.jobId), /*#__PURE__*/React__default['default'].createElement("div", {
3187
3210
  className: "marginTop-16"
3188
3211
  }, /*#__PURE__*/React__default['default'].createElement("div", {
3189
3212
  className: 'fieldLabel'
@@ -3236,23 +3259,7 @@
3236
3259
  className: 'fieldLabel'
3237
3260
  }, "When"), /*#__PURE__*/React__default['default'].createElement("div", {
3238
3261
  className: 'fontRegular fontSize-16 text-dark marginTop-5'
3239
- }, this.state.job.homeText))), (this.state.job.image || this.state.job.images) && /*#__PURE__*/React__default['default'].createElement("div", {
3240
- className: "padding-60 paddingVertical-40 bottomDivideBorder"
3241
- }, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
3242
- type: "formTitleSmall",
3243
- className: "marginBottom-16"
3244
- }, "Image"), /*#__PURE__*/React__default['default'].createElement("div", {
3245
- style: {
3246
- marginTop: 16,
3247
- height: 180,
3248
- width: 260,
3249
- borderRadius: 4,
3250
- border: '1px solid #aaa',
3251
- backgroundColor: '#ddd',
3252
- backgroundImage: "url(".concat(this.state.job.thumbnail, ")"),
3253
- backgroundPosition: 'center'
3254
- }
3255
- })), this.renderCommentSection());
3262
+ }, this.state.job.homeText))), this.renderImages(), this.renderCommentSection());
3256
3263
  }
3257
3264
  }, {
3258
3265
  key: "renderHistoryEntry",
@@ -3425,7 +3432,7 @@
3425
3432
  marginRight: 16
3426
3433
  }
3427
3434
  }, "Back"), Session$2.validateAccess(this.props.auth.site, values.permissionMaintenanceTracking, this.props.auth) && !___default['default'].isEmpty(this.state.job) && /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
3428
- to: "/requestsHub/job/".concat(this.state.jobId)
3435
+ to: "".concat(values.routeAddRequest, "/").concat(this.state.jobId)
3429
3436
  }, /*#__PURE__*/React__default['default'].createElement(Components$2.Button, {
3430
3437
  inline: true,
3431
3438
  style: {
@@ -3963,28 +3970,16 @@
3963
3970
  }, {
3964
3971
  key: "renderSuccess",
3965
3972
  value: function renderSuccess() {
3966
- var _this3 = this;
3967
-
3968
3973
  if (!this.state.success) return null;
3969
-
3970
- var featureTitle = function (key) {
3971
- var strings = _this3.props.strings;
3972
-
3973
- if (!strings || !strings.sideNav || !strings.sideNav[key]) {
3974
- return values.textMenuTitle;
3975
- }
3976
-
3977
- return strings.sideNav[key];
3978
- }();
3979
-
3974
+ var title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
3980
3975
  return /*#__PURE__*/React__default['default'].createElement(Components$1.SuccessPopup, {
3981
- text: "".concat(featureTitle, " request has been ").concat(this.state.id != null ? 'edited' : 'added'),
3976
+ text: "Request has been ".concat(this.state.id != null ? 'edited' : 'added'),
3982
3977
  buttons: [{
3983
3978
  type: 'outlined',
3984
3979
  onClick: function onClick() {
3985
3980
  window.history.back();
3986
3981
  },
3987
- text: "Back to ".concat(featureTitle)
3982
+ text: "Back to ".concat(title)
3988
3983
  }]
3989
3984
  });
3990
3985
  }
@@ -4001,7 +3996,7 @@
4001
3996
  }, {
4002
3997
  key: "renderSubmit",
4003
3998
  value: function renderSubmit() {
4004
- var _this4 = this;
3999
+ var _this3 = this;
4005
4000
 
4006
4001
  if (this.state.updating) {
4007
4002
  return /*#__PURE__*/React__default['default'].createElement(Components$1.Button, {
@@ -4013,7 +4008,7 @@
4013
4008
  inline: true,
4014
4009
  buttonType: "tertiary",
4015
4010
  onClick: function onClick() {
4016
- return _this4.props.history.push('/requestsHub');
4011
+ return _this3.props.history.push(values.routeRequestsHub);
4017
4012
  },
4018
4013
  isActive: true,
4019
4014
  style: {
@@ -4072,7 +4067,7 @@
4072
4067
  }, {
4073
4068
  key: "renderMain",
4074
4069
  value: function renderMain() {
4075
- var _this5 = this;
4070
+ var _this4 = this;
4076
4071
 
4077
4072
  return /*#__PURE__*/React__default['default'].createElement("div", {
4078
4073
  style: {
@@ -4090,15 +4085,15 @@
4090
4085
  placeholder: "Insert address here",
4091
4086
  value: this.state.room,
4092
4087
  onChange: function onChange(e) {
4093
- return _this5.onHandleChange(e);
4088
+ return _this4.onHandleChange(e);
4094
4089
  },
4095
4090
  isRequired: true,
4096
4091
  alwaysShowLabel: true,
4097
4092
  isValid: function isValid() {
4098
- return !___default['default'].isEmpty(_this5.state.room);
4093
+ return !___default['default'].isEmpty(_this4.state.room);
4099
4094
  },
4100
4095
  showError: function showError() {
4101
- return _this5.state.showWarnings && ___default['default'].isEmpty(_this5.state.room);
4096
+ return _this4.state.showWarnings && ___default['default'].isEmpty(_this4.state.room);
4102
4097
  }
4103
4098
  }), /*#__PURE__*/React__default['default'].createElement(Components$1.GenericInput, {
4104
4099
  id: "phone",
@@ -4108,7 +4103,7 @@
4108
4103
  value: this.state.phone // showError={this.state.showWarnings && !this.validateImage()}
4109
4104
  ,
4110
4105
  onChange: function onChange(e) {
4111
- return _this5.onHandleChange(e);
4106
+ return _this4.onHandleChange(e);
4112
4107
  },
4113
4108
  alwaysShowLabel: true
4114
4109
  }), /*#__PURE__*/React__default['default'].createElement("div", {
@@ -4132,17 +4127,17 @@
4132
4127
  placeholder: "Title for the work required",
4133
4128
  value: this.state.title,
4134
4129
  onChange: function onChange(e) {
4135
- return _this5.onHandleChange(e);
4130
+ return _this4.onHandleChange(e);
4136
4131
  },
4137
4132
  inputStyle: {
4138
4133
  height: 80
4139
4134
  },
4140
4135
  isRequired: true,
4141
4136
  isValid: function isValid() {
4142
- return !___default['default'].isEmpty(_this5.state.title);
4137
+ return !___default['default'].isEmpty(_this4.state.title);
4143
4138
  },
4144
4139
  showError: function showError() {
4145
- return _this5.state.showWarnings && ___default['default'].isEmpty(_this5.state.title);
4140
+ return _this4.state.showWarnings && ___default['default'].isEmpty(_this4.state.title);
4146
4141
  },
4147
4142
  alwaysShowLabel: true
4148
4143
  }), /*#__PURE__*/React__default['default'].createElement(Components$1.GenericInput, {
@@ -4152,7 +4147,7 @@
4152
4147
  placeholder: "Description of work required",
4153
4148
  value: this.state.description,
4154
4149
  onChange: function onChange(e) {
4155
- return _this5.onHandleChange(e);
4150
+ return _this4.onHandleChange(e);
4156
4151
  },
4157
4152
  inputStyle: {
4158
4153
  height: 80
@@ -4165,7 +4160,7 @@
4165
4160
  Label: 'No',
4166
4161
  Value: false,
4167
4162
  onChange: function onChange() {
4168
- return _this5.setState({
4163
+ return _this4.setState({
4169
4164
  isHome: false
4170
4165
  });
4171
4166
  }
@@ -4173,7 +4168,7 @@
4173
4168
  Label: 'Yes',
4174
4169
  Value: true,
4175
4170
  onChange: function onChange() {
4176
- return _this5.setState({
4171
+ return _this4.setState({
4177
4172
  isHome: true
4178
4173
  });
4179
4174
  }
@@ -4188,17 +4183,17 @@
4188
4183
  placeholder: "Description of person's available times",
4189
4184
  value: this.state.homeText,
4190
4185
  onChange: function onChange(e) {
4191
- return _this5.onHandleChange(e);
4186
+ return _this4.onHandleChange(e);
4192
4187
  },
4193
4188
  inputStyle: {
4194
4189
  height: 80
4195
4190
  },
4196
4191
  isRequired: true,
4197
4192
  isValid: function isValid() {
4198
- return !___default['default'].isEmpty(_this5.state.homeText);
4193
+ return !___default['default'].isEmpty(_this4.state.homeText);
4199
4194
  },
4200
4195
  showError: function showError() {
4201
- return _this5.state.showWarnings && ___default['default'].isEmpty(_this5.state.homeText);
4196
+ return _this4.state.showWarnings && ___default['default'].isEmpty(_this4.state.homeText);
4202
4197
  },
4203
4198
  alwaysShowLabel: true
4204
4199
  })));
@@ -4206,7 +4201,7 @@
4206
4201
  }, {
4207
4202
  key: "renderUserFilterPopup",
4208
4203
  value: function renderUserFilterPopup() {
4209
- var _this6 = this;
4204
+ var _this5 = this;
4210
4205
 
4211
4206
  var _this$state2 = this.state,
4212
4207
  userFilterOpen = _this$state2.userFilterOpen,
@@ -4234,7 +4229,7 @@
4234
4229
  placeholder: "Search name",
4235
4230
  value: userSearch,
4236
4231
  onChange: function onChange(e) {
4237
- return _this6.onHandleChange(e);
4232
+ return _this5.onHandleChange(e);
4238
4233
  },
4239
4234
  alwaysShowLabel: true
4240
4235
  }), ___default['default'].sortBy(users, function (u) {
@@ -4247,7 +4242,7 @@
4247
4242
  key: user.userId,
4248
4243
  user: user,
4249
4244
  onClick: function onClick() {
4250
- return _this6.onSelectUser(user);
4245
+ return _this5.onSelectUser(user);
4251
4246
  }
4252
4247
  });
4253
4248
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-web-a",
3
- "version": "1.2.2-beta.0",
3
+ "version": "1.2.3-beta.0",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -86,7 +86,7 @@ class JobList extends Component {
86
86
  };
87
87
 
88
88
  onRemoveRequest = async (request) => {
89
- if (window.confirm(`Are you sure you want to delete that request?`)) {
89
+ if (window.confirm(values.textAreYouSureYouWantToDelete)) {
90
90
  this.props.removeJob(request.id);
91
91
  try {
92
92
  await maintenanceActions.deleteJob(this.props.auth.site, request.id);
@@ -532,25 +532,19 @@ class JobList extends Component {
532
532
  }
533
533
 
534
534
  renderEmpty() {
535
- const featureTitle = ((key) => {
536
- const { strings } = this.props;
537
- if (!strings || !strings.sideNav || !strings.sideNav[key]) {
538
- return values.textMenuTitle;
539
- }
540
- return strings.sideNav[key];
541
- })();
535
+ const title = this.props.strings[`${values.featureKey}_textTitleRequests`] || values.textTitleRequests;
542
536
 
543
537
  return (
544
538
  <div style={{ display: 'flex', flexDirection: 'column', flex: 1, justifyContent: 'center', alignItems: 'center', marginTop: 32 }}>
545
539
  <div className="emptyState" />
546
540
  <div className="marginTop-32" style={{ maxWidth: 500, textAlign: 'center' }}>
547
541
  <span className="fontRegular fontSize-13">
548
- <span className="fontHeavy text-brandingColour">{featureTitle} </span>
549
- allows your users to submit Requests (such as maintenance requests) that all appear in this job board.
542
+ <span className="fontHeavy text-brandingColour">{title} </span>
543
+ {values.textEmptyDescription}
550
544
  </span>
551
545
  </div>
552
546
  <div className="marginTop-8 fontRegular fontSize-13" style={{ maxWidth: 500, textAlign: 'center' }}>
553
- Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum.
547
+ {values.textEmptyExample}
554
548
  </div>
555
549
  </div>
556
550
  );
@@ -206,24 +206,17 @@ class AddJob extends Component {
206
206
  renderSuccess() {
207
207
  if (!this.state.success) return null;
208
208
 
209
- const featureTitle = ((key) => {
210
- const { strings } = this.props;
211
- if (!strings || !strings.sideNav || !strings.sideNav[key]) {
212
- return values.textMenuTitle;
213
- }
214
- return strings.sideNav[key];
215
- })();
216
-
209
+ const title = this.props.strings[`${values.featureKey}_textTitleRequests`] || values.textTitleRequests;
217
210
  return (
218
211
  <Components.SuccessPopup
219
- text={`${featureTitle} request has been ${this.state.id != null ? 'edited' : 'added'}`}
212
+ text={`Request has been ${this.state.id != null ? 'edited' : 'added'}`}
220
213
  buttons={[
221
214
  {
222
215
  type: 'outlined',
223
216
  onClick: () => {
224
217
  window.history.back();
225
218
  },
226
- text: `Back to ${featureTitle}`,
219
+ text: `Back to ${title}`,
227
220
  },
228
221
  ]}
229
222
  />
@@ -249,7 +242,7 @@ class AddJob extends Component {
249
242
  <Components.Button
250
243
  inline
251
244
  buttonType="tertiary"
252
- onClick={() => this.props.history.push('/requestsHub')}
245
+ onClick={() => this.props.history.push(values.routeRequestsHub)}
253
246
  isActive
254
247
  style={{ marginRight: 16 }}
255
248
  >