mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
when option uniq is true, display message if you select multiple suggestions
This commit is contained in:
parent
f7c08f02c2
commit
040884a039
@ -91,6 +91,7 @@ export default {
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
console.log('@@@ CLICK button addNewPersons', selected);
|
||||
this.$refs.addPersons.checkUniq();
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addRequestor', item);
|
||||
}, this
|
||||
|
@ -6,7 +6,7 @@ const parametersToString = ({ query, options }) => {
|
||||
options.type.forEach(function(type) {
|
||||
types += '&type[]=' + type;
|
||||
});
|
||||
return 'q=' + query + types + '&uniq=' + options.uniq;
|
||||
return 'q=' + query + types;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -71,6 +71,7 @@
|
||||
@click.prevent="$emit('addNewPersons', { selected, modal })">
|
||||
<i class="fa fa-plus fa-fw"></i>{{ $t('action.add')}}
|
||||
</button>
|
||||
{{ $t(checkUniq) }}
|
||||
</template>
|
||||
|
||||
</modal>
|
||||
@ -144,6 +145,12 @@ export default {
|
||||
},
|
||||
options() {
|
||||
return this.options;
|
||||
},
|
||||
checkUniq() {
|
||||
if (this.options.uniq === true && this.selectedCounter > 1) {
|
||||
return "error_only_one_person";
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -11,7 +11,8 @@ const personMessages = {
|
||||
type_user: "TMS",
|
||||
type_thirdparty: "Tiers",
|
||||
type_household: "Ménage"
|
||||
}
|
||||
},
|
||||
error_only_one_person: "Une seule personne peut être sélectionnée !"
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user