@lingk/sync 1.1.5 → 1.1.6

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/README.md CHANGED
@@ -20,6 +20,5 @@ Serve the `/build` version for testing
20
20
  __`npm publish`__
21
21
  Publish `/build` directory to @lingk/sync
22
22
 
23
-
24
-
25
-
23
+ ### notes
24
+ - react-bootstrap 0.32.1 works with our webpack/babel build
@@ -87,12 +87,18 @@ module.exports =
87
87
  /* 8 */,
88
88
  /* 9 */,
89
89
  /* 10 */,
90
- /* 11 */,
90
+ /* 11 */
91
+ /***/ function(module, exports) {
92
+
93
+ module.exports = require("moment");
94
+
95
+ /***/ },
91
96
  /* 12 */,
92
97
  /* 13 */,
93
98
  /* 14 */,
94
99
  /* 15 */,
95
- /* 16 */
100
+ /* 16 */,
101
+ /* 17 */
96
102
  /***/ function(module, exports, __webpack_require__) {
97
103
 
98
104
  /* WEBPACK VAR INJECTION */(function(global) {/*!
@@ -1888,7 +1894,6 @@ module.exports =
1888
1894
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1889
1895
 
1890
1896
  /***/ },
1891
- /* 17 */,
1892
1897
  /* 18 */,
1893
1898
  /* 19 */,
1894
1899
  /* 20 */,
@@ -3408,7 +3413,7 @@ module.exports =
3408
3413
  return cpt;
3409
3414
  }));
3410
3415
 
3411
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))
3416
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(17).Buffer))
3412
3417
 
3413
3418
  /***/ },
3414
3419
  /* 29 */
@@ -3615,6 +3620,10 @@ module.exports =
3615
3620
 
3616
3621
  var _xlsx2 = _interopRequireDefault(_xlsx);
3617
3622
 
3623
+ var _moment = __webpack_require__(11);
3624
+
3625
+ var _moment2 = _interopRequireDefault(_moment);
3626
+
3618
3627
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3619
3628
 
3620
3629
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
@@ -3727,8 +3736,15 @@ module.exports =
3727
3736
  var data = e.target.result;
3728
3737
  var csv = null;
3729
3738
  if (isXLS) {
3739
+ var i;
3740
+
3730
3741
  (function () {
3731
- var workbook = _xlsx2.default.read(data, { type: 'binary' });
3742
+ var binary = '';
3743
+ var bytes = new Uint8Array(data);
3744
+ for (i = 0; i < length; i++) {
3745
+ binary += String.fromCharCode(bytes[i]);
3746
+ }
3747
+ var workbook = _xlsx2.default.read(binary, { type: 'binary' });
3732
3748
  workbook.SheetNames.forEach(function (sn) {
3733
3749
  if (sn !== 'Export Summary') {
3734
3750
  csv = _xlsx2.default.utils.sheet_to_csv(workbook.Sheets[sn]);
@@ -3769,10 +3785,10 @@ module.exports =
3769
3785
  if (contentCounter === fs.length) {
3770
3786
  _this.setState({ fileContents: fileContents });
3771
3787
  }
3772
- };
3788
+ }; // end file reader on load callback
3773
3789
 
3774
3790
  if (isXLS) {
3775
- reader.readAsBinaryString(file);
3791
+ reader.readAsArrayBuffer(file); // read as binary string???
3776
3792
  } else {
3777
3793
  reader.readAsText(file);
3778
3794
  }
@@ -3828,9 +3844,10 @@ module.exports =
3828
3844
  uploading = _state.uploading,
3829
3845
  dropError = _state.dropError;
3830
3846
  var _props = this.props,
3831
- metadata = _props.metadata,
3847
+ fileSchema = _props.fileSchema,
3832
3848
  inputs = _props.inputs;
3833
3849
 
3850
+ var files = fileSchema && fileSchema.resources;
3834
3851
  var Button = inputs.Button;
3835
3852
  var Spinner = inputs.Spinner;
3836
3853
  var hasFile = meta && meta.length > 0;
@@ -3901,7 +3918,7 @@ module.exports =
3901
3918
  })
3902
3919
  )
3903
3920
  ),
3904
- !uploading && !hasFile && metadata && metadata.length > 0 && _react2.default.createElement(
3921
+ !uploading && !hasFile && files && files.length > 0 && _react2.default.createElement(
3905
3922
  'div',
3906
3923
  { style: {
3907
3924
  marginLeft: 20, display: 'inline-block', marginTop: 13, verticalAlign: 'top'
@@ -3912,18 +3929,23 @@ module.exports =
3912
3929
  _react2.default.createElement(
3913
3930
  'strong',
3914
3931
  { style: { marginRight: 5 } },
3915
- metadata && metadata.length
3932
+ files && files.length
3933
+ ),
3934
+ _react2.default.createElement(
3935
+ 'strong',
3936
+ null,
3937
+ 'file' + (files.length === 1 ? '' : 's') + ' uploaded on '
3916
3938
  ),
3917
3939
  _react2.default.createElement(
3918
3940
  'strong',
3919
3941
  null,
3920
- 'file' + (metadata.length === 1 ? '' : 's') + ' uploaded'
3942
+ (0, _moment2.default)(fileSchema.uploadedTime).format('MMM Do Y, h:mm a')
3921
3943
  )
3922
3944
  ),
3923
3945
  _react2.default.createElement(
3924
3946
  'ul',
3925
3947
  { style: { padding: 0 } },
3926
- metadata.map(function (f, i) {
3948
+ files.map(function (f, i) {
3927
3949
  return _react2.default.createElement(
3928
3950
  'li',
3929
3951
  { key: i, style: { listStyle: 'none' } },
@@ -4253,7 +4275,7 @@ module.exports =
4253
4275
  wizard = _props.wizard,
4254
4276
  adapterSecret = _props.adapterSecret,
4255
4277
  checkOauthCreds = _props.checkOauthCreds,
4256
- metadata = _props.metadata,
4278
+ fileSchema = _props.fileSchema,
4257
4279
  getOauthUrl = _props.getOauthUrl,
4258
4280
  generateNewAdapterSecret = _props.generateNewAdapterSecret,
4259
4281
  setCsvFields = _props.setCsvFields,
@@ -4312,7 +4334,7 @@ module.exports =
4312
4334
  checkOauthCreds: checkOauthCreds, envCheckResult: envCheckResult,
4313
4335
  checking: checking, inputs: inputs, formValues: formValues,
4314
4336
  isWiz: _react2.default.Children.count(this.props.children) > 0
4315
- }) : isFlatFile ? _react2.default.createElement(_flatfile2.default, { wizard: wizard, onCheck: check, metadata: metadata,
4337
+ }) : isFlatFile ? _react2.default.createElement(_flatfile2.default, { wizard: wizard, onCheck: check, fileSchema: fileSchema,
4316
4338
  checking: checking, setCsvFields: setCsvFields,
4317
4339
  providerType: providerType, inputs: inputs,
4318
4340
  accountKey: accountKey, tenantKey: tenantKey,
@@ -24899,7 +24921,7 @@ module.exports =
24899
24921
  (9)
24900
24922
  }));
24901
24923
 
24902
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer, (function() { return this; }())))
24924
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(17).Buffer, (function() { return this; }())))
24903
24925
 
24904
24926
  /***/ },
24905
24927
  /* 73 */
@@ -45154,7 +45176,7 @@ module.exports =
45154
45176
  /*exported XLS, ODS */
45155
45177
  var XLS = XLSX, ODS = XLSX;
45156
45178
 
45157
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(16).Buffer, __webpack_require__(70)))
45179
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(17).Buffer, __webpack_require__(70)))
45158
45180
 
45159
45181
  /***/ },
45160
45182
  /* 74 */