fleetmap-reports 1.0.350 → 1.0.353

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.350",
3
+ "version": "1.0.353",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -115,7 +115,7 @@ async function processDevices(from, to, devices, geofences, drivers, data, tracc
115
115
 
116
116
  async function exportSpeedingReportToPDF(userData, reportData) {
117
117
  console.log('Export to PDF')
118
-
118
+ const lang = userData.user.attributes.lang || (navigator && navigator.language)
119
119
  const translations = getTranslations(userData)
120
120
  const timezone = userData.user.attributes.timezone
121
121
 
@@ -124,6 +124,7 @@ async function exportIdleReportToPDF(userData, reportData) {
124
124
  console.log('Export to PDF')
125
125
 
126
126
  const timezone = userData.user.attributes.timezone
127
+ const lang = userData.user.attributes.lang || (navigator && navigator.language)
127
128
  const translations = getTranslations(userData)
128
129
 
129
130
  const idleData = userData.byDriver ? reportData.drivers : reportData.devices
package/src/index.test.js CHANGED
@@ -166,7 +166,7 @@ describe('Test_Reports', function() {
166
166
  assert.equal(device.summary[0].distance, 1386519.1300000101)
167
167
  assert.equal(device.summary[0].startTime, '2022-01-01T13:35:47.000+0000')
168
168
  assert.equal(device.summary[0].endTime, '2022-01-30T13:48:18.000+0000')
169
- }, 20000)
169
+ }, 90000)
170
170
  it('Activity byDevice groupByDay', async () => {
171
171
  const report = await getReports()
172
172
  const userData = await report.getUserData()
@@ -180,7 +180,7 @@ describe('Test_Reports', function() {
180
180
  assert.equal(device.summary[5].distance, 77020.37999999523)
181
181
  assert.equal(device.summary[5].startTime, '2022-01-06T18:35:04.000+0000')
182
182
  assert.equal(device.summary[5].endTime, '2022-01-06T19:54:27.000+0000')
183
- }, 60000)
183
+ }, 90000)
184
184
  it('test allinone', async() => {
185
185
  console.log('Start')
186
186
  const reports = await getReports()
@@ -4,7 +4,7 @@ require('jspdf-autotable')
4
4
  const {headerFromUser} = require("./util/pdfDocument");
5
5
  const {getStyle} = require("./reportStyle")
6
6
  const {getUserPartner} = require("fleetmap-partners");
7
- const {convertToLocaleString} = require("./util/utils");
7
+ const {convertToLocaleString, getTranslations} = require("./util/utils");
8
8
 
9
9
  const fileName = 'LocationReport'
10
10
 
@@ -104,6 +104,7 @@ async function exportLocationReportToPDF(userData, reportData) {
104
104
  console.log('Export to PDF')
105
105
 
106
106
  const translations = getTranslations(userData)
107
+ const lang = userData.user.attributes.lang || (navigator && navigator.language)
107
108
  const timezone = userData.user.attributes.timezone
108
109
 
109
110
  const headers = [
@@ -430,7 +430,6 @@ async function exportSpeedingReportToPDF(userData, reportData) {
430
430
  }
431
431
  }
432
432
 
433
-
434
433
  function exportSpeedingReportToExcel(userData, reportData) {
435
434
  console.log('Export to Excel')
436
435
 
@@ -205,6 +205,7 @@ async function exportTripReportToPDF(userData, reportData) {
205
205
 
206
206
  const timezone = userData.user.attributes.timezone
207
207
  const translations = getTranslations(userData)
208
+ const lang = userData.user.attributes.lang || (navigator && navigator.language)
208
209
  const tripsData = userData.byDriver ? reportData.drivers : reportData.devices
209
210
 
210
211
  const headers = [
@@ -150,6 +150,7 @@ async function exportZoneReportToPDF(userData, reportData) {
150
150
 
151
151
  const timezone = userData.user.attributes.timezone
152
152
  const translations = getTranslations(userData)
153
+ const lang = userData.user.attributes.lang || (navigator && navigator.language)
153
154
 
154
155
  const headers = [
155
156
  translations.report.enter,