From 6532e8b1131e6f717dce2e91aaa3b917051b5f08 Mon Sep 17 00:00:00 2001 From: "rusov.d.s" Date: Wed, 2 May 2018 21:34:41 +0700 Subject: [PATCH] separate filter by tags and modal --- .../components/chains/common/FilterByTags.vue | 48 +++++--------- .../chains/common/FilterByTagsModal.vue | 48 +++++++------- .../src/components/chains/common/TagLabel.vue | 12 +--- .../chains/feed/FeedFilterByTags.vue | 15 ++--- .../chains/profile/ProfileFilterByTags.vue | 15 ++--- client/src/containers/chains/Feed.vue | 28 +++++++-- client/src/containers/chains/Profile.vue | 24 ++++++- client/src/store/index.js | 4 +- client/src/store/modules/filterByTags.js | 63 +++++++++++++++++++ package.json | 2 +- 10 files changed, 167 insertions(+), 92 deletions(-) create mode 100644 client/src/store/modules/filterByTags.js diff --git a/client/src/components/chains/common/FilterByTags.vue b/client/src/components/chains/common/FilterByTags.vue index 0db2a7a..f6aa1fb 100644 --- a/client/src/components/chains/common/FilterByTags.vue +++ b/client/src/components/chains/common/FilterByTags.vue @@ -11,8 +11,6 @@ @@ -27,37 +25,16 @@ {{$t('profile.showAllTags')}} - diff --git a/client/src/components/chains/profile/ProfileFilterByTags.vue b/client/src/components/chains/profile/ProfileFilterByTags.vue index 71b9ea7..20272e2 100644 --- a/client/src/components/chains/profile/ProfileFilterByTags.vue +++ b/client/src/components/chains/profile/ProfileFilterByTags.vue @@ -9,9 +9,14 @@ const TOP_LIMIT = 10 import FilterByTags from '../../../components/chains/common/FilterByTags.vue' import EventBus from '../../../event-bus' -const parser = require('@oneplace/blockchains-api/parser') + export default { name: 'ProfileFilterByTags', + props: { + tags: { + type: Array + } + }, components: { FilterByTags }, @@ -38,14 +43,6 @@ export default { change({ include, exclude }) { EventBus.$emit('PROFILE:FILTER:CHANGE', { include, exclude }) } - }, - computed: { - tags() { - const posts = this.$store.state.profile.posts.collection - const tags = parser.getTagsFromPosts(posts) - tags.sort((a, b) => b.count - a.count) - return tags - } } } diff --git a/client/src/containers/chains/Feed.vue b/client/src/containers/chains/Feed.vue index 2823a2f..ae08c56 100644 --- a/client/src/containers/chains/Feed.vue +++ b/client/src/containers/chains/Feed.vue @@ -15,7 +15,8 @@
@@ -24,11 +25,15 @@