Implement descriptionExcerpt on group profile

This commit is contained in:
Wolfgang Huß 2022-09-15 09:55:51 +02:00
parent 12a924764c
commit b23f4ea47b
4 changed files with 72 additions and 21 deletions

View File

@ -142,6 +142,7 @@ export const groupQuery = gql`
deleted deleted
about about
description description
# descriptionExcerpt # test this as result
groupType groupType
actionRadius actionRadius
categories { categories {

View File

@ -29,6 +29,7 @@ type Group {
about: String # goal about: String # goal
description: String! description: String!
descriptionExcerpt: String!
groupType: GroupType! groupType: GroupType!
actionRadius: GroupActionRadius! actionRadius: GroupActionRadius!

View File

@ -80,6 +80,7 @@ export const updateGroupMutation = gql`
deleted deleted
about about
description description
descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {
@ -142,6 +143,7 @@ export const groupQuery = gql`
deleted deleted
about about
description description
descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {

View File

@ -178,16 +178,18 @@
</ds-flex-item> </ds-flex-item>
<ds-flex-item :width="{ base: '100%', sm: 3, md: 5, lg: 3 }"> <ds-flex-item :width="{ base: '100%', sm: 3, md: 5, lg: 3 }">
<masonry-grid> <!-- Group description -->
<!-- TapNavigation --> <ds-space>
<!-- <tab-navigation :tabs="tabOptions" :activeTab="tabActive" @switch-tab="handleTab" /> --> <base-card class="group-description">
<!-- TODO: replace editor content with tiptap render view -->
<!-- feed --> <!-- eslint-disable vue/no-v-html -->
<ds-grid-item :row-span="2" column-span="fullWidth"> <div class="content hyphenate-text" v-html="groupDescriptionExcerpt" />
<ds-space centered> <!-- eslint-enable vue/no-v-html -->
</base-card>
</ds-space>
<ds-space v-if="isGroupMemberNonePending" centered>
<nuxt-link :to="{ name: 'post-create' }"> <nuxt-link :to="{ name: 'post-create' }">
<base-button <base-button
v-if="isGroupMember"
v-tooltip="{ v-tooltip="{
content: $t('contribution.newPost'), content: $t('contribution.newPost'),
placement: 'left', placement: 'left',
@ -201,8 +203,11 @@
/> />
</nuxt-link> </nuxt-link>
</ds-space> </ds-space>
</ds-grid-item> <masonry-grid>
<!-- TapNavigation -->
<!-- <tab-navigation :tabs="tabOptions" :activeTab="tabActive" @switch-tab="handleTab" /> -->
<!-- Group post feed -->
<template v-if="posts && posts.length"> <template v-if="posts && posts.length">
<masonry-grid-item <masonry-grid-item
v-for="post in posts" v-for="post in posts"
@ -332,6 +337,9 @@ export default {
isGroupMember() { isGroupMember() {
return this.group ? !!this.group.myRole : false return this.group ? !!this.group.myRole : false
}, },
isGroupMemberNonePending() {
return this.group ? ['usual', 'admin', 'owner'].includes(this.group.myRole) : false
},
groupName() { groupName() {
const { name } = this.group || {} const { name } = this.group || {}
return name || this.$t('profile.userAnonym') return name || this.$t('profile.userAnonym')
@ -340,6 +348,9 @@ export default {
const { slug } = this.group || {} const { slug } = this.group || {}
return slug && `@${slug}` return slug && `@${slug}`
}, },
groupDescriptionExcerpt() {
return this.group ? this.$filters.removeLinks(this.group.descriptionExcerpt) : ''
},
// tabOptions() { // tabOptions() {
// return [ // return [
// { // {
@ -557,4 +568,40 @@ export default {
.chip { .chip {
margin-bottom: $space-x-small; margin-bottom: $space-x-small;
} }
.group-description > .base-card {
display: flex;
flex-direction: column;
height: 100%;
> .content {
flex-grow: 1;
margin-bottom: $space-small;
}
// Wolle: > .footer {
// display: flex;
// justify-content: space-between;
// align-items: center;
// > .categories-placeholder {
// flex-grow: 1;
// }
// > .counter-icon {
// display: block;
// margin-right: $space-small;
// opacity: $opacity-disabled;
// }
// > .content-menu {
// position: relative;
// z-index: $z-index-post-teaser-link;
// }
// .ds-tag {
// margin: 0;
// margin-right: $space-xx-small;
// }
// }
}
</style> </style>