@lingk/sync 1.0.62 → 1.0.64

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
@@ -19378,12 +19378,15 @@ module.exports =
19378
19378
  return m && m.propertyToName === field.label && m.isExternalKeyMapping;
19379
19379
  })) return;
19380
19380
 
19381
- var transform = 'none';
19381
+ var transform = { type: 'none' };
19382
19382
  if (field.format) {
19383
19383
  if (field.format === 'date-time') {
19384
- transform = 'date';
19384
+ transform = { type: 'date' };
19385
19385
  }
19386
19386
  }
19387
+ if (field.type && field.type === 'boolean') {
19388
+ transform = { type: 'bool', args: ['T', 'F'] };
19389
+ }
19387
19390
 
19388
19391
  //cant map multiple to same destination field
19389
19392
  rscGroup.mappings = rscGroup.mappings && rscGroup.mappings.filter(function (m) {
@@ -19400,7 +19403,7 @@ module.exports =
19400
19403
  propertyToName: field.label,
19401
19404
  __propertyToName: field.name,
19402
19405
  propertyToParents: parents,
19403
- transformations: [{ type: transform }],
19406
+ transformations: [transform],
19404
19407
  dataSourceIsDestinationEntity: selectedEntity.isDestinationEntity
19405
19408
  });
19406
19409
  change('resourceGroups', resourceGroups);
@@ -19895,6 +19898,12 @@ module.exports =
19895
19898
  { fill: '#000000', height: '19', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
19896
19899
  _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }),
19897
19900
  _react2.default.createElement('path', { d: 'M12.45 16h2.09L9.43 3H7.57L2.46 16h2.09l1.12-3h5.64l1.14 3zm-6.02-5L8.5 5.48 10.57 11H6.43zm15.16.59l-8.09 8.09L9.83 16l-1.41 1.41 5.09 5.09L23 13l-1.41-1.41z' })
19901
+ ),
19902
+ bool: _react2.default.createElement(
19903
+ 'svg',
19904
+ { fill: '#000000', height: '19', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
19905
+ _react2.default.createElement('path', { d: 'M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z' }),
19906
+ _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' })
19898
19907
  )
19899
19908
 
19900
19909
  };
@@ -21039,6 +21048,7 @@ module.exports =
21039
21048
  'trim': 'Trim Field',
21040
21049
  'date': 'Date Format',
21041
21050
  'lookup': 'Lookup Table',
21051
+ 'bool': 'Boolean',
21042
21052
  'ifnull': 'Null Check'
21043
21053
  };
21044
21054
  _this.dataTypes = ['String', 'Number', 'Date', 'Boolean'];
@@ -21068,8 +21078,9 @@ module.exports =
21068
21078
 
21069
21079
  var groups = [].concat(_toConsumableArray(resourceGroups));
21070
21080
  var trans = resourceGroups[resourceGroupIndex].mappings[mappingIndex].transformations[0];
21071
- if (trans.type !== v) {
21072
- trans.args = [''];
21081
+ trans.args = [''];
21082
+ if (v[0] + v[1] + v[2] + v[3] === 'bool') {
21083
+ trans.args = ['', '', 'false'];
21073
21084
  }
21074
21085
  change('resourceGroups', groups);
21075
21086
  }
@@ -21180,25 +21191,60 @@ module.exports =
21180
21191
  change('resourceGroups', groups);
21181
21192
  this.forceUpdate();
21182
21193
  }
21194
+ }, {
21195
+ key: 'changeBool',
21196
+ value: function changeBool(v, i, mappingIndex) {
21197
+ var _props8 = this.props,
21198
+ change = _props8.change,
21199
+ resourceGroups = _props8.resourceGroups,
21200
+ resourceGroupIndex = _props8.resourceGroupIndex;
21201
+
21202
+ var groups = [].concat(_toConsumableArray(resourceGroups));
21203
+ var trans = resourceGroups[resourceGroupIndex].mappings[mappingIndex].transformations[0];
21204
+ trans.args = trans.args || [];
21205
+ trans.args[i] = v;
21206
+ change('resourceGroups', groups);
21207
+ this.forceUpdate();
21208
+ }
21209
+ }, {
21210
+ key: 'toggleNullBool',
21211
+ value: function toggleNullBool(v, mappingIndex) {
21212
+ var _props9 = this.props,
21213
+ change = _props9.change,
21214
+ resourceGroups = _props9.resourceGroups,
21215
+ resourceGroupIndex = _props9.resourceGroupIndex;
21216
+
21217
+ var groups = [].concat(_toConsumableArray(resourceGroups));
21218
+ var trans = resourceGroups[resourceGroupIndex].mappings[mappingIndex].transformations[0];
21219
+ trans.args = trans.args || [];
21220
+ if (trans.args[2] === v) {
21221
+ trans.args[2] = '';
21222
+ } else {
21223
+ trans.args[2] = v;
21224
+ }
21225
+ change('resourceGroups', groups);
21226
+ this.forceUpdate();
21227
+ }
21183
21228
  }, {
21184
21229
  key: 'render',
21185
21230
  value: function render() {
21186
21231
  var _this3 = this;
21187
21232
 
21188
- var _props8 = this.props,
21189
- inputs = _props8.inputs,
21190
- opened = _props8.opened,
21191
- mapping = _props8.mapping,
21192
- hideModal = _props8.hideModal,
21193
- resourceGroups = _props8.resourceGroups,
21194
- resourceGroupIndex = _props8.resourceGroupIndex,
21195
- sourceSchema = _props8.sourceSchema,
21196
- destinationSchema = _props8.destinationSchema,
21197
- step = _props8.step,
21198
- showApiNames = _props8.showApiNames;
21233
+ var _props10 = this.props,
21234
+ inputs = _props10.inputs,
21235
+ opened = _props10.opened,
21236
+ mapping = _props10.mapping,
21237
+ hideModal = _props10.hideModal,
21238
+ resourceGroups = _props10.resourceGroups,
21239
+ resourceGroupIndex = _props10.resourceGroupIndex,
21240
+ sourceSchema = _props10.sourceSchema,
21241
+ destinationSchema = _props10.destinationSchema,
21242
+ step = _props10.step,
21243
+ showApiNames = _props10.showApiNames;
21199
21244
 
21200
21245
  var Modal = inputs.Modal;
21201
21246
  var Input = inputs.Input;
21247
+ var ToggleButtonGroup = inputs.ToggleButtonGroup;
21202
21248
  var groups = [].concat(_toConsumableArray(resourceGroups));
21203
21249
  var group = groups[resourceGroupIndex];
21204
21250
 
@@ -21214,6 +21260,7 @@ module.exports =
21214
21260
  var transformation = updatedMapping.transformations && updatedMapping.transformations[0];
21215
21261
  var transformSelected = transformation && transformation.type || 'none';
21216
21262
  var transformArgs = transformation && transformation.args || [''];
21263
+
21217
21264
  // create an array of arrays (pairs) for lookup args
21218
21265
  var lookupArgs = [];
21219
21266
  if (transformSelected === 'lookup') {
@@ -21316,8 +21363,9 @@ module.exports =
21316
21363
  'div',
21317
21364
  { style: { width: 150, display: 'inline-block', marginBottom: 20 } },
21318
21365
  _react2.default.createElement(_reduxForm.Field, { name: 'resourceGroups.' + resourceGroupIndex + '.mappings.' + mappingIndex + '.transformations.0.type',
21319
- component: inputs.rfRadioGroup, label: 'Transformation Type', options: this.transformOptions,
21320
- onClickOption: function onClickOption(v) {
21366
+ component: inputs.rfRadioGroup, label: 'Transformation Type',
21367
+ options: this.transformOptions,
21368
+ onChange: function onChange(v) {
21321
21369
  return _this3.clickRadio(v, mappingIndex);
21322
21370
  } })
21323
21371
  ),
@@ -21414,6 +21462,48 @@ module.exports =
21414
21462
  );
21415
21463
  })
21416
21464
  ),
21465
+ transformSelected === 'bool' && _react2.default.createElement(
21466
+ 'div',
21467
+ null,
21468
+ _react2.default.createElement(
21469
+ 'div',
21470
+ { style: { marginBottom: 8 } },
21471
+ 'Values to map to booleans:'
21472
+ ),
21473
+ ['true', 'false'].map(function (b, i) {
21474
+ return _react2.default.createElement(
21475
+ 'div',
21476
+ { key: i, style: { marginBottom: 6 } },
21477
+ _react2.default.createElement(Input, { style: { width: 132, display: 'inline-block' },
21478
+ onChange: function onChange(e, v) {
21479
+ return _this3.changeBool(v, i, mappingIndex);
21480
+ },
21481
+ value: transformArgs[i] || '', placeholder: b + ' value' }),
21482
+ _react2.default.createElement(
21483
+ 'span',
21484
+ null,
21485
+ '\xA0\xA0\u2192\xA0\xA0'
21486
+ ),
21487
+ _react2.default.createElement(Input, { style: { width: 132, display: 'inline-block' },
21488
+ readOnly: true, value: b })
21489
+ );
21490
+ }),
21491
+ _react2.default.createElement(
21492
+ 'div',
21493
+ { style: { marginTop: 12 } },
21494
+ _react2.default.createElement(
21495
+ 'div',
21496
+ { className: 'labelz' },
21497
+ 'Map null values to:'
21498
+ ),
21499
+ _react2.default.createElement(ToggleButtonGroup, { options: ['false', 'true'],
21500
+ value: transformArgs[2], lowercase: true,
21501
+ handleToggle: function handleToggle(e) {
21502
+ return _this3.toggleNullBool(e, mappingIndex);
21503
+ }
21504
+ })
21505
+ )
21506
+ ),
21417
21507
  transformSelected === 'concat' && _react2.default.createElement(
21418
21508
  'div',
21419
21509
  null,