Commit 20ccd93a authored by kaniini's avatar kaniini

about: add staff panel

parent 5db77c83
......@@ -184,6 +184,20 @@ const getAppSecret = async ({ store }) => {
})
}
const resolveStaffAccounts = async ({ store, accounts }) => {
let nicknames = accounts.map(uri => uri.split('/').pop())
const backendInteractor = store.state.api.backendInteractor
nicknames = nicknames.map(id => {
console.log('resolving staff account:', id)
return backendInteractor.fetchUser({ id })
})
nicknames = await Promise.all(nicknames)
store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames })
}
const getNodeInfo = async ({ store }) => {
try {
const res = await window.fetch('/nodeinfo/2.0.json')
......@@ -212,6 +226,9 @@ const getNodeInfo = async ({ store }) => {
const frontendVersion = window.___pleromafe_commit_hash
store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion })
store.dispatch('setInstanceOption', { name: 'tagPolicyAvailable', value: metadata.federation.mrf_policies.includes('TagPolicy') })
const accounts = metadata.staffAccounts
await resolveStaffAccounts({ store, accounts })
} else {
throw (res)
}
......
import InstanceSpecificPanel from '../instance_specific_panel/instance_specific_panel.vue'
import FeaturesPanel from '../features_panel/features_panel.vue'
import TermsOfServicePanel from '../terms_of_service_panel/terms_of_service_panel.vue'
import StaffPanel from '../staff_panel/staff_panel.vue'
const About = {
components: {
InstanceSpecificPanel,
FeaturesPanel,
TermsOfServicePanel
TermsOfServicePanel,
StaffPanel
},
computed: {
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
......
<template>
<div class="sidebar">
<instance-specific-panel v-if="showInstanceSpecificPanel" />
<staff-panel />
<terms-of-service-panel />
<features-panel v-if="showFeaturesPanel" />
</div>
......
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
const StaffPanel = {
components: {
BasicUserCard
},
computed: {
staffAccounts() {
return this.$store.state.instance.staffAccounts
}
}
}
export default StaffPanel
<template>
<div class="staff-panel">
<div class="panel panel-default base01-background">
<div class="panel-heading timeline-heading base02-background">
<div class="title">
{{ $t("about.staff") }}
</div>
</div>
<div class="panel-body">
<basic-user-card
v-for="user in staffAccounts"
:user="user"
v-bind:key="user.screen_name" />
</div>
</div>
</div>
</template>
<script src="./staff_panel.js" ></script>
<style lang="scss">
</style>
{
"about": {
"staff": "Staff"
},
"chat": {
"title": "Chat"
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment