up convert to name
This commit is contained in:
parent
e414600d45
commit
c28741d751
@ -15,7 +15,7 @@ const mappingFINESS: MappingConfigType = {
|
|||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
// exclude_point_if_tag_not_empty: ['id_osm'],
|
// exclude_point_if_tag_not_empty: ['id_osm'],
|
||||||
offset: 1
|
// offset: 1
|
||||||
},
|
},
|
||||||
add_not_mapped_tags_too: false,
|
add_not_mapped_tags_too: false,
|
||||||
boolean_keys: [],
|
boolean_keys: [],
|
||||||
|
@ -455,6 +455,9 @@ export default class {
|
|||||||
*/
|
*/
|
||||||
if (configObject.conditional_values) {
|
if (configObject.conditional_values) {
|
||||||
|
|
||||||
|
// convert numbers from json to string to compare them correctly
|
||||||
|
originalValue = ''+originalValue
|
||||||
|
|
||||||
let keysConditionnalValues: any = Object.keys(configObject.conditional_values)
|
let keysConditionnalValues: any = Object.keys(configObject.conditional_values)
|
||||||
let isFoundValue = keysConditionnalValues.indexOf(originalValue)
|
let isFoundValue = keysConditionnalValues.indexOf(originalValue)
|
||||||
let conditionnalConfig: any = configObject.conditional_values[keysConditionnalValues[isFoundValue]]
|
let conditionnalConfig: any = configObject.conditional_values[keysConditionnalValues[isFoundValue]]
|
||||||
@ -464,10 +467,13 @@ export default class {
|
|||||||
debugLog('isFoundValue', isFoundValue, originalValue)
|
debugLog('isFoundValue', isFoundValue, originalValue)
|
||||||
debugLog('keysConditionnalValues', keysConditionnalValues)
|
debugLog('keysConditionnalValues', keysConditionnalValues)
|
||||||
|
|
||||||
|
debugLog('-----++++++++ originalValue', originalValue)
|
||||||
|
debugLog('----------- isFoundValue', isFoundValue)
|
||||||
if (!remove_original_key) {
|
if (!remove_original_key) {
|
||||||
|
|
||||||
|
|
||||||
if (isFoundValue > -1) {
|
if (isFoundValue !== -1) {
|
||||||
|
debugLog('found condition',isFoundValue )
|
||||||
|
|
||||||
/** ----------------------
|
/** ----------------------
|
||||||
* gestion des valeurs conditionnelles
|
* gestion des valeurs conditionnelles
|
||||||
@ -508,16 +514,10 @@ export default class {
|
|||||||
// on peut définir un ensemble de tags à rajouter
|
// on peut définir un ensemble de tags à rajouter
|
||||||
let tagKeys = Object.keys(conditionnalConfig.tags_to_add)
|
let tagKeys = Object.keys(conditionnalConfig.tags_to_add)
|
||||||
debugLog('conditionnalConfig.tags_to_add', conditionnalConfig.tags_to_add)
|
debugLog('conditionnalConfig.tags_to_add', conditionnalConfig.tags_to_add)
|
||||||
conditionnalConfig.tags_to_add.forEach((object: any, pair: any) => {
|
tagKeys.forEach((index:any) => {
|
||||||
debugLog('object', object)
|
debugLog('key', index)
|
||||||
debugLog('pair', pair)
|
debugLog('value', conditionnalConfig.tags_to_add[index])
|
||||||
let key: any = Object.keys(object)
|
newProperties[index] = conditionnalConfig.tags_to_add[index]
|
||||||
key = key[0]
|
|
||||||
let value = object[key]
|
|
||||||
|
|
||||||
debugLog('key', key)
|
|
||||||
debugLog('value', value)
|
|
||||||
newProperties[key] = value
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +72,12 @@ export default class Formatters {
|
|||||||
|
|
||||||
static convertToName(originalValue: string) {
|
static convertToName(originalValue: string) {
|
||||||
|
|
||||||
|
if (originalValue && originalValue.length) {
|
||||||
|
|
||||||
let tab = originalValue.toLowerCase().split('')
|
let tab = originalValue.toLowerCase().split('')
|
||||||
tab[0] = originalValue[0].toUpperCase()
|
tab[0] = originalValue[0].toUpperCase()
|
||||||
return tab.join('');
|
return tab.join('');
|
||||||
}
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user