aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boot/after_store.js17
-rw-r--r--src/components/about/about.js4
-rw-r--r--src/components/about/about.vue1
-rw-r--r--src/components/staff_panel/staff_panel.js15
-rw-r--r--src/components/staff_panel/staff_panel.vue22
-rw-r--r--src/i18n/en.json3
6 files changed, 61 insertions, 1 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 80a55849..e96baaf0 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -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)
}
diff --git a/src/components/about/about.js b/src/components/about/about.js
index 92856b21..5c95c079 100644
--- a/src/components/about/about.js
+++ b/src/components/about/about.js
@@ -1,12 +1,14 @@
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 },
diff --git a/src/components/about/about.vue b/src/components/about/about.vue
index 10dad4bb..ad520d11 100644
--- a/src/components/about/about.vue
+++ b/src/components/about/about.vue
@@ -1,6 +1,7 @@
<template>
<div class="sidebar">
<instance-specific-panel v-if="showInstanceSpecificPanel" />
+ <staff-panel />
<terms-of-service-panel />
<features-panel v-if="showFeaturesPanel" />
</div>
diff --git a/src/components/staff_panel/staff_panel.js b/src/components/staff_panel/staff_panel.js
new file mode 100644
index 00000000..b4d23079
--- /dev/null
+++ b/src/components/staff_panel/staff_panel.js
@@ -0,0 +1,15 @@
+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
+
diff --git a/src/components/staff_panel/staff_panel.vue b/src/components/staff_panel/staff_panel.vue
new file mode 100644
index 00000000..a74872d2
--- /dev/null
+++ b/src/components/staff_panel/staff_panel.vue
@@ -0,0 +1,22 @@
+<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>
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 483432ff..4cd66177 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -1,4 +1,7 @@
{
+ "about": {
+ "staff": "Staff"
+ },
"chat": {
"title": "Chat"
},