@lingk/sync 2.3.5 → 2.3.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.
@@ -5960,6 +5960,7 @@ module.exports =
5960
5960
  };
5961
5961
 
5962
5962
  _this.onDrop = function (fs) {
5963
+ _this.setState({ fileLoading: true });
5963
5964
  var meta = [].concat(_toConsumableArray(_this.state.meta));
5964
5965
  var counter = 0;
5965
5966
  var fileContents = [].concat(_toConsumableArray(_this.state.fileContents));
@@ -5995,7 +5996,7 @@ module.exports =
5995
5996
  sheetCounter += 1;
5996
5997
  counter += 1;
5997
5998
  if (counter >= fs.length && sheetCounter === sheetNames.length) {
5998
- _this.setState({ meta: meta });
5999
+ _this.setState({ meta: meta, fileLoading: false });
5999
6000
  _this.props.onDrop();
6000
6001
  }
6001
6002
  });
@@ -6005,7 +6006,7 @@ module.exports =
6005
6006
  meta = meta.concat(Object.assign({}, csvMeta, { fileType: extension }));
6006
6007
  counter += 1;
6007
6008
  if (counter === fs.length) {
6008
- _this.setState({ meta: meta });
6009
+ _this.setState({ meta: meta, fileLoading: false });
6009
6010
  _this.props.onDrop();
6010
6011
  }
6011
6012
  });
@@ -6019,7 +6020,7 @@ module.exports =
6019
6020
  meta = meta.concat(Object.assign({}, fileMeta, { fileType: extension }));
6020
6021
  counter += 1;
6021
6022
  if (counter === fs.length) {
6022
- _this.setState({ meta: meta });
6023
+ _this.setState({ meta: meta, fileLoading: false });
6023
6024
  // this.props.onDrop();
6024
6025
  }
6025
6026
  }
@@ -6032,9 +6033,14 @@ module.exports =
6032
6033
  meta = meta.concat(Object.assign({}, csvMeta, { fileType: extension }));
6033
6034
  counter += 1;
6034
6035
  if (counter === fs.length) {
6035
- _this.setState({ meta: meta });
6036
+ _this.setState({ meta: meta, fileLoading: false });
6036
6037
  _this.props.onDrop();
6037
6038
  }
6039
+ } else {
6040
+ _this.setState({ dropError: "File type not accepted.", fileLoading: false });
6041
+ setTimeout(function () {
6042
+ _this.setState({ dropError: null });
6043
+ }, 3500);
6038
6044
  }
6039
6045
 
6040
6046
  // ADD TO CONTENTS, TO UPLOAD
@@ -6051,7 +6057,7 @@ module.exports =
6051
6057
  reader.readAsText(file);
6052
6058
  }
6053
6059
  } else {
6054
- _this.setState({ dropError: "File type not accepted." });
6060
+ _this.setState({ dropError: "File type not accepted.", fileLoading: false });
6055
6061
  setTimeout(function () {
6056
6062
  _this.setState({ dropError: null });
6057
6063
  }, 3500);
@@ -6074,6 +6080,8 @@ module.exports =
6074
6080
  _this.setState({ uploading: true });
6075
6081
  setCsvFields(_this.state.meta, _this.state.fileContents, providerType).then(function () {
6076
6082
  _this.setState({ meta: [], fileContents: [], uploading: false });
6083
+ // update file list
6084
+ _this.handlePageChange(_this.state.activePage);
6077
6085
  });
6078
6086
  };
6079
6087
 
@@ -6089,7 +6097,11 @@ module.exports =
6089
6097
  _this.actuallyDeleteFile = function () {
6090
6098
  var fileName = _this.state.deleteModalOpenFile;
6091
6099
  _this.setState({ deleteModalOpenFile: null, isDeletingFile: fileName });
6092
- _this.props.deleteFlatFile(fileName);
6100
+ _this.props.deleteFlatFile(fileName).then(function (data) {
6101
+ // update file list
6102
+ _this.setState({ isDeletingFile: null });
6103
+ _this.handlePageChange(_this.state.activePage);
6104
+ });
6093
6105
  };
6094
6106
 
6095
6107
  _this.closeDeleteModal = function () {
@@ -6108,7 +6120,8 @@ module.exports =
6108
6120
  fileSchemaCount: 0,
6109
6121
  activePage: 1,
6110
6122
  filesPerPage: 20,
6111
- fileSchema: []
6123
+ fileSchema: [],
6124
+ fileLoading: false
6112
6125
  };
6113
6126
  return _this;
6114
6127
  }
@@ -6131,7 +6144,8 @@ module.exports =
6131
6144
  dropError = _state.dropError,
6132
6145
  sortFileTableBy = _state.sortFileTableBy,
6133
6146
  isDeletingFile = _state.isDeletingFile,
6134
- deleteModalOpenFile = _state.deleteModalOpenFile;
6147
+ deleteModalOpenFile = _state.deleteModalOpenFile,
6148
+ fileLoading = _state.fileLoading;
6135
6149
  var inputs = this.props.inputs;
6136
6150
 
6137
6151
  var Button = inputs.Button;
@@ -6190,7 +6204,7 @@ module.exports =
6190
6204
  )
6191
6205
  )
6192
6206
  ),
6193
- _react2.default.createElement(
6207
+ !fileLoading ? _react2.default.createElement(
6194
6208
  "div",
6195
6209
  {
6196
6210
  style: {
@@ -6270,6 +6284,16 @@ module.exports =
6270
6284
  })
6271
6285
  )
6272
6286
  )
6287
+ ) : _react2.default.createElement(
6288
+ "div",
6289
+ {
6290
+ style: {
6291
+ marginLeft: 50,
6292
+ display: "inline-block"
6293
+ }
6294
+ },
6295
+ _react2.default.createElement(Spinner, null),
6296
+ " Processing...."
6273
6297
  ),
6274
6298
  this.props.fileSchemaCount ? fileSchema && fileSchema.length > 0 && _react2.default.createElement(
6275
6299
  "div",