diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..983b1f48 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "trailingComma": "none", + "singleQuote": true, + "semi": false, + "singleAttributePerLine": true +} diff --git a/src/App.js b/src/App.js index d4b3b41a..83e535b9 100644 --- a/src/App.js +++ b/src/App.js @@ -24,7 +24,9 @@ export default { components: { UserPanel, NavPanel, - Notifications: defineAsyncComponent(() => import('./components/notifications/notifications.vue')), + Notifications: defineAsyncComponent(() => + import('./components/notifications/notifications.vue') + ), InstanceSpecificPanel, FeaturesPanel, WhoToFollowPanel, @@ -44,17 +46,20 @@ export default { data: () => ({ mobileActivePanel: 'timeline' }), - created () { + created() { // Load the locale from the storage const val = this.$store.getters.mergedConfig.interfaceLanguage - this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val }) + this.$store.dispatch('setOption', { + name: 'interfaceLanguage', + value: val + }) window.addEventListener('resize', this.updateMobileState) }, - unmounted () { + unmounted() { window.removeEventListener('resize', this.updateMobileState) }, computed: { - classes () { + classes() { return [ { '-reverse': this.reverseLayout, @@ -64,48 +69,76 @@ export default { '-' + this.layoutType ] }, - currentUser () { return this.$store.state.users.currentUser }, - userBackground () { return this.currentUser.background_image }, - instanceBackground () { + currentUser() { + return this.$store.state.users.currentUser + }, + userBackground() { + return this.currentUser.background_image + }, + instanceBackground() { return this.mergedConfig.hideInstanceWallpaper ? null : this.$store.state.instance.background }, - background () { return this.userBackground || this.instanceBackground }, - bgStyle () { + background() { + return this.userBackground || this.instanceBackground + }, + bgStyle() { if (this.background) { return { '--body-background-image': `url(${this.background})` } } }, - suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled }, - showInstanceSpecificPanel () { - return this.$store.state.instance.showInstanceSpecificPanel && + suggestionsEnabled() { + return this.$store.state.instance.suggestionsEnabled + }, + showInstanceSpecificPanel() { + return ( + this.$store.state.instance.showInstanceSpecificPanel && !this.$store.getters.mergedConfig.hideISP && this.$store.state.instance.instanceSpecificPanelContent + ) }, - newPostButtonShown () { - return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile' + newPostButtonShown() { + return ( + this.$store.getters.mergedConfig.alwaysShowNewPostButton || + this.layoutType === 'mobile' + ) }, - showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, - editingAvailable () { return this.$store.state.instance.editingAvailable }, - layoutType () { return this.$store.state.interface.layoutType }, - privateMode () { return this.$store.state.instance.private }, - reverseLayout () { - const { thirdColumnMode, sidebarRight: reverseSetting } = this.$store.getters.mergedConfig + showFeaturesPanel() { + return this.$store.state.instance.showFeaturesPanel + }, + editingAvailable() { + return this.$store.state.instance.editingAvailable + }, + layoutType() { + return this.$store.state.interface.layoutType + }, + privateMode() { + return this.$store.state.instance.private + }, + reverseLayout() { + const { thirdColumnMode, sidebarRight: reverseSetting } = + this.$store.getters.mergedConfig if (this.layoutType !== 'wide') { return reverseSetting } else { - return thirdColumnMode === 'notifications' ? reverseSetting : !reverseSetting + return thirdColumnMode === 'notifications' + ? reverseSetting + : !reverseSetting } }, - noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders }, - showScrollbars () { return this.$store.getters.mergedConfig.showScrollbars }, + noSticky() { + return this.$store.getters.mergedConfig.disableStickyHeaders + }, + showScrollbars() { + return this.$store.getters.mergedConfig.showScrollbars + }, ...mapGetters(['mergedConfig']) }, methods: { - updateMobileState () { + updateMobileState() { this.$store.dispatch('setLayoutWidth', windowWidth()) this.$store.dispatch('setLayoutHeight', windowHeight()) } diff --git a/src/App.vue b/src/App.vue index 80ebb525..65b6e35b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -43,7 +43,7 @@ :to="{ name: 'login' }" class="panel-body" > - {{ $t("login.hint") }} + {{ $t('login.hint') }} diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 4bafca1d..c09403ba 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -3,13 +3,19 @@ import { createApp } from 'vue' import { createRouter, createWebHistory } from 'vue-router' import vClickOutside from 'click-outside-vue3' -import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome' +import { + FontAwesomeIcon, + FontAwesomeLayers +} from '@fortawesome/vue-fontawesome' import App from '../App.vue' import routes from './routes' import VBodyScrollLock from 'src/directives/body_scroll_lock' -import { windowWidth, windowHeight } from '../services/window_utils/window_utils' +import { + windowWidth, + windowHeight +} from '../services/window_utils/window_utils' import { getOrCreateApp, getClientToken } from '../services/new_api/oauth.js' import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js' @@ -23,7 +29,9 @@ const parsedInitialResults = () => { return null } if (!staticInitialResults) { - staticInitialResults = JSON.parse(document.getElementById('initial-results').textContent) + staticInitialResults = JSON.parse( + document.getElementById('initial-results').textContent + ) } return staticInitialResults } @@ -71,18 +79,30 @@ const getInstanceConfig = async ({ store }) => { const textlimit = data.max_toot_chars const vapidPublicKey = data.pleroma.vapid_public_key - store.dispatch('setInstanceOption', { name: 'textlimit', value: textlimit }) - store.dispatch('setInstanceOption', { name: 'accountApprovalRequired', value: data.approval_required }) + store.dispatch('setInstanceOption', { + name: 'textlimit', + value: textlimit + }) + store.dispatch('setInstanceOption', { + name: 'accountApprovalRequired', + value: data.approval_required + }) // don't override cookie if set if (!Cookies.get('userLanguage')) { - store.dispatch('setOption', { name: 'interfaceLanguage', value: resolveLanguage(data.languages) }) + store.dispatch('setOption', { + name: 'interfaceLanguage', + value: resolveLanguage(data.languages) + }) } if (vapidPublicKey) { - store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey }) + store.dispatch('setInstanceOption', { + name: 'vapidPublicKey', + value: vapidPublicKey + }) } } else { - throw (res) + throw res } } catch (error) { console.error('Could not load instance config, potentially fatal') @@ -97,10 +117,12 @@ const getBackendProvidedConfig = async ({ store }) => { const data = await res.json() return data.pleroma_fe } else { - throw (res) + throw res } } catch (error) { - console.error('Could not load backend-provided frontend config, potentially fatal') + console.error( + 'Could not load backend-provided frontend config, potentially fatal' + ) console.error(error) } } @@ -111,7 +133,7 @@ const getStaticConfig = async () => { if (res.ok) { return res.json() } else { - throw (res) + throw res } } catch (error) { console.warn('Failed to load static/config.json, continuing without it.') @@ -154,16 +176,12 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { store.dispatch('setInstanceOption', { name: 'logoMask', - value: typeof config.logoMask === 'undefined' - ? true - : config.logoMask + value: typeof config.logoMask === 'undefined' ? true : config.logoMask }) store.dispatch('setInstanceOption', { name: 'logoMargin', - value: typeof config.logoMargin === 'undefined' - ? 0 - : config.logoMargin + value: typeof config.logoMargin === 'undefined' ? 0 : config.logoMargin }) copyInstanceOption('logoLeft') store.commit('authFlow/setInitialStrategy', config.loginMethod) @@ -191,7 +209,7 @@ const getTOS = async ({ store }) => { const html = await res.text() store.dispatch('setInstanceOption', { name: 'tos', value: html }) } else { - throw (res) + throw res } } catch (e) { console.warn("Can't load TOS") @@ -204,9 +222,12 @@ const getInstancePanel = async ({ store }) => { const res = await preloadFetch('/instance/panel.html') if (res.ok) { const html = await res.text() - store.dispatch('setInstanceOption', { name: 'instanceSpecificPanelContent', value: html }) + store.dispatch('setInstanceOption', { + name: 'instanceSpecificPanelContent', + value: html + }) } else { - throw (res) + throw res } } catch (e) { console.warn("Can't load instance panel") @@ -219,25 +240,30 @@ const getStickers = async ({ store }) => { const res = await window.fetch('/static/stickers.json') if (res.ok) { const values = await res.json() - const stickers = (await Promise.all( - Object.entries(values).map(async ([name, path]) => { - const resPack = await window.fetch(path + 'pack.json') - var meta = {} - if (resPack.ok) { - meta = await resPack.json() - } - return { - pack: name, - path, - meta - } - }) - )).sort((a, b) => { + const stickers = ( + await Promise.all( + Object.entries(values).map(async ([name, path]) => { + const resPack = await window.fetch(path + 'pack.json') + var meta = {} + if (resPack.ok) { + meta = await resPack.json() + } + return { + pack: name, + path, + meta + } + }) + ) + ).sort((a, b) => { return a.meta.title.localeCompare(b.meta.title) }) - store.dispatch('setInstanceOption', { name: 'stickers', value: stickers }) + store.dispatch('setInstanceOption', { + name: 'stickers', + value: stickers + }) } else { - throw (res) + throw res } } catch (e) { console.warn("Can't load stickers") @@ -252,13 +278,19 @@ const getAppSecret = async ({ store }) => { .then((app) => getClientToken({ ...app, instance: instance.server })) .then((token) => { commit('setAppToken', token.access_token) - commit('setBackendInteractor', backendInteractorService(store.getters.getToken())) + commit( + 'setBackendInteractor', + backendInteractorService(store.getters.getToken()) + ) }) } const resolveStaffAccounts = ({ store, accounts }) => { - const nicknames = accounts.map(uri => uri.split('/').pop()) - store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames }) + const nicknames = accounts.map((uri) => uri.split('/').pop()) + store.dispatch('setInstanceOption', { + name: 'staffAccounts', + value: nicknames + }) } const getNodeInfo = async ({ store }) => { @@ -268,65 +300,137 @@ const getNodeInfo = async ({ store }) => { const data = await res.json() const metadata = data.metadata const features = metadata.features - store.dispatch('setInstanceOption', { name: 'name', value: metadata.nodeName }) - store.dispatch('setInstanceOption', { name: 'registrationOpen', value: data.openRegistrations }) - store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') }) - store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') }) - store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') }) - store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') }) - store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) - store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) - store.dispatch('setInstanceOption', { name: 'translationEnabled', value: features.includes('akkoma:machine_translation') }) + store.dispatch('setInstanceOption', { + name: 'name', + value: metadata.nodeName + }) + store.dispatch('setInstanceOption', { + name: 'registrationOpen', + value: data.openRegistrations + }) + store.dispatch('setInstanceOption', { + name: 'mediaProxyAvailable', + value: features.includes('media_proxy') + }) + store.dispatch('setInstanceOption', { + name: 'safeDM', + value: features.includes('safe_dm_mentions') + }) + store.dispatch('setInstanceOption', { + name: 'pollsAvailable', + value: features.includes('polls') + }) + store.dispatch('setInstanceOption', { + name: 'editingAvailable', + value: features.includes('editing') + }) + store.dispatch('setInstanceOption', { + name: 'pollLimits', + value: metadata.pollLimits + }) + store.dispatch('setInstanceOption', { + name: 'mailerEnabled', + value: metadata.mailerEnabled + }) + store.dispatch('setInstanceOption', { + name: 'translationEnabled', + value: features.includes('akkoma:machine_translation') + }) const uploadLimits = metadata.uploadLimits - store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) }) - store.dispatch('setInstanceOption', { name: 'avatarlimit', value: parseInt(uploadLimits.avatar) }) - store.dispatch('setInstanceOption', { name: 'backgroundlimit', value: parseInt(uploadLimits.background) }) - store.dispatch('setInstanceOption', { name: 'bannerlimit', value: parseInt(uploadLimits.banner) }) - store.dispatch('setInstanceOption', { name: 'fieldsLimits', value: metadata.fieldsLimits }) + store.dispatch('setInstanceOption', { + name: 'uploadlimit', + value: parseInt(uploadLimits.general) + }) + store.dispatch('setInstanceOption', { + name: 'avatarlimit', + value: parseInt(uploadLimits.avatar) + }) + store.dispatch('setInstanceOption', { + name: 'backgroundlimit', + value: parseInt(uploadLimits.background) + }) + store.dispatch('setInstanceOption', { + name: 'bannerlimit', + value: parseInt(uploadLimits.banner) + }) + store.dispatch('setInstanceOption', { + name: 'fieldsLimits', + value: metadata.fieldsLimits + }) - store.dispatch('setInstanceOption', { name: 'restrictedNicknames', value: metadata.restrictedNicknames }) - store.dispatch('setInstanceOption', { name: 'postFormats', value: metadata.postFormats }) + store.dispatch('setInstanceOption', { + name: 'restrictedNicknames', + value: metadata.restrictedNicknames + }) + store.dispatch('setInstanceOption', { + name: 'postFormats', + value: metadata.postFormats + }) const suggestions = metadata.suggestions - store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) - store.dispatch('setInstanceOption', { name: 'suggestionsWeb', value: suggestions.web }) + store.dispatch('setInstanceOption', { + name: 'suggestionsEnabled', + value: suggestions.enabled + }) + store.dispatch('setInstanceOption', { + name: 'suggestionsWeb', + value: suggestions.web + }) const software = data.software - store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version }) - store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: software.name === 'pleroma' }) + store.dispatch('setInstanceOption', { + name: 'backendVersion', + value: software.version + }) + store.dispatch('setInstanceOption', { + name: 'pleromaBackend', + value: software.name === 'pleroma' + }) const priv = metadata.private store.dispatch('setInstanceOption', { name: 'private', value: priv }) const frontendVersion = window.___pleromafe_commit_hash - store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion }) + store.dispatch('setInstanceOption', { + name: 'frontendVersion', + value: frontendVersion + }) const federation = metadata.federation store.dispatch('setInstanceOption', { name: 'tagPolicyAvailable', - value: typeof federation.mrf_policies === 'undefined' - ? false - : metadata.federation.mrf_policies.includes('TagPolicy') + value: + typeof federation.mrf_policies === 'undefined' + ? false + : metadata.federation.mrf_policies.includes('TagPolicy') }) - store.dispatch('setInstanceOption', { name: 'federationPolicy', value: federation }) - store.dispatch('setInstanceOption', { name: 'localBubbleInstances', value: metadata.localBubbleInstances }) + store.dispatch('setInstanceOption', { + name: 'federationPolicy', + value: federation + }) + store.dispatch('setInstanceOption', { + name: 'localBubbleInstances', + value: metadata.localBubbleInstances + }) store.dispatch('setInstanceOption', { name: 'federating', - value: typeof federation.enabled === 'undefined' - ? true - : federation.enabled + value: + typeof federation.enabled === 'undefined' ? true : federation.enabled }) const accountActivationRequired = metadata.accountActivationRequired - store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired }) + store.dispatch('setInstanceOption', { + name: 'accountActivationRequired', + value: accountActivationRequired + }) const accounts = metadata.staffAccounts resolveStaffAccounts({ store, accounts }) } else { - throw (res) + throw res } } catch (e) { console.warn('Could not load nodeinfo') @@ -336,11 +440,16 @@ const getNodeInfo = async ({ store }) => { const setConfig = async ({ store }) => { // apiConfig, staticConfig - const configInfos = await Promise.all([getBackendProvidedConfig({ store }), getStaticConfig()]) + const configInfos = await Promise.all([ + getBackendProvidedConfig({ store }), + getStaticConfig() + ]) const apiConfig = configInfos[0] const staticConfig = configInfos[1] - await setSettings({ store, apiConfig, staticConfig }).then(getAppSecret({ store })) + await setSettings({ store, apiConfig, staticConfig }).then( + getAppSecret({ store }) + ) } const checkOAuthToken = async ({ store }) => { @@ -363,7 +472,10 @@ const afterStoreSetup = async ({ store, i18n }) => { FaviconService.initFaviconService() const overrides = window.___pleromafe_dev_overrides || {} - const server = (typeof overrides.target !== 'undefined') ? overrides.target : window.location.origin + const server = + typeof overrides.target !== 'undefined' + ? overrides.target + : window.location.origin store.dispatch('setInstanceOption', { name: 'server', value: server }) await setConfig({ store }) @@ -373,7 +485,10 @@ const afterStoreSetup = async ({ store, i18n }) => { const customThemePresent = customThemeSource || customTheme if (customThemePresent) { - if (customThemeSource && customThemeSource.themeEngineVersion === CURRENT_VERSION) { + if ( + customThemeSource && + customThemeSource.themeEngineVersion === CURRENT_VERSION + ) { applyTheme(customThemeSource) } else { applyTheme(customTheme) @@ -404,7 +519,7 @@ const afterStoreSetup = async ({ store, i18n }) => { history: createWebHistory(), routes: routes(store), scrollBehavior: (to, _from, savedPosition) => { - if (to.matched.some(m => m.meta.dontScroll)) { + if (to.matched.some((m) => m.meta.dontScroll)) { return {} } diff --git a/src/boot/routes.js b/src/boot/routes.js index 93a94a9b..e2294663 100644 --- a/src/boot/routes.js +++ b/src/boot/routes.js @@ -35,51 +35,145 @@ export default (store) => { } let routes = [ - { name: 'root', + { + name: 'root', path: '/', - redirect: _to => { - return (store.state.users.currentUser - ? store.state.instance.redirectRootLogin - : store.state.instance.redirectRootNoLogin) || '/main/all' + redirect: (_to) => { + return ( + (store.state.users.currentUser + ? store.state.instance.redirectRootLogin + : store.state.instance.redirectRootNoLogin) || '/main/all' + ) } }, - { name: 'public-external-timeline', path: '/main/all', component: PublicAndExternalTimeline }, - { name: 'public-timeline', path: '/main/public', component: PublicTimeline }, - { name: 'bubble-timeline', path: '/main/bubble', component: BubbleTimeline }, - { name: 'friends', path: '/main/friends', component: FriendsTimeline, beforeEnter: validateAuthenticatedRoute }, + { + name: 'public-external-timeline', + path: '/main/all', + component: PublicAndExternalTimeline + }, + { + name: 'public-timeline', + path: '/main/public', + component: PublicTimeline + }, + { + name: 'bubble-timeline', + path: '/main/bubble', + component: BubbleTimeline + }, + { + name: 'friends', + path: '/main/friends', + component: FriendsTimeline, + beforeEnter: validateAuthenticatedRoute + }, { name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline }, { name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline }, - { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } }, - { name: 'remote-user-profile-acct', + { + name: 'conversation', + path: '/notice/:id', + component: ConversationPage, + meta: { dontScroll: true } + }, + { + name: 'remote-user-profile-acct', path: '/remote-users/:_(@)?:username([^/@]+)@:hostname([^/@]+)', component: RemoteUserResolver, beforeEnter: validateAuthenticatedRoute }, - { name: 'remote-user-profile', + { + name: 'remote-user-profile', path: '/remote-users/:hostname/:username', component: RemoteUserResolver, beforeEnter: validateAuthenticatedRoute }, - { name: 'external-user-profile', path: '/users/:id', component: UserProfile, meta: { dontScroll: true } }, - { name: 'interactions', path: '/users/:username/interactions', component: Interactions, beforeEnter: validateAuthenticatedRoute }, - { name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute }, + { + name: 'external-user-profile', + path: '/users/:id', + component: UserProfile, + meta: { dontScroll: true } + }, + { + name: 'interactions', + path: '/users/:username/interactions', + component: Interactions, + beforeEnter: validateAuthenticatedRoute + }, + { + name: 'dms', + path: '/users/:username/dms', + component: DMs, + beforeEnter: validateAuthenticatedRoute + }, { name: 'registration', path: '/registration', component: Registration }, - { name: 'registration-request-sent', path: '/registration-request-sent', component: RegistrationRequestSent }, - { name: 'awaiting-email-confirmation', path: '/awaiting-email-confirmation', component: AwaitingEmailConfirmation }, - { name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true }, - { name: 'registration-token', path: '/registration/:token', component: Registration }, - { name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute }, - { name: 'notifications', path: '/:username/notifications', component: Notifications, props: () => ({ disableTeleport: true }), beforeEnter: validateAuthenticatedRoute }, + { + name: 'registration-request-sent', + path: '/registration-request-sent', + component: RegistrationRequestSent + }, + { + name: 'awaiting-email-confirmation', + path: '/awaiting-email-confirmation', + component: AwaitingEmailConfirmation + }, + { + name: 'password-reset', + path: '/password-reset', + component: PasswordReset, + props: true + }, + { + name: 'registration-token', + path: '/registration/:token', + component: Registration + }, + { + name: 'friend-requests', + path: '/friend-requests', + component: FollowRequests, + beforeEnter: validateAuthenticatedRoute + }, + { + name: 'notifications', + path: '/:username/notifications', + component: Notifications, + props: () => ({ disableTeleport: true }), + beforeEnter: validateAuthenticatedRoute + }, { name: 'login', path: '/login', component: AuthForm }, - { name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) }, - { name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) }, - { name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute }, + { + name: 'oauth-callback', + path: '/oauth-callback', + component: OAuthCallback, + props: (route) => ({ code: route.query.code }) + }, + { + name: 'search', + path: '/search', + component: Search, + props: (route) => ({ query: route.query.query }) + }, + { + name: 'who-to-follow', + path: '/who-to-follow', + component: WhoToFollow, + beforeEnter: validateAuthenticatedRoute + }, { name: 'about', path: '/about', component: About }, { name: 'lists', path: '/lists', component: Lists }, { name: 'list-timeline', path: '/lists/:id', component: ListTimeline }, { name: 'list-edit', path: '/lists/:id/edit', component: ListEdit }, - { name: 'announcements', path: '/announcements', component: AnnouncementsPage }, - { name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile, meta: { dontScroll: true } } + { + name: 'announcements', + path: '/announcements', + component: AnnouncementsPage + }, + { + name: 'user-profile', + path: '/:_(users)?/:name', + component: UserProfile, + meta: { dontScroll: true } + } ] return routes diff --git a/src/components/about/about.js b/src/components/about/about.js index 7998c2d3..c8bc9f51 100644 --- a/src/components/about/about.js +++ b/src/components/about/about.js @@ -15,13 +15,17 @@ const About = { LocalBubblePanel }, computed: { - showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, - showInstanceSpecificPanel () { - return this.$store.state.instance.showInstanceSpecificPanel && + showFeaturesPanel() { + return this.$store.state.instance.showFeaturesPanel + }, + showInstanceSpecificPanel() { + return ( + this.$store.state.instance.showInstanceSpecificPanel && !this.$store.getters.mergedConfig.hideISP && this.$store.state.instance.instanceSpecificPanelContent + ) }, - showLocalBubblePanel () { + showLocalBubblePanel() { return this.$store.state.instance.localBubbleInstances.length > 0 } } diff --git a/src/components/about/about.vue b/src/components/about/about.vue index df9bb196..9126b3ff 100644 --- a/src/components/about/about.vue +++ b/src/components/about/about.vue @@ -9,7 +9,6 @@ - + - + diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 0f348474..92b8679f 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -3,19 +3,13 @@ import Popover from '../popover/popover.vue' import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { mapState } from 'vuex' -import { - faEllipsisV -} from '@fortawesome/free-solid-svg-icons' +import { faEllipsisV } from '@fortawesome/free-solid-svg-icons' -library.add( - faEllipsisV -) +library.add(faEllipsisV) const AccountActions = { - props: [ - 'user', 'relationship' - ], - data () { + props: ['user', 'relationship'], + data() { return { showingConfirmBlock: false } @@ -26,56 +20,59 @@ const AccountActions = { ConfirmModal }, methods: { - refetchRelationship () { + refetchRelationship() { return this.$store.dispatch('fetchUserRelationship', this.user.id) }, - showConfirmBlock () { + showConfirmBlock() { this.showingConfirmBlock = true }, - hideConfirmBlock () { + hideConfirmBlock() { this.showingConfirmBlock = false }, - showRepeats () { + showRepeats() { this.$store.dispatch('showReblogs', this.user.id) }, - hideRepeats () { + hideRepeats() { this.$store.dispatch('hideReblogs', this.user.id) }, - blockUser () { + blockUser() { if (!this.shouldConfirmBlock) { this.doBlockUser() } else { this.showConfirmBlock() } }, - doBlockUser () { + doBlockUser() { this.$store.dispatch('blockUser', this.user.id) this.hideConfirmBlock() }, - unblockUser () { + unblockUser() { this.$store.dispatch('unblockUser', this.user.id) }, - removeUserFromFollowers () { + removeUserFromFollowers() { this.$store.dispatch('removeUserFromFollowers', this.user.id) }, - reportUser () { + reportUser() { this.$store.dispatch('openUserReportingModal', { userId: this.user.id }) }, - muteDomain () { - this.$store.dispatch('muteDomain', this.user.screen_name.split('@')[1]) + muteDomain() { + this.$store + .dispatch('muteDomain', this.user.screen_name.split('@')[1]) .then(() => this.refetchRelationship()) }, - unmuteDomain () { - this.$store.dispatch('unmuteDomain', this.user.screen_name.split('@')[1]) + unmuteDomain() { + this.$store + .dispatch('unmuteDomain', this.user.screen_name.split('@')[1]) .then(() => this.refetchRelationship()) } }, computed: { - shouldConfirmBlock () { + shouldConfirmBlock() { return this.$store.getters.mergedConfig.modalOnBlock }, ...mapState({ - pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable + pleromaChatMessagesAvailable: (state) => + state.instance.pleromaChatMessagesAvailable }) } } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 126f6fa9..1ad96c7f 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -6,7 +6,7 @@ :bound-to="{ x: 'container' }" remove-padding > -