Allow user to mark account as group

This commit is contained in:
tusooa 2023-12-27 22:30:19 -05:00
parent 6391a6a4ea
commit 0110fd86c2
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
6 changed files with 27 additions and 6 deletions

View File

@ -261,6 +261,7 @@ const getNodeInfo = async ({ store }) => {
store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits })
store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled })
store.dispatch('setInstanceOption', { name: 'quotingAvailable', value: features.includes('quote_posting') }) 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 const uploadLimits = metadata.uploadLimits
store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) }) store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) })

View File

@ -9,6 +9,7 @@ import suggestor from 'src/components/emoji_input/suggestor.js'
import Autosuggest from 'src/components/autosuggest/autosuggest.vue' import Autosuggest from 'src/components/autosuggest/autosuggest.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue' import Checkbox from 'src/components/checkbox/checkbox.vue'
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.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 BooleanSetting from '../helpers/boolean_setting.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js' import SharedComputedObject from '../helpers/shared_computed_object.js'
import localeService from 'src/services/locale/locale.service.js' import localeService from 'src/services/locale/locale.service.js'
@ -39,6 +40,7 @@ const ProfileTab = {
showRole: this.$store.state.users.currentUser.show_role, showRole: this.$store.state.users.currentUser.show_role,
role: this.$store.state.users.currentUser.role, role: this.$store.state.users.currentUser.role,
bot: this.$store.state.users.currentUser.bot, bot: this.$store.state.users.currentUser.bot,
actorType: this.$store.state.users.currentUser.actor_type,
pickAvatarBtnVisible: true, pickAvatarBtnVisible: true,
bannerUploading: false, bannerUploading: false,
backgroundUploading: false, backgroundUploading: false,
@ -57,7 +59,8 @@ const ProfileTab = {
ProgressButton, ProgressButton,
Checkbox, Checkbox,
BooleanSetting, BooleanSetting,
InterfaceLanguageSwitcher InterfaceLanguageSwitcher,
Select
}, },
computed: { computed: {
user () { user () {
@ -116,6 +119,9 @@ const ProfileTab = {
bannerImgSrc () { bannerImgSrc () {
const src = this.$store.state.users.currentUser.cover_photo const src = this.$store.state.users.currentUser.cover_photo
return (!src) ? this.defaultBanner : src return (!src) ? this.defaultBanner : src
},
availableActorTypes () {
return this.$store.state.instance.groupActorAvailable ? ['Person', 'Service', 'Group'] : ['Person', 'Service']
} }
}, },
methods: { methods: {
@ -127,7 +133,7 @@ const ProfileTab = {
/* eslint-disable camelcase */ /* eslint-disable camelcase */
display_name: this.newName, display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null), fields_attributes: this.newFields.filter(el => el != null),
bot: this.bot, actor_type: this.actorType,
show_role: this.showRole, show_role: this.showRole,
birthday: this.newBirthday || '', birthday: this.newBirthday || '',
show_birthday: this.showBirthday show_birthday: this.showBirthday

View File

@ -109,9 +109,18 @@
</button> </button>
</div> </div>
<p> <p>
<Checkbox v-model="bot"> <label>
{{ $t('settings.bot') }} {{ $t('settings.actor_type') }}
</Checkbox> <Select v-model="actorType">
<option
v-for="option in availableActorTypes"
:key="option"
:value="option"
>
{{ $t('settings.actor_type_' + option) }}
</option>
</Select>
</label>
</p> </p>
<p> <p>
<interface-language-switcher <interface-language-switcher

View File

@ -359,6 +359,10 @@
"remove_language": "Remove", "remove_language": "Remove",
"primary_language": "Primary language:", "primary_language": "Primary language:",
"fallback_language": "Fallback language {index}:", "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", "app_name": "App name",
"expert_mode": "Show advanced", "expert_mode": "Show advanced",
"save": "Save changes", "save": "Save changes",
@ -423,7 +427,6 @@
"added_backup": "Added a new backup.", "added_backup": "Added a new backup.",
"add_backup_error": "Error adding a new backup: {error}", "add_backup_error": "Error adding a new backup: {error}",
"blocks_tab": "Blocks", "blocks_tab": "Blocks",
"bot": "This is a bot account",
"btnRadius": "Buttons", "btnRadius": "Buttons",
"cBlue": "Blue (Reply, follow)", "cBlue": "Blue (Reply, follow)",
"cGreen": "Green (Retweet)", "cGreen": "Green (Retweet)",

View File

@ -137,6 +137,7 @@ const defaultState = {
suggestionsEnabled: false, suggestionsEnabled: false,
suggestionsWeb: '', suggestionsWeb: '',
quotingAvailable: false, quotingAvailable: false,
groupActorAvailable: false,
// Html stuff // Html stuff
instanceSpecificPanelContent: '', instanceSpecificPanelContent: '',

View File

@ -165,6 +165,7 @@ export const parseUser = (data) => {
output.show_role = data.source.pleroma.show_role output.show_role = data.source.pleroma.show_role
output.discoverable = data.source.pleroma.discoverable output.discoverable = data.source.pleroma.discoverable
output.show_birthday = data.pleroma.show_birthday output.show_birthday = data.pleroma.show_birthday
output.actor_type = data.source.pleroma.actor_type
} }
} }