Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into develop

This commit is contained in:
sadposter 2020-09-09 09:45:48 +01:00
commit 098991d767
30 changed files with 383 additions and 118 deletions

View file

@ -2,7 +2,7 @@
.chat-message-wrapper {
&.hovered-message-chain {
.animated.avatar {
.animated.Avatar {
canvas {
display: none;
}

View file

@ -39,7 +39,7 @@
word-wrap: break-word;
word-break: break-word;
&:hover .animated.avatar {
&:hover .animated.Avatar {
canvas {
display: none;
}

View file

@ -47,11 +47,6 @@ const passwordReset = {
if (status === 204) {
this.success = true
this.error = null
} else if (status === 404 || status === 400) {
this.error = this.$t('password_reset.not_found')
this.$nextTick(() => {
this.$refs.email.focus()
})
} else if (status === 429) {
this.throttled = true
this.error = this.$t('password_reset.too_many_requests')

View file

@ -96,6 +96,7 @@
align-items: center;
padding: 0.1em 0.25em;
z-index: 1;
word-break: break-word;
}
.result-percentage {
width: 3.5em;

View file

@ -555,6 +555,9 @@ const PostStatusForm = {
},
updateIdempotencyKey () {
this.idempotencyKey = Date.now().toString()
},
openProfileTab () {
this.$store.dispatch('openSettingsModalTab', 'profile')
}
}
}

View file

@ -23,9 +23,12 @@
tag="p"
class="visibility-notice"
>
<router-link :to="{ name: 'user-settings' }">
<a
href="#"
@click="openProfileTab"
>
{{ $t('post_status.account_not_locked_warning_link') }}
</router-link>
</a>
</i18n>
<p
v-if="!hideScopeNotice && newStatus.visibility === 'public'"

View file

@ -27,6 +27,34 @@ const SettingsModalContent = {
computed: {
isLoggedIn () {
return !!this.$store.state.users.currentUser
},
open () {
return this.$store.state.interface.settingsModalState !== 'hidden'
}
},
methods: {
onOpen () {
const targetTab = this.$store.state.interface.settingsModalTargetTab
// We're being told to open in specific tab
if (targetTab) {
const tabIndex = this.$refs.tabSwitcher.$slots.default.findIndex(elm => {
return elm.data && elm.data.attrs['data-tab-name'] === targetTab
})
if (tabIndex >= 0) {
this.$refs.tabSwitcher.setTab(tabIndex)
}
}
// Clear the state of target tab, so that next time settings is opened
// it doesn't force it.
this.$store.dispatch('clearSettingsModalTargetTab')
}
},
mounted () {
this.onOpen()
},
watch: {
open: function (value) {
if (value) this.onOpen()
}
}
}

View file

@ -8,6 +8,7 @@
<div
:label="$t('settings.general')"
icon="wrench"
data-tab-name="general"
>
<GeneralTab />
</div>
@ -15,6 +16,7 @@
v-if="isLoggedIn"
:label="$t('settings.profile_tab')"
icon="user"
data-tab-name="profile"
>
<ProfileTab />
</div>
@ -22,18 +24,21 @@
v-if="isLoggedIn"
:label="$t('settings.security_tab')"
icon="lock"
data-tab-name="security"
>
<SecurityTab />
</div>
<div
:label="$t('settings.filtering')"
icon="filter"
data-tab-name="filtering"
>
<FilteringTab />
</div>
<div
:label="$t('settings.theme')"
icon="brush"
data-tab-name="theme"
>
<ThemeTab />
</div>
@ -41,6 +46,7 @@
v-if="isLoggedIn"
:label="$t('settings.notifications')"
icon="bell-ringing-o"
data-tab-name="notifications"
>
<NotificationsTab />
</div>
@ -48,6 +54,7 @@
v-if="isLoggedIn"
:label="$t('settings.data_import_export_tab')"
icon="download"
data-tab-name="dataImportExport"
>
<DataImportExportTab />
</div>
@ -56,12 +63,14 @@
:label="$t('settings.mutes_and_blocks')"
:fullHeight="true"
icon="eye-off"
data-tab-name="mutesAndBlocks"
>
<MutesAndBlocksTab />
</div>
<div
:label="$t('settings.version.title')"
icon="info-circled"
data-tab-name="version"
>
<VersionTab />
</div>

View file

@ -71,6 +71,10 @@
v-if="attachmentTypes.includes('unknown')"
class="icon-doc"
/>
<span
v-if="status.poll && status.poll.options"
class="icon-chart-bar"
/>
<span
v-if="status.card"
class="icon-link"
@ -86,7 +90,7 @@
</a>
</div>
<div v-if="status.poll && status.poll.options">
<div v-if="status.poll && status.poll.options && !hideSubjectStatus">
<poll :base-poll="status.poll" />
</div>

View file

@ -60,16 +60,19 @@ export default Vue.component('tab-switcher', {
}
},
methods: {
activateTab (index) {
clickTab (index) {
return (e) => {
e.preventDefault()
if (typeof this.onSwitch === 'function') {
this.onSwitch.call(null, this.$slots.default[index].key)
}
this.active = index
if (this.scrollableTabs) {
this.$refs.contents.scrollTop = 0
}
this.setTab(index)
}
},
setTab (index) {
if (typeof this.onSwitch === 'function') {
this.onSwitch.call(null, this.$slots.default[index].key)
}
this.active = index
if (this.scrollableTabs) {
this.$refs.contents.scrollTop = 0
}
}
},
@ -88,7 +91,7 @@ export default Vue.component('tab-switcher', {
<div class={classesWrapper.join(' ')}>
<button
disabled={slot.data.attrs.disabled}
onClick={this.activateTab(index)}
onClick={this.clickTab(index)}
class={classesTab.join(' ')}>
<img src={slot.data.attrs.image} title={slot.data.attrs['image-tooltip']}/>
{slot.data.attrs.label ? '' : slot.data.attrs.label}
@ -100,7 +103,7 @@ export default Vue.component('tab-switcher', {
<div class={classesWrapper.join(' ')}>
<button
disabled={slot.data.attrs.disabled}
onClick={this.activateTab(index)}
onClick={this.clickTab(index)}
class={classesTab.join(' ')}
type="button"
>

View file

@ -354,7 +354,7 @@
align-items: flex-start;
max-height: 56px;
.avatar {
.Avatar {
flex: 1 0 100%;
width: 56px;
height: 56px;
@ -364,7 +364,7 @@
}
}
&:hover .avatar {
&:hover .Avatar {
--still-image-img: visible;
--still-image-canvas: hidden;
}