@symbolic/lib
Advanced tools
Comparing version 1.0.211 to 1.0.212
{ | ||
"name": "@symbolic/lib", | ||
"version": "1.0.211", | ||
"version": "1.0.212", | ||
"description": "plain js utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -6,31 +6,21 @@ import _ from "lodash"; | ||
var engravingsPropertyData = _.get(activeProductInstanceWithData, 'properties.27', {}); | ||
var structuredEngravingsPropertyData = _.get(engravingsPropertyData, 'structuredEngravingsPropertyData', {}); | ||
_.times(inputQuantity, i => { | ||
var aboveMechanismEngravingData = []; | ||
var belowMechanismEngravingData = []; | ||
var engravings = _.get(engravingsPropertyData, 'engravings'); | ||
//Maybe clone ^ | ||
if (_.has(engravingsPropertyData, 'text') && !_.isEmpty(_.get(engravingsPropertyData, `text[${i}]`))) { | ||
if (!engravings) { | ||
engravings = {}; | ||
_.forEach(_.get(engravingsPropertyData, 'text'), (engravingTextArray, mechanismIndex) => { | ||
var engravingLocation = _.get(activeProductInstanceWithData, 'propertiesDataById.108.selectedProductOption.id') === 623 ? 'above' : 'below'; | ||
if (engravingLocation === 'above') { | ||
aboveMechanismEngravingData = _.map(_.get(engravingsPropertyData, `text[${i}]`), engraving => ({text: engraving})); | ||
} | ||
engravings[mechanismIndex] = { | ||
[engravingLocation]: _.map(engravingTextArray, engravingText => ({text: engravingText})) | ||
}; | ||
}) | ||
} | ||
if (engravingLocation === 'below') { | ||
belowMechanismEngravingData = _.map(_.get(engravingsPropertyData, `text[${i}]`), engraving => ({text: engraving})); | ||
} | ||
_.set(structuredEngravingsPropertyData, `${i}.above`, aboveMechanismEngravingData); | ||
_.set(structuredEngravingsPropertyData, `${i}.below`, belowMechanismEngravingData); | ||
} | ||
else { | ||
_.set(structuredEngravingsPropertyData, `${i}.above`, [{text: ''}, {text: ''}]); | ||
_.set(structuredEngravingsPropertyData, `${i}.below`, [{text: ''}, {text: ''}]); | ||
} | ||
}); | ||
return structuredEngravingsPropertyData; | ||
return engravings; | ||
} | ||
} | ||
Sorry, the diff of this file is too big to display
150502
2913