aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-06-16 20:16:52 +0300
committerHenry Jameson <me@hjkos.com>2019-06-16 20:16:52 +0300
commite3638af031abbd091f504611270c4545b98926c5 (patch)
tree0542923e7a2240fb7b1abd650dc2b3c869d7aa4a
parent1db3c785d805bfe1e7bb09f2d85875448cb03f9a (diff)
Removed formattingOptionsEnabled in favor of relying on BE-provided list of
accepted formatting options
-rw-r--r--BREAKING_CHANGES.md3
-rw-r--r--src/boot/after_store.js1
-rw-r--r--src/components/post_status_form/post_status_form.js3
-rw-r--r--src/components/post_status_form/post_status_form.vue15
-rw-r--r--src/components/settings/settings.vue2
-rw-r--r--src/modules/instance.js1
-rw-r--r--static/config.json1
7 files changed, 18 insertions, 8 deletions
diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md
index 924c38da..505fec75 100644
--- a/BREAKING_CHANGES.md
+++ b/BREAKING_CHANGES.md
@@ -1,5 +1,8 @@
# v1.0
## Removed features/radically changed behavior
+### formattingOptionsEnabled
+as of !xxx `formattingOptionsEnabled` is no longer available and instead FE check for available post formatting options and enables formatting control if there's more than one option.
+
### minimalScopesMode
As of !633, `scopeOptions` is no longer available and instead is changed for `minimalScopesMode` (default: `false`)
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index c271d413..7a1ae1f2 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -100,7 +100,6 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
copyInstanceOption('redirectRootLogin')
copyInstanceOption('showInstanceSpecificPanel')
copyInstanceOption('minimalScopesMode')
- copyInstanceOption('formattingOptionsEnabled')
copyInstanceOption('hideMutedPosts')
copyInstanceOption('collapseMessageWithSubject')
copyInstanceOption('scopeCopy')
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index cbd2024a..a2dbf736 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -174,9 +174,6 @@ const PostStatusForm = {
return true
}
},
- formattingOptionsEnabled () {
- return this.$store.state.instance.formattingOptionsEnabled
- },
postFormats () {
return this.$store.state.instance.postFormats || []
},
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 25c5284f..08ecd576 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -58,7 +58,7 @@
>
</textarea>
<div class="visibility-tray">
- <div class="text-format" v-if="formattingOptionsEnabled">
+ <div class="text-format" v-if="postFormats.length > 1">
<label for="post-content-type" class="select">
<select id="post-content-type" v-model="newStatus.contentType" class="form-control">
<option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
@@ -68,6 +68,11 @@
<i class="icon-down-open"></i>
</label>
</div>
+ <div class="text-format" v-if="postFormats.length === 1">
+ <span class="only-format">
+ {{$t(`post_status.content_type["${postFormats[0]}"]`)}}
+ </span>
+ </div>
<scope-selector
:showAll="showAllScopes"
@@ -173,6 +178,14 @@
}
}
+ .text-format {
+ .only-format {
+ color: $fallback--faint;
+ color: var(--faint, $fallback--faint);
+ }
+ }
+
+
.error {
text-align: center;
}
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 4cf6fae2..7067c508 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -102,7 +102,7 @@
</label>
</div>
</li>
- <li>
+ <li v-if="postFormats.length > 0">
<div>
{{$t('settings.post_status_content_type')}}
<label for="postContentType" class="select">
diff --git a/src/modules/instance.js b/src/modules/instance.js
index fc4578ed..59beb23c 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -16,7 +16,6 @@ const defaultState = {
redirectRootNoLogin: '/main/all',
redirectRootLogin: '/main/friends',
showInstanceSpecificPanel: false,
- formattingOptionsEnabled: false,
alwaysShowSubjectInput: true,
hideMutedPosts: false,
collapseMessageWithSubject: false,
diff --git a/static/config.json b/static/config.json
index 04cbb97b..5cdb33a0 100644
--- a/static/config.json
+++ b/static/config.json
@@ -8,7 +8,6 @@
"redirectRootLogin": "/main/friends",
"chatDisabled": false,
"showInstanceSpecificPanel": false,
- "formattingOptionsEnabled": false,
"collapseMessageWithSubject": false,
"scopeCopy": true,
"subjectLineBehavior": "email",