@lingk/sync 0.0.34 → 0.0.36

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
@@ -104,7 +104,7 @@ module.exports =
104
104
  },
105
105
  'Next'
106
106
  ) : null,
107
- props.nav.last ? _react2.default.createElement(
107
+ _react2.default.createElement(
108
108
  Button,
109
109
  {
110
110
  type: 'brand',
@@ -112,12 +112,14 @@ module.exports =
112
112
  iconAlign: 'right',
113
113
  onClick: function onClick() {
114
114
  props.handleSubmit();
115
- //setTimeout(() => props.reset(), 100)
115
+ setTimeout(function () {
116
+ return props.reset();
117
+ }, 100);
116
118
  },
117
119
  style: { float: 'right', marginRight: 14 }
118
120
  },
119
- 'Finish'
120
- ) : null
121
+ props.nav.last ? 'Finish' : 'Save And Exit'
122
+ )
121
123
  );
122
124
  };
123
125
 
@@ -161,12 +163,15 @@ module.exports =
161
163
  Object.defineProperty(exports, "__esModule", {
162
164
  value: true
163
165
  });
164
- // Wizard
166
+ var SET_WIZARD_SAVED_MAPPING = exports.SET_WIZARD_SAVED_MAPPING = 'SET_WIZARD_SAVED_MAPPING';
167
+ var SET_WIZARD_SAVED_CONFIGURATION = exports.SET_WIZARD_SAVED_CONFIGURATION = 'SET_WIZARD_SAVED_CONFIGURATION';
168
+ var SET_WIZARD_SAVED_SCHEMAS = exports.SET_WIZARD_SAVED_SCHEMAS = 'SET_WIZARD_SAVED_SCHEMAS';
169
+ var SET_WIZARD_LOADED = exports.SET_WIZARD_LOADED = 'SET_WIZARD_LOADED';
170
+
171
+ // old Wizard
165
172
  var SET_WIZARD_DATA_ENTITIES = exports.SET_WIZARD_DATA_ENTITIES = 'SET_WIZARD_DATA_ENTITIES';
166
173
  var SET_WIZARD_RESOURCE_META = exports.SET_WIZARD_RESOURCE_META = 'SET_WIZARD_RESOURCE_META';
167
- var SET_WIZARD_LOADED = exports.SET_WIZARD_LOADED = 'SET_WIZARD_LOADED';
168
174
  var SET_WIZARD_DATA = exports.SET_WIZARD_DATA = 'SET_WIZARD_DATA';
169
- var SET_WIZARD_SAVED_SCHEMAS = exports.SET_WIZARD_SAVED_SCHEMAS = 'SET_WIZARD_SAVED_SCHEMAS';
170
175
 
171
176
  /***/ },
172
177
  /* 7 */,
@@ -211,17 +216,18 @@ module.exports =
211
216
  });
212
217
  exports.callGetWizardSourceData = callGetWizardSourceData;
213
218
  exports.callPreview = callPreview;
214
- exports.callGetSchemasForProvider = callGetSchemasForProvider;
215
- exports.clearSavedSchemas = clearSavedSchemas;
216
219
  exports.callPostSchema = callPostSchema;
217
220
  exports.callPostMapping = callPostMapping;
218
221
  exports.callPostProductizedIntegration = callPostProductizedIntegration;
219
- exports.callGenerateIntegration = callGenerateIntegration;
222
+ exports.callGenerateRecipe = callGenerateRecipe;
220
223
  exports.callGetTransformersAfterGeneration = callGetTransformersAfterGeneration;
221
224
  exports.submitWizardData = submitWizardData;
222
225
  exports.callExecuteTransformer = callExecuteTransformer;
223
226
  exports.callLookupLogData = callLookupLogData;
227
+ exports.setWizardLoaded = setWizardLoaded;
224
228
  exports.callGetPiConfig = callGetPiConfig;
229
+ exports.callGetMapping = callGetMapping;
230
+ exports.callGetSchemas = callGetSchemas;
225
231
  exports.callGetWizardDataEntities = callGetWizardDataEntities;
226
232
  exports.callGetWizardResourceMeta = callGetWizardResourceMeta;
227
233
  exports.clearWizardResourceMeta = clearWizardResourceMeta;
@@ -275,37 +281,35 @@ module.exports =
275
281
  };
276
282
  }
277
283
 
278
- function callGetSchemasForProvider(tenantId, appId, providerType) {
279
- return function (dispatch, getState, api) {
280
- var _getState = getState(),
281
- config = _getState.config;
282
-
283
- var TRANS_API_URL = config.TRANS_API_URL;
284
-
285
- return api.get(tenantId + '/' + appId + '/schemas/' + providerType, {
286
- endpoint: TRANS_API_URL
287
- }).then(function (data) {
284
+ /*export function callGetSchemasForProvider(tenantId, appId, providerType) {
285
+ return (dispatch, getState, api) => {
286
+ const { config } = getState();
287
+ const { TRANS_API_URL } = config;
288
+ return api.get(`${tenantId}/${appId}/schemas/${providerType}`, {
289
+ endpoint: TRANS_API_URL,
290
+ })
291
+ .then((data) => {
288
292
  dispatch({
289
293
  type: types.SET_WIZARD_SAVED_SCHEMAS,
290
- data: data
294
+ data
291
295
  });
292
296
  });
293
297
  };
294
298
  }
295
299
 
296
- function clearSavedSchemas() {
297
- return function (dispatch) {
300
+ export function clearSavedSchemas() {
301
+ return (dispatch) => {
298
302
  dispatch({
299
303
  type: types.SET_WIZARD_SAVED_SCHEMAS,
300
304
  data: []
301
305
  });
302
- };
303
- }
306
+ }
307
+ }*/
304
308
 
305
309
  function callPostSchema(tenantId, appId, data) {
306
310
  return function (dispatch, getState, api) {
307
- var _getState2 = getState(),
308
- config = _getState2.config;
311
+ var _getState = getState(),
312
+ config = _getState.config;
309
313
 
310
314
  var TRANS_API_URL = config.TRANS_API_URL;
311
315
 
@@ -320,8 +324,8 @@ module.exports =
320
324
 
321
325
  function callPostMapping(tenantId, appId, schemaFromGuid, schemaToGuid, mappings) {
322
326
  return function (dispatch, getState, api) {
323
- var _getState3 = getState(),
324
- config = _getState3.config;
327
+ var _getState2 = getState(),
328
+ config = _getState2.config;
325
329
 
326
330
  var TRANS_API_URL = config.TRANS_API_URL;
327
331
 
@@ -341,31 +345,18 @@ module.exports =
341
345
 
342
346
  function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, configuration, title, typeGuid) {
343
347
  return function (dispatch, getState, api) {
344
- var _getState4 = getState(),
345
- config = _getState4.config;
348
+ var _getState3 = getState(),
349
+ config = _getState3.config;
346
350
 
347
351
  var TRANS_API_URL = config.TRANS_API_URL;
348
352
 
349
353
  var data = {
350
354
  schemaMappingGuid: schemaMappingGuid,
351
355
  integrationTypeGuid: typeGuid,
352
- name: "Banner to Salesforce",
353
- "configuration": {
354
- "apiEndpoint_Student": 'https://www.lingkapis.com/v1/@self/ps/students?filter=firstName%20eq%20Rachel',
355
- "apiEndpoint_Course": "https://www.lingkapis.com/v1/@self/ps/courses?filter=institutionGuid%20eq%202b3e5636f2a94450a404f1a3b7c55059",
356
- "apiEndpoint_Institution": "https://www.lingkapis.com/v1/@self/ps/institutions?filter=shortName%20eq%20orci",
357
- "apiKey": "5664bb4478fae2000100004aae5d222c6c2742717cebc5abf69f0f9e",
358
- "apiSecret": "YThjODc4MjQ2MzEwNDgzMjYwY2RiYmY5Yzg4NzBhMmI=",
359
- "clientId": "3MVG9szVa2RxsqBbm3SjG5D.osKk4_dg2A1KP.v2_SvhrqBuS19C.ktOCziR8tQuIOyRk2.iery_dRTSXX_iO",
360
- "clientSecret": "3321758897975330201",
361
- "environment": "dev",
362
- "pageSize": "100",
363
- "password": "Welcome@1",
364
- "securityToken": "YKy6pDY3AYfbwgxvRplRY3bOU",
365
- "username": "lingkhedadev@lingk.io",
366
- "version": "v37.0"
367
- }
356
+ name: title,
357
+ configuration: configuration
368
358
  };
359
+ console.log(data);
369
360
  return api.post(tenantId + '/' + appId + '/productizedintegrations', {
370
361
  endpoint: TRANS_API_URL,
371
362
  data: data
@@ -375,19 +366,19 @@ module.exports =
375
366
  };
376
367
  }
377
368
 
378
- function callGenerateIntegration(tenantId, appId, piGuid, mappingGuidDeleteThis) {
369
+ function callGenerateRecipe(tenantId, appId, typeGuid, title, piGuid, mappingGuidDeleteThis) {
379
370
  return function (dispatch, getState, api) {
380
- var _getState5 = getState(),
381
- config = _getState5.config;
371
+ var _getState4 = getState(),
372
+ config = _getState4.config;
382
373
 
383
374
  var TRANS_API_URL = config.TRANS_API_URL;
384
375
 
385
376
  return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
386
377
  endpoint: TRANS_API_URL,
387
378
  data: {
388
- "integrationTypeId": 2,
389
- "name": "Lingk to Salesforce",
390
- "integrationTypeGuid": "9090b61412a74d97ad9ed02c5fx7e705",
379
+ "integrationTypeId": 2, // 1 = Lingk, 2 = Salesforce
380
+ "name": title,
381
+ "integrationTypeGuid": typeGuid,
391
382
  "schemaMappingGuid": mappingGuidDeleteThis
392
383
  }
393
384
  }).then(function (res) {
@@ -398,8 +389,8 @@ module.exports =
398
389
 
399
390
  function callGetTransformersAfterGeneration(appId) {
400
391
  return function (dispatch, getState, api) {
401
- var _getState6 = getState(),
402
- config = _getState6.config;
392
+ var _getState5 = getState(),
393
+ config = _getState5.config;
403
394
 
404
395
  var TRANS_API_URL = config.TRANS_API_URL;
405
396
 
@@ -412,14 +403,16 @@ module.exports =
412
403
  function submitWizardData(tenantId, appId, sourceSchema, destinationSchema, mapping, configuration, title, typeGuid, onGenerate, onFinish) {
413
404
  return function (dispatch) {
414
405
  return Promise.all([dispatch(callPostSchema(tenantId, appId, sourceSchema)), dispatch(callPostSchema(tenantId, appId, destinationSchema))]).then(function (guids) {
415
- return dispatch(callPostMapping(tenantId, appId, guids[0], guids[1], mapping)).then(function (res) {
416
- dispatch(callPostProductizedIntegration(tenantId, appId, res.schemaMappingGuid, configuration, title, typeGuid)).then(function (pi) {
417
- dispatch(callGenerateIntegration(tenantId, appId, pi.productizedIntegrationGuid, res.schemaMappingGuid)).then(function (generatedRecipe) {
418
- dispatch(callExecuteTransformer(generatedRecipe.Id)).then(function (response) {
419
- onGenerate();
420
- dispatch(callLookupLogData(response.externalExecutionId, 0, onFinish, generatedRecipe, pi.productizedIntegrationGuid, res.schemaMappingGuid));
406
+ return dispatch(callPostMapping(tenantId, appId, guids[0], guids[1], mapping)).then(function (map) {
407
+ dispatch(callPostProductizedIntegration(tenantId, appId, map.schemaMappingGuid, configuration, title, typeGuid)).then(function (pi) {
408
+ if (map.mappings && map.mappings.length > 0) {
409
+ dispatch(callGenerateRecipe(tenantId, appId, typeGuid, title, pi.productizedIntegrationGuid, map.schemaMappingGuid)).then(function (generatedRecipe) {
410
+ dispatch(callExecuteTransformer(generatedRecipe.Id)).then(function (response) {
411
+ onGenerate();
412
+ dispatch(callLookupLogData(response.externalExecutionId, 0, onFinish, generatedRecipe, pi.productizedIntegrationGuid, map.schemaMappingGuid));
413
+ });
421
414
  });
422
- });
415
+ }
423
416
  });
424
417
  });
425
418
  });
@@ -428,8 +421,8 @@ module.exports =
428
421
 
429
422
  function callExecuteTransformer(transId) {
430
423
  return function (dispatch, getState, api) {
431
- var _getState7 = getState(),
432
- config = _getState7.config;
424
+ var _getState6 = getState(),
425
+ config = _getState6.config;
433
426
 
434
427
  var TRANS_API_URL = config.TRANS_API_URL;
435
428
 
@@ -456,8 +449,8 @@ module.exports =
456
449
 
457
450
  function callLookupLogData(externalExecutionId, index, onFinish, generatedRecipe, piGuid, mapGuid) {
458
451
  return function (dispatch, getState, api) {
459
- var _getState8 = getState(),
460
- config = _getState8.config;
452
+ var _getState7 = getState(),
453
+ config = _getState7.config;
461
454
 
462
455
  var TRANS_API_URL = config.TRANS_API_URL;
463
456
 
@@ -488,28 +481,102 @@ module.exports =
488
481
  };
489
482
  }
490
483
 
484
+ function setWizardLoaded(bool) {
485
+ return function (dispatch, getState, api) {
486
+ dispatch({
487
+ type: types.SET_WIZARD_LOADED,
488
+ bool: bool
489
+ });
490
+ };
491
+ }
492
+ /* THREE-STEP Loading process */
493
+
491
494
  function callGetPiConfig(tenantId, accountId, piGuid) {
495
+ return function (dispatch, getState, api) {
496
+ dispatch({
497
+ type: types.SET_WIZARD_LOADED,
498
+ bool: false
499
+ });
500
+
501
+ var _getState8 = getState(),
502
+ config = _getState8.config;
503
+
504
+ var TRANS_API_URL = config.TRANS_API_URL;
505
+
506
+ return api.get(tenantId + '/productizedintegrations', {
507
+ endpoint: TRANS_API_URL
508
+ }).then(function (data) {
509
+ var config = {};
510
+ data[0].Configuration.forEach(function (c) {
511
+ config[c.Key] = c.Value;
512
+ });
513
+ dispatch({
514
+ type: types.SET_WIZARD_SAVED_CONFIGURATION,
515
+ data: config
516
+ });
517
+ dispatch(callGetMapping(tenantId, accountId, data[0].SchemaMappingGuid));
518
+ });
519
+ };
520
+ }
521
+
522
+ function callGetMapping(tenantId, accountId, mappingGuid) {
492
523
  return function (dispatch, getState, api) {
493
524
  var _getState9 = getState(),
494
525
  config = _getState9.config;
495
526
 
496
527
  var TRANS_API_URL = config.TRANS_API_URL;
497
528
 
498
- return api.get(tenantId + '/productizedintegrations', {
529
+ return api.get(tenantId + '/' + accountId + '/schemamappings/' + mappingGuid, {
499
530
  endpoint: TRANS_API_URL
500
531
  }).then(function (data) {
501
- console.log(data);
502
- // get mapping
503
- // get schemas
532
+ dispatch({
533
+ type: types.SET_WIZARD_SAVED_MAPPING,
534
+ data: data
535
+ });
536
+ dispatch(callGetSchemas(tenantId, accountId, data.schemaFromGuid, data.schemaToGuid));
504
537
  });
505
538
  };
506
539
  }
507
540
 
508
- function callGetWizardDataEntities(hubId) {
541
+ function callGetSchemas(tenantId, accountId, schemaFromGuid, schemaToGuid) {
509
542
  return function (dispatch, getState, api) {
510
543
  var _getState10 = getState(),
511
544
  config = _getState10.config;
512
545
 
546
+ var TRANS_API_URL = config.TRANS_API_URL;
547
+
548
+ return api.get(tenantId + '/' + accountId + '/schemas', {
549
+ endpoint: TRANS_API_URL
550
+ }).then(function (data) {
551
+ var schemas = {
552
+ 'sourceSchema': data.filter(function (s) {
553
+ return s.schemaGuid === schemaFromGuid;
554
+ })[0] || null,
555
+ 'destinationSchema': data.filter(function (s) {
556
+ return s.schemaGuid === schemaToGuid;
557
+ })[0] || null
558
+ };
559
+ dispatch({
560
+ type: types.SET_WIZARD_SAVED_SCHEMAS,
561
+ data: schemas
562
+ });
563
+ dispatch({
564
+ type: types.SET_WIZARD_LOADED,
565
+ bool: true
566
+ });
567
+ });
568
+ };
569
+ }
570
+
571
+ /* */
572
+
573
+ /* old stuff */
574
+
575
+ function callGetWizardDataEntities(hubId) {
576
+ return function (dispatch, getState, api) {
577
+ var _getState11 = getState(),
578
+ config = _getState11.config;
579
+
513
580
  var API_URL = config.API_URL;
514
581
 
515
582
  return api.get('apihubs/' + hubId, {
@@ -525,8 +592,8 @@ module.exports =
525
592
 
526
593
  function callGetWizardResourceMeta(resourceId) {
527
594
  return function (dispatch, getState, api) {
528
- var _getState11 = getState(),
529
- config = _getState11.config;
595
+ var _getState12 = getState(),
596
+ config = _getState12.config;
530
597
 
531
598
  var API_URL = config.API_URL;
532
599
 
@@ -2340,7 +2407,6 @@ module.exports =
2340
2407
  includedDestinationFields = _props2.includedDestinationFields,
2341
2408
  mappings = _props2.mappings;
2342
2409
 
2343
-
2344
2410
  return _react2.default.createElement(
2345
2411
  'div',
2346
2412
  null,
@@ -2420,13 +2486,44 @@ module.exports =
2420
2486
  }
2421
2487
 
2422
2488
  _createClass(MapStep, [{
2489
+ key: 'componentDidMount',
2490
+ value: function componentDidMount() {
2491
+ var _props3 = this.props,
2492
+ wizard = _props3.wizard,
2493
+ change = _props3.change,
2494
+ formValues = _props3.formValues;
2495
+
2496
+
2497
+ var mappings = {};
2498
+ if (wizard.savedMapping && wizard.savedMapping.mappings && !formValues.mappings) {
2499
+ wizard.savedMapping.mappings.forEach(function (m) {
2500
+ mappings[m.resourceFromName + '.' + m.propertyFromName] = m.resourceToName + '.' + m.propertyToName;
2501
+ });
2502
+ }
2503
+ change('mappings', formValues.mappings || mappings);
2504
+
2505
+ var schema = {};
2506
+ var modes = ['source', 'destination'];
2507
+ modes.forEach(function (mode) {
2508
+ if (wizard.savedSchemas && wizard.savedSchemas[mode + 'Schema'] && !formValues[mode + 'Schema']) {
2509
+ wizard.savedSchemas[mode + 'Schema'].resources.forEach(function (r) {
2510
+ schema[r.name] = {};
2511
+ r.properties.forEach(function (p) {
2512
+ schema[r.name][p.name] = true;
2513
+ });
2514
+ });
2515
+ }
2516
+ change(mode + 'Schema', formValues[mode + 'Schema'] || schema);
2517
+ });
2518
+ }
2519
+ }, {
2423
2520
  key: 'autoMap',
2424
2521
  value: function autoMap() {
2425
2522
  // this function needs to dig deeper and check every field against every mapping
2426
- var _props3 = this.props,
2427
- formValues = _props3.formValues,
2428
- change = _props3.change,
2429
- step = _props3.step;
2523
+ var _props4 = this.props,
2524
+ formValues = _props4.formValues,
2525
+ change = _props4.change,
2526
+ step = _props4.step;
2430
2527
 
2431
2528
  var sourceSchema = formValues['sourceSchema'] || {};
2432
2529
  var obj = {};
@@ -2466,14 +2563,14 @@ module.exports =
2466
2563
  }, {
2467
2564
  key: 'render',
2468
2565
  value: function render() {
2469
- var _props4 = this.props,
2470
- inputs = _props4.inputs,
2471
- handleSubmit = _props4.handleSubmit,
2472
- nav = _props4.nav,
2473
- formValues = _props4.formValues,
2474
- change = _props4.change,
2475
- step = _props4.step,
2476
- reset = _props4.reset;
2566
+ var _props5 = this.props,
2567
+ inputs = _props5.inputs,
2568
+ handleSubmit = _props5.handleSubmit,
2569
+ nav = _props5.nav,
2570
+ formValues = _props5.formValues,
2571
+ change = _props5.change,
2572
+ step = _props5.step,
2573
+ reset = _props5.reset;
2477
2574
 
2478
2575
  var sourceSchema = formValues['sourceSchema'] || {};
2479
2576
  var destinationSchema = formValues['destinationSchema'] || {};
@@ -2948,6 +3045,26 @@ module.exports =
2948
3045
  }
2949
3046
 
2950
3047
  _createClass(SchemaStep, [{
3048
+ key: 'componentDidMount',
3049
+ value: function componentDidMount() {
3050
+ var _props = this.props,
3051
+ wizard = _props.wizard,
3052
+ change = _props.change,
3053
+ formValues = _props.formValues,
3054
+ step = _props.step;
3055
+
3056
+ var schema = {};
3057
+ if (wizard.savedSchemas && wizard.savedSchemas[step.mode + 'Schema'] && !formValues[step.mode + 'Schema']) {
3058
+ wizard.savedSchemas[step.mode + 'Schema'].resources.forEach(function (r) {
3059
+ schema[r.name] = {};
3060
+ r.properties.forEach(function (p) {
3061
+ schema[r.name][p.name] = true;
3062
+ });
3063
+ });
3064
+ }
3065
+ change(step.mode + 'Schema', formValues[step.mode + 'Schema'] || schema);
3066
+ }
3067
+ }, {
2951
3068
  key: 'componentWillUnmount',
2952
3069
  value: function componentWillUnmount() {
2953
3070
  this.setState({
@@ -2968,18 +3085,18 @@ module.exports =
2968
3085
  }, {
2969
3086
  key: 'loadDefault',
2970
3087
  value: function loadDefault() {
2971
- var _props = this.props,
2972
- step = _props.step,
2973
- change = _props.change;
3088
+ var _props2 = this.props,
3089
+ step = _props2.step,
3090
+ change = _props2.change;
2974
3091
 
2975
3092
  change(step.mode + 'Schema', step.defaultSchema);
2976
3093
  }
2977
3094
  }, {
2978
3095
  key: 'clearAllData',
2979
3096
  value: function clearAllData() {
2980
- var _props2 = this.props,
2981
- step = _props2.step,
2982
- change = _props2.change;
3097
+ var _props3 = this.props,
3098
+ step = _props3.step,
3099
+ change = _props3.change;
2983
3100
 
2984
3101
  this.setState({ selectedDataEntity: '' });
2985
3102
  change(step.mode + 'Schema', {});
@@ -2987,10 +3104,10 @@ module.exports =
2987
3104
  }, {
2988
3105
  key: 'addCustomEntity',
2989
3106
  value: function addCustomEntity() {
2990
- var _props3 = this.props,
2991
- step = _props3.step,
2992
- change = _props3.change,
2993
- formValues = _props3.formValues;
3107
+ var _props4 = this.props,
3108
+ step = _props4.step,
3109
+ change = _props4.change,
3110
+ formValues = _props4.formValues;
2994
3111
 
2995
3112
  var includedFields = formValues[step.mode + 'Schema'] || {};
2996
3113
  var obj = Object.assign({}, includedFields) || {};
@@ -3002,10 +3119,10 @@ module.exports =
3002
3119
  }, {
3003
3120
  key: 'addDefaultDataEntity',
3004
3121
  value: function addDefaultDataEntity(v) {
3005
- var _props4 = this.props,
3006
- step = _props4.step,
3007
- change = _props4.change,
3008
- formValues = _props4.formValues;
3122
+ var _props5 = this.props,
3123
+ step = _props5.step,
3124
+ change = _props5.change,
3125
+ formValues = _props5.formValues;
3009
3126
 
3010
3127
  var includedFields = formValues[step.mode + 'Schema'] || {};
3011
3128
  var obj = Object.assign({}, includedFields) || {};
@@ -3024,10 +3141,10 @@ module.exports =
3024
3141
  }, {
3025
3142
  key: 'selectAll',
3026
3143
  value: function selectAll() {
3027
- var _props5 = this.props,
3028
- step = _props5.step,
3029
- change = _props5.change,
3030
- formValues = _props5.formValues;
3144
+ var _props6 = this.props,
3145
+ step = _props6.step,
3146
+ change = _props6.change,
3147
+ formValues = _props6.formValues;
3031
3148
 
3032
3149
  var includedFields = formValues[step.mode + 'Schema'] || {};
3033
3150
  var obj = Object.assign({}, includedFields) || {};
@@ -3041,10 +3158,10 @@ module.exports =
3041
3158
  }, {
3042
3159
  key: 'deselectAll',
3043
3160
  value: function deselectAll() {
3044
- var _props6 = this.props,
3045
- change = _props6.change,
3046
- step = _props6.step,
3047
- formValues = _props6.formValues;
3161
+ var _props7 = this.props,
3162
+ change = _props7.change,
3163
+ step = _props7.step,
3164
+ formValues = _props7.formValues;
3048
3165
 
3049
3166
  var includedFields = formValues[step.mode + 'Schema'] || {};
3050
3167
  var obj = Object.assign({}, includedFields) || {};
@@ -3059,10 +3176,10 @@ module.exports =
3059
3176
  key: 'removeEntity',
3060
3177
  value: function removeEntity(e, entity) {
3061
3178
  e.stopPropagation();
3062
- var _props7 = this.props,
3063
- change = _props7.change,
3064
- step = _props7.step,
3065
- formValues = _props7.formValues;
3179
+ var _props8 = this.props,
3180
+ change = _props8.change,
3181
+ step = _props8.step,
3182
+ formValues = _props8.formValues;
3066
3183
 
3067
3184
  var includedFields = formValues[step.mode + 'Schema'] || {};
3068
3185
  var obj = Object.assign({}, includedFields);
@@ -3074,14 +3191,14 @@ module.exports =
3074
3191
  value: function render() {
3075
3192
  var _this2 = this;
3076
3193
 
3077
- var _props8 = this.props,
3078
- inputs = _props8.inputs,
3079
- handleSubmit = _props8.handleSubmit,
3080
- nav = _props8.nav,
3081
- formValues = _props8.formValues,
3082
- step = _props8.step,
3083
- reset = _props8.reset,
3084
- change = _props8.change;
3194
+ var _props9 = this.props,
3195
+ inputs = _props9.inputs,
3196
+ handleSubmit = _props9.handleSubmit,
3197
+ nav = _props9.nav,
3198
+ formValues = _props9.formValues,
3199
+ step = _props9.step,
3200
+ reset = _props9.reset,
3201
+ change = _props9.change;
3085
3202
 
3086
3203
  var includedFields = formValues[step.mode + 'Schema'] || {};
3087
3204
  var Button = inputs.Button;
@@ -3681,6 +3798,8 @@ module.exports =
3681
3798
 
3682
3799
  if (piGuid) {
3683
3800
  actions.callGetPiConfig(tenantId, accountId, piGuid);
3801
+ } else {
3802
+ actions.setWizardLoaded(true);
3684
3803
  }
3685
3804
  }
3686
3805
  }]);
@@ -3693,10 +3812,8 @@ module.exports =
3693
3812
  _this.nextPage = _this.nextPage.bind(_this);
3694
3813
  _this.previousPage = _this.previousPage.bind(_this);
3695
3814
  _this.onSubmit = _this.onSubmit.bind(_this);
3696
- _this.goToPage = _this.goToPage.bind(_this);
3697
3815
  _this.state = {
3698
- page: 1,
3699
- currentPage: 1
3816
+ currentPage: null
3700
3817
  };
3701
3818
  _this.possibleSteps = {
3702
3819
  account: _accountStep2.default,
@@ -3751,14 +3868,14 @@ module.exports =
3751
3868
  schemas['' + mode] = {
3752
3869
  name: name || mode + 'Schema',
3753
3870
  providerType: _this2.props.providers[mode],
3754
- resources: resources
3871
+ resources: resources || []
3755
3872
  };
3756
3873
  });
3757
- console.log(schemas);
3874
+ console.log("SCHEMAS: ", schemas);
3758
3875
  //----------------------------------
3759
3876
  // Create mapping
3760
3877
  //----------------------------------
3761
- var mapping = values.mappings && Object.keys(values.mappings).map(function (src) {
3878
+ var makeMapping = values.mappings && Object.keys(values.mappings).map(function (src) {
3762
3879
  var destResource = values.mappings[src].split('.')[0];
3763
3880
  var destProperty = values.mappings[src].split('.')[1];
3764
3881
  var srcProperty = src.split('.')[1].replace(/ /g, '');
@@ -3769,13 +3886,28 @@ module.exports =
3769
3886
  propertyToName: example.Heda[destResource] && example.Heda[destResource][destProperty] ? 'hed__' + destProperty.replace(/ /g, '') + '__c' : destProperty.replace(/ /g, '')
3770
3887
  };
3771
3888
  });
3772
- console.log(mapping);
3889
+ var mapping = makeMapping || [];
3890
+ console.log('Mapping: ', mapping);
3773
3891
  //----------------------------------
3774
3892
  // Create configuration
3775
3893
  //----------------------------------
3776
3894
  var configuration = {
3777
- sourceEndpoint: config.sourceEndpoint,
3778
- destinationEndpoint: config.destinationEndpoint
3895
+ sourceEndpoint: config.sourceEndpoint || 'https://',
3896
+ destinationEndpoint: config.destinationEndpoint || 'https://',
3897
+ currentPage: JSON.stringify(this.state.currentPage),
3898
+ "apiEndpoint_Student": 'https://www.lingkapis.com/v1/@self/ps/students?filter=firstName%20eq%20Rachel',
3899
+ "apiEndpoint_Course": "https://www.lingkapis.com/v1/@self/ps/courses?filter=institutionGuid%20eq%202b3e5636f2a94450a404f1a3b7c55059",
3900
+ "apiEndpoint_Institution": "https://www.lingkapis.com/v1/@self/ps/institutions?filter=shortName%20eq%20orci",
3901
+ "apiKey": "5664bb4478fae2000100004aae5d222c6c2742717cebc5abf69f0f9e",
3902
+ "apiSecret": "YThjODc4MjQ2MzEwNDgzMjYwY2RiYmY5Yzg4NzBhMmI=",
3903
+ "clientId": "3MVG9szVa2RxsqBbm3SjG5D.osKk4_dg2A1KP.v2_SvhrqBuS19C.ktOCziR8tQuIOyRk2.iery_dRTSXX_iO",
3904
+ "clientSecret": "3321758897975330201",
3905
+ "environment": "dev",
3906
+ "pageSize": "100",
3907
+ "password": "Welcome@1",
3908
+ "securityToken": "YKy6pDY3AYfbwgxvRplRY3bOU",
3909
+ "username": "lingkhedadev@lingk.io",
3910
+ "version": "v37.0"
3779
3911
  };
3780
3912
  //----------------------------------
3781
3913
  // Post
@@ -3789,30 +3921,26 @@ module.exports =
3789
3921
  accountId = _props2.accountId,
3790
3922
  tenantId = _props2.tenantId;
3791
3923
 
3792
- if (true) {
3793
- actions.submitWizardData(tenantId, accountId, schemas.source, schemas.destination, mapping, configuration, config.title || '', typeGuid, onGenerate, onFinish);
3794
- onSubmit();
3924
+ if (false) {
3925
+ actions.submitWizardData(tenantId, accountId, schemas.source, schemas.destination, mapping, configuration, config.title || 'Banner for Salesforce', typeGuid, onGenerate, onFinish);
3926
+ onSubmit({ complete: config.hasOwnProperty('deployment') });
3795
3927
  }
3796
3928
  }
3797
3929
  }, {
3798
3930
  key: 'nextPage',
3799
3931
  value: function nextPage() {
3800
- this.setState({
3801
- currentPage: this.state.currentPage + 1,
3802
- page: this.state.page < this.state.currentPage + 1 ? this.state.currentPage + 1 : this.state.page
3803
- });
3932
+ var wizard = this.props.wizard;
3933
+
3934
+ var savedPage = wizard.savedConfiguration && parseInt(wizard.savedConfiguration.currentPage, 10);
3935
+ this.setState({ currentPage: this.state.currentPage ? this.state.currentPage + 1 : savedPage ? savedPage + 1 : 2 });
3804
3936
  }
3805
3937
  }, {
3806
3938
  key: 'previousPage',
3807
3939
  value: function previousPage() {
3808
- this.setState({ currentPage: this.state.currentPage - 1 });
3809
- }
3810
- }, {
3811
- key: 'goToPage',
3812
- value: function goToPage(currentPage) {
3813
- if (currentPage <= this.state.page) {
3814
- this.setState({ currentPage: currentPage });
3815
- }
3940
+ var wizard = this.props.wizard;
3941
+
3942
+ var savedPage = wizard.savedConfiguration && parseInt(wizard.savedConfiguration.currentPage, 10);
3943
+ this.setState({ currentPage: this.state.currentPage ? this.state.currentPage - 1 : savedPage - 1 });
3816
3944
  }
3817
3945
  }, {
3818
3946
  key: 'render',
@@ -3828,43 +3956,67 @@ module.exports =
3828
3956
  inputs = _props3.inputs;
3829
3957
  var Sidebar = inputs.Sidebar;
3830
3958
 
3831
- return _react2.default.createElement(
3832
- 'div',
3833
- { className: 'wizard-body' },
3834
- _react2.default.createElement(
3959
+ if (!wizard.loaded) {
3960
+ return _react2.default.createElement(
3835
3961
  'div',
3836
- { className: 'wizard-sidebar' },
3837
- _react2.default.createElement(Sidebar, { steps: steps, currentPage: currentPage })
3838
- ),
3839
- _react2.default.createElement(
3840
- 'div',
3841
- { className: 'wizard-content' },
3842
- steps.filter(function (s, i) {
3843
- return i + 1 === currentPage;
3844
- }).map(function (step, index) {
3845
- var StepComponent = _this3.possibleSteps[step.type];
3846
- var nav = {
3847
- first: currentPage === 1,
3848
- last: currentPage === steps.length,
3849
- previousPage: _this3.previousPage,
3850
- nextPage: _this3.nextPage
3851
- };
3852
- return _react2.default.createElement(
3962
+ { className: 'wizard-body' },
3963
+ _react2.default.createElement(
3964
+ 'div',
3965
+ { className: 'wizard-sidebar' },
3966
+ _react2.default.createElement(Sidebar, { steps: steps, currentPage: null })
3967
+ ),
3968
+ _react2.default.createElement(
3969
+ 'div',
3970
+ { className: 'wizard-content' },
3971
+ _react2.default.createElement(inputs.Spinner, null)
3972
+ )
3973
+ );
3974
+ } else {
3975
+ var _ret = function () {
3976
+ var page = currentPage || wizard.savedConfiguration && parseInt(wizard.savedConfiguration.currentPage, 10) || 1;
3977
+ return {
3978
+ v: _react2.default.createElement(
3853
3979
  'div',
3854
- { key: 'child-' + index },
3855
- _react2.default.createElement(StepComponent, {
3856
- step: step,
3857
- actions: actions,
3858
- wizard: wizard,
3859
- onSubmit: _this3.onSubmit,
3860
- formValues: formValues,
3861
- inputs: inputs,
3862
- nav: nav
3863
- })
3864
- );
3865
- })
3866
- )
3867
- );
3980
+ { className: 'wizard-body' },
3981
+ _react2.default.createElement(
3982
+ 'div',
3983
+ { className: 'wizard-sidebar' },
3984
+ _react2.default.createElement(Sidebar, { steps: steps, currentPage: page })
3985
+ ),
3986
+ _react2.default.createElement(
3987
+ 'div',
3988
+ { className: 'wizard-content' },
3989
+ steps.filter(function (s, i) {
3990
+ return i + 1 === page;
3991
+ }).map(function (step, index) {
3992
+ var StepComponent = _this3.possibleSteps[step.type];
3993
+ var nav = {
3994
+ first: page === 1,
3995
+ last: page === steps.length,
3996
+ previousPage: _this3.previousPage,
3997
+ nextPage: _this3.nextPage
3998
+ };
3999
+ return _react2.default.createElement(
4000
+ 'div',
4001
+ { key: 'child-' + index },
4002
+ _react2.default.createElement(StepComponent, {
4003
+ step: step,
4004
+ actions: actions,
4005
+ wizard: wizard,
4006
+ onSubmit: _this3.onSubmit,
4007
+ formValues: formValues,
4008
+ inputs: inputs,
4009
+ nav: nav
4010
+ })
4011
+ );
4012
+ })
4013
+ )
4014
+ )
4015
+ };
4016
+ }();
4017
+
4018
+ if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
4019
+ }
3868
4020
  }
3869
4021
  }]);
3870
4022