Merge remote-tracking branch 'origin/develop' into shigusegubu-vue3

This commit is contained in:
Henry Jameson 2024-01-23 00:44:28 +02:00
commit bceb3da0ea
18 changed files with 727 additions and 225 deletions

View file

@ -114,6 +114,7 @@ const EmojiPicker = {
groupsScrolledClass: 'scrolled-top',
keepOpen: false,
customEmojiTimeout: null,
hideCustomEmojiInPicker: false,
// Lazy-load only after the first time `showing` becomes true.
contentLoaded: false,
groupRefs: {},
@ -286,7 +287,7 @@ const EmojiPicker = {
return 0
},
allCustomGroups () {
if (this.hideCustomEmoji) {
if (this.hideCustomEmoji || this.hideCustomEmojiInPicker) {
return {}
}
const emojis = this.$store.getters.groupedCustomEmojis

View file

@ -39,11 +39,16 @@ $emoji-picker-emoji-size: 32px;
}
.keep-open,
.too-many-emoji {
.too-many-emoji,
.hide-custom-emoji {
padding: 7px;
line-height: normal;
}
.hide-custom-emoji {
padding-top: 0;
}
.too-many-emoji {
display: flex;
flex-direction: column;

View file

@ -142,6 +142,17 @@
{{ $t('emoji.keep_open') }}
</Checkbox>
</div>
<div
v-if="!hideCustomEmoji"
class="hide-custom-emoji"
>
<Checkbox
v-model="hideCustomEmojiInPicker"
@change="onShowing"
>
{{ $t('emoji.hide_custom_emoji') }}
</Checkbox>
</div>
</div>
<div
v-if="showingStickers"

View file

@ -83,6 +83,8 @@ const registration = {
signedIn: (state) => !!state.users.currentUser,
isPending: (state) => state.users.signUpPending,
serverValidationErrors: (state) => state.users.signUpErrors,
signUpNotice: (state) => state.users.signUpNotice,
hasSignUpNotice: (state) => !!state.users.signUpNotice.message,
termsOfService: (state) => state.instance.tos,
accountActivationRequired: (state) => state.instance.accountActivationRequired,
accountApprovalRequired: (state) => state.instance.accountApprovalRequired,
@ -107,8 +109,12 @@ const registration = {
if (!this.v$.$invalid) {
try {
await this.signUp(this.user)
this.$router.push({ name: 'friends' })
const status = await this.signUp(this.user)
if (status === 'ok') {
this.$router.push({ name: 'friends' })
}
// If status is not 'ok' (i.e. it needs further actions to be done
// before you can login), display sign up notice, do not switch anywhere
} catch (error) {
console.warn('Registration failed: ', error)
this.setCaptcha()

View file

@ -3,7 +3,10 @@
<div class="panel-heading">
{{ $t('registration.registration') }}
</div>
<div class="panel-body">
<div
v-if="!hasSignUpNotice"
class="panel-body"
>
<form
class="registration-form"
@submit.prevent="submit(user)"
@ -307,6 +310,11 @@
</div>
</form>
</div>
<div v-else>
<p class="registration-notice">
{{ signUpNotice.message }}
</p>
</div>
</div>
</template>
@ -404,6 +412,10 @@ $validations-cRed: #f04124;
}
}
.registration-notice {
margin: 0.6em;
}
@media all and (max-width: 800px) {
.registration-form .container {
flex-direction: column-reverse;

View file

@ -80,6 +80,9 @@ const UserProfile = {
followersTabVisible () {
return this.isUs || !this.user.hide_followers
},
favoritesTabVisible () {
return this.isUs || !this.user.hide_favorites
},
formattedBirthday () {
const browserLocale = localeService.internalToBrowserLocale(this.$i18n.locale)
return this.user.birthday && new Date(Date.parse(this.user.birthday)).toLocaleDateString(browserLocale, { timeZone: 'UTC', day: 'numeric', month: 'long', year: 'numeric' })
@ -103,6 +106,8 @@ const UserProfile = {
startFetchingTimeline('user', userId)
startFetchingTimeline('media', userId)
if (this.isUs) {
startFetchingTimeline('favorites')
} else if (!this.user.hide_favorites) {
startFetchingTimeline('favorites', userId)
}
// Fetch all pinned statuses immediately

View file

@ -109,7 +109,7 @@
:footer-slipgate="footerRef"
/>
<Timeline
v-if="isUs"
v-if="favoritesTabVisible"
key="favorites"
:label="$t('user_card.favorites')"
:disabled="!favorites.visibleStatuses.length"
@ -117,6 +117,7 @@
:title="$t('user_card.favorites')"
timeline-name="favorites"
:timeline="favorites"
:user-id="userId"
:in-profile="true"
:footer-slipgate="footerRef"
/>