@lingk/sync 2.3.4 → 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",
@@ -6763,9 +6787,21 @@ module.exports =
6763
6787
  var _this = _possibleConstructorReturn(this, (EnvSection.__proto__ || Object.getPrototypeOf(EnvSection)).call(this));
6764
6788
 
6765
6789
  _this.onDefaultConnectionChange = function () {
6766
- _this.setState({
6767
- defaultConnection: !_this.state.defaultConnection
6768
- });
6790
+ var defaultConnection = _this.state.defaultConnection;
6791
+ var _this$props = _this.props,
6792
+ config = _this$props.config,
6793
+ multipleConnectors = _this$props.multipleConnectors;
6794
+
6795
+ var providerType = config && config.type;
6796
+ if (defaultConnection && (multipleConnectors.includes(config.label) || multipleConnectors.includes(providerType) || multipleConnectors.includes(config.credentialType))) {
6797
+ _this.setState({
6798
+ warningMessage: config && config.label
6799
+ });
6800
+ } else {
6801
+ _this.setState({
6802
+ defaultConnection: !defaultConnection
6803
+ });
6804
+ }
6769
6805
  };
6770
6806
 
6771
6807
  _this.onAPIAccessChange = function () {
@@ -6775,9 +6811,9 @@ module.exports =
6775
6811
  };
6776
6812
 
6777
6813
  _this.credKeyPress = function (e) {
6778
- var _this$props = _this.props,
6779
- checking = _this$props.checking,
6780
- check = _this$props.check;
6814
+ var _this$props2 = _this.props,
6815
+ checking = _this$props2.checking,
6816
+ check = _this$props2.check;
6781
6817
 
6782
6818
  if (e.key === "Enter" && checking !== true) {
6783
6819
  check(_this.state.actualCreds || {});
@@ -6951,7 +6987,6 @@ module.exports =
6951
6987
  var formCreds = creds;
6952
6988
  return !Object.keys(formCreds).includes(c.split(" ").join(""));
6953
6989
  });
6954
-
6955
6990
  var AmazonRDSdbs = [{
6956
6991
  name: "PostgreSQL",
6957
6992
  satisfiesSearch: true,
@@ -7244,13 +7279,36 @@ module.exports =
7244
7279
  null,
7245
7280
  this.props.children
7246
7281
  ),
7247
- _react2.default.createElement("br", null),
7282
+ this.state.warningMessage && _react2.default.createElement(
7283
+ "div",
7284
+ { style: { marginTop: 10, maxWidth: 450 } },
7285
+ _react2.default.createElement(
7286
+ _reactBootstrap.Alert,
7287
+ { bsStyle: "danger", style: { textAlign: "left" } },
7288
+ _react2.default.createElement(
7289
+ "strong",
7290
+ null,
7291
+ "You can not uncheck this default connection!"
7292
+ ),
7293
+ _react2.default.createElement("br", null),
7294
+ "There are multiple connections configured for ",
7295
+ _react2.default.createElement(
7296
+ "strong",
7297
+ null,
7298
+ this.state.warningMessage
7299
+ ),
7300
+ " connector in this environment.",
7301
+ _react2.default.createElement("br", null),
7302
+ "Please select different connection as a default connection."
7303
+ )
7304
+ ),
7248
7305
  config.type != "LocalFile" && _react2.default.createElement(APIAcessHandle, {
7249
7306
  APIAccess: this.state.APIAccess,
7250
7307
  onChangeHandle: this.onAPIAccessChange,
7251
7308
  defaultConnection: this.state.defaultConnection,
7252
7309
  onDefaultConnectionChange: this.onDefaultConnectionChange,
7253
- disableMarkConnection: wizard.disableMarkConnection
7310
+ disableMarkConnection: wizard.disableMarkConnection,
7311
+ misconfiguredConnectors: this.props.misconfiguredConnectors
7254
7312
  })
7255
7313
  );
7256
7314
  }
@@ -7329,7 +7387,7 @@ module.exports =
7329
7387
 
7330
7388
  return _react2.default.createElement(
7331
7389
  "div",
7332
- null,
7390
+ { style: { marginTop: 10 } },
7333
7391
  _react2.default.createElement(
7334
7392
  _reactBootstrap.Checkbox,
7335
7393
  {