@lingk/sync 0.0.68 → 0.0.69

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
@@ -5396,7 +5396,8 @@ module.exports =
5396
5396
  leftClicked: false,
5397
5397
  justClicked: false,
5398
5398
  multiple: false,
5399
- overflowHidden: true
5399
+ overflowHidden: true,
5400
+ customizingGroup: null
5400
5401
  };
5401
5402
  _this.pickEntity = _this.pickEntity.bind(_this);
5402
5403
  _this.unPick = _this.unPick.bind(_this);
@@ -5412,6 +5413,7 @@ module.exports =
5412
5413
  _this.go = _this.go.bind(_this);
5413
5414
  _this.disableMultiple = _this.disableMultiple.bind(_this);
5414
5415
  _this.addDefaultEntity = _this.addDefaultEntity.bind(_this);
5416
+ _this.customize = _this.customize.bind(_this);
5415
5417
  return _this;
5416
5418
  }
5417
5419
 
@@ -5455,6 +5457,15 @@ module.exports =
5455
5457
  break;
5456
5458
  }
5457
5459
  }
5460
+ }, {
5461
+ key: 'customize',
5462
+ value: function customize(groupName) {
5463
+ if (this.state.customizingGroup === groupName) {
5464
+ this.setState({ customizingGroup: null });
5465
+ } else {
5466
+ this.setState({ customizingGroup: groupName });
5467
+ }
5468
+ }
5458
5469
  }, {
5459
5470
  key: 'showOverflow',
5460
5471
  value: function showOverflow() {
@@ -5475,7 +5486,8 @@ module.exports =
5475
5486
  resourceGroupIndex: resourceGroupIndex,
5476
5487
  paneToggle: !this.state.paneToggle,
5477
5488
  overflowHidden: true,
5478
- justClicked: true
5489
+ justClicked: true,
5490
+ customizingGroup: null
5479
5491
  });
5480
5492
  setTimeout(function () {
5481
5493
  _this2.setState({ justClicked: false });
@@ -5600,7 +5612,9 @@ module.exports =
5600
5612
  removeResourceGroup: this.removeResourceGroup,
5601
5613
  disableMultiple: this.disableMultiple,
5602
5614
  clickTableRow: this.clickDot,
5603
- unPick: this.unPick
5615
+ unPick: this.unPick,
5616
+ customizingGroup: this.state.customizingGroup,
5617
+ customize: this.customize
5604
5618
  };
5605
5619
 
5606
5620
  var smallButtonStyle = {
@@ -16909,6 +16923,7 @@ module.exports =
16909
16923
  value: true
16910
16924
  });
16911
16925
  exports.callCheckConnection = callCheckConnection;
16926
+ exports.callAddCustomField = callAddCustomField;
16912
16927
  exports.callGetScenario = callGetScenario;
16913
16928
  exports.callPreviewIntegration = callPreviewIntegration;
16914
16929
  exports.callPostBundles = callPostBundles;
@@ -16973,7 +16988,23 @@ module.exports =
16973
16988
  };
16974
16989
  }
16975
16990
 
16976
- function callGetScenario(magicNumber, bundleGuid, mappingGuid) {
16991
+ function callAddCustomField(objectType, fieldName, fieldLabel, completedCallback) {
16992
+ return function (dispatch, getState, api) {
16993
+ var _getState2 = getState(),
16994
+ config = _getState2.config;
16995
+
16996
+ var TRANS_API_URL = config.TRANS_API_URL;
16997
+
16998
+ return api.get('transformer/versions/1606/latest', {
16999
+ endpoint: TRANS_API_URL
17000
+ }).then(function (res) {
17001
+ console.log(res);
17002
+ completedCallback();
17003
+ });
17004
+ };
17005
+ }
17006
+
17007
+ function callGetScenario(magicNumber, bundleGuid, mappingGuid, completedCallback) {
16977
17008
  return function (dispatch, getState, api) {
16978
17009
  dispatch({
16979
17010
  type: types.START_GET_SCENARIO
@@ -16984,8 +17015,10 @@ module.exports =
16984
17015
  dispatch({
16985
17016
  type: types.FINISH_GET_SCENARIO
16986
17017
  });
17018
+ completedCallback();
16987
17019
  }).catch(function (err) {
16988
17020
  console.log(err);
17021
+ completedCallback();
16989
17022
  });
16990
17023
  };
16991
17024
  }
@@ -16996,8 +17029,8 @@ module.exports =
16996
17029
  type: types.START_PREVIEW
16997
17030
  });
16998
17031
 
16999
- var _getState2 = getState(),
17000
- config = _getState2.config;
17032
+ var _getState3 = getState(),
17033
+ config = _getState3.config;
17001
17034
 
17002
17035
  var TRANS_API_URL = config.TRANS_API_URL;
17003
17036
 
@@ -17016,8 +17049,8 @@ module.exports =
17016
17049
 
17017
17050
  function callPostBundles(tenantId, appId, bundles) {
17018
17051
  return function (dispatch, getState, api) {
17019
- var _getState3 = getState(),
17020
- config = _getState3.config;
17052
+ var _getState4 = getState(),
17053
+ config = _getState4.config;
17021
17054
 
17022
17055
  var TRANS_API_URL = config.TRANS_API_URL;
17023
17056
 
@@ -17033,8 +17066,8 @@ module.exports =
17033
17066
 
17034
17067
  function callPostMapping(tenantId, appId, mappings) {
17035
17068
  return function (dispatch, getState, api) {
17036
- var _getState4 = getState(),
17037
- config = _getState4.config;
17069
+ var _getState5 = getState(),
17070
+ config = _getState5.config;
17038
17071
 
17039
17072
  var TRANS_API_URL = config.TRANS_API_URL;
17040
17073
 
@@ -17050,8 +17083,8 @@ module.exports =
17050
17083
 
17051
17084
  function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid) {
17052
17085
  return function (dispatch, getState, api) {
17053
- var _getState5 = getState(),
17054
- config = _getState5.config;
17086
+ var _getState6 = getState(),
17087
+ config = _getState6.config;
17055
17088
 
17056
17089
  var TRANS_API_URL = config.TRANS_API_URL;
17057
17090
 
@@ -17073,8 +17106,8 @@ module.exports =
17073
17106
 
17074
17107
  function callGenerateRecipe(tenantId, appId, typeGuid, title, piGuid, mappingGuid, destinationMetadata) {
17075
17108
  return function (dispatch, getState, api) {
17076
- var _getState6 = getState(),
17077
- config = _getState6.config;
17109
+ var _getState7 = getState(),
17110
+ config = _getState7.config;
17078
17111
 
17079
17112
  var TRANS_API_URL = config.TRANS_API_URL;
17080
17113
 
@@ -17121,8 +17154,8 @@ module.exports =
17121
17154
 
17122
17155
  function callExecuteTransformer(transId) {
17123
17156
  return function (dispatch, getState, api) {
17124
- var _getState7 = getState(),
17125
- config = _getState7.config;
17157
+ var _getState8 = getState(),
17158
+ config = _getState8.config;
17126
17159
 
17127
17160
  var TRANS_API_URL = config.TRANS_API_URL;
17128
17161
 
@@ -17149,8 +17182,8 @@ module.exports =
17149
17182
 
17150
17183
  function callLookupLogData(externalExecutionId, index, onFinish, generatedRecipe, piGuid, mapGuid) {
17151
17184
  return function (dispatch, getState, api) {
17152
- var _getState8 = getState(),
17153
- config = _getState8.config;
17185
+ var _getState9 = getState(),
17186
+ config = _getState9.config;
17154
17187
 
17155
17188
  var TRANS_API_URL = config.TRANS_API_URL;
17156
17189
 
@@ -17195,8 +17228,8 @@ module.exports =
17195
17228
  };
17196
17229
  }
17197
17230
  return function (dispatch, getState, api) {
17198
- var _getState9 = getState(),
17199
- config = _getState9.config;
17231
+ var _getState10 = getState(),
17232
+ config = _getState10.config;
17200
17233
 
17201
17234
  var TRANS_API_URL = config.TRANS_API_URL;
17202
17235
 
@@ -17211,8 +17244,8 @@ module.exports =
17211
17244
 
17212
17245
  function callDeployTrigger(generatedRecipe, piGuid, mapGuid, onFinish) {
17213
17246
  return function (dispatch, getState, api) {
17214
- var _getState10 = getState(),
17215
- config = _getState10.config;
17247
+ var _getState11 = getState(),
17248
+ config = _getState11.config;
17216
17249
 
17217
17250
  var TRANS_API_URL = config.TRANS_API_URL;
17218
17251
 
@@ -17247,8 +17280,8 @@ module.exports =
17247
17280
  function callGetPiConfig(tenantId, accountId, piGuid, providers, metadataEndpoints) {
17248
17281
  if (piGuid) {
17249
17282
  return function (dispatch, getState, api) {
17250
- var _getState11 = getState(),
17251
- config = _getState11.config;
17283
+ var _getState12 = getState(),
17284
+ config = _getState12.config;
17252
17285
 
17253
17286
  var TRANS_API_URL = config.TRANS_API_URL;
17254
17287
 
@@ -17285,8 +17318,8 @@ module.exports =
17285
17318
  function callGetBundles(tenantId, accountId, bundlePackGuid) {
17286
17319
  if (bundlePackGuid) {
17287
17320
  return function (dispatch, getState, api) {
17288
- var _getState12 = getState(),
17289
- config = _getState12.config;
17321
+ var _getState13 = getState(),
17322
+ config = _getState13.config;
17290
17323
 
17291
17324
  var TRANS_API_URL = config.TRANS_API_URL;
17292
17325
 
@@ -17307,8 +17340,8 @@ module.exports =
17307
17340
  function callGetMapping(tenantId, accountId, mappingGuid) {
17308
17341
  if (mappingGuid) {
17309
17342
  return function (dispatch, getState, api) {
17310
- var _getState13 = getState(),
17311
- config = _getState13.config;
17343
+ var _getState14 = getState(),
17344
+ config = _getState14.config;
17312
17345
 
17313
17346
  var TRANS_API_URL = config.TRANS_API_URL;
17314
17347
 
@@ -17342,8 +17375,8 @@ module.exports =
17342
17375
 
17343
17376
  function callGetProviderMetadata(tenantId, appId, urlSuffix, mode, providerType) {
17344
17377
  return function (dispatch, getState, api) {
17345
- var _getState14 = getState(),
17346
- config = _getState14.config;
17378
+ var _getState15 = getState(),
17379
+ config = _getState15.config;
17347
17380
 
17348
17381
  var AGENT_API_URL = config.AGENT_API_URL;
17349
17382
 
@@ -17366,8 +17399,8 @@ module.exports =
17366
17399
 
17367
17400
  function callGetTrigger(transBaseId) {
17368
17401
  return function (dispatch, getState, api) {
17369
- var _getState15 = getState(),
17370
- config = _getState15.config;
17402
+ var _getState16 = getState(),
17403
+ config = _getState16.config;
17371
17404
 
17372
17405
  var TRANS_API_URL = config.TRANS_API_URL;
17373
17406
 
@@ -17383,20 +17416,16 @@ module.exports =
17383
17416
  }
17384
17417
 
17385
17418
  function setWizardLoaded(bool) {
17386
- return function (dispatch, getState, api) {
17387
- dispatch({
17388
- type: types.SET_WIZARD_LOADED,
17389
- bool: bool
17390
- });
17419
+ return {
17420
+ type: types.SET_WIZARD_LOADED,
17421
+ bool: bool
17391
17422
  };
17392
17423
  }
17393
17424
 
17394
17425
  function setWizardDataLoaded(bool) {
17395
- return function (dispatch, getState, api) {
17396
- dispatch({
17397
- type: types.SET_WIZARD_DATA_LOADED,
17398
- bool: bool
17399
- });
17426
+ return {
17427
+ type: types.SET_WIZARD_DATA_LOADED,
17428
+ bool: bool
17400
17429
  };
17401
17430
  }
17402
17431
 
@@ -18563,7 +18592,8 @@ module.exports =
18563
18592
  change = _props3.change,
18564
18593
  step = _props3.step,
18565
18594
  reset = _props3.reset,
18566
- wizard = _props3.wizard;
18595
+ wizard = _props3.wizard,
18596
+ actions = _props3.actions;
18567
18597
 
18568
18598
  var MapTable = inputs.MapTable;
18569
18599
  var sourceSchema = wizard['sourceMetadata'] ? wizard['sourceMetadata'] : null;
@@ -18605,10 +18635,10 @@ module.exports =
18605
18635
  { style: { position: 'relative' } },
18606
18636
  _react2.default.createElement(
18607
18637
  _groupNav2.default,
18608
- { resourceGroups: resourceGroups, customizable: false, isBundleStep: false, inputs: inputs,
18638
+ { resourceGroups: resourceGroups, isBundleStep: false, inputs: inputs,
18609
18639
  style: { position: 'relative', width: 640, height: 69, zIndex: 9000 }, step: step },
18610
18640
  _react2.default.createElement(_mapAccordion2.default, { sourceSchema: sourceSchema, destinationSchema: destinationSchema,
18611
- formValues: formValues, change: change, update: this.update, step: step }),
18641
+ formValues: formValues, change: change, update: this.update, step: step, actions: actions }),
18612
18642
  _react2.default.createElement(
18613
18643
  MapTable,
18614
18644
  { clearOneMapping: this.clearOneMapping, selectMapping: this.selectMapping },
@@ -19061,18 +19091,40 @@ module.exports =
19061
19091
  };
19062
19092
 
19063
19093
  _this.select = function (o) {
19064
- var wizard = _this.props.wizard;
19094
+ var _this$props = _this.props,
19095
+ wizard = _this$props.wizard,
19096
+ formValues = _this$props.formValues;
19065
19097
 
19066
- if (wizard.savedConfiguration && wizard.savedConfiguration.scenario) {
19067
- _this.openModal(o);
19068
- } else {
19069
- _this.changeScenario(o);
19098
+ if (!(formValues.scenario && formValues.scenario === o.name)) {
19099
+ if (wizard.savedConfiguration && wizard.savedConfiguration.scenario) {
19100
+ _this.openModal(o);
19101
+ } else {
19102
+ _this.changeScenario(o);
19103
+ }
19070
19104
  }
19071
19105
  };
19072
19106
 
19107
+ _this.goLoading = function () {
19108
+ _this.setState({ loadingDots: '.' });
19109
+ _this.loadingInterval = setInterval(function () {
19110
+ if (_this.state.loadingDots.length <= 10) {
19111
+ _this.setState({ loadingDots: _this.state.loadingDots + '.' });
19112
+ } else {
19113
+ _this.setState({ loadingDots: '.' });
19114
+ }
19115
+ }, 150);
19116
+ };
19117
+
19118
+ _this.completedCallback = function () {
19119
+ _this.setState({ currentlyLoadingScenario: '', loadingDots: '' });
19120
+ clearInterval(_this.loadingInterval);
19121
+ };
19122
+
19073
19123
  _this.state = {
19074
19124
  showModal: false,
19075
- modalOption: null
19125
+ modalOption: null,
19126
+ currentlyLoadingScenario: '',
19127
+ loadingDots: ''
19076
19128
  };
19077
19129
  return _this;
19078
19130
  }
@@ -19110,7 +19162,9 @@ module.exports =
19110
19162
 
19111
19163
  change('resourceGroups', null); //clear old data
19112
19164
  change('scenario', o.name);
19113
- actions.callGetScenario(step.magicNumber, o.bundleGuid, o.mappingGuid);
19165
+ actions.callGetScenario(step.magicNumber, o.bundleGuid, o.mappingGuid, this.completedCallback);
19166
+ this.setState({ currentlyLoadingScenario: o.name });
19167
+ this.goLoading();
19114
19168
  }
19115
19169
  }, {
19116
19170
  key: 'render',
@@ -19154,10 +19208,12 @@ module.exports =
19154
19208
  return _react2.default.createElement(
19155
19209
  'div',
19156
19210
  { key: i },
19157
- _react2.default.createElement(Radio, { label: o.title, checked: o.name === scenario, style: { cursor: 'pointer' },
19158
- onChange: function onChange() {
19211
+ _react2.default.createElement(Radio, { onChange: function onChange() {
19159
19212
  return _this2.select(o);
19160
- } }),
19213
+ },
19214
+ label: '' + o.title + (_this2.state.currentlyLoadingScenario === o.name ? _this2.state.loadingDots : ''),
19215
+ checked: o.name === scenario, style: { cursor: 'pointer' }
19216
+ }),
19161
19217
  _react2.default.createElement('br', null),
19162
19218
  _react2.default.createElement(
19163
19219
  'span',
@@ -19495,6 +19551,21 @@ module.exports =
19495
19551
 
19496
19552
  var destinationSchema = wizard['destinationMetadata'] ? wizard['destinationMetadata'] : null;
19497
19553
 
19554
+ var enabled = resourceGroups && resourceGroups.length > 0 && resourceGroups.every(function (g) {
19555
+ var isConnected = false;
19556
+ if (g.customExternalKeys) {
19557
+ if (g.sourceKeys && g.sourceKeys.length > 0 && g.destinationKeys && g.destinationKeys.length > 0) {
19558
+ isConnected = true;
19559
+ }
19560
+ } else {
19561
+ if (g.lingkSourceKey) isConnected = true;
19562
+ }
19563
+ var areJoined = g.resources && g.resources.every(function (r, i) {
19564
+ return i === 0 || r.joinKeyName && r.primaryKeyName;
19565
+ });
19566
+ return isConnected && areJoined;
19567
+ });
19568
+
19498
19569
  return _react2.default.createElement(
19499
19570
  'form',
19500
19571
  { onKeyPress: function onKeyPress(e) {
@@ -19526,7 +19597,7 @@ module.exports =
19526
19597
  { isBundleStep: true, style: { position: 'relative', width: 585, height: 69, zIndex: 9000 },
19527
19598
  resourceGroups: resourceGroups, removeGroup: this.removeGroup, addGroup: this.addGroup,
19528
19599
  destinationSchema: destinationSchema, changeGroupOrder: this.changeGroupOrder, step: step,
19529
- inputs: inputs, customizable: step.customizable, addDefaultEntity: this.addDefaultEntity },
19600
+ inputs: inputs, addDefaultEntity: this.addDefaultEntity },
19530
19601
  _react2.default.createElement(_schemaAccordion2.default, { sourceSchema: sourceSchema, removeEntity: this.removeEntity,
19531
19602
  changeEntityOrder: this.changeEntityOrder, step: step, destinationSchema: destinationSchema }),
19532
19603
  _react2.default.createElement(
@@ -19554,10 +19625,7 @@ module.exports =
19554
19625
  ),
19555
19626
  _react2.default.createElement('br', null),
19556
19627
  _react2.default.createElement(_navButtons2.default, { handleSubmit: handleSubmit, nav: nav, reset: reset, inputs: inputs,
19557
- nextDisabled: !(resourceGroups && resourceGroups.length > 0) || !resourceGroups.every(function (g) {
19558
- return g.resources;
19559
- }) //&& g.destinationKey && g.resources.every(rsc=>rsc.externalKey))
19560
- })
19628
+ nextDisabled: !enabled })
19561
19629
  );
19562
19630
  }
19563
19631
  }]);
@@ -20080,13 +20148,79 @@ module.exports =
20080
20148
  var _this = _possibleConstructorReturn(this, (MapAccordion.__proto__ || Object.getPrototypeOf(MapAccordion)).call(this));
20081
20149
 
20082
20150
  _this.state = {
20083
- selectedField: null
20151
+ selectedField: null,
20152
+ customFieldValue: '',
20153
+ addNewButtonText: 'Add New'
20084
20154
  };
20085
20155
  _this.onSelectDestinationField = _this.onSelectDestinationField.bind(_this);
20156
+ _this.customize = _this.customize.bind(_this);
20157
+ _this.submitCustomField = _this.submitCustomField.bind(_this);
20158
+ _this.changeCustomFieldValue = _this.changeCustomFieldValue.bind(_this);
20159
+ _this.completedCallback = _this.completedCallback.bind(_this);
20160
+ _this.goLoading = _this.goLoading.bind(_this);
20086
20161
  return _this;
20087
20162
  }
20088
20163
 
20089
20164
  _createClass(MapAccordion, [{
20165
+ key: 'customize',
20166
+ value: function customize(groupName) {
20167
+ var _this2 = this;
20168
+
20169
+ this.props.customize(groupName);
20170
+ setTimeout(function () {
20171
+ if (_this2.customFieldInput) {
20172
+ _this2.customFieldInput.focus();
20173
+ }
20174
+ }, 100);
20175
+ }
20176
+ }, {
20177
+ key: 'changeCustomFieldValue',
20178
+ value: function changeCustomFieldValue(e) {
20179
+ var last = e.target.value[e.target.value.length - 1];
20180
+ if (!(last === ' ' && (this.state.customFieldValue.length === 0 || this.state.customFieldValue[this.state.customFieldValue.length - 1] === ' '))) {
20181
+ this.setState({ customFieldValue: e.target.value });
20182
+ }
20183
+ }
20184
+ }, {
20185
+ key: 'submitCustomField',
20186
+ value: function submitCustomField() {
20187
+ var _props = this.props,
20188
+ destinationSchema = _props.destinationSchema,
20189
+ customizingGroup = _props.customizingGroup,
20190
+ actions = _props.actions;
20191
+
20192
+ var fieldLabel = this.state.customFieldValue;
20193
+ if (fieldLabel[fieldLabel.length - 1] === ' ') {
20194
+ fieldLabel = fieldLabel.slice(0, -1);
20195
+ }
20196
+ var fieldName = 'lingk__' + fieldLabel.replace(' ', '_') + '__c';
20197
+ var object = destinationSchema.find(function (o) {
20198
+ return o.name === customizingGroup;
20199
+ });
20200
+ actions.callAddCustomField(object.type, fieldName, fieldLabel, this.completedCallback);
20201
+ this.goLoading();
20202
+ }
20203
+ }, {
20204
+ key: 'goLoading',
20205
+ value: function goLoading() {
20206
+ var _this3 = this;
20207
+
20208
+ this.setState({ addNewButtonText: '.' });
20209
+ this.loadingInterval = setInterval(function () {
20210
+ if (_this3.state.addNewButtonText.length <= 10) {
20211
+ _this3.setState({ addNewButtonText: _this3.state.addNewButtonText + '.' });
20212
+ } else {
20213
+ _this3.setState({ addNewButtonText: '.' });
20214
+ }
20215
+ }, 150);
20216
+ }
20217
+ }, {
20218
+ key: 'completedCallback',
20219
+ value: function completedCallback() {
20220
+ this.setState({ customFieldValue: '', addNewButtonText: 'Add New' });
20221
+ clearInterval(this.loadingInterval);
20222
+ }
20223
+ }, {
20090
20224
  key: 'scrollToTop',
20091
20225
  value: function scrollToTop(element, scrollDuration, scrollTarget) {
20092
20226
  var initial = element.scrollTop,
@@ -20108,11 +20242,11 @@ module.exports =
20108
20242
  }, {
20109
20243
  key: 'onSelectDestinationField',
20110
20244
  value: function onSelectDestinationField(group, field) {
20111
- var _props = this.props,
20112
- change = _props.change,
20113
- formValues = _props.formValues,
20114
- selectedEntities = _props.selectedEntities,
20115
- resourceGroupIndex = _props.resourceGroupIndex;
20245
+ var _props2 = this.props,
20246
+ change = _props2.change,
20247
+ formValues = _props2.formValues,
20248
+ selectedEntities = _props2.selectedEntities,
20249
+ resourceGroupIndex = _props2.resourceGroupIndex;
20116
20250
 
20117
20251
  var selectedEntity = selectedEntities[resourceGroupIndex];
20118
20252
  if (this.state.selectedField) {
@@ -20145,19 +20279,23 @@ module.exports =
20145
20279
  }, {
20146
20280
  key: 'render',
20147
20281
  value: function render() {
20148
- var _this2 = this;
20282
+ var _this4 = this;
20149
20283
 
20150
- var _props2 = this.props,
20151
- selectedEntities = _props2.selectedEntities,
20152
- resourceGroups = _props2.resourceGroups,
20153
- resourceGroupIndex = _props2.resourceGroupIndex,
20154
- leftClicked = _props2.leftClicked,
20155
- sourceSchema = _props2.sourceSchema,
20156
- destinationSchema = _props2.destinationSchema,
20157
- toggle = _props2.toggle,
20158
- step = _props2.step;
20284
+ var _props3 = this.props,
20285
+ selectedEntities = _props3.selectedEntities,
20286
+ resourceGroups = _props3.resourceGroups,
20287
+ resourceGroupIndex = _props3.resourceGroupIndex,
20288
+ leftClicked = _props3.leftClicked,
20289
+ sourceSchema = _props3.sourceSchema,
20290
+ destinationSchema = _props3.destinationSchema,
20291
+ toggle = _props3.toggle,
20292
+ step = _props3.step,
20293
+ customizingGroup = _props3.customizingGroup,
20294
+ inputs = _props3.inputs;
20159
20295
  var selectedField = this.state.selectedField;
20160
20296
 
20297
+ var Button = inputs.Button;
20298
+ var Input = inputs.Input;
20161
20299
 
20162
20300
  var group = resourceGroups[resourceGroupIndex];
20163
20301
  var selectedEntity = selectedEntities[resourceGroupIndex] || { name: '' };
@@ -20173,6 +20311,15 @@ module.exports =
20173
20311
  }
20174
20312
  });
20175
20313
 
20314
+ var smallButtonStyle = {
20315
+ height: 18,
20316
+ lineHeight: '7px',
20317
+ padding: '0px 12px',
20318
+ fontSize: 10,
20319
+ float: 'right',
20320
+ width: 70
20321
+ };
20322
+
20176
20323
  return _react2.default.createElement(
20177
20324
  'div',
20178
20325
  null,
@@ -20198,7 +20345,7 @@ module.exports =
20198
20345
  _react2.default.createElement(
20199
20346
  'div',
20200
20347
  { ref: function ref(_ref) {
20201
- _this2['scroller-' + ii] = _ref;
20348
+ _this4['scroller-' + ii] = _ref;
20202
20349
  }, className: 'scrolly',
20203
20350
  style: { background: 'white', height: 261, width: 350, padding: '6px 12px' } },
20204
20351
  group.resources && group.resources.map(function (rsc, i) {
@@ -20211,9 +20358,9 @@ module.exports =
20211
20358
  { className: 'accordion-panel-header',
20212
20359
  style: { height: 35 },
20213
20360
  onClick: function onClick() {
20214
- _this2.scrollToTop(_this2['scroller-' + ii], 18, i * 43 + 6);
20215
- _this2.props.pickEntity({ name: rsc.name, isDestinationEntity: rsc.provider === step.destinationProvider });
20216
- _this2.setState({ selectedField: null });
20361
+ _this4.scrollToTop(_this4['scroller-' + ii], 18, i * 43 + 6);
20362
+ _this4.props.pickEntity({ name: rsc.name, isDestinationEntity: rsc.provider === step.destinationProvider });
20363
+ _this4.setState({ selectedField: null });
20217
20364
  }
20218
20365
  },
20219
20366
  _react2.default.createElement(
@@ -20256,7 +20403,7 @@ module.exports =
20256
20403
  'div',
20257
20404
  { key: ii, className: 'wizard-map-field',
20258
20405
  style: style, onClick: function onClick() {
20259
- return _this2.setState({ selectedField: field.label });
20406
+ return _this4.setState({ selectedField: field.label });
20260
20407
  }
20261
20408
  },
20262
20409
  field.label
@@ -20278,7 +20425,19 @@ module.exports =
20278
20425
  _react2.default.createElement(
20279
20426
  'div',
20280
20427
  { style: { height: 27, borderBottom: '1px solid rgb(204, 205, 207)', padding: '4px 8px', fontWeight: 'bold', background: '#EEEEEE' } },
20281
- 'Target Fields'
20428
+ _react2.default.createElement(
20429
+ 'span',
20430
+ null,
20431
+ 'Target Fields'
20432
+ ),
20433
+ step.customizable && _react2.default.createElement(
20434
+ Button,
20435
+ { type: customizingGroup === group.name ? "neutral" : "brand",
20436
+ style: smallButtonStyle, onClick: function onClick() {
20437
+ return _this4.customize(group.name);
20438
+ } },
20439
+ this.state.addNewButtonText
20440
+ )
20282
20441
  ),
20283
20442
  bit.map(function (x, i) {
20284
20443
  return _react2.default.createElement(
@@ -20291,6 +20450,21 @@ module.exports =
20291
20450
  _react2.default.createElement(
20292
20451
  'div',
20293
20452
  { className: 'scrolly', style: { height: 256, padding: '8px 12px' } },
20453
+ customizingGroup === group.name && _react2.default.createElement(
20454
+ 'div',
20455
+ { style: { width: 264, marginBottom: 5 } },
20456
+ _react2.default.createElement(Input, { placeholder: 'Add Custom Field', inputRef: function inputRef(ref) {
20457
+ return _this4.customFieldInput = ref;
20458
+ },
20459
+ onChange: _this4.changeCustomFieldValue, value: _this4.state.customFieldValue,
20460
+ symbolPattern: '[a-zA-Z ]', style: { width: 210 } }),
20461
+ _react2.default.createElement(
20462
+ Button,
20463
+ { type: 'neutral', style: { float: 'right' }, onClick: _this4.submitCustomField,
20464
+ disabled: !_this4.state.customFieldValue || _this4.state.addNewButtonText !== 'Add New' },
20465
+ 'OK'
20466
+ )
20467
+ ),
20294
20468
  destinationSchema && destinationSchema.find(function (r) {
20295
20469
  return r.name === group.name;
20296
20470
  }).properties.filter(function (p) {
@@ -20304,7 +20478,7 @@ module.exports =
20304
20478
  fontWeight: mappings && Object.keys(mappings).includes(field.label) ? 'bold' : 'normal',
20305
20479
  color: mappings && Object.keys(mappings).includes(field.label) ? '#16325c' : selectedField ? 'black' : 'grey'
20306
20480
  }, onClick: function onClick() {
20307
- return _this2.onSelectDestinationField(group.name, field.label);
20481
+ return _this4.onSelectDestinationField(group.name, field.label);
20308
20482
  } },
20309
20483
  field.label
20310
20484
  );
@@ -20718,7 +20892,11 @@ module.exports =
20718
20892
  step.sourceProvider,
20719
20893
  ' Objects to map into the ',
20720
20894
  step.destinationProvider,
20721
- ' Object. If multiple Objects are added to a single Sync Operation, the Keys for joining these objects must be configured as well.'
20895
+ ' Object. If multiple ',
20896
+ step.sourceProvider,
20897
+ ' Objects are added to a single ',
20898
+ step.destinationProvider,
20899
+ ' Object, the Keys for joining these objects must be configured as well.'
20722
20900
  )
20723
20901
  ),
20724
20902
  _react2.default.createElement(
@@ -21233,8 +21411,10 @@ module.exports =
21233
21411
  _this.nextPage = _this.nextPage.bind(_this);
21234
21412
  _this.previousPage = _this.previousPage.bind(_this);
21235
21413
  _this.onSubmit = _this.onSubmit.bind(_this);
21414
+ _this.goToPage = _this.goToPage.bind(_this);
21236
21415
  _this.state = {
21237
- currentPage: null
21416
+ currentPage: 1,
21417
+ highestPage: 1
21238
21418
  };
21239
21419
  _this.possibleSteps = {
21240
21420
  account: _accountStep2.default,
@@ -21434,15 +21614,24 @@ module.exports =
21434
21614
  value: function nextPage() {
21435
21615
  //const { wizard } = this.props
21436
21616
  //const savedPage = (wizard.savedConfiguration && parseInt(wizard.savedConfiguration.currentPage, 10))
21437
- this.setState({ currentPage: this.state.currentPage ? this.state.currentPage + 1 : 2 });
21438
- //savedPage ? savedPage + 1 : 2 })
21617
+ this.setState({ currentPage: this.state.currentPage + 1 });
21618
+ if (this.state.currentPage + 1 > this.state.highestPage) {
21619
+ this.setState({ highestPage: this.state.currentPage + 1 });
21620
+ }
21439
21621
  }
21440
21622
  }, {
21441
21623
  key: 'previousPage',
21442
21624
  value: function previousPage() {
21443
21625
  //const { wizard } = this.props
21444
21626
  //const savedPage = (wizard.savedConfiguration && parseInt(wizard.savedConfiguration.currentPage, 10))
21445
- this.setState({ currentPage: this.state.currentPage ? this.state.currentPage - 1 : 1 }); //: savedPage - 1 })
21627
+ this.setState({ currentPage: this.state.currentPage - 1 }); //: savedPage - 1 })
21628
+ }
21629
+ }, {
21630
+ key: 'goToPage',
21631
+ value: function goToPage(i) {
21632
+ if (i + 1 <= this.state.highestPage) {
21633
+ this.setState({ currentPage: i + 1 });
21634
+ }
21446
21635
  }
21447
21636
  }, {
21448
21637
  key: 'render',
@@ -21467,7 +21656,7 @@ module.exports =
21467
21656
  _react2.default.createElement(
21468
21657
  'div',
21469
21658
  { className: 'wizard-sidebar' },
21470
- _react2.default.createElement(Sidebar, { steps: steps, currentPage: null })
21659
+ _react2.default.createElement(Sidebar, { steps: steps, currentPage: 1, highestPage: 1, goToPage: function goToPage() {} })
21471
21660
  ),
21472
21661
  _react2.default.createElement(
21473
21662
  'div',
@@ -21485,7 +21674,7 @@ module.exports =
21485
21674
  _react2.default.createElement(
21486
21675
  'div',
21487
21676
  { className: 'wizard-sidebar' },
21488
- _react2.default.createElement(Sidebar, { steps: steps, currentPage: page })
21677
+ _react2.default.createElement(Sidebar, { steps: steps, currentPage: page, goToPage: _this3.goToPage, highestPage: _this3.state.highestPage })
21489
21678
  ),
21490
21679
  _react2.default.createElement(
21491
21680
  'div',
@@ -21604,8 +21793,6 @@ module.exports =
21604
21793
  var wiz = {
21605
21794
  title: 'Banner to Salesforce',
21606
21795
  nameStep: false,
21607
- phaseStep: false,
21608
- filterStep: false,
21609
21796
  source: {
21610
21797
  type: 'Banner',
21611
21798
  name: 'Banner',
@@ -21617,7 +21804,7 @@ module.exports =
21617
21804
  type: 'Salesforce',
21618
21805
  name: 'Salesforce',
21619
21806
  env: false,
21620
- customizable: false, // if destination schema is not customizable, disclude the entire step
21807
+ customizable: true,
21621
21808
  customStep: false
21622
21809
  },
21623
21810
  deployment: ['once', 'daily', 'repeating'],
@@ -21753,8 +21940,8 @@ module.exports =
21753
21940
  if (step.type === 'name' && wizard.nameStep) {
21754
21941
  step.name = wizard.title;
21755
21942
  stepList.push(step);
21756
- } else if (step.type === 'phase' && wizard.phaseStep) {
21757
- stepList.push(step);
21943
+ /*} else if (step.type === 'phase' && wizard.phaseStep) {
21944
+ stepList.push(step)*/
21758
21945
  } else if (step.type === 'custom') {
21759
21946
  var customStep = providerData.providerTypes[wizard.destination.type].customStep;
21760
21947
  if (customStep && wizard[step.mode].customStep) {
@@ -21778,13 +21965,12 @@ module.exports =
21778
21965
  stepList.push(step);
21779
21966
  }
21780
21967
  } else if (step.type === 'schema') {
21781
- step.customizable = wizard.source.customizable;
21782
- stepList.push(step);
21783
- } else if (step.type === 'filter' && wizard.filterStep) {
21784
- step.provider = wizard.source.name;
21785
21968
  stepList.push(step);
21969
+ /*} else if (step.type === 'filter' && wizard.filterStep) {
21970
+ step.provider = wizard.source.name
21971
+ stepList.push(step)*/
21786
21972
  } else if (step.type === 'map') {
21787
- step.defaultSchema = wizard.source.defaultSchema || null; //remove this
21973
+ step.customizable = wizard.destination.customizable;
21788
21974
  stepList.push(step);
21789
21975
  } else if (step.type === 'preview') {
21790
21976
  step.dummyData = wizard.dummyData || null;