From 6184c88ac70b33e66a87222142344f693406bd87 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 3 Mar 2019 15:15:41 +0200 Subject: Initial work on deprecating scopeModesEnabled in favor of minimalScopeMode --- src/components/user_settings/user_settings.js | 6 ++++-- src/components/user_settings/user_settings.vue | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/components/user_settings') diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index d6972737..1911ab23 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -4,6 +4,7 @@ import get from 'lodash/get' import TabSwitcher from '../tab_switcher/tab_switcher.js' import ImageCropper from '../image_cropper/image_cropper.vue' import StyleSwitcher from '../style_switcher/style_switcher.vue' +import ScopeSelector from '../scope_selector/scope_selector.vue' import fileSizeFormatService from '../../services/file_size_format/file_size_format.js' import BlockCard from '../block_card/block_card.vue' import MuteCard from '../mute_card/mute_card.vue' @@ -66,6 +67,7 @@ const UserSettings = { }, components: { StyleSwitcher, + ScopeSelector, TabSwitcher, ImageCropper, BlockList, @@ -78,8 +80,8 @@ const UserSettings = { pleromaBackend () { return this.$store.state.instance.pleromaBackend }, - scopeOptionsEnabled () { - return this.$store.state.instance.scopeOptionsEnabled + scopeOptionsMinimal () { + return this.$store.state.instance.scopeOptionsMinimal }, vis () { return { diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index a1123638..7bd391ba 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -29,13 +29,13 @@

-
+
- - - - +

-- cgit v1.2.3-70-g09d2 From 4dc64438e929169770347c8868daa1e1c907290e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:41:42 +0200 Subject: aaaaggghh --- BREAKING_CHANGES.md | 4 ++-- src/components/features_panel/features_panel.js | 2 +- src/components/post_status_form/post_status_form.js | 4 ++-- src/components/user_settings/user_settings.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/components/user_settings') diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 45f7c74b..924c38da 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,7 +1,7 @@ # v1.0 ## Removed features/radically changed behavior -### scopeOptionsMinimal -As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (default: `false`) +### minimalScopesMode +As of !633, `scopeOptions` is no longer available and instead is changed for `minimalScopesMode` (default: `false`) Reasoning is that scopeOptions option originally existed mostly as a backwards-compatibility with GNU Social which only had `public` scope available and using scope selector would''t work. Since at some point we dropped GNU Social support, this option was mostly a nuisance (being default `false`'), however some people think scopes are an annoyance to a certain degree and want as less of that feature as possible. diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js index 0a7234cc..5f0b7b25 100644 --- a/src/components/features_panel/features_panel.js +++ b/src/components/features_panel/features_panel.js @@ -6,7 +6,7 @@ const FeaturesPanel = { gopher: function () { return this.$store.state.instance.gopherAvailable }, whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled }, mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable }, - scopeOptionsMinimal: function () { return this.$store.state.instance.scopeOptionsMinimal }, + minimalScopesMode: function () { return this.$store.state.instance.minimalScopesMode }, textlimit: function () { return this.$store.state.instance.textlimit } } } diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 499cbbfb..40e2610e 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -162,8 +162,8 @@ const PostStatusForm = { isOverLengthLimit () { return this.hasStatusLengthLimit && (this.charactersLeft < 0) }, - scopeOptionsMinimal () { - return this.$store.state.instance.scopeOptionsMinimal + minimalScopesMode () { + return this.$store.state.instance.minimalScopesMode }, alwaysShowSubject () { if (typeof this.$store.state.config.alwaysShowSubjectInput !== 'undefined') { diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 4b277b6c..b6a0479d 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -82,8 +82,8 @@ const UserSettings = { pleromaBackend () { return this.$store.state.instance.pleromaBackend }, - scopeOptionsMinimal () { - return this.$store.state.instance.scopeOptionsMinimal + minimalScopesMode () { + return this.$store.state.instance.minimalScopesMode }, vis () { return { -- cgit v1.2.3-70-g09d2 From da5844205c5e2ead4da42f89f1f9586683af693e Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 2 Apr 2019 06:12:31 -0400 Subject: add user autosuggest component --- .../user_autosuggest/user_autosuggest.js | 41 ++++++++++ .../user_autosuggest/user_autosuggest.vue | 93 ++++++++++++++++++++++ src/components/user_settings/user_settings.js | 4 +- src/components/user_settings/user_settings.vue | 3 +- 4 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 src/components/user_autosuggest/user_autosuggest.js create mode 100644 src/components/user_autosuggest/user_autosuggest.vue (limited to 'src/components/user_settings') diff --git a/src/components/user_autosuggest/user_autosuggest.js b/src/components/user_autosuggest/user_autosuggest.js new file mode 100644 index 00000000..6612c2f3 --- /dev/null +++ b/src/components/user_autosuggest/user_autosuggest.js @@ -0,0 +1,41 @@ +import { VueAutosuggest } from 'vue-autosuggest' +import BasicUserCard from '../basic_user_card/basic_user_card.vue' +import userSearchApi from '../../services/new_api/user_search.js' + +export default { + components: { + VueAutosuggest, + BasicUserCard + }, + data () { + return { + results: [], + timeout: null, + selected: null, + debounceMilliseconds: 500, + inputProps: { + id: 'autosuggest__input', + onInputChange: this.fetchResults, + placeholder: 'Search...', + class: 'form-control' + }, + suggestions: [] + } + }, + methods: { + fetchResults (query) { + clearTimeout(this.timeout) + this.timeout = setTimeout(() => { + userSearchApi.search({query, store: this.$store}) + .then((data) => { this.suggestions = [{ data }] }) + }, this.debounceMilliseconds) + }, + clickHandler (item) { + return false + }, + clickUserHandler () { + console.log('clickUserHandler') + return false + } + } +} diff --git a/src/components/user_autosuggest/user_autosuggest.vue b/src/components/user_autosuggest/user_autosuggest.vue new file mode 100644 index 00000000..48fe350d --- /dev/null +++ b/src/components/user_autosuggest/user_autosuggest.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index b6a0479d..d5772082 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -9,6 +9,7 @@ import fileSizeFormatService from '../../services/file_size_format/file_size_for import BlockCard from '../block_card/block_card.vue' import MuteCard from '../mute_card/mute_card.vue' 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' @@ -73,7 +74,8 @@ const UserSettings = { ImageCropper, BlockList, MuteList, - EmojiInput + EmojiInput, + UserAutoSuggest }, computed: { user () { diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index c08698dc..d98a8eba 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -22,7 +22,7 @@

{{$t('settings.name_bio')}}

{{$t('settings.name')}}

-
+ -- cgit v1.2.3-70-g09d2 From fd4289e45a1d9f952b44251110abe01081b92f8a Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 2 Apr 2019 13:18:41 -0400 Subject: improve ui --- src/components/user_autosuggest/user_autosuggest.vue | 20 ++++++++++++++++++-- src/components/user_settings/user_settings.vue | 8 +++++++- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'src/components/user_settings') diff --git a/src/components/user_autosuggest/user_autosuggest.vue b/src/components/user_autosuggest/user_autosuggest.vue index eb5aa41b..2840941f 100644 --- a/src/components/user_autosuggest/user_autosuggest.vue +++ b/src/components/user_autosuggest/user_autosuggest.vue @@ -1,6 +1,6 @@