@lingk/sync 1.0.13 → 1.0.15

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/build/main.js CHANGED
@@ -274,16 +274,17 @@ module.exports =
274
274
  }
275
275
  }
276
276
 
277
- if (!formValues['resourceGroups']) {
277
+ if (!formValues['resourceGroups'] || formValues['resourceGroups'] && formValues['resourceGroups'].length < 1) {
278
+ // rgs default to []
278
279
  var sourceMetadata = wizard.sourceMetadata,
279
280
  destinationMetadata = wizard.destinationMetadata;
280
281
 
281
282
  if (wizard.savedBundles && wizard.savedBundles.bundles && sourceMetadata && destinationMetadata) {
282
-
283
283
  var resourceGroups = (0, _loadData2.default)(wizard.savedBundles, wizard.savedMapping, step.sourceProvider, step.destinationProvider, sourceMetadata, destinationMetadata, isReverse);
284
-
285
- change('resourceGroups', formValues['resourceGroups'] || resourceGroups);
286
- } // end if wizard.savedBundles and metadatas
284
+ if (resourceGroups) {
285
+ change('resourceGroups', resourceGroups);
286
+ }
287
+ }
287
288
  } // end if (!formValues['resourceGroups'])
288
289
 
289
290
 
@@ -16980,6 +16981,7 @@ module.exports =
16980
16981
  });
16981
16982
  exports.callGetMetadata = callGetMetadata;
16982
16983
  exports.setCsvFields = setCsvFields;
16984
+ exports.removeFileResourceFromMetadata = removeFileResourceFromMetadata;
16983
16985
  exports.clearCsvFields = clearCsvFields;
16984
16986
  exports.uploadFilesToS3 = uploadFilesToS3;
16985
16987
  exports.singleFileToS3 = singleFileToS3;
@@ -17043,6 +17045,8 @@ module.exports =
17043
17045
 
17044
17046
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17045
17047
 
17048
+ 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); } }
17049
+
17046
17050
  // isReload means that the "Check Connection" button was NOT clicked
17047
17051
  function callGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, endpoint, credsConfig, isFramework, creds, environment, isReload, fileSchemaGuid) {
17048
17052
  var metadata = null;
@@ -17113,6 +17117,26 @@ module.exports =
17113
17117
  };
17114
17118
  }
17115
17119
 
17120
+ function removeFileResourceFromMetadata(mode, r, providerType) {
17121
+ return function (dispatch, getState, api) {
17122
+ var _getState2 = getState(),
17123
+ wizard = _getState2.wizard;
17124
+
17125
+ var metadata = [].concat(_toConsumableArray(wizard[mode + 'Metadata']));
17126
+ var i = metadata.findIndex(function (rsc) {
17127
+ return r.name === rsc.name && r.type === rsc.type;
17128
+ });
17129
+ if (i > -1) {
17130
+ metadata.splice(i, 1);
17131
+ console.log('send now', { resources: metadata });
17132
+ dispatch({
17133
+ type: types.FINISH_WIZARD_ENV_CHECK,
17134
+ data: { metadata: { resources: metadata }, mode: mode, code: '200 OK', providerType: providerType }
17135
+ });
17136
+ }
17137
+ };
17138
+ }
17139
+
17116
17140
  function clearCsvFields(mode) {
17117
17141
  return {
17118
17142
  type: types.FINISH_WIZARD_ENV_CHECK,
@@ -17187,8 +17211,8 @@ module.exports =
17187
17211
  var isOauth = credsConfig && credsConfig[0] === 'Oauth';
17188
17212
  var isAdapter = urlSuffix === 'testconnection' || urlSuffix === 'adaptermetadata';
17189
17213
 
17190
- var _getState2 = getState(),
17191
- config = _getState2.config;
17214
+ var _getState3 = getState(),
17215
+ config = _getState3.config;
17192
17216
  // if demo creds are entered, skip this
17193
17217
  // ADD: OR IF adaptermetadata SKIP THIS
17194
17218
 
@@ -17213,8 +17237,8 @@ module.exports =
17213
17237
  };
17214
17238
  }
17215
17239
  return function (dispatch, getState, api) {
17216
- var _getState3 = getState(),
17217
- config = _getState3.config;
17240
+ var _getState4 = getState(),
17241
+ config = _getState4.config;
17218
17242
  // 'testconnection' GET route is for adapter. Should be called 'adaptermetadata'
17219
17243
 
17220
17244
 
@@ -17251,8 +17275,8 @@ module.exports =
17251
17275
  mode: mode
17252
17276
  });
17253
17277
 
17254
- var _getState4 = getState(),
17255
- config = _getState4.config;
17278
+ var _getState5 = getState(),
17279
+ config = _getState5.config;
17256
17280
 
17257
17281
  return api.get(tenantId + '/' + appId + '/environments/' + envName + '/oauthurl/9090b61412a74d97ad9ed02c5fx7e705/' + orgType, {
17258
17282
  endpoint: config.SF_AGENT_API_URL
@@ -17269,9 +17293,9 @@ module.exports =
17269
17293
 
17270
17294
  function generateNewAdapterSecret(tenantId, accountId, envName, mode) {
17271
17295
  return function (dispatch, getState, api) {
17272
- var _getState5 = getState(),
17273
- config = _getState5.config,
17274
- wizard = _getState5.wizard;
17296
+ var _getState6 = getState(),
17297
+ config = _getState6.config,
17298
+ wizard = _getState6.wizard;
17275
17299
 
17276
17300
  var TRANS_API_URL = config.TRANS_API_URL;
17277
17301
 
@@ -17288,8 +17312,8 @@ module.exports =
17288
17312
 
17289
17313
  function createLingkExternalIds(tenantId, appId, bundles, mappings, metadata, envName) {
17290
17314
  return function (dispatch, getState, api) {
17291
- var _getState6 = getState(),
17292
- config = _getState6.config;
17315
+ var _getState7 = getState(),
17316
+ config = _getState7.config;
17293
17317
 
17294
17318
  var externalIdlessObjects = [];
17295
17319
  // only run for Salesforce
@@ -17327,8 +17351,8 @@ module.exports =
17327
17351
 
17328
17352
  function callAddCustomField(tenantId, appId, objectType, fieldName, completedCallback, envName) {
17329
17353
  return function (dispatch, getState, api) {
17330
- var _getState7 = getState(),
17331
- config = _getState7.config;
17354
+ var _getState8 = getState(),
17355
+ config = _getState8.config;
17332
17356
 
17333
17357
  return api.post(tenantId + '/' + appId + '/environments/' + envName + '/salesforceschema/field', {
17334
17358
  endpoint: config.SF_AGENT_API_URL,
@@ -17380,8 +17404,8 @@ module.exports =
17380
17404
 
17381
17405
  function callGetScenarioList(tenantId, appId, typeGuid) {
17382
17406
  return function (dispatch, getState, api) {
17383
- var _getState8 = getState(),
17384
- config = _getState8.config;
17407
+ var _getState9 = getState(),
17408
+ config = _getState9.config;
17385
17409
 
17386
17410
  return api.get(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
17387
17411
  endpoint: config.TRANS_API_URL
@@ -17391,8 +17415,8 @@ module.exports =
17391
17415
 
17392
17416
  function callCreateScenario(tenantId, appId, data) {
17393
17417
  return function (dispatch, getState, api) {
17394
- var _getState9 = getState(),
17395
- config = _getState9.config;
17418
+ var _getState10 = getState(),
17419
+ config = _getState10.config;
17396
17420
 
17397
17421
  return api.post(tenantId + '/' + appId + '/scenario', {
17398
17422
  endpoint: config.TRANS_API_URL,
@@ -17403,8 +17427,8 @@ module.exports =
17403
17427
 
17404
17428
  function callUpdateScenarioList(tenantId, appId, typeGuid, scenarioIds) {
17405
17429
  return function (dispatch, getState, api) {
17406
- var _getState10 = getState(),
17407
- config = _getState10.config;
17430
+ var _getState11 = getState(),
17431
+ config = _getState11.config;
17408
17432
 
17409
17433
  return api.post(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
17410
17434
  endpoint: config.TRANS_API_URL,
@@ -17417,8 +17441,8 @@ module.exports =
17417
17441
 
17418
17442
  function callPostBundles(tenantId, appId, bundles, onGenerationError) {
17419
17443
  return function (dispatch, getState, api) {
17420
- var _getState11 = getState(),
17421
- config = _getState11.config;
17444
+ var _getState12 = getState(),
17445
+ config = _getState12.config;
17422
17446
 
17423
17447
  var data = { bundles: bundles };
17424
17448
  return api.post(tenantId + '/' + appId + '/bundle', {
@@ -17433,8 +17457,8 @@ module.exports =
17433
17457
 
17434
17458
  function callPostMapping(tenantId, appId, mappings, onGenerationError) {
17435
17459
  return function (dispatch, getState, api) {
17436
- var _getState12 = getState(),
17437
- config = _getState12.config;
17460
+ var _getState13 = getState(),
17461
+ config = _getState13.config;
17438
17462
 
17439
17463
  var data = { mappings: mappings };
17440
17464
  return api.post(tenantId + '/' + appId + '/schemamappings', {
@@ -17449,8 +17473,8 @@ module.exports =
17449
17473
 
17450
17474
  function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, piGuid, onGenerationError) {
17451
17475
  return function (dispatch, getState, api) {
17452
- var _getState13 = getState(),
17453
- config = _getState13.config;
17476
+ var _getState14 = getState(),
17477
+ config = _getState14.config;
17454
17478
 
17455
17479
  var data = Object.assign({
17456
17480
  schemaMappingGuid: schemaMappingGuid,
@@ -17471,8 +17495,8 @@ module.exports =
17471
17495
 
17472
17496
  function callUpdateProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, piGuid, onGenerationError) {
17473
17497
  return function (dispatch, getState, api) {
17474
- var _getState14 = getState(),
17475
- config = _getState14.config;
17498
+ var _getState15 = getState(),
17499
+ config = _getState15.config;
17476
17500
 
17477
17501
  var data = {
17478
17502
  schemaMappingGuid: schemaMappingGuid,
@@ -17493,8 +17517,8 @@ module.exports =
17493
17517
 
17494
17518
  function callGenerateRecipe(tenantId, appId, typeId, typeGuid, title, piGuid, mappingGuid, sourceMetadata, destinationMetadata, isManagedPackage, onGenerationError, envName, envId) {
17495
17519
  return function (dispatch, getState, api) {
17496
- var _getState15 = getState(),
17497
- config = _getState15.config;
17520
+ var _getState16 = getState(),
17521
+ config = _getState16.config;
17498
17522
 
17499
17523
  return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
17500
17524
  endpoint: config.TRANS_API_URL,
@@ -17513,8 +17537,8 @@ module.exports =
17513
17537
 
17514
17538
  function trySaveFileSchema(tenantId, appId, schema) {
17515
17539
  return function (dispatch, getState, api) {
17516
- var _getState16 = getState(),
17517
- config = _getState16.config;
17540
+ var _getState17 = getState(),
17541
+ config = _getState17.config;
17518
17542
 
17519
17543
  if (schema && schema.resources) {
17520
17544
  return api.post(tenantId + '/' + appId + '/fileschema', {
@@ -17601,8 +17625,8 @@ module.exports =
17601
17625
 
17602
17626
  function callPostEventContext(data, transBaseId) {
17603
17627
  return function (dispatch, getState, api) {
17604
- var _getState17 = getState(),
17605
- config = _getState17.config;
17628
+ var _getState18 = getState(),
17629
+ config = _getState18.config;
17606
17630
 
17607
17631
  var TRANS_API_URL = config.TRANS_API_URL;
17608
17632
 
@@ -17615,8 +17639,8 @@ module.exports =
17615
17639
 
17616
17640
  function callExecuteTransformer(transId) {
17617
17641
  return function (dispatch, getState, api) {
17618
- var _getState18 = getState(),
17619
- config = _getState18.config;
17642
+ var _getState19 = getState(),
17643
+ config = _getState19.config;
17620
17644
 
17621
17645
  var query = '';
17622
17646
  var d = new Date();
@@ -17636,8 +17660,8 @@ module.exports =
17636
17660
 
17637
17661
  function callLookupLogData(tenantId, externalExecutionId, index, onFinish, generatedRecipe, pi) {
17638
17662
  return function (dispatch, getState, api) {
17639
- var _getState19 = getState(),
17640
- config = _getState19.config;
17663
+ var _getState20 = getState(),
17664
+ config = _getState20.config;
17641
17665
 
17642
17666
  return api.get(tenantId + '/logs/transformers/externalExecutionId/' + externalExecutionId, {
17643
17667
  endpoint: config.TRANS_API_URL
@@ -17681,8 +17705,8 @@ module.exports =
17681
17705
  };
17682
17706
  }
17683
17707
  return function (dispatch, getState, api) {
17684
- var _getState20 = getState(),
17685
- config = _getState20.config;
17708
+ var _getState21 = getState(),
17709
+ config = _getState21.config;
17686
17710
 
17687
17711
  return api.post(tenantId + '/createtrigger', {
17688
17712
  endpoint: config.TRANS_API_URL,
@@ -17720,8 +17744,8 @@ module.exports =
17720
17744
 
17721
17745
  if (piGuid && piGuid !== '_') {
17722
17746
  return function (dispatch, getState, api) {
17723
- var _getState21 = getState(),
17724
- config = _getState21.config;
17747
+ var _getState22 = getState(),
17748
+ config = _getState22.config;
17725
17749
 
17726
17750
  return api.get(tenantId + '/' + accountId + '/productizedintegrations/' + piGuid + '/versions', {
17727
17751
  endpoint: config.TRANS_API_URL
@@ -17793,8 +17817,8 @@ module.exports =
17793
17817
 
17794
17818
  function clearAdapterSecrets() {
17795
17819
  return function (dispatch, getState, api) {
17796
- var _getState22 = getState(),
17797
- wizard = _getState22.wizard;
17820
+ var _getState23 = getState(),
17821
+ wizard = _getState23.wizard;
17798
17822
 
17799
17823
  dispatch({
17800
17824
  type: types.SET_WIZARD_SAVED_CREDENTIALS,
@@ -17808,8 +17832,8 @@ module.exports =
17808
17832
 
17809
17833
  function setLoadedAdapterSecret(cred, mode) {
17810
17834
  return function (dispatch, getState, api) {
17811
- var _getState23 = getState(),
17812
- wizard = _getState23.wizard;
17835
+ var _getState24 = getState(),
17836
+ wizard = _getState24.wizard;
17813
17837
 
17814
17838
  dispatch({
17815
17839
  type: types.SET_WIZARD_SAVED_CREDENTIALS,
@@ -17820,8 +17844,8 @@ module.exports =
17820
17844
 
17821
17845
  function getCredentialForEnvironment(tenantId, appId, credentialType, envName, mode) {
17822
17846
  return function (dispatch, getState, api) {
17823
- var _getState24 = getState(),
17824
- config = _getState24.config;
17847
+ var _getState25 = getState(),
17848
+ config = _getState25.config;
17825
17849
 
17826
17850
  return api.get(tenantId + '/' + appId + '/credentials/' + credentialType + '/' + envName, {
17827
17851
  endpoint: config.TRANS_API_URL
@@ -17873,8 +17897,8 @@ module.exports =
17873
17897
  function callGetBundles(tenantId, accountId, bundlePackGuid) {
17874
17898
  if (bundlePackGuid) {
17875
17899
  return function (dispatch, getState, api) {
17876
- var _getState25 = getState(),
17877
- config = _getState25.config;
17900
+ var _getState26 = getState(),
17901
+ config = _getState26.config;
17878
17902
 
17879
17903
  return api.get(tenantId + '/' + accountId + '/bundle/' + bundlePackGuid, {
17880
17904
  endpoint: config.TRANS_API_URL
@@ -17891,8 +17915,8 @@ module.exports =
17891
17915
  function callGetMapping(tenantId, accountId, mappingGuid) {
17892
17916
  if (mappingGuid) {
17893
17917
  return function (dispatch, getState, api) {
17894
- var _getState26 = getState(),
17895
- config = _getState26.config;
17918
+ var _getState27 = getState(),
17919
+ config = _getState27.config;
17896
17920
 
17897
17921
  return api.get(tenantId + '/' + accountId + '/schemamappings/' + mappingGuid, {
17898
17922
  endpoint: config.TRANS_API_URL
@@ -17913,8 +17937,8 @@ module.exports =
17913
17937
  mode: mode
17914
17938
  });
17915
17939
 
17916
- var _getState27 = getState(),
17917
- config = _getState27.config;
17940
+ var _getState28 = getState(),
17941
+ config = _getState28.config;
17918
17942
 
17919
17943
  return api.post(tenantId + '/' + appId + '/environments/' + envId + '/credentials', {
17920
17944
  endpoint: config.TRANS_API_URL,
@@ -17928,8 +17952,8 @@ module.exports =
17928
17952
 
17929
17953
  function getEnvironments(tenantId, appId) {
17930
17954
  return function (dispatch, getState, api) {
17931
- var _getState28 = getState(),
17932
- config = _getState28.config;
17955
+ var _getState29 = getState(),
17956
+ config = _getState29.config;
17933
17957
 
17934
17958
  return api.get(tenantId + '/' + appId + '/environments', {
17935
17959
  endpoint: config.TRANS_API_URL
@@ -17949,8 +17973,8 @@ module.exports =
17949
17973
 
17950
17974
  function callGetTrigger(transBaseId, envId) {
17951
17975
  return function (dispatch, getState, api) {
17952
- var _getState29 = getState(),
17953
- config = _getState29.config;
17976
+ var _getState30 = getState(),
17977
+ config = _getState30.config;
17954
17978
 
17955
17979
  if (transBaseId) {
17956
17980
  return api.get('gettriggers/' + transBaseId, {
@@ -21181,8 +21205,8 @@ module.exports =
21181
21205
  }
21182
21206
 
21183
21207
  _createClass(DeployStep, [{
21184
- key: 'componentDidMount',
21185
- value: function componentDidMount() {
21208
+ key: 'componentWillMount',
21209
+ value: function componentWillMount() {
21186
21210
  //const { step, change, formValues } = this.props
21187
21211
  //change('deployment', formValues.deployment || {type: step.options[0]})
21188
21212
  var _props = this.props,
@@ -21395,6 +21419,8 @@ module.exports =
21395
21419
 
21396
21420
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21397
21421
 
21422
+ 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); } }
21423
+
21398
21424
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21399
21425
 
21400
21426
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -21482,8 +21508,8 @@ module.exports =
21482
21508
  x.focus();
21483
21509
  }
21484
21510
  }, {
21485
- key: 'componentDidMount',
21486
- value: function componentDidMount() {
21511
+ key: 'componentWillMount',
21512
+ value: function componentWillMount() {
21487
21513
  var _props2 = this.props,
21488
21514
  step = _props2.step,
21489
21515
  change = _props2.change,
@@ -21531,14 +21557,22 @@ module.exports =
21531
21557
  // set defaults of filename and delimiter
21532
21558
  var isFileSchema = metadata && metadata.providerType === 'SFTP';
21533
21559
  if (isFileSchema) {
21534
- change(mode + 'FileSchema', metadata.resources.filter(function (m) {
21535
- return !m.parentRef;
21536
- }).map(function (r) {
21537
- return Object.assign({}, r, {
21538
- filePattern: r.name,
21539
- delimiter: ','
21540
- });
21541
- }));
21560
+ (function () {
21561
+ var savedFileSchema = [];
21562
+ if (_this2.props.formValues[mode + 'FileSchema']) {
21563
+ savedFileSchema = [].concat(_toConsumableArray(formValues[mode + 'FileSchema']));
21564
+ }
21565
+ change(mode + 'FileSchema', metadata.resources.map(function (r) {
21566
+ var existing = savedFileSchema.find(function (rsc) {
21567
+ return r.name === rsc.name && r.type === rsc.type;
21568
+ });
21569
+ if (existing) return existing;
21570
+ return Object.assign({}, r, {
21571
+ filePattern: r.name,
21572
+ delimiter: ','
21573
+ });
21574
+ }));
21575
+ })();
21542
21576
  }
21543
21577
  //change(`${mode}Credentials`, credentials)
21544
21578
  });
@@ -22174,8 +22208,8 @@ module.exports =
22174
22208
  x.focus();
22175
22209
  }
22176
22210
  }, {
22177
- key: 'componentDidMount',
22178
- value: function componentDidMount() {
22211
+ key: 'componentWillMount',
22212
+ value: function componentWillMount() {
22179
22213
  var _props2 = this.props,
22180
22214
  step = _props2.step,
22181
22215
  change = _props2.change,
@@ -22591,6 +22625,8 @@ module.exports =
22591
22625
 
22592
22626
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22593
22627
 
22628
+ 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); } }
22629
+
22594
22630
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22595
22631
 
22596
22632
  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
@@ -22601,14 +22637,35 @@ module.exports =
22601
22637
  _inherits(FileProcessing, _Component);
22602
22638
 
22603
22639
  function FileProcessing() {
22640
+ var _ref;
22641
+
22642
+ var _temp, _this, _ret;
22643
+
22604
22644
  _classCallCheck(this, FileProcessing);
22605
22645
 
22606
- return _possibleConstructorReturn(this, (FileProcessing.__proto__ || Object.getPrototypeOf(FileProcessing)).apply(this, arguments));
22646
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
22647
+ args[_key] = arguments[_key];
22648
+ }
22649
+
22650
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FileProcessing.__proto__ || Object.getPrototypeOf(FileProcessing)).call.apply(_ref, [this].concat(args))), _this), _this.removeFile = function (file, index) {
22651
+ var _this$props = _this.props,
22652
+ change = _this$props.change,
22653
+ step = _this$props.step,
22654
+ formValues = _this$props.formValues,
22655
+ actions = _this$props.actions;
22656
+
22657
+ var providerType = step[step.mode + 'Provider'];
22658
+ var fs = formValues[step.mode + 'FileSchema'];
22659
+ var fileSchema = [].concat(_toConsumableArray(fs));
22660
+ fileSchema.splice(index, 1);
22661
+ change(step.mode + 'FileSchema', fileSchema);
22662
+ actions.removeFileResourceFromMetadata(step.mode, file, providerType);
22663
+ }, _temp), _possibleConstructorReturn(_this, _ret);
22607
22664
  }
22608
22665
 
22609
22666
  _createClass(FileProcessing, [{
22610
- key: 'componentDidMount',
22611
- value: function componentDidMount() {
22667
+ key: 'componentWillMount',
22668
+ value: function componentWillMount() {
22612
22669
  var _props = this.props,
22613
22670
  step = _props.step,
22614
22671
  wizard = _props.wizard,
@@ -22633,11 +22690,17 @@ module.exports =
22633
22690
 
22634
22691
  var fileSchema = formValues[step.mode + 'FileSchema'];
22635
22692
  var filledOut = true;
22636
- fileSchema.forEach(function (f) {
22637
- if (!f.delimiter || !f.filePattern) {
22693
+ if (fileSchema) {
22694
+ fileSchema.forEach(function (f) {
22695
+ if (!f.delimiter || !f.filePattern) {
22696
+ filledOut = false;
22697
+ }
22698
+ });
22699
+ if (fileSchema.length < 1) {
22638
22700
  filledOut = false;
22639
22701
  }
22640
- });
22702
+ }
22703
+
22641
22704
  var FileTable = inputs.FileTable;
22642
22705
  return _react2.default.createElement(
22643
22706
  'form',
@@ -22659,9 +22722,12 @@ module.exports =
22659
22722
  _react2.default.createElement(
22660
22723
  'div',
22661
22724
  { className: 'labelz', style: { fontSize: '14px', marginBottom: 5 } },
22662
- 'Available Files:'
22725
+ fileSchema && fileSchema.length > 0 ? 'Available Files:' : 'No available files. Please upload files to your SFTP server and click Check Connection in the Environments step.'
22663
22726
  ),
22664
- _react2.default.createElement(FileTable, { files: fileSchema, inputs: inputs, mode: step.mode }),
22727
+ fileSchema && fileSchema.length > 0 && _react2.default.createElement(FileTable, {
22728
+ files: fileSchema, inputs: inputs, mode: step.mode,
22729
+ removeFile: this.removeFile
22730
+ }),
22665
22731
  _react2.default.createElement('br', null),
22666
22732
  _react2.default.createElement(_navButtons2.default, { handleSubmit: handleSubmit, nav: nav, reset: reset, inputs: inputs,
22667
22733
  nextDisabled: !filledOut,
@@ -23045,8 +23111,8 @@ module.exports =
23045
23111
  }
23046
23112
 
23047
23113
  _createClass(MapStep, [{
23048
- key: 'componentDidMount',
23049
- value: function componentDidMount() {
23114
+ key: 'componentWillMount',
23115
+ value: function componentWillMount() {
23050
23116
  var _props = this.props,
23051
23117
  step = _props.step,
23052
23118
  wizard = _props.wizard,
@@ -23300,8 +23366,8 @@ module.exports =
23300
23366
  }
23301
23367
 
23302
23368
  _createClass(NameStep, [{
23303
- key: 'componentDidMount',
23304
- value: function componentDidMount() {
23369
+ key: 'componentWillMount',
23370
+ value: function componentWillMount() {
23305
23371
  var _props = this.props,
23306
23372
  step = _props.step,
23307
23373
  wizard = _props.wizard,
@@ -23699,8 +23765,10 @@ module.exports =
23699
23765
  }
23700
23766
 
23701
23767
  _createClass(DefaultDatasetStep, [{
23702
- key: 'componentDidMount',
23703
- value: function componentDidMount() {
23768
+ key: 'componentWillMount',
23769
+ value: function componentWillMount() {
23770
+ var _this2 = this;
23771
+
23704
23772
  var _props = this.props,
23705
23773
  step = _props.step,
23706
23774
  wizard = _props.wizard,
@@ -23711,9 +23779,9 @@ module.exports =
23711
23779
  if (!wizard.dataLoaded) {
23712
23780
  (function () {
23713
23781
  (0, _initialize2.default)(step, wizard, change, formValues, actions);
23714
- var scenario = formValues['scenario'];
23782
+ var scenario = _this2.props.formValues['scenario'];
23715
23783
  if (scenario && !(step.options && step.options.find(function (o) {
23716
- return o.id === scenario;
23784
+ return o.id === parseInt(scenario, 10);
23717
23785
  }))) {
23718
23786
  change('scenario', '0');
23719
23787
  }
@@ -23733,7 +23801,7 @@ module.exports =
23733
23801
  actions = _props2.actions,
23734
23802
  change = _props2.change;
23735
23803
 
23736
- change('resourceGroups', null); //clear old data
23804
+ change('resourceGroups', []); //clear old data
23737
23805
  change('scenario', String(o.id));
23738
23806
  if (String(o.id) === '0') {
23739
23807
  actions.gotEmptyScenario();
@@ -23746,7 +23814,7 @@ module.exports =
23746
23814
  }, {
23747
23815
  key: 'render',
23748
23816
  value: function render() {
23749
- var _this2 = this;
23817
+ var _this3 = this;
23750
23818
 
23751
23819
  var _props3 = this.props,
23752
23820
  inputs = _props3.inputs,
@@ -23803,9 +23871,9 @@ module.exports =
23803
23871
  'div',
23804
23872
  { key: i },
23805
23873
  _react2.default.createElement(Radio, { onChange: function onChange() {
23806
- return _this2.select(o);
23874
+ return _this3.select(o);
23807
23875
  },
23808
- label: '' + o.title + (_this2.state.currentlyLoadingScenario === String(o.id) ? _this2.state.loadingDots : ''),
23876
+ label: '' + o.title + (_this3.state.currentlyLoadingScenario === String(o.id) ? _this3.state.loadingDots : ''),
23809
23877
  checked: String(o.id) === scenario, style: { cursor: 'pointer' }
23810
23878
  }),
23811
23879
  _react2.default.createElement('br', null),
@@ -23935,8 +24003,8 @@ module.exports =
23935
24003
  }
23936
24004
 
23937
24005
  _createClass(SchemaStep, [{
23938
- key: 'componentDidMount',
23939
- value: function componentDidMount() {
24006
+ key: 'componentWillMount',
24007
+ value: function componentWillMount() {
23940
24008
  var _this2 = this;
23941
24009
 
23942
24010
  var _props = this.props,
@@ -23949,15 +24017,15 @@ module.exports =
23949
24017
  var isReverse = formValues.direction === 'reverse';
23950
24018
  if (!wizard.dataLoaded) {
23951
24019
  (0, _initialize2.default)(step, wizard, change, formValues, actions, isReverse);
23952
- }
23953
- if (formValues['resourceGroups']) {
23954
- var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
23955
- resourceGroups && resourceGroups.forEach(function (rg, i) {
23956
- _this2.assignAllParents(i);
23957
- _this2.forceUpdate();
23958
- });
23959
- } else {
23960
- change('resourceGroups', []);
24020
+ setTimeout(function () {
24021
+ if (_this2.props.formValues['resourceGroups']) {
24022
+ var resourceGroups = [].concat(_toConsumableArray(_this2.props.formValues['resourceGroups']));
24023
+ resourceGroups && resourceGroups.forEach(function (rg, i) {
24024
+ _this2.assignAllParents(i);
24025
+ _this2.forceUpdate();
24026
+ });
24027
+ }
24028
+ }, 10);
23961
24029
  }
23962
24030
  }
23963
24031
  }, {
@@ -24270,9 +24338,11 @@ module.exports =
24270
24338
  wizard = _props14.wizard,
24271
24339
  change = _props14.change;
24272
24340
 
24273
- if (!formValues['resourceGroups']) return _react2.default.createElement('div', null);
24274
24341
 
24275
- var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups'])) || null;
24342
+ var resourceGroups = [];
24343
+ if (formValues['resourceGroups']) {
24344
+ resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
24345
+ }
24276
24346
 
24277
24347
  var sourceSchema = wizard['sourceMetadata'] ? wizard['sourceMetadata'] : null;
24278
24348