mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-24 15:44:59 +00:00
Allow creating new entities directly from AddPersons
modal
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
:key="uniqid"
|
||||
:buttonTitle="translatedListOfTypes"
|
||||
:modalTitle="translatedListOfTypes"
|
||||
:allowCreate="true"
|
||||
@addNewPersons="addNewEntity"
|
||||
>
|
||||
</add-persons>
|
||||
|
@@ -32,11 +32,13 @@ interface AddPersonsConfig {
|
||||
buttonTitle: string;
|
||||
modalTitle: string;
|
||||
options: SearchOptions;
|
||||
allowCreate?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<AddPersonsConfig>(), {
|
||||
suggested: () => [],
|
||||
selected: () => [],
|
||||
allowCreate: () => true,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
@@ -63,7 +63,15 @@
|
||||
@update-selected="updateSelected"
|
||||
/>
|
||||
|
||||
<div class="create-button">
|
||||
<div v-if="props.allowCreate && query.length > 0" class="create-button">
|
||||
<button
|
||||
type="button"
|
||||
@click="emit('onAskForCreate', {query })"
|
||||
>
|
||||
{{ trans(ONTHEFLY_CREATE_BUTTON, { q: query }) }}
|
||||
</button>
|
||||
<!--
|
||||
TODO remove this
|
||||
<on-the-fly
|
||||
v-if="
|
||||
queryLength >= 3 &&
|
||||
@@ -128,12 +136,14 @@ interface Props {
|
||||
suggested?: Suggestion[];
|
||||
selected?: Suggestion[];
|
||||
modalDialogClass?: string;
|
||||
allowCreate?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
suggested: () => [],
|
||||
selected: () => [],
|
||||
modalDialogClass: 'modal-dialog-scrollable modal-xl',
|
||||
allowCreate: () => true,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
Reference in New Issue
Block a user