@lighthouse/common 5.0.0-canary-11 → 5.0.0-canary-13
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/helpers/build-fetch-url/index.js +2 -2
- package/dist/helpers/fetch-image/index.js +1 -1
- package/dist/helpers/fetch-image-for-pdf-generator-service/index.js +9 -9
- package/dist/helpers/fetch-image-for-web/index.js +3 -14
- package/dist/helpers/get-audit-entry-details/index.js +2 -0
- package/dist/helpers/get-issue-details/index.js +2 -0
- package/dist/helpers/get-task-entry-details/index.js +3 -1
- package/dist/pdf/helpers/fields/index.js +2 -2
- package/dist/scheduling/scheduling.types.js +9 -9
- package/dist/service-hours/schema.js +12 -12
- package/lib/errors/DomainError.js +7 -8
- package/lib/errors/DomainError.js.map +1 -1
- package/lib/errors/ValidationError.js +11 -9
- package/lib/errors/ValidationError.js.map +1 -1
- package/lib/helpers/build-fetch-url/index.js +2 -2
- package/lib/helpers/build-fetch-url/index.js.map +1 -1
- package/lib/helpers/fetch-image/index.js +1 -1
- package/lib/helpers/fetch-image/index.js.map +1 -1
- package/lib/helpers/fetch-image-for-pdf-generator-service/index.js +174 -180
- package/lib/helpers/fetch-image-for-pdf-generator-service/index.js.map +1 -1
- package/lib/helpers/fetch-image-for-web/index.js +60 -74
- package/lib/helpers/fetch-image-for-web/index.js.map +1 -1
- package/lib/helpers/fetch-lighthouse-logo/index.js +41 -43
- package/lib/helpers/fetch-lighthouse-logo/index.js.map +1 -1
- package/lib/helpers/get-audit-entry-details/index.js +2 -0
- package/lib/helpers/get-audit-entry-details/index.js.map +1 -1
- package/lib/helpers/get-audit-items-data/index.js +8 -8
- package/lib/helpers/get-audit-items-data/index.js.map +1 -1
- package/lib/helpers/get-issue-details/index.js +2 -0
- package/lib/helpers/get-issue-details/index.js.map +1 -1
- package/lib/helpers/get-job-details/index.js.map +1 -1
- package/lib/helpers/get-location-reference/index.js +6 -4
- package/lib/helpers/get-location-reference/index.js.map +1 -1
- package/lib/helpers/get-reference-details/index.js.map +1 -1
- package/lib/helpers/get-task-entry-details/index.js +3 -1
- package/lib/helpers/get-task-entry-details/index.js.map +1 -1
- package/lib/helpers/get-timezone-datetime/index.js.map +1 -1
- package/lib/pdf/activity-report/index.js +299 -311
- package/lib/pdf/activity-report/index.js.map +1 -1
- package/lib/pdf/audit/index.js.map +1 -1
- package/lib/pdf/helpers/build-audit-content/index.js.map +1 -1
- package/lib/pdf/helpers/build-audit-follow-ups/index.js.map +1 -1
- package/lib/pdf/helpers/build-location-scans-content/index.js.map +1 -1
- package/lib/pdf/helpers/build-template-content/index.js.map +1 -1
- package/lib/pdf/helpers/fields/index.js +14 -14
- package/lib/pdf/helpers/fields/index.js.map +1 -1
- package/lib/pdf/helpers/generate-definition/index.js.map +1 -1
- package/lib/pdf/helpers/horizontal-line/index.js.map +1 -1
- package/lib/pdf/helpers/html-transformer/index.js +1 -2
- package/lib/pdf/helpers/html-transformer/index.js.map +1 -1
- package/lib/pdf/helpers/table/index.js +63 -65
- package/lib/pdf/helpers/table/index.js.map +1 -1
- package/lib/pdf/issue/index.js.map +1 -1
- package/lib/pdf/job/index.js.map +1 -1
- package/lib/pdf/shift-report/index.js +275 -291
- package/lib/pdf/shift-report/index.js.map +1 -1
- package/lib/pdf/task/index.js.map +1 -1
- package/lib/scheduling/generators/occurrenceIntervalsGenerator.js +27 -30
- package/lib/scheduling/generators/occurrenceIntervalsGenerator.js.map +1 -1
- package/lib/scheduling/generators/scheduleIntervalsGenerator.js +19 -21
- package/lib/scheduling/generators/scheduleIntervalsGenerator.js.map +1 -1
- package/lib/scheduling/generators/serviceIntervalsGenerator.js +134 -136
- package/lib/scheduling/generators/serviceIntervalsGenerator.js.map +1 -1
- package/lib/scheduling/helpers/generateNonRepeatingSchedule.js +81 -83
- package/lib/scheduling/helpers/generateNonRepeatingSchedule.js.map +1 -1
- package/lib/scheduling/helpers/generateRepeatingSchedule.js +104 -106
- package/lib/scheduling/helpers/generateRepeatingSchedule.js.map +1 -1
- package/lib/scheduling/helpers/generateScheduleEnd.js.map +1 -1
- package/lib/scheduling/helpers/mergeIntervals.js.map +1 -1
- package/lib/scheduling/scheduling.types.js +9 -9
- package/lib/scheduling/scheduling.types.js.map +1 -1
- package/lib/scheduling/strategies/getNext.js +21 -17
- package/lib/scheduling/strategies/getNext.js.map +1 -1
- package/lib/scheduling/strategies/getNextExactDateOfMonth.js +21 -18
- package/lib/scheduling/strategies/getNextExactDateOfMonth.js.map +1 -1
- package/lib/scheduling/strategies/getNextLastDayOfMonth.js +20 -17
- package/lib/scheduling/strategies/getNextLastDayOfMonth.js.map +1 -1
- package/lib/scheduling/strategies/getNextLastWeekdayOfMonth.js +20 -17
- package/lib/scheduling/strategies/getNextLastWeekdayOfMonth.js.map +1 -1
- package/lib/scheduling/strategies/getNextNoRepeat.js +15 -14
- package/lib/scheduling/strategies/getNextNoRepeat.js.map +1 -1
- package/lib/scheduling/strategies/getNextWeekday.js +36 -33
- package/lib/scheduling/strategies/getNextWeekday.js.map +1 -1
- package/lib/scheduling/strategies/getNextXDayOfXWeekOfMonth.js +20 -17
- package/lib/scheduling/strategies/getNextXDayOfXWeekOfMonth.js.map +1 -1
- package/lib/schema/schema.js +21 -23
- package/lib/schema/schema.js.map +1 -1
- package/lib/service-hours/schema.js +15 -13
- package/lib/service-hours/schema.js.map +1 -1
- package/package.json +2 -2
- package/yarn-error.log +0 -13549
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import Promise from 'bluebird';
|
|
@@ -48,27 +48,25 @@ export function buildShiftPdf(_x, _x2) {
|
|
|
48
48
|
function _buildShiftPdf() {
|
|
49
49
|
_buildShiftPdf = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdfOptions, data) {
|
|
50
50
|
var timestamp, timezone, title, content;
|
|
51
|
-
return _regeneratorRuntime.wrap(function
|
|
52
|
-
while (1) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return _context.stop();
|
|
71
|
-
}
|
|
51
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
52
|
+
while (1) switch (_context.prev = _context.next) {
|
|
53
|
+
case 0:
|
|
54
|
+
timestamp = data.timestamp, timezone = data.timezone;
|
|
55
|
+
title = 'Daily Shift Report';
|
|
56
|
+
_context.next = 1;
|
|
57
|
+
return generateContent(data);
|
|
58
|
+
case 1:
|
|
59
|
+
content = _context.sent;
|
|
60
|
+
return _context.abrupt("return", generateDefinition(_objectSpread({
|
|
61
|
+
content: content,
|
|
62
|
+
fileTitle: title,
|
|
63
|
+
timestamp: timestamp,
|
|
64
|
+
timezone: timezone,
|
|
65
|
+
type: 'Shift Report'
|
|
66
|
+
}, pdfOptions)));
|
|
67
|
+
case 2:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context.stop();
|
|
72
70
|
}
|
|
73
71
|
}, _callee);
|
|
74
72
|
}));
|
|
@@ -80,21 +78,19 @@ function generateContent(_x3) {
|
|
|
80
78
|
function _generateContent() {
|
|
81
79
|
_generateContent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
|
82
80
|
var activitySection, summarySection, titleTable;
|
|
83
|
-
return _regeneratorRuntime.wrap(function
|
|
84
|
-
while (1) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return _context2.stop();
|
|
97
|
-
}
|
|
81
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
82
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
_context2.next = 1;
|
|
85
|
+
return buildActivitySection(data);
|
|
86
|
+
case 1:
|
|
87
|
+
activitySection = _context2.sent;
|
|
88
|
+
summarySection = buildSummarySection(data);
|
|
89
|
+
titleTable = buildTitleTable(data);
|
|
90
|
+
return _context2.abrupt("return", [titleTable, summarySection, activitySection]);
|
|
91
|
+
case 2:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
98
94
|
}
|
|
99
95
|
}, _callee2);
|
|
100
96
|
}));
|
|
@@ -106,23 +102,21 @@ function buildActivitySection(_x4) {
|
|
|
106
102
|
function _buildActivitySection() {
|
|
107
103
|
_buildActivitySection = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data) {
|
|
108
104
|
var timeline, activitySummary;
|
|
109
|
-
return _regeneratorRuntime.wrap(function
|
|
110
|
-
while (1) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return _context3.stop();
|
|
125
|
-
}
|
|
105
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
106
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
107
|
+
case 0:
|
|
108
|
+
_context3.next = 1;
|
|
109
|
+
return buildTimelineTable(data);
|
|
110
|
+
case 1:
|
|
111
|
+
timeline = _context3.sent;
|
|
112
|
+
_context3.next = 2;
|
|
113
|
+
return buildActivitySummarySection(data);
|
|
114
|
+
case 2:
|
|
115
|
+
activitySummary = _context3.sent;
|
|
116
|
+
return _context3.abrupt("return", [timeline, activitySummary]);
|
|
117
|
+
case 3:
|
|
118
|
+
case "end":
|
|
119
|
+
return _context3.stop();
|
|
126
120
|
}
|
|
127
121
|
}, _callee3);
|
|
128
122
|
}));
|
|
@@ -216,43 +210,41 @@ function buildActivitySummarySection(_x5) {
|
|
|
216
210
|
function _buildActivitySummarySection() {
|
|
217
211
|
_buildActivitySummarySection = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
|
|
218
212
|
var audits, events, issues, settings, tasks, timezone, enterEvents, auditRows, issueRows, scanRows, taskRows, rows, sortedRows, title, header, hLine, activityTable, activitySummarySection;
|
|
219
|
-
return _regeneratorRuntime.wrap(function
|
|
220
|
-
while (1) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return _context4.stop();
|
|
255
|
-
}
|
|
213
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
214
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
215
|
+
case 0:
|
|
216
|
+
audits = data.audits, events = data.events, issues = data.issues, settings = data.settings, tasks = data.tasks, timezone = data.timezone;
|
|
217
|
+
enterEvents = filter(events, function (event) {
|
|
218
|
+
return event.type === 'enter';
|
|
219
|
+
});
|
|
220
|
+
auditRows = map(audits, getFormRowData('audits', data));
|
|
221
|
+
issueRows = map(issues, getFormRowData('issues', data));
|
|
222
|
+
scanRows = map(enterEvents, getScanRowData(data));
|
|
223
|
+
taskRows = map(tasks, getFormRowData('tasks', data));
|
|
224
|
+
rows = [].concat(_toConsumableArray(auditRows), _toConsumableArray(issueRows), _toConsumableArray(scanRows), _toConsumableArray(taskRows));
|
|
225
|
+
sortedRows = sortBy(rows, ['timestamp'], ['asc']);
|
|
226
|
+
title = text('Activity Summary', {
|
|
227
|
+
style: 'summarySectionHeader'
|
|
228
|
+
});
|
|
229
|
+
header = table({
|
|
230
|
+
body: [[title]],
|
|
231
|
+
layout: 'noBorders',
|
|
232
|
+
style: 'summaryHeaderTable'
|
|
233
|
+
});
|
|
234
|
+
hLine = horizontalLine();
|
|
235
|
+
_context4.next = 1;
|
|
236
|
+
return buildActivityTable({
|
|
237
|
+
rows: sortedRows,
|
|
238
|
+
settings: settings,
|
|
239
|
+
timezone: timezone
|
|
240
|
+
});
|
|
241
|
+
case 1:
|
|
242
|
+
activityTable = _context4.sent;
|
|
243
|
+
activitySummarySection = [header, hLine, activityTable];
|
|
244
|
+
return _context4.abrupt("return", activitySummarySection);
|
|
245
|
+
case 2:
|
|
246
|
+
case "end":
|
|
247
|
+
return _context4.stop();
|
|
256
248
|
}
|
|
257
249
|
}, _callee4);
|
|
258
250
|
}));
|
|
@@ -264,143 +256,139 @@ function buildActivityTable(_x6) {
|
|
|
264
256
|
function _buildActivityTable() {
|
|
265
257
|
_buildActivityTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref) {
|
|
266
258
|
var rows, settings, timezone, timezoneAbbr, activityTableHeader, activityTableRows, activityTableBody, activityTable;
|
|
267
|
-
return _regeneratorRuntime.wrap(function
|
|
268
|
-
while (1) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
var
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
_context5.next = 10;
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
_context5.next = 8;
|
|
320
|
-
return summaryFieldsTable({
|
|
321
|
-
fields: summaryFields,
|
|
322
|
-
settings: settings,
|
|
323
|
-
timezone: timezone
|
|
324
|
-
});
|
|
325
|
-
case 8:
|
|
326
|
-
fieldsTable = _context5.sent;
|
|
327
|
-
rows.push([fieldsTable]);
|
|
328
|
-
case 10:
|
|
329
|
-
activityTableRow = [table({
|
|
330
|
-
body: [].concat(rows),
|
|
331
|
-
colSpan: 5,
|
|
332
|
-
dontBreakRows: true,
|
|
333
|
-
headerRow: 0,
|
|
334
|
-
layout: {
|
|
335
|
-
hLineWidth: function hLineWidth() {
|
|
336
|
-
return 0;
|
|
337
|
-
},
|
|
338
|
-
paddingLeft: function paddingLeft() {
|
|
339
|
-
return 0;
|
|
340
|
-
},
|
|
341
|
-
paddingRight: function paddingRight() {
|
|
342
|
-
return 0;
|
|
343
|
-
},
|
|
344
|
-
paddingTop: function paddingTop() {
|
|
345
|
-
return 5;
|
|
346
|
-
},
|
|
347
|
-
paddingBottom: function paddingBottom() {
|
|
348
|
-
return 5;
|
|
349
|
-
},
|
|
350
|
-
vLineWidth: function vLineWidth() {
|
|
351
|
-
return 0;
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
widths: [120, 25, 200, 110, '*']
|
|
355
|
-
})];
|
|
356
|
-
return _context5.abrupt("return", activityTableRow);
|
|
357
|
-
case 12:
|
|
358
|
-
case "end":
|
|
359
|
-
return _context5.stop();
|
|
259
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
260
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
261
|
+
case 0:
|
|
262
|
+
rows = _ref.rows, settings = _ref.settings, timezone = _ref.timezone;
|
|
263
|
+
timezoneAbbr = getTimezoneAbbr(timezone);
|
|
264
|
+
activityTableHeader = [text('Activity', {
|
|
265
|
+
bold: true
|
|
266
|
+
}), {
|
|
267
|
+
text: ''
|
|
268
|
+
}, text('Location', {
|
|
269
|
+
bold: true
|
|
270
|
+
}), text("Timestamp (".concat(timezoneAbbr, ")"), {
|
|
271
|
+
alignment: 'right',
|
|
272
|
+
bold: true
|
|
273
|
+
})];
|
|
274
|
+
_context6.next = 1;
|
|
275
|
+
return Promise.map(rows, /*#__PURE__*/function () {
|
|
276
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
|
|
277
|
+
var link, location, icon, summaryFields, timestamp, title, timezoneHour, iconCell, rows, hasSummaryFields, fieldsTable, activityTableRow;
|
|
278
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
279
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
280
|
+
case 0:
|
|
281
|
+
link = data.link, location = data.location, icon = data.icon, summaryFields = data.summaryFields, timestamp = data.timestamp, title = data.title;
|
|
282
|
+
timezoneHour = getTimezoneDatetime({
|
|
283
|
+
format: 'ddd DD h:mm a',
|
|
284
|
+
showTzAbbr: false,
|
|
285
|
+
timestamp: timestamp,
|
|
286
|
+
timezone: timezone
|
|
287
|
+
});
|
|
288
|
+
iconCell = icon ? {
|
|
289
|
+
alignment: 'center',
|
|
290
|
+
fit: [8, 8],
|
|
291
|
+
image: icon,
|
|
292
|
+
link: link
|
|
293
|
+
} : {
|
|
294
|
+
text: ''
|
|
295
|
+
};
|
|
296
|
+
rows = [[text(title, {
|
|
297
|
+
link: link
|
|
298
|
+
}), iconCell, text(location, {
|
|
299
|
+
link: link
|
|
300
|
+
}), text(timezoneHour, {
|
|
301
|
+
alignment: 'right',
|
|
302
|
+
link: link
|
|
303
|
+
})]];
|
|
304
|
+
hasSummaryFields = !isEmpty(summaryFields);
|
|
305
|
+
if (!hasSummaryFields) {
|
|
306
|
+
_context5.next = 2;
|
|
307
|
+
break;
|
|
360
308
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
309
|
+
_context5.next = 1;
|
|
310
|
+
return summaryFieldsTable({
|
|
311
|
+
fields: summaryFields,
|
|
312
|
+
settings: settings,
|
|
313
|
+
timezone: timezone
|
|
314
|
+
});
|
|
315
|
+
case 1:
|
|
316
|
+
fieldsTable = _context5.sent;
|
|
317
|
+
rows.push([fieldsTable]);
|
|
318
|
+
case 2:
|
|
319
|
+
activityTableRow = [table({
|
|
320
|
+
body: [].concat(rows),
|
|
321
|
+
colSpan: 5,
|
|
322
|
+
dontBreakRows: true,
|
|
323
|
+
headerRow: 0,
|
|
324
|
+
layout: {
|
|
325
|
+
hLineWidth: function hLineWidth() {
|
|
326
|
+
return 0;
|
|
327
|
+
},
|
|
328
|
+
paddingLeft: function paddingLeft() {
|
|
329
|
+
return 0;
|
|
330
|
+
},
|
|
331
|
+
paddingRight: function paddingRight() {
|
|
332
|
+
return 0;
|
|
333
|
+
},
|
|
334
|
+
paddingTop: function paddingTop() {
|
|
335
|
+
return 5;
|
|
336
|
+
},
|
|
337
|
+
paddingBottom: function paddingBottom() {
|
|
338
|
+
return 5;
|
|
339
|
+
},
|
|
340
|
+
vLineWidth: function vLineWidth() {
|
|
341
|
+
return 0;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
widths: [120, 25, 200, 110, '*']
|
|
345
|
+
})];
|
|
346
|
+
return _context5.abrupt("return", activityTableRow);
|
|
347
|
+
case 3:
|
|
348
|
+
case "end":
|
|
349
|
+
return _context5.stop();
|
|
395
350
|
}
|
|
351
|
+
}, _callee5);
|
|
352
|
+
}));
|
|
353
|
+
return function (_x8) {
|
|
354
|
+
return _ref6.apply(this, arguments);
|
|
355
|
+
};
|
|
356
|
+
}());
|
|
357
|
+
case 1:
|
|
358
|
+
activityTableRows = _context6.sent;
|
|
359
|
+
activityTableBody = isEmpty(activityTableRows) ? [[text('No other activity', {
|
|
360
|
+
colSpan: 4
|
|
361
|
+
})]] : activityTableRows;
|
|
362
|
+
activityTable = table({
|
|
363
|
+
body: [activityTableHeader].concat(_toConsumableArray(activityTableBody)),
|
|
364
|
+
dontBreakRows: true,
|
|
365
|
+
layout: {
|
|
366
|
+
hLineWidth: function hLineWidth() {
|
|
367
|
+
return 0;
|
|
368
|
+
},
|
|
369
|
+
fillColor: zebraFillColor,
|
|
370
|
+
paddingLeft: function paddingLeft() {
|
|
371
|
+
return 5;
|
|
396
372
|
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
373
|
+
paddingRight: function paddingRight() {
|
|
374
|
+
return 5;
|
|
375
|
+
},
|
|
376
|
+
paddingTop: function paddingTop() {
|
|
377
|
+
return 5;
|
|
378
|
+
},
|
|
379
|
+
paddingBottom: function paddingBottom() {
|
|
380
|
+
return 5;
|
|
381
|
+
},
|
|
382
|
+
vLineWidth: function vLineWidth() {
|
|
383
|
+
return 0;
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
widths: [110, 15, 230, 80, '*']
|
|
387
|
+
});
|
|
388
|
+
return _context6.abrupt("return", activityTable);
|
|
389
|
+
case 2:
|
|
390
|
+
case "end":
|
|
391
|
+
return _context6.stop();
|
|
404
392
|
}
|
|
405
393
|
}, _callee6);
|
|
406
394
|
}));
|
|
@@ -459,72 +447,68 @@ function buildTimelineTable(_x7) {
|
|
|
459
447
|
function _buildTimelineTable() {
|
|
460
448
|
_buildTimelineTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
|
|
461
449
|
var timezone, timezoneAbbr, shiftRows, sortedRows, timeline, timelineHeaderRow, timelineTable, title, header, hLine, timelineSection;
|
|
462
|
-
return _regeneratorRuntime.wrap(function
|
|
463
|
-
while (1) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
case 14:
|
|
525
|
-
case "end":
|
|
526
|
-
return _context8.stop();
|
|
527
|
-
}
|
|
450
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
451
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
452
|
+
case 0:
|
|
453
|
+
timezone = data.timezone;
|
|
454
|
+
timezoneAbbr = getTimezoneAbbr(timezone);
|
|
455
|
+
shiftRows = getShiftRowData(data);
|
|
456
|
+
sortedRows = sortBy(shiftRows, ['timestamp'], ['asc']);
|
|
457
|
+
_context8.next = 1;
|
|
458
|
+
return Promise.map(sortedRows, /*#__PURE__*/function () {
|
|
459
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
|
|
460
|
+
var location, timestamp, title, timezoneHour, rows;
|
|
461
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
462
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
463
|
+
case 0:
|
|
464
|
+
location = data.location, timestamp = data.timestamp, title = data.title;
|
|
465
|
+
timezoneHour = getTimezoneDatetime({
|
|
466
|
+
format: 'ddd DD h:mm a',
|
|
467
|
+
showTzAbbr: false,
|
|
468
|
+
timestamp: timestamp,
|
|
469
|
+
timezone: timezone
|
|
470
|
+
});
|
|
471
|
+
rows = [text(title), text(location), text(timezoneHour, {
|
|
472
|
+
alignment: 'right'
|
|
473
|
+
})];
|
|
474
|
+
return _context7.abrupt("return", rows);
|
|
475
|
+
case 1:
|
|
476
|
+
case "end":
|
|
477
|
+
return _context7.stop();
|
|
478
|
+
}
|
|
479
|
+
}, _callee7);
|
|
480
|
+
}));
|
|
481
|
+
return function (_x9) {
|
|
482
|
+
return _ref7.apply(this, arguments);
|
|
483
|
+
};
|
|
484
|
+
}());
|
|
485
|
+
case 1:
|
|
486
|
+
timeline = _context8.sent;
|
|
487
|
+
timelineHeaderRow = [text('Activity', {
|
|
488
|
+
bold: true
|
|
489
|
+
}), text('Location', {
|
|
490
|
+
bold: true
|
|
491
|
+
}), text("Timestamp (".concat(timezoneAbbr, ")"), {
|
|
492
|
+
alignment: 'right',
|
|
493
|
+
bold: true
|
|
494
|
+
})];
|
|
495
|
+
timelineTable = threeColumnTable({
|
|
496
|
+
body: [timelineHeaderRow].concat(_toConsumableArray(timeline))
|
|
497
|
+
});
|
|
498
|
+
title = text('Timeline', {
|
|
499
|
+
style: 'timelineTitle'
|
|
500
|
+
});
|
|
501
|
+
header = table({
|
|
502
|
+
body: [[title]],
|
|
503
|
+
layout: 'noBorders',
|
|
504
|
+
style: 'summaryHeaderTable'
|
|
505
|
+
});
|
|
506
|
+
hLine = horizontalLine();
|
|
507
|
+
timelineSection = [header, hLine, timelineTable];
|
|
508
|
+
return _context8.abrupt("return", timelineSection);
|
|
509
|
+
case 2:
|
|
510
|
+
case "end":
|
|
511
|
+
return _context8.stop();
|
|
528
512
|
}
|
|
529
513
|
}, _callee8);
|
|
530
514
|
}));
|