@lingk/sync 0.0.57 → 0.0.59

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
@@ -4599,7 +4599,9 @@ module.exports =
4599
4599
  resources.push(Object.assign({
4600
4600
  name: rscResource.name,
4601
4601
  provider: resourceProvider
4602
- }, rscPrimaryKey && { primaryKeyName: rscPrimaryKey.label }, rscJoinKey && { joinKeyName: rscJoinKey.label }));
4602
+ }, rscPrimaryKey && { primaryKeyName: rscPrimaryKey.label }, rscJoinKey && { joinKeyName: rscJoinKey.label }, {
4603
+ joinType: rsc.joinType || 'LEFT JOIN'
4604
+ }));
4603
4605
  }
4604
4606
  }); // end bundle.resource.forEach
4605
4607
 
@@ -5478,21 +5480,23 @@ module.exports =
5478
5480
  }, {
5479
5481
  key: 'removeResourceGroup',
5480
5482
  value: function removeResourceGroup(i) {
5481
- this.props.removeGroup(i);
5482
5483
  var isFirst = i === 0;
5483
5484
  if (i === this.state.resourceGroupIndex) {
5484
5485
  this.go(!isFirst, isFirst ? 0 : i - 1);
5485
5486
  }
5487
+ if (this.state.resourceGroupIndex === this.props.resourceGroups.length - 1) {
5488
+ this.go(true, this.state.resourceGroupIndex - 1);
5489
+ }
5490
+ this.props.removeGroup(i);
5486
5491
  }
5487
5492
  }, {
5488
5493
  key: 'addDefaultResourceGroup',
5489
5494
  value: function addDefaultResourceGroup(v, i, id) {
5490
- var _props = this.props,
5491
- resourceGroups = _props.resourceGroups,
5492
- addGroup = _props.addGroup;
5495
+ var addGroup = this.props.addGroup;
5496
+ var resourceGroupIndex = this.state.resourceGroupIndex;
5493
5497
 
5494
- this.go(false, resourceGroups.length);
5495
- addGroup(v, id);
5498
+ this.go(false, resourceGroupIndex + 1);
5499
+ addGroup(v, resourceGroupIndex, id);
5496
5500
  }
5497
5501
  }, {
5498
5502
  key: 'pickEntity',
@@ -5546,14 +5550,14 @@ module.exports =
5546
5550
  value: function render() {
5547
5551
  var _this3 = this;
5548
5552
 
5549
- var _props2 = this.props,
5550
- resourceGroups = _props2.resourceGroups,
5551
- style = _props2.style,
5552
- isBundleStep = _props2.isBundleStep,
5553
- addDefaultEntity = _props2.addDefaultEntity,
5554
- destinationSchema = _props2.destinationSchema,
5555
- inputs = _props2.inputs,
5556
- step = _props2.step;
5553
+ var _props = this.props,
5554
+ resourceGroups = _props.resourceGroups,
5555
+ style = _props.style,
5556
+ isBundleStep = _props.isBundleStep,
5557
+ addDefaultEntity = _props.addDefaultEntity,
5558
+ destinationSchema = _props.destinationSchema,
5559
+ inputs = _props.inputs,
5560
+ step = _props.step;
5557
5561
  var _state = this.state,
5558
5562
  resourceGroupIndex = _state.resourceGroupIndex,
5559
5563
  paneToggle = _state.paneToggle,
@@ -18678,6 +18682,28 @@ module.exports =
18678
18682
  joinKeyName: '',
18679
18683
  primaryKeyName: '',
18680
18684
  provider: 'Banner'
18685
+ }],
18686
+ mappings: [{
18687
+ isExternalKeyMapping: true,
18688
+ propertyFromName: "ExternalId",
18689
+ propertyToName: "Lingk External Id",
18690
+ resourceFromName: "Applicants",
18691
+ resourceToName: "Contact"
18692
+ }, {
18693
+ propertyFromName: "FirstName",
18694
+ propertyToName: "Fist Name",
18695
+ resourceFromName: "Applicants",
18696
+ resourceToName: "Contact"
18697
+ }, {
18698
+ propertyFromName: "LastName",
18699
+ propertyToName: "Last Name",
18700
+ resourceFromName: "Applicants",
18701
+ resourceToName: "Contact"
18702
+ }, {
18703
+ propertyFromName: "Gender",
18704
+ propertyToName: "Gender",
18705
+ resourceFromName: "Applicants",
18706
+ resourceToName: "Contact"
18681
18707
  }]
18682
18708
  }, {
18683
18709
  name: 'Admissions Application',
@@ -18693,7 +18719,25 @@ module.exports =
18693
18719
  name: 'Contact',
18694
18720
  joinKeyName: 'Lingk External Id',
18695
18721
  primaryKeyName: 'StudentExternalId',
18696
- provider: 'Salesforce'
18722
+ provider: 'Salesforce',
18723
+ joinType: 'LEFT JOIN'
18724
+ }],
18725
+ mappings: [{
18726
+ isExternalKeyMapping: true,
18727
+ propertyFromName: "ApplicationNumber",
18728
+ propertyToName: "Lingk External Id",
18729
+ resourceFromName: "Student Applications",
18730
+ resourceToName: "Admissions Application"
18731
+ }, {
18732
+ propertyFromName: "ApplicationStatus",
18733
+ propertyToName: "Status",
18734
+ resourceFromName: "Student Applications",
18735
+ resourceToName: "Admissions Application"
18736
+ }, {
18737
+ propertyFromName: "Contact ID",
18738
+ propertyToName: "Contact",
18739
+ resourceFromName: "Contact",
18740
+ resourceToName: "Admissions Application"
18697
18741
  }]
18698
18742
  }];
18699
18743
  _this.loadDefault = _this.loadDefault.bind(_this);
@@ -20174,14 +20218,14 @@ module.exports =
20174
20218
  }
20175
20219
  }, {
20176
20220
  key: 'addGroup',
20177
- value: function addGroup(v, recordTypeId) {
20221
+ value: function addGroup(v, index, recordTypeId) {
20178
20222
  var _props4 = this.props,
20179
20223
  change = _props4.change,
20180
20224
  formValues = _props4.formValues;
20181
20225
 
20182
20226
 
20183
20227
  var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups'])) || [];
20184
- resourceGroups.push({
20228
+ resourceGroups.splice(index + 1, 0, {
20185
20229
  name: v,
20186
20230
  resources: null,
20187
20231
  recordTypeId: recordTypeId
@@ -20200,12 +20244,17 @@ module.exports =
20200
20244
  var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
20201
20245
  var group = resourceGroups[groupIndex];
20202
20246
  if (!group.resources) {
20203
- group.resources = [];
20247
+ group.resources = [{
20248
+ name: v,
20249
+ provider: section
20250
+ }];
20251
+ } else {
20252
+ group.resources.push({
20253
+ name: v,
20254
+ provider: section,
20255
+ joinType: 'LEFT OUTER'
20256
+ });
20204
20257
  }
20205
- group.resources.push({
20206
- name: v,
20207
- provider: section
20208
- });
20209
20258
  if (group.resources.length === 1) {
20210
20259
  this.openConnectionModal(group, groupIndex);
20211
20260
  }
@@ -20425,16 +20474,30 @@ module.exports =
20425
20474
  i = props.i,
20426
20475
  openConnectionModal = props.openConnectionModal;
20427
20476
 
20477
+ var linked = false;
20478
+ if (group.customExternalKeys) {
20479
+ if (group.sourceKeys && group.sourceKeys.length > 0 && group.destinationKeys && group.destinationKeys.length > 0) {
20480
+ linked = true;
20481
+ }
20482
+ } else {
20483
+ if (group.lingkSourceKey) {
20484
+ linked = true;
20485
+ }
20486
+ }
20428
20487
  return _react2.default.createElement(
20429
20488
  'div',
20430
20489
  { className: 'connect-resource-group', onClick: function onClick(e) {
20431
20490
  e.stopPropagation();
20432
20491
  openConnectionModal(group, i);
20433
- } },
20434
- _react2.default.createElement(
20492
+ }, style: { paddingTop: linked ? 5 : 6 } },
20493
+ linked ? _react2.default.createElement(
20435
20494
  'svg',
20436
- { fill: '#000000', height: '19', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
20495
+ { fill: '#000000', width: '29', height: '24', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' },
20437
20496
  _react2.default.createElement('path', { d: 'M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z' })
20497
+ ) : _react2.default.createElement(
20498
+ 'svg',
20499
+ { fill: '#AAAAAA', width: '24', height: '19', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' },
20500
+ _react2.default.createElement('path', { d: 'M2,5.27L3.28,4L20,20.72L18.73,22L14.73,18H13V16.27L9.73,13H8V11.27L5.5,8.76C4.5,9.5 3.9,10.68 3.9,12C3.9,14.26 5.74,16.1 8,16.1H11V18H8A6,6 0 0,1 2,12C2,10.16 2.83,8.5 4.14,7.41L2,5.27M16,6A6,6 0 0,1 22,12C22,14.21 20.8,16.15 19,17.19L17.6,15.77C19.07,15.15 20.1,13.7 20.1,12C20.1,9.73 18.26,7.9 16,7.9H13V6H16M8,6H11V7.9H9.72L7.82,6H8M16,11V13H14.82L12.82,11H16Z' })
20438
20501
  )
20439
20502
  );
20440
20503
  };
@@ -20456,8 +20519,10 @@ module.exports =
20456
20519
 
20457
20520
  var BundleTableDeleteRow = exports.BundleTableDeleteRow = function BundleTableDeleteRow(props) {
20458
20521
  var removeResourceGroup = props.removeResourceGroup,
20459
- i = props.i;
20522
+ i = props.i,
20523
+ resourceGroups = props.resourceGroups;
20460
20524
 
20525
+ if (resourceGroups && resourceGroups.length < 2) return _react2.default.createElement('div', null);
20461
20526
  return _react2.default.createElement(
20462
20527
  'div',
20463
20528
  { className: 'remove-resource-group', onClick: function onClick(e) {
@@ -20698,9 +20763,7 @@ module.exports =
20698
20763
  },
20699
20764
  type: 'brand', fieldPropLabel: 'label',
20700
20765
  values: vals, sectionLabels: sectionLabels, sectionLabelSuffix: 'Fields',
20701
- selectedValues: resourceGroups[bundleIndex].sourceKeys && resourceGroups[bundleIndex].sourceKeys.map(function (ks) {
20702
- return { label: ks };
20703
- })
20766
+ selectedValues: resourceGroups[bundleIndex].sourceKeys && [{ label: resourceGroups[bundleIndex].sourceKeys[i] }]
20704
20767
  })
20705
20768
  ),
20706
20769
  _react2.default.createElement(
@@ -20724,9 +20787,7 @@ module.exports =
20724
20787
  return !p.readOnly;
20725
20788
  })],
20726
20789
  sectionLabels: [bundle.name], sectionLabelSuffix: 'Fields', fieldPropLabel: 'label',
20727
- selectedValues: resourceGroups[bundleIndex].destinationKeys && resourceGroups[bundleIndex].destinationKeys.map(function (ks) {
20728
- return { label: ks };
20729
- })
20790
+ selectedValues: resourceGroups[bundleIndex].destinationKeys && [{ label: resourceGroups[bundleIndex].destinationKeys[i] }]
20730
20791
  })
20731
20792
  ),
20732
20793
  i !== 0 && _react2.default.createElement(
@@ -21486,7 +21547,7 @@ module.exports =
21486
21547
 
21487
21548
  var filteredDestinationSchema = destinationSchema.filter(function (rsc) {
21488
21549
  return resourceGroups.find(function (g) {
21489
- return g.name === rsc.name && group.name !== rsc.name;
21550
+ return g.name === rsc.name && group && group.name !== rsc.name;
21490
21551
  }) ? true : false;
21491
21552
  });
21492
21553
 
@@ -21681,8 +21742,8 @@ module.exports =
21681
21742
  ),
21682
21743
  _react2.default.createElement(_reduxForm.Field, { name: 'resourceGroups.' + resourceGroupIndex + '.resources.' + i + '.joinType',
21683
21744
  component: inputs.rfRadioGroup, label: 'Join Type', onClickOption: function onClickOption() {}, options: {
21684
- all: 'All records',
21685
- matching: 'Matching records'
21745
+ 'LEFT JOIN': 'All records',
21746
+ 'INNER JOIN': 'Matching records'
21686
21747
  } })
21687
21748
  )
21688
21749
  ) : null
@@ -22178,7 +22239,8 @@ module.exports =
22178
22239
  }) && primarySourceResource.properties.find(function (prop) {
22179
22240
  return prop.label === rsc.primaryKeyName;
22180
22241
  }).name || '',
22181
- provider: rsc.provider.toLowerCase() + 'Reader'
22242
+ provider: rsc.provider.toLowerCase() + 'Reader',
22243
+ joinType: rsc.joinType
22182
22244
  };
22183
22245
  } else return null;
22184
22246
  });