@lingk/sync 0.0.88 → 0.0.90

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
@@ -5475,6 +5475,7 @@ module.exports =
5475
5475
  }, {
5476
5476
  key: 'showOverflow',
5477
5477
  value: function showOverflow() {
5478
+ console.log('showOverflow');
5478
5479
  this.setState({ overflowHidden: false });
5479
5480
  }
5480
5481
  }, {
@@ -18962,6 +18963,11 @@ module.exports =
18962
18963
 
18963
18964
  function callGetPiConfig(tenantId, accountId, piGuid, providers, metadataEndpoints) {
18964
18965
  // a wizard config already exists
18966
+ var source = metadataEndpoints.source,
18967
+ sourceApi = metadataEndpoints.sourceApi,
18968
+ destination = metadataEndpoints.destination,
18969
+ destinationApi = metadataEndpoints.destinationApi;
18970
+
18965
18971
  if (piGuid) {
18966
18972
  return function (dispatch, getState, api) {
18967
18973
  var _getState13 = getState(),
@@ -18991,12 +18997,12 @@ module.exports =
18991
18997
  type: types.SET_WIZARD_SAVED_CONFIGURATION,
18992
18998
  data: config
18993
18999
  });
18994
- return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, metadataEndpoints.source, savedSourceEndpoint)), dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination, metadataEndpoints.destination, savedDestinationEndpoint)), dispatch(callGetMapping(tenantId, accountId, PI.SchemaMappingGuid)), dispatch(callGetBundles(tenantId, accountId, PI.BundlePackGuid)), dispatch(callGetTrigger(PI.TransformerBaseId))]);
19000
+ return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, savedSourceEndpoint)), dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination, destination, destinationApi, savedDestinationEndpoint)), dispatch(callGetMapping(tenantId, accountId, PI.SchemaMappingGuid)), dispatch(callGetBundles(tenantId, accountId, PI.BundlePackGuid)), dispatch(callGetTrigger(PI.TransformerBaseId))]);
18995
19001
  });
18996
19002
  };
18997
19003
  } else return function (dispatch) {
18998
19004
  // FIRST TIME!
18999
- return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, metadataEndpoints.source, null)), dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination, metadataEndpoints.destination, null))]);
19005
+ return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, null)), dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination, destination, destinationApi, null))]);
19000
19006
  };
19001
19007
  }
19002
19008
 
@@ -19044,10 +19050,10 @@ module.exports =
19044
19050
  };
19045
19051
  }
19046
19052
 
19047
- function tryGetMetadata(tenantId, appId, mode, providerType, urlSuffix, savedEndpoint) {
19053
+ function tryGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, savedEndpoint) {
19048
19054
  if (urlSuffix) {
19049
19055
  return function (dispatch) {
19050
- return dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, mode, providerType));
19056
+ return dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType));
19051
19057
  };
19052
19058
  } else if (savedEndpoint) {
19053
19059
  return function (dispatch) {
@@ -19058,15 +19064,13 @@ module.exports =
19058
19064
  };
19059
19065
  }
19060
19066
 
19061
- function callGetProviderMetadata(tenantId, appId, urlSuffix, mode, providerType) {
19067
+ function callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType) {
19062
19068
  return function (dispatch, getState, api) {
19063
19069
  var _getState16 = getState(),
19064
19070
  config = _getState16.config;
19065
19071
 
19066
- var AGENT_API_URL = config.AGENT_API_URL;
19067
-
19068
19072
  return api.get(tenantId + '/' + appId + '/' + urlSuffix, {
19069
- endpoint: AGENT_API_URL
19073
+ endpoint: config[apiUrl]
19070
19074
  }).then(function (res) {
19071
19075
  dispatch({
19072
19076
  type: types.SET_WIZARD_METADATA,
@@ -21002,6 +21006,8 @@ module.exports =
21002
21006
  _this.openConnectionModal = _this.openConnectionModal.bind(_this);
21003
21007
  _this.hideModal = _this.hideModal.bind(_this);
21004
21008
  _this.refreshAllPrimaryKeyNames = _this.refreshAllPrimaryKeyNames.bind(_this);
21009
+ _this.selectPrimaryKey = _this.selectPrimaryKey.bind(_this);
21010
+ _this.selectJoinKey = _this.selectJoinKey.bind(_this);
21005
21011
  return _this;
21006
21012
  }
21007
21013
 
@@ -21192,20 +21198,48 @@ module.exports =
21192
21198
  resourceGroups.splice(iEnd, 0, resourceGroups.splice(iStart, 1)[0]);
21193
21199
  change('resourceGroups', resourceGroups);
21194
21200
  }
21201
+ }, {
21202
+ key: 'selectPrimaryKey',
21203
+ value: function selectPrimaryKey(v, parents, rgi, i) {
21204
+ var _props10 = this.props,
21205
+ change = _props10.change,
21206
+ formValues = _props10.formValues;
21207
+
21208
+ var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
21209
+ var rsc = resourceGroups[rgi].resources[i];
21210
+ rsc.primaryKeyName = v;
21211
+ rsc.primaryKeyParents = parents;
21212
+ change('resourceGroups', resourceGroups);
21213
+ this.forceUpdate();
21214
+ }
21215
+ }, {
21216
+ key: 'selectJoinKey',
21217
+ value: function selectJoinKey(v, parents, rgi, i) {
21218
+ var _props11 = this.props,
21219
+ change = _props11.change,
21220
+ formValues = _props11.formValues;
21221
+
21222
+ var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
21223
+ var rsc = resourceGroups[rgi].resources[i];
21224
+ rsc.joinKeyName = v;
21225
+ rsc.joinKeyParents = parents;
21226
+ change('resourceGroups', resourceGroups);
21227
+ this.forceUpdate();
21228
+ }
21195
21229
  }, {
21196
21230
  key: 'render',
21197
21231
  value: function render() {
21198
21232
  var _this2 = this;
21199
21233
 
21200
- var _props10 = this.props,
21201
- inputs = _props10.inputs,
21202
- handleSubmit = _props10.handleSubmit,
21203
- nav = _props10.nav,
21204
- formValues = _props10.formValues,
21205
- step = _props10.step,
21206
- reset = _props10.reset,
21207
- wizard = _props10.wizard,
21208
- change = _props10.change;
21234
+ var _props12 = this.props,
21235
+ inputs = _props12.inputs,
21236
+ handleSubmit = _props12.handleSubmit,
21237
+ nav = _props12.nav,
21238
+ formValues = _props12.formValues,
21239
+ step = _props12.step,
21240
+ reset = _props12.reset,
21241
+ wizard = _props12.wizard,
21242
+ change = _props12.change;
21209
21243
 
21210
21244
  if (!formValues['resourceGroups']) return _react2.default.createElement('div', null);
21211
21245
 
@@ -21264,7 +21298,10 @@ module.exports =
21264
21298
  changeGroupOrder: this.changeGroupOrder, step: step,
21265
21299
  inputs: inputs, addDefaultEntity: this.addDefaultEntity },
21266
21300
  _react2.default.createElement(_schemaAccordion2.default, { sourceSchema: sourceSchema, removeEntity: this.removeEntity,
21267
- changeEntityOrder: this.changeEntityOrder, step: step, destinationSchema: destinationSchema }),
21301
+ changeEntityOrder: this.changeEntityOrder, step: step,
21302
+ destinationSchema: destinationSchema,
21303
+ selectPrimaryKey: this.selectPrimaryKey,
21304
+ selectJoinKey: this.selectJoinKey }),
21268
21305
  _react2.default.createElement(_bundleTable2.default, { openConnectionModal: this.openConnectionModal })
21269
21306
  ),
21270
21307
  _react2.default.createElement('br', null)
@@ -21550,7 +21587,7 @@ module.exports =
21550
21587
  var groupsBeforeThis = resourceGroups.slice(0, i);
21551
21588
  var groupBeforeThisIndex = 0;
21552
21589
  groupsBeforeThis.forEach(function (g, idx) {
21553
- if (group.resources.find(function (r) {
21590
+ if (group.resources && group.resources.find(function (r) {
21554
21591
  return r.name === g.name;
21555
21592
  })) {
21556
21593
  groupBeforeThisIndex = idx + 1;
@@ -21558,15 +21595,15 @@ module.exports =
21558
21595
  });
21559
21596
 
21560
21597
  var groupsAfterThis = resourceGroups.slice(i + 1);
21561
- var groupsAfterThisContainThisResource = groupsAfterThis.find(function (g) {
21562
- return g.resources.find(function (r) {
21598
+ var groupsAfterThisContainThisResource = groupsAfterThis && groupsAfterThis.find(function (g) {
21599
+ return g.resources && g.resources.find(function (r) {
21563
21600
  return r.name === group.name;
21564
21601
  }) ? true : false;
21565
21602
  });
21566
21603
 
21567
21604
  var groupAfterThisIndex = 0;
21568
21605
  groupsAfterThis.forEach(function (g, idx) {
21569
- if (g.resources.find(function (r) {
21606
+ if (g.resources && g.resources.find(function (r) {
21570
21607
  return r.name === group.name;
21571
21608
  })) {
21572
21609
  groupAfterThisIndex = idx;
@@ -21732,7 +21769,8 @@ module.exports =
21732
21769
  resourceFromName: group.sourceKeysObjects[i],
21733
21770
  propertyFromName: sk,
21734
21771
  resourceToName: group.name,
21735
- propertyToName: group.destinationKeys[i]
21772
+ propertyToName: group.destinationKeys[i],
21773
+ propertyFromParents: group.sourceKeysParents[i]
21736
21774
  }, rsc.provider === step.destinationProvider && { dataSourceIsDestinationEntity: true });
21737
21775
  group.mappings = group.mappings || [];
21738
21776
  group.mappings.push(map);
@@ -21746,6 +21784,7 @@ module.exports =
21746
21784
  var map = Object.assign({
21747
21785
  isExternalKeyMapping: true,
21748
21786
  resourceFromName: group.lingkSourceKeyObject,
21787
+ propertyFromParents: group.lingkSourceKeyParents,
21749
21788
  propertyFromName: group.lingkSourceKey,
21750
21789
  resourceToName: group.name,
21751
21790
  propertyToName: 'Lingk External Id'
@@ -21786,36 +21825,41 @@ module.exports =
21786
21825
  props.update();
21787
21826
  };
21788
21827
 
21789
- var selectSourceKeyForLingk = function selectSourceKeyForLingk(key, section) {
21828
+ var selectSourceKeyForLingk = function selectSourceKeyForLingk(key, section, parents) {
21790
21829
  var rgs = [].concat(_toConsumableArray(resourceGroups));
21791
21830
  var group = rgs[bundleIndex];
21792
21831
  group.lingkSourceKey = key;
21793
21832
  group.lingkSourceKeyObject = section;
21833
+ group.lingkSourceKeyParents = parents;
21794
21834
  change('resourceGroups', rgs);
21795
21835
  props.update();
21796
21836
  };
21797
21837
 
21798
- var selectCustomSourceKey = function selectCustomSourceKey(key, section, i) {
21838
+ var selectCustomSourceKey = function selectCustomSourceKey(key, section, i, parents) {
21799
21839
  var rgs = [].concat(_toConsumableArray(resourceGroups));
21800
21840
  var group = rgs[bundleIndex];
21801
21841
  if (i === 0) {
21802
21842
  group.sourceKeys = [key];
21803
21843
  group.sourceKeysObjects = [section];
21844
+ group.sourceKeysParents = [parents];
21804
21845
  } else {
21805
21846
  group.sourceKeys[i] = key;
21806
21847
  group.sourceKeysObjects[i] = section;
21848
+ group.sourceKeysParents[i] = parents;
21807
21849
  }
21808
21850
  change('resourceGroups', rgs);
21809
21851
  props.update();
21810
21852
  };
21811
21853
 
21812
- var selectCustomDestinationKey = function selectCustomDestinationKey(key, i) {
21854
+ var selectCustomDestinationKey = function selectCustomDestinationKey(key, i, parents) {
21813
21855
  var rgs = [].concat(_toConsumableArray(resourceGroups));
21814
21856
  var group = rgs[bundleIndex];
21815
21857
  if (i === 0) {
21816
21858
  group.destinationKeys = [key];
21859
+ group.destinationKeysParents = [parents];
21817
21860
  } else {
21818
21861
  group.destinationKeys[i] = key;
21862
+ group.destinationKeysParents[i] = parents;
21819
21863
  }
21820
21864
  change('resourceGroups', rgs);
21821
21865
  props.update();
@@ -21910,8 +21954,8 @@ module.exports =
21910
21954
  'div',
21911
21955
  { className: 'external-keys-column' },
21912
21956
  _react2.default.createElement(Select, { label: sk || 'Choose Key', menuItemStyle: { height: 20, padding: '1px 8px' },
21913
- onSelect: function onSelect(v, iii, rtid, section) {
21914
- return selectCustomSourceKey(v, section, i);
21957
+ onSelect: function onSelect(v, iii, rtid, section, parents) {
21958
+ return selectCustomSourceKey(v, section, i, parents);
21915
21959
  },
21916
21960
  type: 'brand', fieldPropLabel: 'label',
21917
21961
  values: vals, sectionLabels: sectionLabels, sectionLabelSuffix: 'Fields',
@@ -21928,8 +21972,8 @@ module.exports =
21928
21972
  { className: 'external-keys-column' },
21929
21973
  _react2.default.createElement(Select, { label: resourceGroups[bundleIndex].destinationKeys && resourceGroups[bundleIndex].destinationKeys[i] || 'Choose Key',
21930
21974
  menuItemStyle: { height: 20, padding: '1px 8px' },
21931
- onSelect: function onSelect(v, iii, rtid, section) {
21932
- return selectCustomDestinationKey(v, i);
21975
+ onSelect: function onSelect(v, iii, rtid, section, parents) {
21976
+ return selectCustomDestinationKey(v, i, parents);
21933
21977
  }, type: 'brand',
21934
21978
  values: [destinationSchema && destinationSchema.find(function (defaultRsc) {
21935
21979
  return defaultRsc.name === bundle.name;
@@ -22014,8 +22058,8 @@ module.exports =
22014
22058
  { className: 'external-keys-column' },
22015
22059
  _react2.default.createElement(Select, { label: resourceGroups[bundleIndex].lingkSourceKey || 'Choose Key',
22016
22060
  menuItemStyle: { height: 20, padding: '1px 8px' },
22017
- onSelect: function onSelect(v, i, rtid, section) {
22018
- return selectSourceKeyForLingk(v, section);
22061
+ onSelect: function onSelect(v, i, rtid, section, parents) {
22062
+ return selectSourceKeyForLingk(v, section, parents);
22019
22063
  }, type: 'brand',
22020
22064
  values: vals, sectionLabels: sectionLabels, sectionLabelSuffix: 'Fields', fieldPropLabel: 'label',
22021
22065
  selectedValues: [{ label: resourceGroups[bundleIndex].lingkSourceKey }]
@@ -22070,6 +22114,51 @@ module.exports =
22070
22114
 
22071
22115
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
22072
22116
 
22117
+ var SourceField = function SourceField(props) {
22118
+ var field = props.field,
22119
+ selectedField = props.selectedField,
22120
+ filteredMappings = props.filteredMappings,
22121
+ click = props.click,
22122
+ parents = props.parents;
22123
+
22124
+ var style = {
22125
+ paddingLeft: 5,
22126
+ background: selectedField && selectedField === field.label ? '#dfe0e0' : 'initial',
22127
+ fontWeight: selectedField === field.name || filteredMappings && Object.values(filteredMappings).includes(field.label) ? 'bold' : 'normal'
22128
+ };
22129
+ if (filteredMappings && Object.values(filteredMappings).includes(field)) {
22130
+ style['color'] = 'black';
22131
+ }
22132
+ return _react2.default.createElement(
22133
+ 'div',
22134
+ null,
22135
+ _react2.default.createElement(
22136
+ 'div',
22137
+ { className: field.object ? '' : 'wizard-map-field',
22138
+ style: field.object ? { paddingLeft: 5, textDecoration: 'underline', color: '#AAAAAA',
22139
+ fontWeight: 'bold' } : style,
22140
+ onClick: function onClick() {
22141
+ if (!field.object) {
22142
+ click(field.label, parents);
22143
+ }
22144
+ }
22145
+ },
22146
+ field.label
22147
+ ),
22148
+ _react2.default.createElement(
22149
+ 'div',
22150
+ { style: { paddingLeft: 12 } },
22151
+ field.object && field.object.properties.map(function (nestedField, i) {
22152
+ var newParent = field.label;
22153
+ var parentsArray = parents.concat(newParent);
22154
+ return _react2.default.createElement(SourceField, { key: i, field: nestedField, selectedField: selectedField,
22155
+ filteredMappings: filteredMappings, parents: parentsArray,
22156
+ click: click });
22157
+ })
22158
+ )
22159
+ );
22160
+ };
22161
+
22073
22162
  var MapAccordion = function (_React$Component) {
22074
22163
  _inherits(MapAccordion, _React$Component);
22075
22164
 
@@ -22080,6 +22169,7 @@ module.exports =
22080
22169
 
22081
22170
  _this.state = {
22082
22171
  selectedField: null,
22172
+ selectedFieldParents: null,
22083
22173
  customFieldValue: '',
22084
22174
  addNewButtonText: 'Add New'
22085
22175
  };
@@ -22203,12 +22293,13 @@ module.exports =
22203
22293
  resourceFromName: selectedEntity.name,
22204
22294
  resourceToName: group,
22205
22295
  propertyFromName: this.state.selectedField,
22296
+ propertyFromParents: this.state.selectedFieldParents,
22206
22297
  propertyToName: field,
22207
22298
  transformations: [{ type: transform }],
22208
22299
  dataSourceIsDestinationEntity: selectedEntity.isDestinationEntity
22209
22300
  });
22210
22301
  change('resourceGroups', resourceGroups);
22211
- this.setState({ selectedField: null });
22302
+ this.setState({ selectedField: null, selectedFieldParents: null });
22212
22303
  this.props.update();
22213
22304
  this.props.disableMultiple();
22214
22305
  }
@@ -22318,9 +22409,8 @@ module.exports =
22318
22409
  'div',
22319
22410
  { className: 'accordion-panel-collapse',
22320
22411
  style: {
22321
- height: schema && selectedEntity.name === rsc.name ? schema.find(function (r) {
22322
- return r.name === rsc.name;
22323
- }).properties.length * 18 + 19 : 0,
22412
+ //height:schema && selectedEntity.name===rsc.name ? schema.find(r=>r.name===rsc.name).properties.length * 18 + 19 : 0,
22413
+ maxHeight: schema && selectedEntity.name === rsc.name ? 2000 : 0,
22324
22414
  padding: '0 6px'
22325
22415
  }
22326
22416
  },
@@ -22328,23 +22418,13 @@ module.exports =
22328
22418
  schema && schema.find(function (r) {
22329
22419
  return r.name === rsc.name;
22330
22420
  }).properties.map(function (field, ii) {
22331
- var style = {
22332
- paddingLeft: 5,
22333
- background: selectedField && selectedField === field.label ? '#dfe0e0' : 'initial',
22334
- fontWeight: selectedField === field.name || filteredMappings && Object.values(filteredMappings).includes(field.label) ? 'bold' : 'normal'
22335
- };
22336
- if (filteredMappings && Object.values(filteredMappings).includes(field)) {
22337
- style['color'] = 'black';
22338
- }
22339
- return _react2.default.createElement(
22340
- 'div',
22341
- { key: ii, className: 'wizard-map-field',
22342
- style: style, onClick: function onClick() {
22343
- return _this4.setState({ selectedField: field.label });
22344
- }
22345
- },
22346
- field.label
22347
- );
22421
+ return _react2.default.createElement(SourceField, { key: ii, field: field, selectedField: selectedField,
22422
+ filteredMappings: filteredMappings, parents: [],
22423
+ click: function click(v, parents) {
22424
+ return _this4.setState({
22425
+ selectedField: v, selectedFieldParents: parents
22426
+ });
22427
+ } });
22348
22428
  }),
22349
22429
  _react2.default.createElement('div', { style: { height: 9 } })
22350
22430
  )
@@ -22508,6 +22588,14 @@ module.exports =
22508
22588
  minHeight: 18
22509
22589
  } },
22510
22590
  mapz && mapz.map(function (m, iv) {
22591
+ var fromString = '';
22592
+ if (m.propertyFromParents && m.propertyFromParents.length > 0) {
22593
+ m.propertyFromParents.forEach(function (p) {
22594
+ fromString += p;
22595
+ fromString += ': ';
22596
+ });
22597
+ }
22598
+ fromString += m.propertyFromName;
22511
22599
  return _react2.default.createElement(
22512
22600
  'div',
22513
22601
  { key: iv, style: { height: 19, minWidth: 220, whiteSpace: 'nowrap' } },
@@ -22522,7 +22610,7 @@ module.exports =
22522
22610
  _react2.default.createElement(
22523
22611
  'div',
22524
22612
  { className: 'mapping-entry' },
22525
- m.propertyFromName + ' \u2192 ' + m.propertyToName
22613
+ fromString + ' \u2192 ' + m.propertyToName
22526
22614
  )
22527
22615
  );
22528
22616
  })
@@ -22825,6 +22913,8 @@ module.exports =
22825
22913
  addDefaultEntity = _props3.addDefaultEntity,
22826
22914
  resourceGroupIndex = _props3.resourceGroupIndex,
22827
22915
  selectedEntities = _props3.selectedEntities,
22916
+ selectPrimaryKey = _props3.selectPrimaryKey,
22917
+ selectJoinKey = _props3.selectJoinKey,
22828
22918
  toggle = _props3.toggle,
22829
22919
  leftClicked = _props3.leftClicked,
22830
22920
  sourceSchema = _props3.sourceSchema,
@@ -22855,7 +22945,7 @@ module.exports =
22855
22945
  _react2.default.createElement(
22856
22946
  Tooltip,
22857
22947
  { nubbin: 'left-top', popStyle: { width: 250 },
22858
- wrapStyle: { position: 'absolute', left: 96, top: 6, zIndex: 6001 } },
22948
+ wrapStyle: { position: 'absolute', left: 106, top: 7, zIndex: 6001 } },
22859
22949
  _react2.default.createElement(
22860
22950
  'p',
22861
22951
  null,
@@ -22951,7 +23041,7 @@ module.exports =
22951
23041
  _this3.props.pickEntity({ name: rsc.name,
22952
23042
  isDestinationEntity: rsc.provider === step.destinationProvider });
22953
23043
  } },
22954
- rsc.joinKeyName && rsc.primaryKeyName ? rsc.joinKeyName + ' = ' + rsc.primaryKeyName : 'Configure Join'
23044
+ rsc.joinKeyName && rsc.primaryKeyName ? rsc.primaryKeyName + ' = ' + rsc.joinKeyName : 'Configure Join'
22955
23045
  ) : null
22956
23046
  )
22957
23047
  ),
@@ -22972,7 +23062,7 @@ module.exports =
22972
23062
  _react2.default.createElement(
22973
23063
  Tooltip,
22974
23064
  { nubbin: 'left-top', popStyle: { width: 180 },
22975
- wrapStyle: { position: 'absolute', left: 140, top: 2, zIndex: 6003 } },
23065
+ wrapStyle: { position: 'absolute', left: 148, top: 2, zIndex: 6003 } },
22976
23066
  _react2.default.createElement(
22977
23067
  'p',
22978
23068
  null,
@@ -22981,21 +23071,23 @@ module.exports =
22981
23071
  ')'
22982
23072
  )
22983
23073
  ),
22984
- _react2.default.createElement(_reduxForm.Field, { component: inputs.rfSelect, type: 'input',
22985
- defaultLabel: group.resources[0].name + ' Join Key', colorType: 'brand',
22986
- selectedValue: group.resources[i].primaryKeyName, onClick: function onClick() {
22987
- showOverflow();
23074
+ _react2.default.createElement(Select, { label: group.resources[i] && group.resources[i].primaryKeyName ? group.resources[i].primaryKeyName : 'Primary Join Key',
23075
+ onSelect: function onSelect(v, a, b, c, parents) {
23076
+ return selectPrimaryKey(v, parents, resourceGroupIndex, i);
22988
23077
  },
23078
+ onClick: showOverflow,
23079
+ type: 'neutral',
22989
23080
  values: group.resources[0].provider === step.destinationProvider ? destinationSchema && destinationSchema.find(function (defaultRsc) {
22990
23081
  return defaultRsc.name === group.resources[0].name;
22991
23082
  }) && destinationSchema.find(function (defaultRsc) {
22992
23083
  return defaultRsc.name === group.resources[0].name;
22993
23084
  }).properties : sourceSchema && sourceSchema.find(function (defaultRsc) {
22994
23085
  return defaultRsc.name === group.resources[0].name;
22995
- }) && sourceSchema.find(function (defaultRsc) {
23086
+ }) && [sourceSchema.find(function (defaultRsc) {
22996
23087
  return defaultRsc.name === group.resources[0].name;
22997
- }).properties,
22998
- name: 'resourceGroups.' + resourceGroupIndex + '.resources.' + i + '.primaryKeyName'
23088
+ }).properties],
23089
+ sectionLabels: [group.resources[0].name],
23090
+ fieldPropLabel: 'label'
22999
23091
  })
23000
23092
  ),
23001
23093
  _react2.default.createElement(
@@ -23018,21 +23110,23 @@ module.exports =
23018
23110
  '), whose value should match the Primary Object Join Key.'
23019
23111
  )
23020
23112
  ),
23021
- _react2.default.createElement(_reduxForm.Field, { component: inputs.rfSelect, type: 'input',
23022
- defaultLabel: rsc.name + ' Join Key', colorType: 'brand',
23023
- selectedValue: group.resources[i].joinKeyName, onClick: function onClick() {
23024
- showOverflow();
23113
+ _react2.default.createElement(Select, { label: group.resources[i] && group.resources[i].joinKeyName ? group.resources[i].joinKeyName : 'Join Key',
23114
+ onSelect: function onSelect(v, a, b, c, parents) {
23115
+ return selectJoinKey(v, parents, resourceGroupIndex, i);
23025
23116
  },
23117
+ onClick: showOverflow,
23118
+ type: 'neutral',
23026
23119
  values: rsc.provider === step.destinationProvider ? destinationSchema && destinationSchema.find(function (defaultRsc) {
23027
23120
  return defaultRsc.name === rsc.name;
23028
23121
  }) && destinationSchema.find(function (defaultRsc) {
23029
23122
  return defaultRsc.name === rsc.name;
23030
23123
  }).properties : sourceSchema && sourceSchema.find(function (defaultRsc) {
23031
23124
  return defaultRsc.name === rsc.name;
23032
- }) && sourceSchema.find(function (defaultRsc) {
23125
+ }) && [sourceSchema.find(function (defaultRsc) {
23033
23126
  return defaultRsc.name === rsc.name;
23034
- }).properties,
23035
- name: 'resourceGroups.' + resourceGroupIndex + '.resources.' + i + '.joinKeyName'
23127
+ }).properties],
23128
+ sectionLabels: [group.resources[i].name],
23129
+ fieldPropLabel: 'label'
23036
23130
  })
23037
23131
  ),
23038
23132
  _react2.default.createElement(
@@ -23564,6 +23658,8 @@ module.exports =
23564
23658
  var mappings = [];
23565
23659
  bundles.forEach(function (group, index) {
23566
23660
 
23661
+ console.log(group);
23662
+
23567
23663
  // first get target resource
23568
23664
  var destinationResource = _this2.props.wizard.destinationMetadata ? _this2.props.wizard.destinationMetadata.find(function (rsc) {
23569
23665
  return rsc.name === group.name;
@@ -23579,6 +23675,7 @@ module.exports =
23579
23675
  if (!group.customExternalKeys) {
23580
23676
  group.sourceKeys = [group.lingkSourceKey];
23581
23677
  group.sourceKeysObjects = [group.lingkSourceKeyObject];
23678
+ group.sourceKeysParents = [group.lingkSourceKeyParents];
23582
23679
  group.destinationKeys = ['lingk__Lingk_External_Id__c'];
23583
23680
  } else {
23584
23681
  (function () {
@@ -23601,6 +23698,7 @@ module.exports =
23601
23698
  // get resource + name of sourceKeys
23602
23699
  var sourceKeys = [];
23603
23700
  var sourceKeysObjects = [];
23701
+ var sourceKeysParents = [];
23604
23702
  group.sourceKeys && group.sourceKeys.forEach(function (sk, i) {
23605
23703
  var sourceKeyResourceProvider = group.resources.find(function (r) {
23606
23704
  return r.name === group.sourceKeysObjects[i];
@@ -23612,22 +23710,51 @@ module.exports =
23612
23710
 
23613
23711
  if (sourceResource) {
23614
23712
  sourceKeysObjects.push(sourceResource.type);
23615
- if (sourceResource.properties && sourceResource.properties.find(function (prop) {
23616
- return prop.label === sk;
23617
- })) {
23618
- sourceKeys.push(sourceResource.properties.find(function (prop) {
23713
+ if (group.sourceKeysParents[i].length > 0) {
23714
+ (function () {
23715
+ // nested
23716
+ var nestedRsc = sourceResource;
23717
+ var tempParentsArray = [];
23718
+ group.sourceKeysParents[i].forEach(function (skp) {
23719
+ if (nestedRsc.properties && nestedRsc.properties.find(function (prop) {
23720
+ return prop.label === skp;
23721
+ })) {
23722
+ var skpProp = nestedRsc.properties.find(function (prop) {
23723
+ return prop.label === skp;
23724
+ });
23725
+ tempParentsArray.push(skpProp.name);
23726
+ nestedRsc = skpProp.object;
23727
+ }
23728
+ });
23729
+ sourceKeysParents.push(JSON.stringify(tempParentsArray));
23730
+ if (nestedRsc.properties && nestedRsc.properties.find(function (prop) {
23731
+ return prop.label === sk;
23732
+ })) {
23733
+ sourceKeys.push(nestedRsc.properties.find(function (prop) {
23734
+ return prop.label === sk;
23735
+ }).name);
23736
+ }
23737
+ })();
23738
+ } else {
23739
+ // non-nested
23740
+ if (sourceResource.properties && sourceResource.properties.find(function (prop) {
23619
23741
  return prop.label === sk;
23620
- }).name);
23742
+ })) {
23743
+ sourceKeys.push(sourceResource.properties.find(function (prop) {
23744
+ return prop.label === sk;
23745
+ }).name);
23746
+ }
23621
23747
  }
23622
23748
  }
23623
23749
  });
23624
23750
  group.sourceKeys = sourceKeys;
23625
23751
  group.sourceKeysObjects = sourceKeysObjects;
23752
+ group.sourceKeysParents = sourceKeysParents;
23626
23753
 
23627
23754
  // MAPPINGS
23628
23755
  if (group.mappings) {
23629
23756
  group.mappings.forEach(function (singleMapping) {
23630
-
23757
+ console.log(singleMapping);
23631
23758
  // get mapping source resource (check both metadatas)
23632
23759
  var dataSourceMetadata = singleMapping.dataSourceIsDestinationEntity ? _this2.props.wizard.destinationMetadata : _this2.props.wizard.sourceMetadata;
23633
23760
  var sourceResource = dataSourceMetadata.find(function (rsc) {
@@ -23668,6 +23795,7 @@ module.exports =
23668
23795
  delete group.mappings; // remove the mapping obj from a resourceGroup
23669
23796
  if (group.lingkSourceKey) delete group.lingkSourceKey;
23670
23797
  if (group.lingkSourceKeyObject) delete group.lingkSourceKeyObject;
23798
+ if (group.lingkSourceKeyParents) delete group.lingkSourceKeyParents;
23671
23799
  }
23672
23800
 
23673
23801
  // BUNDLES
@@ -23734,7 +23862,7 @@ module.exports =
23734
23862
  accountId = _props2.accountId,
23735
23863
  tenantId = _props2.tenantId;
23736
23864
 
23737
- if (true) {
23865
+ if (false) {
23738
23866
  actions.submitWizardData(tenantId, accountId, bundles, mappings, configuration, formValues.title || 'Banner for Salesforce', formValues.deployment || null, typeId, typeGuid, onGenerate, onFinish, this.props.wizard.destinationMetadata || []);
23739
23867
  onSubmit({ complete: formValues.hasOwnProperty('deployment') });
23740
23868
  }
@@ -23797,7 +23925,7 @@ module.exports =
23797
23925
  )
23798
23926
  );
23799
23927
  } else {
23800
- var _ret2 = function () {
23928
+ var _ret3 = function () {
23801
23929
  var page = currentPage || 1; //(wizard.savedConfiguration && parseInt(wizard.savedConfiguration.currentPage, 10)) || 1
23802
23930
  return {
23803
23931
  v: _react2.default.createElement(
@@ -23843,7 +23971,7 @@ module.exports =
23843
23971
  };
23844
23972
  }();
23845
23973
 
23846
- if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
23974
+ if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v;
23847
23975
  }
23848
23976
  }
23849
23977
  }]);
@@ -24045,7 +24173,9 @@ module.exports =
24045
24173
  };
24046
24174
  var metadataEndpoints = {
24047
24175
  source: wizard.source.metadataEndpoint || null,
24048
- destination: wizard.destination.metadataEndpoint || null
24176
+ sourceApi: wizard.source.metadataApi || null,
24177
+ destination: wizard.destination.metadataEndpoint || null,
24178
+ destinationApi: wizard.destination.metadataApi || null
24049
24179
  };
24050
24180
  this.setState({
24051
24181
  steps: stepList,