-
+
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index d5772082..259e3418 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -1,6 +1,8 @@
import { compose } from 'vue-compose'
import unescape from 'lodash/unescape'
import get from 'lodash/get'
+import map from 'lodash/map'
+import reject from 'lodash/reject'
import TabSwitcher from '../tab_switcher/tab_switcher.js'
import ImageCropper from '../image_cropper/image_cropper.vue'
import StyleSwitcher from '../style_switcher/style_switcher.vue'
@@ -12,6 +14,7 @@ import EmojiInput from '../emoji-input/emoji-input.vue'
import UserAutoSuggest from '../user_autosuggest/user_autosuggest.vue'
import withSubscription from '../../hocs/with_subscription/with_subscription'
import withList from '../../hocs/with_list/with_list'
+import userSearchApi from '../../services/new_api/user_search.js'
const BlockList = compose(
withSubscription({
@@ -336,6 +339,19 @@ const UserSettings = {
if (window.confirm(`${this.$i18n.t('settings.revoke_token')}?`)) {
this.$store.dispatch('revokeToken', id)
}
+ },
+ filterUnblockedUsers (userIds) {
+ return reject(userIds, (userId) => {
+ const user = this.$store.getters.findUser(userId)
+ return !user || user.statusnet_blocking || user.id === this.$store.state.users.currentUser.id
+ })
+ },
+ queryUserIds (query) {
+ return userSearchApi.search({query, store: this.$store})
+ .then((users) => {
+ this.$store.dispatch('addNewUsers', users)
+ return map(users, 'id')
+ })
}
}
}
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 811f63aa..6018cc30 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -196,7 +196,7 @@
-
+
{{$t('settings.no_blocks')}}
From fc5f4fba8c4af713855b881d7b178623b1e77b01 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Tue, 2 Apr 2019 15:43:41 -0400
Subject: [PATCH 14/20] make more generic
---
src/components/user_autosuggest/user_autosuggest.js | 4 ++++
src/components/user_autosuggest/user_autosuggest.vue | 2 +-
src/components/user_settings/user_settings.vue | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/components/user_autosuggest/user_autosuggest.js b/src/components/user_autosuggest/user_autosuggest.js
index 6b95fc15..12a6964a 100644
--- a/src/components/user_autosuggest/user_autosuggest.js
+++ b/src/components/user_autosuggest/user_autosuggest.js
@@ -10,6 +10,10 @@ export default {
},
filter: { // function to filter results in real time
type: Function
+ },
+ placeholder: {
+ type: String,
+ default: 'Search...'
}
},
components: {
diff --git a/src/components/user_autosuggest/user_autosuggest.vue b/src/components/user_autosuggest/user_autosuggest.vue
index 48cffc78..db3e1bdf 100644
--- a/src/components/user_autosuggest/user_autosuggest.vue
+++ b/src/components/user_autosuggest/user_autosuggest.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 6018cc30..3dde5ae1 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -196,7 +196,7 @@
-
+
{{$t('settings.no_blocks')}}
From 1cf9780e05957c96b6d6b6b898b83ff1987b2703 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Tue, 2 Apr 2019 16:02:02 -0400
Subject: [PATCH 15/20] make more generic
---
src/components/user_autosuggest/user_autosuggest.js | 5 -----
src/components/user_autosuggest/user_autosuggest.vue | 3 ++-
src/components/user_settings/user_settings.js | 3 ++-
src/components/user_settings/user_settings.vue | 4 +++-
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/components/user_autosuggest/user_autosuggest.js b/src/components/user_autosuggest/user_autosuggest.js
index 12a6964a..d4efe912 100644
--- a/src/components/user_autosuggest/user_autosuggest.js
+++ b/src/components/user_autosuggest/user_autosuggest.js
@@ -1,5 +1,3 @@
-import BlockCard from '../block_card/block_card.vue'
-
const debounceMilliseconds = 500
export default {
@@ -16,9 +14,6 @@ export default {
default: 'Search...'
}
},
- components: {
- BlockCard
- },
data () {
return {
term: '',
diff --git a/src/components/user_autosuggest/user_autosuggest.vue b/src/components/user_autosuggest/user_autosuggest.vue
index db3e1bdf..6eaecbaa 100644
--- a/src/components/user_autosuggest/user_autosuggest.vue
+++ b/src/components/user_autosuggest/user_autosuggest.vue
@@ -2,7 +2,8 @@
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 259e3418..2cae2d00 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -78,7 +78,8 @@ const UserSettings = {
BlockList,
MuteList,
EmojiInput,
- UserAutoSuggest
+ UserAutoSuggest,
+ BlockCard
},
computed: {
user () {
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 3dde5ae1..69d3dc53 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -196,7 +196,9 @@
-
+
+
+
{{$t('settings.no_blocks')}}
From 0bdb0e5a8124508edff12a265174bd51a09c37e6 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Tue, 2 Apr 2019 16:10:03 -0400
Subject: [PATCH 16/20] rename Autosuggest component
---
.../user_autosuggest.js => autosuggest/autosuggest.js} | 0
.../autosuggest.vue} | 10 +++++-----
src/components/user_settings/user_settings.js | 4 ++--
src/components/user_settings/user_settings.vue | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
rename src/components/{user_autosuggest/user_autosuggest.js => autosuggest/autosuggest.js} (100%)
rename src/components/{user_autosuggest/user_autosuggest.vue => autosuggest/autosuggest.vue} (78%)
diff --git a/src/components/user_autosuggest/user_autosuggest.js b/src/components/autosuggest/autosuggest.js
similarity index 100%
rename from src/components/user_autosuggest/user_autosuggest.js
rename to src/components/autosuggest/autosuggest.js
diff --git a/src/components/user_autosuggest/user_autosuggest.vue b/src/components/autosuggest/autosuggest.vue
similarity index 78%
rename from src/components/user_autosuggest/user_autosuggest.vue
rename to src/components/autosuggest/autosuggest.vue
index 6eaecbaa..ae1e312d 100644
--- a/src/components/user_autosuggest/user_autosuggest.vue
+++ b/src/components/autosuggest/autosuggest.vue
@@ -1,19 +1,19 @@
-