logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 0110fd86c2f166de5be8d675ffa34ab815463b2d
parent 6391a6a4ead068455a5b23d7d11ce0cdf2ec87ea
Author: tusooa <tusooa@kazv.moe>
Date:   Wed, 27 Dec 2023 22:30:19 -0500

Allow user to mark account as group

Diffstat:

Msrc/boot/after_store.js1+
Msrc/components/settings_modal/tabs/profile_tab.js10++++++++--
Msrc/components/settings_modal/tabs/profile_tab.vue15++++++++++++---
Msrc/i18n/en.json5++++-
Msrc/modules/instance.js1+
Msrc/services/entity_normalizer/entity_normalizer.service.js1+
6 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/src/boot/after_store.js b/src/boot/after_store.js @@ -261,6 +261,7 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) store.dispatch('setInstanceOption', { name: 'quotingAvailable', value: features.includes('quote_posting') }) + store.dispatch('setInstanceOption', { name: 'groupActorAvailable', value: features.includes('pleroma:group_actors') }) const uploadLimits = metadata.uploadLimits store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) }) diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js @@ -9,6 +9,7 @@ import suggestor from 'src/components/emoji_input/suggestor.js' import Autosuggest from 'src/components/autosuggest/autosuggest.vue' import Checkbox from 'src/components/checkbox/checkbox.vue' import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue' +import Select from 'src/components/select/select.vue' import BooleanSetting from '../helpers/boolean_setting.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import localeService from 'src/services/locale/locale.service.js' @@ -39,6 +40,7 @@ const ProfileTab = { showRole: this.$store.state.users.currentUser.show_role, role: this.$store.state.users.currentUser.role, bot: this.$store.state.users.currentUser.bot, + actorType: this.$store.state.users.currentUser.actor_type, pickAvatarBtnVisible: true, bannerUploading: false, backgroundUploading: false, @@ -57,7 +59,8 @@ const ProfileTab = { ProgressButton, Checkbox, BooleanSetting, - InterfaceLanguageSwitcher + InterfaceLanguageSwitcher, + Select }, computed: { user () { @@ -116,6 +119,9 @@ const ProfileTab = { bannerImgSrc () { const src = this.$store.state.users.currentUser.cover_photo return (!src) ? this.defaultBanner : src + }, + availableActorTypes () { + return this.$store.state.instance.groupActorAvailable ? ['Person', 'Service', 'Group'] : ['Person', 'Service'] } }, methods: { @@ -127,7 +133,7 @@ const ProfileTab = { /* eslint-disable camelcase */ display_name: this.newName, fields_attributes: this.newFields.filter(el => el != null), - bot: this.bot, + actor_type: this.actorType, show_role: this.showRole, birthday: this.newBirthday || '', show_birthday: this.showBirthday diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue @@ -109,9 +109,18 @@ </button> </div> <p> - <Checkbox v-model="bot"> - {{ $t('settings.bot') }} - </Checkbox> + <label> + {{ $t('settings.actor_type') }} + <Select v-model="actorType"> + <option + v-for="option in availableActorTypes" + :key="option" + :value="option" + > + {{ $t('settings.actor_type_' + option) }} + </option> + </Select> + </label> </p> <p> <interface-language-switcher diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -359,6 +359,10 @@ "remove_language": "Remove", "primary_language": "Primary language:", "fallback_language": "Fallback language {index}:", + "actor_type": "This account is:", + "actor_type_Person": "a normal user", + "actor_type_Service": "a bot", + "actor_type_Group": "a group", "app_name": "App name", "expert_mode": "Show advanced", "save": "Save changes", @@ -423,7 +427,6 @@ "added_backup": "Added a new backup.", "add_backup_error": "Error adding a new backup: {error}", "blocks_tab": "Blocks", - "bot": "This is a bot account", "btnRadius": "Buttons", "cBlue": "Blue (Reply, follow)", "cGreen": "Green (Retweet)", diff --git a/src/modules/instance.js b/src/modules/instance.js @@ -137,6 +137,7 @@ const defaultState = { suggestionsEnabled: false, suggestionsWeb: '', quotingAvailable: false, + groupActorAvailable: false, // Html stuff instanceSpecificPanelContent: '', diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js @@ -165,6 +165,7 @@ export const parseUser = (data) => { output.show_role = data.source.pleroma.show_role output.discoverable = data.source.pleroma.discoverable output.show_birthday = data.pleroma.show_birthday + output.actor_type = data.source.pleroma.actor_type } }