mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Refactor 'GroupContentMenu' component
This commit is contained in:
parent
2eda102a71
commit
ac9be9e2a3
@ -47,34 +47,27 @@ export default {
|
|||||||
return value.match(/(groupTeaser|groupProfile)/)
|
return value.match(/(groupTeaser|groupProfile)/)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
resource: { type: Object, required: true },
|
group: { type: Object, required: true },
|
||||||
resourceType: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
validator: (value) => {
|
|
||||||
return value.match(/(group)/)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
placement: { type: String, default: 'bottom-end' },
|
placement: { type: String, default: 'bottom-end' },
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
routes() {
|
routes() {
|
||||||
const routes = []
|
const routes = []
|
||||||
|
|
||||||
if (this.resourceType === 'group') {
|
if (this.usage !== 'groupProfile') {
|
||||||
routes.push({
|
routes.push({
|
||||||
label: this.$t('group.contentMenu.visitGroupPage'),
|
label: this.$t('group.contentMenu.visitGroupPage'),
|
||||||
icon: 'home',
|
icon: 'home',
|
||||||
name: 'group-id-slug',
|
name: 'group-id-slug',
|
||||||
params: { id: this.resource.id, slug: this.resource.slug },
|
params: { id: this.group.id, slug: this.group.slug },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (this.group.myRole === 'owner') {
|
||||||
|
routes.push({
|
||||||
|
label: this.$t('admin.settings.name'),
|
||||||
|
path: `/group/edit/${this.group.id}`,
|
||||||
|
icon: 'edit',
|
||||||
})
|
})
|
||||||
if (this.resource.myRole === 'owner') {
|
|
||||||
routes.push({
|
|
||||||
label: this.$t('admin.settings.name'),
|
|
||||||
path: `/group/edit/${this.resource.id}`,
|
|
||||||
icon: 'edit',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return routes
|
return routes
|
||||||
|
|||||||
@ -58,12 +58,7 @@
|
|||||||
<div v-else class="categories-placeholder"></div>
|
<div v-else class="categories-placeholder"></div>
|
||||||
<!-- group context menu -->
|
<!-- group context menu -->
|
||||||
<client-only>
|
<client-only>
|
||||||
<group-content-menu
|
<group-content-menu :usage="'groupTeaser'" :group="group || {}" placement="bottom-end" />
|
||||||
:usage="'groupProfile'"
|
|
||||||
:resourceType="'group'"
|
|
||||||
:resource="group"
|
|
||||||
:group="group"
|
|
||||||
/>
|
|
||||||
</client-only>
|
</client-only>
|
||||||
</footer>
|
</footer>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
|
|||||||
@ -18,10 +18,10 @@
|
|||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
<client-only>
|
<client-only>
|
||||||
<group-content-menu
|
<group-content-menu
|
||||||
|
v-if="isGroupOwner"
|
||||||
class="group-content-menu"
|
class="group-content-menu"
|
||||||
:usage="'groupProfile'"
|
:usage="'groupProfile'"
|
||||||
:resourceType="'group'"
|
:group="group || {}"
|
||||||
:resource="group || {}"
|
|
||||||
placement="bottom-end"
|
placement="bottom-end"
|
||||||
/>
|
/>
|
||||||
<!-- TODO: implement later on -->
|
<!-- TODO: implement later on -->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user