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/scope_selector/scope_selector.js | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/components/scope_selector/scope_selector.js (limited to 'src/components/scope_selector/scope_selector.js') diff --git a/src/components/scope_selector/scope_selector.js b/src/components/scope_selector/scope_selector.js new file mode 100644 index 00000000..578f1ba5 --- /dev/null +++ b/src/components/scope_selector/scope_selector.js @@ -0,0 +1,55 @@ +const ScopeSelector = { + props: [ + 'showAll', + 'userEnabled', + 'userDefault', + 'originalScope', + 'initialScope', + 'onScopeChange' + ], + data () { + return { + currentScope: this.initialScope + } + }, + computed: { + showNothing () { + return !this.showPublic && !this.showUnlisted && !this.showPrivate && !this.showDirect + }, + showPublic () { + return this.originalScope !== 'direct' && this.shouldShow('public') + }, + showUnlisted () { + return this.originalScope !== 'direct' && this.shouldShow('unlisted') + }, + showPrivate () { + return this.originalScope !== 'direct' && this.shouldShow('private') + }, + showDirect () { + return this.shouldShow('direct') + }, + css () { + return { + public: {selected: this.currentScope === 'public'}, + unlisted: {selected: this.currentScope === 'unlisted'}, + private: {selected: this.currentScope === 'private'}, + direct: {selected: this.currentScope === 'direct'} + } + } + }, + methods: { + shouldShow (scope) { + return this.showAll || + this.currentScope === scope || + this.originalScope === scope || + this.userDefault === scope || + this.userEnabled.includes(scope) + }, + changeVis (scope) { + this.currentScope = scope + this.onScopeChange && this.onScopeChange(scope) + } + } +} + +export default ScopeSelector -- cgit v1.2.3-70-g09d2 From bf927122df94853593a000ae873e8c840674258f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:25:23 +0200 Subject: Review --- BREAKING_CHANGES.md | 6 ++++++ src/components/post_status_form/post_status_form.vue | 1 - src/components/scope_selector/scope_selector.js | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 BREAKING_CHANGES.md (limited to 'src/components/scope_selector/scope_selector.js') diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md new file mode 100644 index 00000000..915aa74c --- /dev/null +++ b/BREAKING_CHANGES.md @@ -0,0 +1,6 @@ +# v1.0 +## Removed features/radically changed behavior +* As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (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. +Solution - to only show minimal set among: *Direct*, *User default* and *Scope of post replying to*. This also makes it impossible to reply to a DM with a non-DM post from UI. +*This setting is admin-default, user-configurable. Admin can choose different default for their instance but user can override it.* diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index b3d731cd..8beb73a9 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -46,7 +46,6 @@ Date: Sat, 30 Mar 2019 12:34:13 +0200 Subject: fix lint --- src/components/scope_selector/scope_selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/scope_selector/scope_selector.js') diff --git a/src/components/scope_selector/scope_selector.js b/src/components/scope_selector/scope_selector.js index 4693d066..8a42ee7b 100644 --- a/src/components/scope_selector/scope_selector.js +++ b/src/components/scope_selector/scope_selector.js @@ -42,7 +42,7 @@ const ScopeSelector = { this.currentScope === scope || this.originalScope === scope || this.userDefault === scope || - 'direct' === scope + scope === 'direct' }, changeVis (scope) { this.currentScope = scope -- cgit v1.2.3-70-g09d2