forked from AkkomaGang/akkoma-fe
Merge branch 'develop' into 'eslint-fix'
# Conflicts: # src/components/post_status_form/post_status_form.vue
This commit is contained in:
commit
8f53796420
6 changed files with 63 additions and 158 deletions
|
@ -58,150 +58,30 @@
|
||||||
<span v-if="safeDMEnabled">{{ $t('post_status.direct_warning_to_first_only') }}</span>
|
<span v-if="safeDMEnabled">{{ $t('post_status.direct_warning_to_first_only') }}</span>
|
||||||
<span v-else>{{ $t('post_status.direct_warning_to_all') }}</span>
|
<span v-else>{{ $t('post_status.direct_warning_to_all') }}</span>
|
||||||
</p>
|
</p>
|
||||||
<EmojiInput
|
</EmojiInput>
|
||||||
v-if="newStatus.spoilerText || alwaysShowSubject"
|
<div class="visibility-tray">
|
||||||
v-model="newStatus.spoilerText"
|
<scope-selector
|
||||||
:suggest="emojiSuggestor"
|
:showAll="showAllScopes"
|
||||||
class="form-control"
|
:userDefault="userDefaultScope"
|
||||||
>
|
:originalScope="copyMessageScope"
|
||||||
<input
|
:initialScope="newStatus.visibility"
|
||||||
|
:onScopeChange="changeVis"/>
|
||||||
|
|
||||||
v-model="newStatus.spoilerText"
|
<div class="text-format" v-if="postFormats.length > 1">
|
||||||
type="text"
|
<label for="post-content-type" class="select">
|
||||||
:placeholder="$t('post_status.content_warning')"
|
<select id="post-content-type" v-model="newStatus.contentType" class="form-control">
|
||||||
class="form-post-subject"
|
<option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
|
||||||
>
|
{{$t(`post_status.content_type["${postFormat}"]`)}}
|
||||||
</EmojiInput>
|
</option>
|
||||||
<EmojiInput
|
</select>
|
||||||
v-model="newStatus.status"
|
<i class="icon-down-open"></i>
|
||||||
:suggest="emojiUserSuggestor"
|
</label>
|
||||||
class="form-control main-input"
|
|
||||||
>
|
|
||||||
<textarea
|
|
||||||
ref="textarea"
|
|
||||||
v-model="newStatus.status"
|
|
||||||
:placeholder="$t('post_status.default')"
|
|
||||||
rows="1"
|
|
||||||
:disabled="posting"
|
|
||||||
class="form-post-body"
|
|
||||||
@keydown.meta.enter="postStatus(newStatus)"
|
|
||||||
@keyup.ctrl.enter="postStatus(newStatus)"
|
|
||||||
@drop="fileDrop"
|
|
||||||
@dragover.prevent="fileDrag"
|
|
||||||
@input="resize"
|
|
||||||
@paste="paste"
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
v-if="hasStatusLengthLimit"
|
|
||||||
class="character-counter faint"
|
|
||||||
:class="{ error: isOverLengthLimit }"
|
|
||||||
>
|
|
||||||
{{ charactersLeft }}
|
|
||||||
</p>
|
|
||||||
</EmojiInput>
|
|
||||||
<div class="visibility-tray">
|
|
||||||
<div
|
|
||||||
v-if="postFormats.length > 1"
|
|
||||||
class="text-format"
|
|
||||||
>
|
|
||||||
<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"
|
|
||||||
>
|
|
||||||
{{ $t(`post_status.content_type["${postFormat}"]`) }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<i class="icon-down-open" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="postFormats.length === 1"
|
|
||||||
class="text-format"
|
|
||||||
>
|
|
||||||
<span class="only-format">
|
|
||||||
{{ $t(`post_status.content_type["${postFormats[0]}"]`) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<scope-selector
|
|
||||||
:show-all="showAllScopes"
|
|
||||||
:user-default="userDefaultScope"
|
|
||||||
:original-scope="copyMessageScope"
|
|
||||||
:initial-scope="newStatus.visibility"
|
|
||||||
:on-scope-change="changeVis"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="text-format" v-if="postFormats.length === 1 && postFormats[0] !== 'text/plain'">
|
||||||
<poll-form
|
<span class="only-format">
|
||||||
v-if="pollsAvailable"
|
{{$t(`post_status.content_type["${postFormats[0]}"]`)}}
|
||||||
ref="pollForm"
|
</span>
|
||||||
:visible="pollFormVisible"
|
|
||||||
@update-poll="setPoll"
|
|
||||||
/>
|
|
||||||
<div class="form-bottom">
|
|
||||||
<div class="form-bottom-left">
|
|
||||||
<media-upload
|
|
||||||
ref="mediaUpload"
|
|
||||||
:drop-files="dropFiles"
|
|
||||||
@uploading="disableSubmit"
|
|
||||||
@uploaded="addMediaFile"
|
|
||||||
@upload-failed="uploadFailed"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
v-if="pollsAvailable"
|
|
||||||
class="poll-icon"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
:title="$t('polls.add_poll')"
|
|
||||||
class="icon-chart-bar btn btn-default"
|
|
||||||
:class="pollFormVisible && 'selected'"
|
|
||||||
@click="togglePollForm"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
|
||||||
v-if="posting"
|
|
||||||
disabled
|
|
||||||
class="btn btn-default"
|
|
||||||
>
|
|
||||||
{{ $t('post_status.posting') }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-else-if="isOverLengthLimit"
|
|
||||||
disabled
|
|
||||||
class="btn btn-default"
|
|
||||||
>
|
|
||||||
{{ $t('general.submit') }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-else
|
|
||||||
:disabled="submitDisabled"
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-default"
|
|
||||||
>
|
|
||||||
{{ $t('general.submit') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="error"
|
|
||||||
class="alert error"
|
|
||||||
>
|
|
||||||
Error: {{ error }}
|
|
||||||
<i
|
|
||||||
class="button-icon icon-cancel"
|
|
||||||
@click="clearError"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="attachments">
|
<div class="attachments">
|
||||||
<div
|
<div
|
||||||
|
@ -276,7 +156,6 @@
|
||||||
.visibility-tray {
|
.visibility-tray {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: row-reverse;
|
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,6 +203,7 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ const Timeline = {
|
||||||
if (this.newStatusCount === 0) return
|
if (this.newStatusCount === 0) return
|
||||||
|
|
||||||
if (this.timeline.flushMarker !== 0) {
|
if (this.timeline.flushMarker !== 0) {
|
||||||
this.$store.commit('clearTimeline', { timeline: this.timelineName })
|
this.$store.commit('clearTimeline', { timeline: this.timelineName, excludeUserId: true })
|
||||||
this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
|
this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
|
||||||
this.fetchOlderStatuses()
|
this.fetchOlderStatuses()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -31,6 +31,8 @@ const UserProfile = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
// Make sure that timelines used in this page are empty
|
||||||
|
this.cleanUp()
|
||||||
const routeParams = this.$route.params
|
const routeParams = this.$route.params
|
||||||
this.load(routeParams.name || routeParams.id)
|
this.load(routeParams.name || routeParams.id)
|
||||||
},
|
},
|
||||||
|
|
|
@ -78,6 +78,20 @@
|
||||||
"repeated_you": "a repetit vòstre estatut",
|
"repeated_you": "a repetit vòstre estatut",
|
||||||
"no_more_notifications": "Pas mai de notificacions"
|
"no_more_notifications": "Pas mai de notificacions"
|
||||||
},
|
},
|
||||||
|
"polls": {
|
||||||
|
"add_poll": "Ajustar un sondatge",
|
||||||
|
"add_option": "Ajustar d’opcions",
|
||||||
|
"option": "Opcion",
|
||||||
|
"votes": "vòtes",
|
||||||
|
"vote": "Votar",
|
||||||
|
"type": "Tipe de sondatge",
|
||||||
|
"single_choice": "Causida unica",
|
||||||
|
"multiple_choices": "Causida multipla",
|
||||||
|
"expiry": "Durada del sondatge",
|
||||||
|
"expires_in": "Lo sondatge s’acabarà {0}",
|
||||||
|
"expired": "Sondatge acabat {0}",
|
||||||
|
"not_enough_options": "I a pas pro d’opcions"
|
||||||
|
},
|
||||||
"post_status": {
|
"post_status": {
|
||||||
"new_status": "Publicar d’estatuts novèls",
|
"new_status": "Publicar d’estatuts novèls",
|
||||||
"account_not_locked_warning": "Vòstre compte es pas {0}. Qual que siá pòt vos seguir per veire vòstras publicacions destinadas pas qu’a vòstres seguidors.",
|
"account_not_locked_warning": "Vòstre compte es pas {0}. Qual que siá pòt vos seguir per veire vòstras publicacions destinadas pas qu’a vòstres seguidors.",
|
||||||
|
@ -197,6 +211,7 @@
|
||||||
"loop_video": "Bocla vidèo",
|
"loop_video": "Bocla vidèo",
|
||||||
"loop_video_silent_only": "Legir en bocla solament las vidèos sens son (coma los « Gifs » de Mastodon)",
|
"loop_video_silent_only": "Legir en bocla solament las vidèos sens son (coma los « Gifs » de Mastodon)",
|
||||||
"mutes_tab": "Agamats",
|
"mutes_tab": "Agamats",
|
||||||
|
"interactions_tab": "Interaccions",
|
||||||
"play_videos_in_modal": "Legir las vidèos dirèctament dins la visualizaira mèdia",
|
"play_videos_in_modal": "Legir las vidèos dirèctament dins la visualizaira mèdia",
|
||||||
"use_contain_fit": "Talhar pas las pèças juntas per las vinhetas",
|
"use_contain_fit": "Talhar pas las pèças juntas per las vinhetas",
|
||||||
"name": "Nom",
|
"name": "Nom",
|
||||||
|
@ -264,8 +279,15 @@
|
||||||
"false": "non",
|
"false": "non",
|
||||||
"true": "òc"
|
"true": "òc"
|
||||||
},
|
},
|
||||||
"notifications": "Notificacions",
|
"notifications": "Notificacions",
|
||||||
"enable_web_push_notifications": "Activar las notificacions web push",
|
"notification_setting": "Receber las notificacions de :",
|
||||||
|
"notification_setting_follows": "Utilizaires que seguissètz",
|
||||||
|
"notification_setting_non_follows": "Utilizaires que seguissètz pas",
|
||||||
|
"notification_setting_followers": "Utilizaires que vos seguisson",
|
||||||
|
"notification_setting_non_followers": "Utilizaires que vos seguisson pas",
|
||||||
|
"notification_mutes": "Per receber pas mai d’un utilizaire en particular, botatz-lo en silenci.",
|
||||||
|
"notification_blocks": "Blocar un utilizaire arrèsta totas las notificacions tan coma quitar de los seguir.",
|
||||||
|
"enable_web_push_notifications": "Activar las notificacions web push",
|
||||||
"style": {
|
"style": {
|
||||||
"switcher": {
|
"switcher": {
|
||||||
"keep_color": "Gardar las colors",
|
"keep_color": "Gardar las colors",
|
||||||
|
@ -386,14 +408,14 @@
|
||||||
"days": "{0} jorns",
|
"days": "{0} jorns",
|
||||||
"day_short": "{0} jorn",
|
"day_short": "{0} jorn",
|
||||||
"days_short": "{0} jorns",
|
"days_short": "{0} jorns",
|
||||||
"hour": "{0} hour",
|
"hour": "{0} ora",
|
||||||
"hours": "{0} hours",
|
"hours": "{0} oras",
|
||||||
"hour_short": "{0}h",
|
"hour_short": "{0}h",
|
||||||
"hours_short": "{0}h",
|
"hours_short": "{0}h",
|
||||||
"in_future": "in {0}",
|
"in_future": "d’aquí {0}",
|
||||||
"in_past": "fa {0}",
|
"in_past": "fa {0}",
|
||||||
"minute": "{0} minute",
|
"minute": "{0} minuta",
|
||||||
"minutes": "{0} minutes",
|
"minutes": "{0} minutas",
|
||||||
"minute_short": "{0}min",
|
"minute_short": "{0}min",
|
||||||
"minutes_short": "{0}min",
|
"minutes_short": "{0}min",
|
||||||
"month": "{0} mes",
|
"month": "{0} mes",
|
||||||
|
@ -402,12 +424,12 @@
|
||||||
"months_short": "{0} meses",
|
"months_short": "{0} meses",
|
||||||
"now": "ara meteis",
|
"now": "ara meteis",
|
||||||
"now_short": "ara meteis",
|
"now_short": "ara meteis",
|
||||||
"second": "{0} second",
|
"second": "{0} segonda",
|
||||||
"seconds": "{0} seconds",
|
"seconds": "{0} segondas",
|
||||||
"second_short": "{0}s",
|
"second_short": "{0}s",
|
||||||
"seconds_short": "{0}s",
|
"seconds_short": "{0}s",
|
||||||
"week": "{0} setm.",
|
"week": "{0} setmana.",
|
||||||
"weeks": "{0} setm.",
|
"weeks": "{0} setmanas.",
|
||||||
"week_short": "{0} setm.",
|
"week_short": "{0} setm.",
|
||||||
"weeks_short": "{0} setm.",
|
"weeks_short": "{0} setm.",
|
||||||
"year": "{0} an",
|
"year": "{0} an",
|
||||||
|
|
|
@ -395,8 +395,9 @@ export const mutations = {
|
||||||
state[key] = value
|
state[key] = value
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clearTimeline (state, { timeline }) {
|
clearTimeline (state, { timeline, excludeUserId = false }) {
|
||||||
state.timelines[timeline] = emptyTl(state.timelines[timeline].userId)
|
const userId = excludeUserId ? state.timelines[timeline].userId : undefined
|
||||||
|
state.timelines[timeline] = emptyTl(userId)
|
||||||
},
|
},
|
||||||
clearNotifications (state) {
|
clearNotifications (state) {
|
||||||
state.notifications = emptyNotifications()
|
state.notifications = emptyNotifications()
|
||||||
|
|
|
@ -258,11 +258,11 @@ describe('Statuses module', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('clearTimeline', () => {
|
describe('clearTimeline', () => {
|
||||||
it('keeps userId when clearing user timeline', () => {
|
it('keeps userId when clearing user timeline when excludeUserId param is true', () => {
|
||||||
const state = defaultState()
|
const state = defaultState()
|
||||||
state.timelines.user.userId = 123
|
state.timelines.user.userId = 123
|
||||||
|
|
||||||
mutations.clearTimeline(state, { timeline: 'user' })
|
mutations.clearTimeline(state, { timeline: 'user', excludeUserId: true })
|
||||||
|
|
||||||
expect(state.timelines.user.userId).to.eql(123)
|
expect(state.timelines.user.userId).to.eql(123)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue