@lingk/sync 1.1.13 → 1.1.14

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.
@@ -3823,7 +3823,6 @@ module.exports =
3823
3823
 
3824
3824
  _this.setState({ uploading: true });
3825
3825
  setCsvFields(_this.state.meta, _this.state.fileContents, providerType).then(function () {
3826
- console.log("SET META BACK");
3827
3826
  _this.setState({ meta: [], fileContents: [], uploading: false });
3828
3827
  });
3829
3828
  };
@@ -3837,8 +3836,8 @@ module.exports =
3837
3836
  meta: [],
3838
3837
  fileContents: [],
3839
3838
  uploading: false,
3840
- dropError: null
3841
- };
3839
+ dropError: null,
3840
+ sortFileTableBy: 'uploadedTime' };
3842
3841
  return _this;
3843
3842
  }
3844
3843
 
@@ -3850,15 +3849,24 @@ module.exports =
3850
3849
  var _state = this.state,
3851
3850
  meta = _state.meta,
3852
3851
  uploading = _state.uploading,
3853
- dropError = _state.dropError;
3854
- var _props = this.props,
3855
- fileSchema = _props.fileSchema,
3856
- inputs = _props.inputs;
3852
+ dropError = _state.dropError,
3853
+ sortFileTableBy = _state.sortFileTableBy;
3854
+ var inputs = this.props.inputs;
3857
3855
 
3858
3856
  var Button = inputs.Button;
3859
3857
  var Spinner = inputs.Spinner;
3860
3858
  var hasFile = meta && meta.length > 0;
3861
3859
 
3860
+ var fileSchema = [];
3861
+ if (this.props.fileSchema && this.props.fileSchema.length) {
3862
+ fileSchema = [].concat(_toConsumableArray(this.props.fileSchema));
3863
+ fileSchema = fileSchema.sort(function (a, b) {
3864
+ var term = sortFileTableBy;
3865
+ if (term === 'uploadedTime') {}
3866
+ return a[term] > b[term];
3867
+ });
3868
+ }
3869
+
3862
3870
  return _react2.default.createElement(
3863
3871
  'div',
3864
3872
  null,
@@ -3951,7 +3959,7 @@ module.exports =
3951
3959
  ),
3952
3960
  _react2.default.createElement(
3953
3961
  _reactBootstrap.Table,
3954
- { bordered: true, condensed: true },
3962
+ { bordered: true, condensed: true, className: 'file-manager-table' },
3955
3963
  _react2.default.createElement(
3956
3964
  'thead',
3957
3965
  null,
@@ -3960,18 +3968,24 @@ module.exports =
3960
3968
  null,
3961
3969
  _react2.default.createElement(
3962
3970
  'th',
3963
- null,
3971
+ { onClick: function onClick() {
3972
+ return _this2.setState({ sortFileTableBy: 'name' });
3973
+ } },
3964
3974
  'Name'
3965
3975
  ),
3966
3976
  _react2.default.createElement(
3967
3977
  'th',
3968
- null,
3978
+ { onClick: function onClick() {
3979
+ return _this2.setState({ sortFileTableBy: 'byteSize' });
3980
+ } },
3969
3981
  'Size'
3970
3982
  ),
3971
3983
  _react2.default.createElement(
3972
3984
  'th',
3973
- null,
3974
- 'Date Uploaded'
3985
+ { onClick: function onClick() {
3986
+ return _this2.setState({ sortFileTableBy: 'uploadedTime' });
3987
+ } },
3988
+ 'Date uploaded'
3975
3989
  )
3976
3990
  )
3977
3991
  ),