mirror of
https://github.com/directus/directus.git
synced 2026-01-23 06:28:20 -05:00
Merge pull request #585 from directus/fix-381
Add unnamed custom collection grouping.
This commit is contained in:
@@ -77,7 +77,7 @@ fields:
|
||||
locked: true
|
||||
options:
|
||||
template: '{{ name }}'
|
||||
createItemText: Add Module
|
||||
addLabel: Add New Module...
|
||||
fields:
|
||||
- name: Icon
|
||||
field: icon
|
||||
@@ -112,7 +112,7 @@ fields:
|
||||
locked: true
|
||||
options:
|
||||
template: '{{ group_name }}'
|
||||
createItemText: Add Group
|
||||
addLabel: Add New Group...
|
||||
fields:
|
||||
- name: Group Name
|
||||
field: group_name
|
||||
@@ -123,7 +123,9 @@ fields:
|
||||
options:
|
||||
iconRight: title
|
||||
placeholder: Label this group...
|
||||
- name: Accordion
|
||||
schema:
|
||||
is_nullable: false
|
||||
- name: Type
|
||||
field: accordion
|
||||
type: string
|
||||
schema:
|
||||
@@ -145,7 +147,7 @@ fields:
|
||||
meta:
|
||||
interface: repeater
|
||||
options:
|
||||
createItemText: Add Collection
|
||||
addLabel: Add New Collection...
|
||||
template: '{{ collection }}'
|
||||
fields:
|
||||
- name: Collection
|
||||
@@ -154,6 +156,8 @@ fields:
|
||||
meta:
|
||||
interface: collection
|
||||
width: full
|
||||
schema:
|
||||
is_nullable: false
|
||||
special: json
|
||||
sort: 10
|
||||
width: full
|
||||
|
||||
@@ -25,7 +25,7 @@ export default defineComponent({
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: i18n.t('empty_item'),
|
||||
default: null,
|
||||
},
|
||||
toggle: {
|
||||
type: Function,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:toggle="toggle"
|
||||
@delete="$emit('delete')"
|
||||
:disabled="disabled"
|
||||
:placeholder="headerPlaceholder"
|
||||
/>
|
||||
<transition-expand>
|
||||
<div v-if="active">
|
||||
@@ -46,6 +47,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
headerPlaceholder: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
@input="updateValues(index, $event)"
|
||||
@delete="removeItem(row)"
|
||||
:disabled="disabled"
|
||||
:headerPlaceholder="headerPlaceholder"
|
||||
/>
|
||||
</draggable>
|
||||
<button @click="addNew" class="add-new" v-if="showAddNew">
|
||||
@@ -54,6 +55,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
headerPlaceholder: {
|
||||
type: String,
|
||||
default: i18n.t('empty_item'),
|
||||
}
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const selection = ref<number[]>([]);
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
<template>
|
||||
<v-list large>
|
||||
<template v-if="customNavItems && customNavItems.length > 0">
|
||||
<v-detail
|
||||
:active="group.accordion === 'always_open' || undefined"
|
||||
:disabled="group.accordion === 'always_open'"
|
||||
:start-open="group.accordion === 'start_open'"
|
||||
:label="group.name"
|
||||
:key="group.name"
|
||||
v-for="group in customNavItems"
|
||||
>
|
||||
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
|
||||
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
|
||||
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-detail>
|
||||
<template v-for="(group, index) in customNavItems">
|
||||
<template v-if="(group.name === undefined || group.name === null) && group.accordion === 'always_open' && index === 0">
|
||||
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
|
||||
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
|
||||
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
|
||||
</v-list-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-detail
|
||||
:active="group.accordion === 'always_open' || undefined"
|
||||
:disabled="group.accordion === 'always_open'"
|
||||
:start-open="group.accordion === 'start_open'"
|
||||
:label="group.name || null"
|
||||
:key="group.name"
|
||||
>
|
||||
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
|
||||
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
|
||||
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-detail>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<v-list-item v-else :exact="exact" v-for="navItem in navItems" :key="navItem.to" :to="navItem.to">
|
||||
|
||||
Reference in New Issue
Block a user