@lingk/sync 1.1.43 → 1.1.45
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/credentialSections.js +736 -450
- package/build/credentialSections.js.map +1 -1
- package/build/css/credentialSections.css +3 -10
- package/build/css/lightningStyles.css +2 -4
- package/build/css/lingkStyles.css +2 -4
- package/build/css/main.css +43 -93
- package/build/lightning.js +1816 -779
- package/build/lightning.js.map +1 -1
- package/build/lightningStyles.js +2 -2
- package/build/lightningStyles.js.map +1 -1
- package/build/lingk.js +54 -54
- package/build/lingk.js.map +1 -1
- package/build/lingkStyles.js +2 -2
- package/build/lingkStyles.js.map +1 -1
- package/build/loadData.js +224 -232
- package/build/loadData.js.map +1 -1
- package/build/main.js +8514 -4736
- package/build/main.js.map +1 -1
- package/build/metadataDropdown.js +51 -55
- package/build/metadataDropdown.js.map +1 -1
- package/build/metadataFunctions.js +307 -365
- package/build/metadataFunctions.js.map +1 -1
- package/build/reducer.js +313 -371
- package/build/reducer.js.map +1 -1
- package/build/saveData.js +61 -70
- package/build/saveData.js.map +1 -1
- package/package.json +5 -1
package/build/loadData.js
CHANGED
|
@@ -46,12 +46,12 @@ module.exports =
|
|
|
46
46
|
/***/ 0:
|
|
47
47
|
/***/ function(module, exports, __webpack_require__) {
|
|
48
48
|
|
|
49
|
-
module.exports = __webpack_require__(
|
|
49
|
+
module.exports = __webpack_require__(76);
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
/***/ },
|
|
53
53
|
|
|
54
|
-
/***/
|
|
54
|
+
/***/ 76:
|
|
55
55
|
/***/ function(module, exports) {
|
|
56
56
|
|
|
57
57
|
'use strict';
|
|
@@ -79,246 +79,240 @@ module.exports =
|
|
|
79
79
|
return rsc.name === bundle.resourceLabel;
|
|
80
80
|
});
|
|
81
81
|
if (bundleResource) {
|
|
82
|
-
(function () {
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
destinationKeys.push('Lingk External Id');
|
|
98
|
-
__destinationKeys.push('Lingk_External_Id__c');
|
|
83
|
+
//get bundle destinationKeys
|
|
84
|
+
var destinationKeys = [];
|
|
85
|
+
var __destinationKeys = [];
|
|
86
|
+
var destinationKeysParents = [];
|
|
87
|
+
bundle.destinationKeys.forEach(function (dk, i) {
|
|
88
|
+
if (bundle.customExternalKeys) {
|
|
89
|
+
var deNestedProp = deNest(dk, bundle.destinationKeysParents && JSON.parse(bundle.destinationKeysParents[i]), bundleResource);
|
|
90
|
+
if (deNestedProp.property) {
|
|
91
|
+
destinationKeys.push(deNestedProp.property);
|
|
92
|
+
__destinationKeys.push(deNestedProp.__property);
|
|
93
|
+
destinationKeysParents.push(deNestedProp.parentsArray);
|
|
99
94
|
}
|
|
100
|
-
}
|
|
95
|
+
} else {
|
|
96
|
+
destinationKeys.push('Lingk External Id');
|
|
97
|
+
__destinationKeys.push('Lingk_External_Id__c');
|
|
98
|
+
}
|
|
99
|
+
});
|
|
101
100
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
101
|
+
//get bundle sourceKeys
|
|
102
|
+
var sourceKeys = [];
|
|
103
|
+
var __sourceKeys = [];
|
|
104
|
+
var sourceKeysObjects = [];
|
|
105
|
+
var __sourceKeysObjects = [];
|
|
106
|
+
var sourceKeysParents = [];
|
|
107
|
+
bundle.sourceKeys.forEach(function (sk, i) {
|
|
108
|
+
var sourceKeyResourceObj = bundle.resources.find(function (r) {
|
|
109
|
+
return r.resourceName === bundle.sourceKeysObjects[i];
|
|
110
|
+
});
|
|
111
|
+
if (sourceKeyResourceObj) {
|
|
112
|
+
var sourceKeyResourceProvider = sourceKeyResourceObj.provider.replace('Reader', '').toLowerCase();
|
|
113
|
+
var primaryDataSourceMetadata = sourceKeyResourceProvider === DP.toLowerCase() ? DM : sourceKeyResourceProvider === SP.toLowerCase() ? SM : null;
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
if (primaryDataSourceMetadata) {
|
|
116
|
+
var sourceKeyResource = primaryDataSourceMetadata.find(function (r) {
|
|
117
|
+
return r.name === sourceKeyResourceObj.resourceLabel && r.type === sourceKeyResourceObj.resourceName;
|
|
118
|
+
});
|
|
119
|
+
if (sourceKeyResource) {
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
121
|
+
var deNestedProp = deNest(sk, bundle.sourceKeysParents && JSON.parse(bundle.sourceKeysParents[i]), sourceKeyResource);
|
|
122
|
+
if (deNestedProp.property) {
|
|
123
|
+
sourceKeys.push(deNestedProp.property);
|
|
124
|
+
__sourceKeys.push(deNestedProp.__property);
|
|
125
|
+
sourceKeysObjects.push(sourceKeyResource.name);
|
|
126
|
+
__sourceKeysObjects.push(sourceKeyResource.type);
|
|
127
|
+
sourceKeysParents.push(deNestedProp.parentsArray);
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
|
-
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
var resources = [];
|
|
135
|
+
bundle.resources && bundle.resources.forEach(function (rsc, rscIndex) {
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
//get resource and joinKey for bundleResource (check both metadatas)
|
|
138
|
+
var resourceProvider = rsc.provider.replace('Reader', '').toLowerCase();
|
|
139
|
+
var dataSourceMetadata = resourceProvider === DP.toLowerCase() ? DM : resourceProvider === SP.toLowerCase() ? SM : null;
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
var rscResource = null;
|
|
142
|
+
var deNestedJoinKey = {};
|
|
143
|
+
var joinKeyResourceName = null;
|
|
144
|
+
var __joinKeyResourceName = null;
|
|
145
|
+
if (dataSourceMetadata) {
|
|
146
|
+
rscResource = dataSourceMetadata.find(function (r) {
|
|
147
|
+
return r.name === rsc.resourceLabel;
|
|
148
|
+
});
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
if (rsc.joinKeyName) {
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
//}
|
|
152
|
+
if (rsc.joinKeyIsParameter) {
|
|
153
|
+
// joinKeyName coming from parameter from another resource
|
|
154
|
+
deNestedJoinKey = { property: rsc.joinKeyName };
|
|
155
|
+
joinKeyResourceName = rsc.joinKeyResource;
|
|
156
|
+
__joinKeyResourceName = rsc.joinKeyResource;
|
|
157
|
+
} else {
|
|
158
|
+
// joinKeyName coming from field on this resource
|
|
159
|
+
//if(rsc.resourceName===rsc.joinKeyResource){
|
|
160
|
+
var joinKeyResource = dataSourceMetadata.find(function (r) {
|
|
161
|
+
return r.type === rsc.resourceName && r.name === rsc.resourceLabel;
|
|
162
|
+
});
|
|
163
|
+
if (joinKeyResource) {
|
|
164
|
+
deNestedJoinKey = deNest(rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource);
|
|
165
|
+
joinKeyResourceName = joinKeyResource.name;
|
|
166
|
+
__joinKeyResourceName = joinKeyResource.type;
|
|
170
167
|
}
|
|
168
|
+
//}
|
|
171
169
|
}
|
|
172
|
-
}
|
|
170
|
+
}
|
|
171
|
+
} // end if dataSourceMetadata
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
//get resource and primaryKey for parent resource for join
|
|
174
|
+
var primaryResourceProviderLast_Index = rsc.parentNameAndProvider.lastIndexOf('_');
|
|
175
|
+
var primaryResourceProvider = rsc.parentNameAndProvider.substr(primaryResourceProviderLast_Index + 1, rsc.parentNameAndProvider.length);
|
|
176
|
+
var primaryDataSourceMetadata = primaryResourceProvider.toLowerCase() === DP.toLowerCase() ? DM : primaryResourceProvider.toLowerCase() === SP.toLowerCase() ? SM : null;
|
|
178
177
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
var deNestedPrimaryKey = {};
|
|
179
|
+
var primaryKeyResourceName = null;
|
|
180
|
+
var __primaryKeyResourceName = null;
|
|
181
|
+
if (primaryDataSourceMetadata) {
|
|
182
|
+
if (rsc.primaryKeyName) {
|
|
184
183
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
})();
|
|
184
|
+
if (rsc.primaryKeyIsParameter) {
|
|
185
|
+
//primaryKeyName coming from parameter (another resource)
|
|
186
|
+
deNestedPrimaryKey = { property: rsc.primaryKeyName };
|
|
187
|
+
primaryKeyResourceName = rsc.primaryKeyResource;
|
|
188
|
+
__primaryKeyResourceName = rsc.primaryKeyResource;
|
|
189
|
+
} else {
|
|
190
|
+
// primaryKeyName coming from resource IN THIS BUNDLE
|
|
191
|
+
var primaryKeyResourceResource = bundle.resources.find(function (r) {
|
|
192
|
+
return rsc.primaryKeyResource === r.resourceName;
|
|
193
|
+
});
|
|
194
|
+
if (primaryKeyResourceResource) {
|
|
195
|
+
//if(primaryResourceName===rsc.primaryKeyResource){
|
|
196
|
+
var rscPrimaryResource = primaryDataSourceMetadata.find(function (r) {
|
|
197
|
+
return r.name === primaryKeyResourceResource.resourceLabel;
|
|
198
|
+
});
|
|
199
|
+
if (rscPrimaryResource) {
|
|
200
|
+
deNestedPrimaryKey = deNest(rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource);
|
|
201
|
+
primaryKeyResourceName = rscPrimaryResource.name;
|
|
202
|
+
__primaryKeyResourceName = rscPrimaryResource.type;
|
|
203
|
+
}
|
|
208
204
|
}
|
|
209
205
|
}
|
|
210
206
|
}
|
|
207
|
+
}
|
|
211
208
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
209
|
+
if (rscResource) {
|
|
210
|
+
resources.push(Object.assign({
|
|
211
|
+
name: rscResource.name,
|
|
212
|
+
__name: rscResource.type,
|
|
213
|
+
provider: resourceProvider
|
|
214
|
+
}, deNestedJoinKey.property && { joinKeyName: deNestedJoinKey.property }, deNestedJoinKey.__property && { __joinKeyName: deNestedJoinKey.__property }, joinKeyResourceName && { joinKeyResource: joinKeyResourceName }, __joinKeyResourceName && { __joinKeyResource: __joinKeyResourceName }, deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length > 0 && { joinKeyParents: deNestedJoinKey.parentsArray }, deNestedPrimaryKey.property && { primaryKeyName: deNestedPrimaryKey.property }, deNestedPrimaryKey.__property && { __primaryKeyName: deNestedPrimaryKey.__property }, primaryKeyResourceName && { primaryKeyResource: primaryKeyResourceName }, __primaryKeyResourceName && { __primaryKeyResource: __primaryKeyResourceName }, deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length > 0 && { primaryKeyParents: deNestedPrimaryKey.parentsArray }, {
|
|
215
|
+
joinType: rsc.joinType || 'LEFT JOIN'
|
|
216
|
+
}, rscResource.parentRef && { parentRef: rscResource.parentRef }, rsc.parameterFilters && { parameterFilters: rsc.parameterFilters }, {
|
|
217
|
+
level: rsc.level || (rscIndex === 0 ? 0 : 1),
|
|
218
|
+
parentNameAndProvider: rsc.parentNameAndProvider
|
|
219
|
+
}));
|
|
220
|
+
//console.log(resources[resources.length-1])
|
|
221
|
+
}
|
|
222
|
+
}); // end bundle.resource.forEach
|
|
226
223
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
224
|
+
var mappings = [];
|
|
225
|
+
savedMapping.mappings && savedMapping.mappings.filter(function (map) {
|
|
226
|
+
return map.bundleIndex === index;
|
|
227
|
+
}).forEach(function (m) {
|
|
228
|
+
var dataSourceMetadata = m.isDestinationResource ? DM : SM;
|
|
229
|
+
if (isReverse) {
|
|
230
|
+
dataSourceMetadata = m.isDestinationResource ? SM : DM;
|
|
231
|
+
}
|
|
235
232
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
233
|
+
// source key / parents
|
|
234
|
+
var resourceFromBundle = bundle.resources.find(function (br) {
|
|
235
|
+
return br.resourceName === m.resourceFromName;
|
|
236
|
+
});
|
|
237
|
+
var sourceResource = resourceFromBundle && dataSourceMetadata.find(function (rsc) {
|
|
238
|
+
return rsc.name === resourceFromBundle.resourceLabel;
|
|
239
|
+
});
|
|
240
|
+
var deNestedSourceProp = deNest(m.propertyFromName, m.propertyFromParents, sourceResource);
|
|
244
241
|
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
// destintation key / parents
|
|
243
|
+
var deNestedDestProp = deNest(m.propertyToName, m.propertyToParents, bundleResource);
|
|
247
244
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
245
|
+
var transformations = [{ type: 'none' }];
|
|
246
|
+
if (m.transformations && m.transformations.length > 0) {
|
|
247
|
+
var trans = m.transformations[0];
|
|
248
|
+
if (trans.type === 'concat') {
|
|
249
|
+
var s = trans.args[1].split('->');
|
|
250
|
+
var transConcatResourceName = s[s.length - 2];
|
|
251
|
+
var nestedFields = s[s.length - 1].split('.');
|
|
252
|
+
var field = nestedFields[nestedFields.length - 1];
|
|
253
|
+
nestedFields.pop();
|
|
254
|
+
var concatRsc = savedBundles.bundles[m.bundleIndex].resources.find(function (r) {
|
|
255
|
+
return r.resourceLabel === transConcatResourceName;
|
|
256
|
+
});
|
|
257
|
+
if (concatRsc) {
|
|
258
|
+
var concatRscProvider = concatRsc.provider.replace('Reader', '').toLowerCase();
|
|
259
|
+
var concatRscMetadata = concatRscProvider === DP.toLowerCase() ? DM : concatRscProvider === SP.toLowerCase() ? SM : null;
|
|
260
|
+
if (concatRscMetadata) {
|
|
261
|
+
var transConcatResource = concatRscMetadata.find(function (r) {
|
|
262
|
+
return r.type === concatRsc.resourceName;
|
|
260
263
|
});
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
var result = transConcatResource.name + '->';
|
|
270
|
-
concatLabels.parentsArray.forEach(function (p) {
|
|
271
|
-
return result += p + '.';
|
|
272
|
-
});
|
|
273
|
-
result += concatLabels.property;
|
|
274
|
-
transformations = [{ type: 'concat', args: [trans.args[0], result] }];
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
})();
|
|
278
|
-
} else {
|
|
279
|
-
transformations = m.transformations;
|
|
264
|
+
var concatLabels = deNest(field, nestedFields, transConcatResource);
|
|
265
|
+
var result = transConcatResource.name + '->';
|
|
266
|
+
concatLabels.parentsArray.forEach(function (p) {
|
|
267
|
+
return result += p + '.';
|
|
268
|
+
});
|
|
269
|
+
result += concatLabels.property;
|
|
270
|
+
transformations = [{ type: 'concat', args: [trans.args[0], result] }];
|
|
271
|
+
}
|
|
280
272
|
}
|
|
273
|
+
} else {
|
|
274
|
+
transformations = m.transformations;
|
|
281
275
|
}
|
|
276
|
+
}
|
|
282
277
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
})();
|
|
278
|
+
if (sourceResource && deNestedSourceProp.property && deNestedDestProp.property) {
|
|
279
|
+
mappings.push(Object.assign({
|
|
280
|
+
resourceFromName: sourceResource.name,
|
|
281
|
+
__resourceFromName: sourceResource.type,
|
|
282
|
+
propertyFromName: deNestedSourceProp.property,
|
|
283
|
+
__propertyFromName: deNestedSourceProp.__property
|
|
284
|
+
}, deNestedSourceProp.parentsArray && deNestedSourceProp.parentsArray.length > 0 && { propertyFromParents: deNestedSourceProp.parentsArray }, {
|
|
285
|
+
resourceToName: bundleResource.name,
|
|
286
|
+
__resourceToName: bundleResource.type,
|
|
287
|
+
propertyToName: deNestedDestProp.property,
|
|
288
|
+
__propertyToName: deNestedDestProp.__property
|
|
289
|
+
}, deNestedDestProp.parentsArray && deNestedDestProp.parentsArray.length > 0 && { propertyToParents: deNestedDestProp.parentsArray }, m.isDestinationResource && { dataSourceIsDestinationEntity: true }, m.isExternalKeyMapping && { isExternalKeyMapping: true }, m.isUnique && { isUnique: true }, {
|
|
290
|
+
transformations: transformations
|
|
291
|
+
}));
|
|
292
|
+
}
|
|
293
|
+
}); // end wizard.savedMappings.forEach
|
|
294
|
+
resourceGroups.push(Object.assign({
|
|
295
|
+
name: bundleResource.name,
|
|
296
|
+
__name: bundleResource.type,
|
|
297
|
+
resources: resources, mappings: mappings,
|
|
298
|
+
customExternalKeys: bundle.customExternalKeys || false
|
|
299
|
+
}, bundle.customExternalKeys === true && {
|
|
300
|
+
sourceKeys: sourceKeys, __sourceKeys: __sourceKeys,
|
|
301
|
+
sourceKeysObjects: sourceKeysObjects, __sourceKeysObjects: __sourceKeysObjects,
|
|
302
|
+
sourceKeysParents: sourceKeysParents,
|
|
303
|
+
destinationKeys: destinationKeys, __destinationKeys: __destinationKeys,
|
|
304
|
+
destinationKeysParents: destinationKeysParents
|
|
305
|
+
}, bundle.customExternalKeys === false && {
|
|
306
|
+
lingkSourceKey: sourceKeys[0], __lingkSourceKey: __sourceKeys[0],
|
|
307
|
+
lingkSourceKeyObject: sourceKeysObjects[0],
|
|
308
|
+
__lingkSourceKeyObject: __sourceKeysObjects[0],
|
|
309
|
+
lingkSourceKeyParents: sourceKeysParents[0]
|
|
310
|
+
}, {
|
|
311
|
+
provider: bundle.provider,
|
|
312
|
+
//...bundle.recordTypeId && {recordTypeId: bundle.recordTypeId},
|
|
313
|
+
deleteEnabled: bundle.deleteEnabled || false,
|
|
314
|
+
writeMode: bundle.writeMode || (bundle.deleteEnabled ? 'delete' : 'default')
|
|
315
|
+
})); // end push each bundle (contains resources AND mappings)
|
|
322
316
|
} // end if bundleResource
|
|
323
317
|
}); // end forEach over bundles
|
|
324
318
|
|
|
@@ -331,33 +325,31 @@ module.exports =
|
|
|
331
325
|
var parentsArray = [];
|
|
332
326
|
if (rsc) {
|
|
333
327
|
if (parents && parents.length > 0) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return p.name === ps;
|
|
340
|
-
});
|
|
341
|
-
tempParentsArray.push(pProp.label);
|
|
342
|
-
nestedRsc = pProp.object;
|
|
343
|
-
});
|
|
344
|
-
parentsArray = tempParentsArray;
|
|
345
|
-
var sourceKeyProperty = nestedRsc.properties && nestedRsc.properties.find(function (p) {
|
|
346
|
-
return p.name === prop;
|
|
328
|
+
var nestedRsc = rsc;
|
|
329
|
+
var tempParentsArray = [];
|
|
330
|
+
parents.forEach(function (ps) {
|
|
331
|
+
var pProp = nestedRsc.properties && nestedRsc.properties.find(function (p) {
|
|
332
|
+
return p.name === ps;
|
|
347
333
|
});
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
} else {
|
|
354
|
-
var sourceKeyProperty = rsc.properties && rsc.properties.find(function (p) {
|
|
334
|
+
tempParentsArray.push(pProp.label);
|
|
335
|
+
nestedRsc = pProp.object;
|
|
336
|
+
});
|
|
337
|
+
parentsArray = tempParentsArray;
|
|
338
|
+
var sourceKeyProperty = nestedRsc.properties && nestedRsc.properties.find(function (p) {
|
|
355
339
|
return p.name === prop;
|
|
356
340
|
});
|
|
357
341
|
if (sourceKeyProperty) {
|
|
358
342
|
property = sourceKeyProperty.label;
|
|
359
343
|
__property = sourceKeyProperty.name;
|
|
360
344
|
}
|
|
345
|
+
} else {
|
|
346
|
+
var _sourceKeyProperty = rsc.properties && rsc.properties.find(function (p) {
|
|
347
|
+
return p.name === prop;
|
|
348
|
+
});
|
|
349
|
+
if (_sourceKeyProperty) {
|
|
350
|
+
property = _sourceKeyProperty.label;
|
|
351
|
+
__property = _sourceKeyProperty.name;
|
|
352
|
+
}
|
|
361
353
|
}
|
|
362
354
|
}
|
|
363
355
|
if (prop === 'Lingk_External_Id__c') {
|