mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
FIX [review] implement changes based on review
This commit is contained in:
@@ -17,8 +17,7 @@
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="Object.keys(suggested).length > 0" class="list-suggest add-items inline">
|
||||
<p>hello {{ Object.keys(suggested) }}</p>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li v-for="s in suggested" :key="s.id" @click="addNewSuggested(s)"><span>{{ s.text }}</span></li>
|
||||
</ul>
|
||||
</template>
|
||||
@@ -105,14 +104,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
addNewSuggested(entity) {
|
||||
this.$emit('addNewEntity', entity);
|
||||
const indexToRemove = this.suggested.findIndex(e => e.id === entity.id)
|
||||
this.suggested.splice(indexToRemove, 1);
|
||||
this.$emit('addNewEntity', {entity: entity, isSuggested: true});
|
||||
},
|
||||
addNewEntity({ selected, modal }) {
|
||||
selected.forEach((item) => {
|
||||
this.$emit('addNewEntity', item.result);
|
||||
}, this
|
||||
this.$emit('addNewEntity', { entity: item.result });
|
||||
}, this
|
||||
);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
@@ -121,8 +118,7 @@ export default {
|
||||
if (!this.$props.removableIfSet) {
|
||||
return;
|
||||
}
|
||||
this.$emit('removeEntity', entity);
|
||||
this.suggested.push(entity);
|
||||
this.$emit('removeEntity',{ entity: entity, isSuggested: true });
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user