Skip to content
Snippets Groups Projects
Commit 8334098c authored by Timothee P's avatar Timothee P :sunflower:
Browse files

fix import check for new custom field type multiple choices list

parent d69fe24b
No related branches found
No related tags found
No related merge requests found
......@@ -604,6 +604,17 @@ export default {
pour le champ personnalisé "${name}".`;
return false;
}
} else if (field_type === 'multi_choices_list') {
//*then check if the values in the value array are available options
//const unvalidValues = fieldInFeature.some((el) => !options.includes(el));
const unvalidValues = fieldInFeature.filter((el) => !options.includes(el));
console.log(customType, field_type, options, fieldInFeature, unvalidValues);
if (unvalidValues.length > 0) {
const plural = unvalidValues.length > 1;
this.importError = `Le fichier est invalide: ${plural ? 'les valeurs' : 'la valeur'} [ ${unvalidValues.join(', ')} ] ${plural ? 'ne sont pas des options valides' : 'n\'est pas une option valide'}
pour le champ personnalisé "${name}".`;
return false;
}
} else if (customType !== field_type) {
//* check if custom field value match
this.importError = `Le fichier est invalide: Un champ de type ${field_type} ne peut pas avoir la valeur [ ${fieldInFeature} ]`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment