Merge branch 'mastoapi-login-and-config-fixes' into 'develop'

Mastoapi login and config fixes

See merge request pleroma/pleroma-fe!833
This commit is contained in:
HJ 2019-06-17 20:17:58 +00:00
commit ac46de3972
11 changed files with 35 additions and 58 deletions

View file

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

View file

@ -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;
}

View file

@ -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">

View file

@ -46,7 +46,9 @@ const UserSettings = {
pickAvatarBtnVisible: true,
bannerUploading: false,
backgroundUploading: false,
banner: null,
bannerPreview: null,
background: null,
backgroundPreview: null,
bannerUploadError: null,
backgroundUploadError: null,
@ -198,22 +200,12 @@ const UserSettings = {
},
submitBg () {
if (!this.backgroundPreview) { return }
let img = this.backgroundPreview
// eslint-disable-next-line no-undef
let imginfo = new Image()
let cropX, cropY, cropW, cropH
imginfo.src = img
cropX = 0
cropY = 0
cropW = imginfo.width
cropH = imginfo.width
let background = this.background
this.backgroundUploading = true
this.$store.state.api.backendInteractor.updateBg({params: {img, cropX, cropY, cropW, cropH}}).then((data) => {
this.$store.state.api.backendInteractor.updateBg({ background }).then((data) => {
if (!data.error) {
let clone = JSON.parse(JSON.stringify(this.$store.state.users.currentUser))
clone.background_image = data.url
this.$store.commit('addNewUsers', [clone])
this.$store.commit('setCurrentUser', clone)
this.$store.commit('addNewUsers', [data])
this.$store.commit('setCurrentUser', data)
this.backgroundPreview = null
} else {
this.backgroundUploadError = this.$t('upload.error.base') + data.error