add select mode to user modal

This commit is contained in:
Nitwel
2020-09-07 13:16:14 +02:00
parent d95b05eee7
commit e915287d52
3 changed files with 25 additions and 3 deletions

View File

@@ -7,5 +7,26 @@ export default defineInterface(({ i18n }) => ({
icon: 'person',
component: InterfaceUser,
types: ['uuid'],
options: [],
options: [
{
field: 'selectMode',
name: i18n.t('select_mode'),
type: 'string',
meta: {
width: 'full',
interface: 'dropdown',
options: {
choices: [
{ text: 'Auto', value: 'auto' },
{ text: 'Dropdown', value: 'dropdown' },
{ text: 'Modal', value: 'modal' },
],
},
},
schema: {
default_value: 'auto',
},
},
],
recommendedDisplays: ['user'],
}));

View File

@@ -102,7 +102,7 @@ export default defineComponent({
components: { ModalDetail, ModalBrowse },
props: {
value: {
type: [Number, Object],
type: [String, Object],
default: null,
},
template: {
@@ -162,7 +162,7 @@ export default defineComponent({
(newValue) => {
// When the newly configured value is a primitive, assume it's the primary key
// of the item and fetch it from the API to render the preview
if (newValue !== null && newValue !== currentUser.value?.id && typeof newValue === 'number') {
if (newValue !== null && newValue !== currentUser.value?.id && typeof newValue === 'string') {
fetchCurrent();
}

View File

@@ -314,6 +314,7 @@
"slug": "Slug",
"repeater": "Repeater",
"max-amount": "Max Amount",
"select_mode": "Select Mode",
"months": {
"january": "January",