-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 🍰 Alphabetically sorting tags using compute functions on index and more… #3589
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ | |
<!-- Tags --> | ||
<div v-if="post.tags && post.tags.length" class="tags"> | ||
<ds-space margin="xx-small" /> | ||
<hc-hashtag v-for="tag in post.tags" :key="tag.id" :id="tag.id" /> | ||
<hc-hashtag v-for="tag in sortedTags" :key="tag.id" :id="tag.id" /> | ||
</div> | ||
<ds-space margin-top="x-large"> | ||
<ds-flex :gutter="{ lg: 'small' }"> | ||
|
@@ -116,7 +116,11 @@ import UserTeaser from '~/components/UserTeaser/UserTeaser' | |
import HcShoutButton from '~/components/ShoutButton.vue' | ||
import CommentForm from '~/components/CommentForm/CommentForm' | ||
import CommentList from '~/components/CommentList/CommentList' | ||
import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers' | ||
import { | ||
postMenuModalsData, | ||
deletePostMutation, | ||
sortTagsAlphabetically, | ||
} from '~/components/utils/PostHelpers' | ||
import PostQuery from '~/graphql/PostQuery' | ||
import HcEmotions from '~/components/Emotions/Emotions' | ||
import PostMutations from '~/graphql/PostMutations' | ||
|
@@ -179,6 +183,9 @@ export default { | |
if (!author) return false | ||
return this.$store.getters['auth/user'].id === author.id | ||
}, | ||
sortedTags() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@@ -179,6 +179,20 @@ export default {
if (!author) return false
return this.$store.getters['auth/user'].id === author.id
},
+ sortedTags() { I would love to have this imported as a more general function located in It can be used to sort the post categories in the future. 🙏🏼 |
||
return sortTagsAlphabetically(this.post.tags) | ||
}, | ||
}, | ||
methods: { | ||
reply(message) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
<h3> | ||
{{ $t('post.moreInfo.titleOfHashtagsSection') }} | ||
</h3> | ||
<hc-hashtag v-for="tag in post.tags" :key="tag.id" :id="tag.id" /> | ||
<hc-hashtag v-for="tag in sortedTags" :key="tag.id" :id="tag.id" /> | ||
</template> | ||
<h3>{{ $t('post.moreInfo.titleOfRelatedContributionsSection') }}</h3> | ||
<ds-section> | ||
|
@@ -44,6 +44,7 @@ import HcHashtag from '~/components/Hashtag/Hashtag' | |
import { relatedContributions } from '~/graphql/PostQuery' | ||
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue' | ||
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue' | ||
import { sortTagsAlphabetically } from '~/components/utils/PostHelpers' | ||
|
||
export default { | ||
transition: { | ||
|
@@ -62,6 +63,9 @@ export default { | |
post() { | ||
return this.Post ? this.Post[0] || {} : {} | ||
}, | ||
sortedTags() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@@ -62,6 +62,20 @@ export default {
post() {
return this.Post ? this.Post[0] || {} : {}
},
+ sortedTags() { Would be nice to have a shared function … see above ☝🏼 |
||
return sortTagsAlphabetically(this.post.tags) | ||
}, | ||
}, | ||
methods: { | ||
removePostFromList(deletedPost) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done 😍
Thanks for testing! 👍🏼