@@ -1262,13 +1262,13 @@ class Browser extends DashboardView {
1262
1262
const className = this . props . params . className ;
1263
1263
const query = new Parse . Query ( className ) ;
1264
1264
1265
- if ( ! rows [ "*" ] ) {
1265
+ if ( ! rows [ '*' ] ) {
1266
1266
// Export selected
1267
1267
const objectIds = [ ] ;
1268
1268
for ( const objectId in this . state . rowsToExport ) {
1269
1269
objectIds . push ( objectId ) ;
1270
1270
}
1271
- query . containedIn ( " objectId" , objectIds ) ;
1271
+ query . containedIn ( ' objectId' , objectIds ) ;
1272
1272
query . limit ( objectIds . length ) ;
1273
1273
}
1274
1274
@@ -1286,8 +1286,8 @@ class Browser extends DashboardView {
1286
1286
className
1287
1287
) . filter ( ( column ) => column . visible ) ;
1288
1288
1289
- if ( type === " .json" ) {
1290
- const element = document . createElement ( "a" ) ;
1289
+ if ( type === ' .json' ) {
1290
+ const element = document . createElement ( 'a' ) ;
1291
1291
const file = new Blob (
1292
1292
[
1293
1293
JSON . stringify (
@@ -1300,7 +1300,7 @@ class Browser extends DashboardView {
1300
1300
indentation ? 2 : null ,
1301
1301
) ,
1302
1302
] ,
1303
- { type : " application/json" }
1303
+ { type : ' application/json' }
1304
1304
) ;
1305
1305
element . href = URL . createObjectURL ( file ) ;
1306
1306
element . download = `${ className } .json` ;
@@ -1310,41 +1310,41 @@ class Browser extends DashboardView {
1310
1310
return ;
1311
1311
}
1312
1312
1313
- let csvString = columns . map ( ( column ) => column . name ) . join ( "," ) + "\n" ;
1313
+ let csvString = columns . map ( ( column ) => column . name ) . join ( ',' ) + '\n' ;
1314
1314
for ( const object of objects ) {
1315
1315
const row = columns
1316
1316
. map ( ( column ) => {
1317
1317
const type = columnsObject [ column . name ] . type ;
1318
- if ( column . name === " objectId" ) {
1318
+ if ( column . name === ' objectId' ) {
1319
1319
return object . id ;
1320
- } else if ( type === " Relation" || type === " Pointer" ) {
1320
+ } else if ( type === ' Relation' || type === ' Pointer' ) {
1321
1321
if ( object . get ( column . name ) ) {
1322
1322
return object . get ( column . name ) . id ;
1323
1323
} else {
1324
- return "" ;
1324
+ return '' ;
1325
1325
}
1326
1326
} else {
1327
1327
let colValue ;
1328
- if ( column . name === " ACL" ) {
1328
+ if ( column . name === ' ACL' ) {
1329
1329
colValue = object . getACL ( ) ;
1330
1330
} else {
1331
1331
colValue = object . get ( column . name ) ;
1332
1332
}
1333
1333
// Stringify objects and arrays
1334
1334
if (
1335
1335
Object . prototype . toString . call ( colValue ) ===
1336
- " [object Object]" ||
1337
- Object . prototype . toString . call ( colValue ) === " [object Array]"
1336
+ ' [object Object]' ||
1337
+ Object . prototype . toString . call ( colValue ) === ' [object Array]'
1338
1338
) {
1339
1339
colValue = JSON . stringify ( colValue ) ;
1340
1340
}
1341
- if ( typeof colValue === " string" ) {
1341
+ if ( typeof colValue === ' string' ) {
1342
1342
if ( colValue . includes ( '"' ) ) {
1343
1343
// Has quote in data, escape and quote
1344
1344
// If the value contains both a quote and delimiter, adding quotes and escaping will take care of both scenarios
1345
1345
colValue = colValue . split ( '"' ) . join ( '""' ) ;
1346
1346
return `"${ colValue } "` ;
1347
- } else if ( colValue . includes ( "," ) ) {
1347
+ } else if ( colValue . includes ( ',' ) ) {
1348
1348
// Has delimiter in data, surround with quote (which the value doesn't already contain)
1349
1349
return `"${ colValue } "` ;
1350
1350
} else {
@@ -1353,27 +1353,27 @@ class Browser extends DashboardView {
1353
1353
}
1354
1354
} else if ( colValue === undefined ) {
1355
1355
// Export as empty CSV field
1356
- return "" ;
1356
+ return '' ;
1357
1357
} else {
1358
1358
return `${ colValue } ` ;
1359
1359
}
1360
1360
}
1361
1361
} )
1362
- . join ( "," ) ;
1363
- csvString += row + "\n" ;
1362
+ . join ( ',' ) ;
1363
+ csvString += row + '\n' ;
1364
1364
}
1365
1365
1366
1366
// Deliver to browser to download file
1367
- const element = document . createElement ( "a" ) ;
1368
- const file = new Blob ( [ csvString ] , { type : " text/csv" } ) ;
1367
+ const element = document . createElement ( 'a' ) ;
1368
+ const file = new Blob ( [ csvString ] , { type : ' text/csv' } ) ;
1369
1369
element . href = URL . createObjectURL ( file ) ;
1370
1370
element . download = `${ className } .csv` ;
1371
1371
document . body . appendChild ( element ) ; // Required for this to work in FireFox
1372
1372
element . click ( ) ;
1373
1373
document . body . removeChild ( element ) ;
1374
1374
} ;
1375
1375
1376
- if ( ! rows [ "*" ] ) {
1376
+ if ( ! rows [ '*' ] ) {
1377
1377
const objects = await query . find ( { useMasterKey : true } ) ;
1378
1378
processObjects ( objects ) ;
1379
1379
this . setState ( { exporting : false , exportingCount : objects . length } ) ;
0 commit comments