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