Removed formattingOptionsEnabled in favor of relying on BE-provided list of

accepted formatting options
This commit is contained in:
Henry Jameson 2019-06-16 20:16:52 +03:00
parent 1db3c785d8
commit e3638af031
7 changed files with 18 additions and 8 deletions

View File

@ -1,5 +1,8 @@
# v1.0 # v1.0
## Removed features/radically changed behavior ## 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 ### minimalScopesMode
As of !633, `scopeOptions` is no longer available and instead is changed for `minimalScopesMode` (default: `false`) As of !633, `scopeOptions` is no longer available and instead is changed for `minimalScopesMode` (default: `false`)

View File

@ -100,7 +100,6 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
copyInstanceOption('redirectRootLogin') copyInstanceOption('redirectRootLogin')
copyInstanceOption('showInstanceSpecificPanel') copyInstanceOption('showInstanceSpecificPanel')
copyInstanceOption('minimalScopesMode') copyInstanceOption('minimalScopesMode')
copyInstanceOption('formattingOptionsEnabled')
copyInstanceOption('hideMutedPosts') copyInstanceOption('hideMutedPosts')
copyInstanceOption('collapseMessageWithSubject') copyInstanceOption('collapseMessageWithSubject')
copyInstanceOption('scopeCopy') copyInstanceOption('scopeCopy')

View File

@ -174,9 +174,6 @@ const PostStatusForm = {
return true return true
} }
}, },
formattingOptionsEnabled () {
return this.$store.state.instance.formattingOptionsEnabled
},
postFormats () { postFormats () {
return this.$store.state.instance.postFormats || [] return this.$store.state.instance.postFormats || []
}, },

View File

@ -58,7 +58,7 @@
> >
</textarea> </textarea>
<div class="visibility-tray"> <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"> <label for="post-content-type" class="select">
<select id="post-content-type" v-model="newStatus.contentType" class="form-control"> <select id="post-content-type" v-model="newStatus.contentType" class="form-control">
<option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat"> <option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
@ -68,6 +68,11 @@
<i class="icon-down-open"></i> <i class="icon-down-open"></i>
</label> </label>
</div> </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 <scope-selector
:showAll="showAllScopes" :showAll="showAllScopes"
@ -173,6 +178,14 @@
} }
} }
.text-format {
.only-format {
color: $fallback--faint;
color: var(--faint, $fallback--faint);
}
}
.error { .error {
text-align: center; text-align: center;
} }

View File

@ -102,7 +102,7 @@
</label> </label>
</div> </div>
</li> </li>
<li> <li v-if="postFormats.length > 0">
<div> <div>
{{$t('settings.post_status_content_type')}} {{$t('settings.post_status_content_type')}}
<label for="postContentType" class="select"> <label for="postContentType" class="select">

View File

@ -16,7 +16,6 @@ const defaultState = {
redirectRootNoLogin: '/main/all', redirectRootNoLogin: '/main/all',
redirectRootLogin: '/main/friends', redirectRootLogin: '/main/friends',
showInstanceSpecificPanel: false, showInstanceSpecificPanel: false,
formattingOptionsEnabled: false,
alwaysShowSubjectInput: true, alwaysShowSubjectInput: true,
hideMutedPosts: false, hideMutedPosts: false,
collapseMessageWithSubject: false, collapseMessageWithSubject: false,

View File

@ -8,7 +8,6 @@
"redirectRootLogin": "/main/friends", "redirectRootLogin": "/main/friends",
"chatDisabled": false, "chatDisabled": false,
"showInstanceSpecificPanel": false, "showInstanceSpecificPanel": false,
"formattingOptionsEnabled": false,
"collapseMessageWithSubject": false, "collapseMessageWithSubject": false,
"scopeCopy": true, "scopeCopy": true,
"subjectLineBehavior": "email", "subjectLineBehavior": "email",