From ae1b6ad887d367dd039a47baef1e62a2f66b2a76 Mon Sep 17 00:00:00 2001 From: floatingghost Date: Mon, 5 Sep 2022 17:02:16 +0000 Subject: [PATCH] Customisation of default profile tab, clean up settings (#156) Co-authored-by: FloatingGhost Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/156 --- src/components/extra_buttons/extra_buttons.js | 7 ++- .../extra_buttons/extra_buttons.vue | 10 ++++ .../settings_modal/tabs/general_tab.js | 5 ++ .../settings_modal/tabs/general_tab.vue | 60 +++++++------------ src/components/user_profile/user_profile.js | 12 ++-- src/i18n/en.json | 4 ++ src/modules/config.js | 3 +- 7 files changed, 54 insertions(+), 47 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 4ac463e6..042a96a1 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -55,8 +55,10 @@ const ExtraButtons = { hideDeleteStatusConfirmDialog () { this.showingDeleteDialog = false }, - translateStatus () { + if (this.noTranslationTargetSet) { + this.$store.dispatch('pushGlobalNotice', { messageKey: 'toast.no_translation_target_set', level: 'info' }) + } const translateTo = this.$store.getters.mergedConfig.translationLanguage || this.$store.state.instance.interfaceLanguage this.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo }) .then(() => this.$emit('onSuccess')) @@ -120,6 +122,9 @@ const ExtraButtons = { canTranslate () { return this.$store.state.instance.translationEnabled === true }, + noTranslationTargetSet () { + return this.$store.getters.mergedConfig.translationLanguage === undefined + }, statusLink () { if (this.status.is_local) { return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}` diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index bbb140e4..b1cbe8dc 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -126,6 +126,16 @@ fixed-width icon="globe" />{{ $t("status.translate") }} + + diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index c3c18132..9fe47eaf 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -43,6 +43,11 @@ const GeneralTab = { value: mode, label: this.$t(`settings.third_column_mode_${mode}`) })), + userProfileDefaultTabOptions: ['statuses', 'replies'].map(tab => ({ + key: tab, + value: tab, + label: this.$t(`user_card.${tab}`) + })), loopSilentAvailable: // Firefox Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') || diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 72d877bd..608c73af 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -15,11 +15,6 @@ {{ $t('settings.hide_isp') }} -
  • - - {{ $t('settings.right_sidebar') }} - -
  • {{ $t('settings.hide_wallpaper') }} @@ -104,41 +99,7 @@ {{ $t('settings.virtual_scrolling') }}
  • -
  • - - {{ $t('settings.disable_sticky_headers') }} - -
  • -
  • - - {{ $t('settings.show_scrollbars') }} - -
  • -
  • - - {{ $t('settings.third_column_mode') }} - -
  • -
  • - - {{ $t('settings.minimal_scopes_mode') }} - -
  • -
  • - - {{ $t('settings.sensitive_by_default') }} - -
  • -
  • - - {{ $t('settings.sensitive_if_subject') }} - -
  • +
  • {{ $t('settings.render_mfm') }} @@ -156,6 +117,15 @@
  • +
  • + + {{ $t('settings.user_profile_default_tab') }} + +
  • +
  • + + {{ $t('settings.minimal_scopes_mode') }} + +
  • {{ $t('settings.sensitive_by_default') }}
  • +
  • + + {{ $t('settings.sensitive_if_subject') }} + +