diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 694b77f9..6c83a123 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,32 +3,10 @@ # https://hub.docker.com/r/library/node/tags/ image: node:7 -before_script: - # Install ssh-agent if not already installed, it is required by Docker. - # (change apt-get to yum if you use a CentOS-based image) - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - # Run ssh-agent (inside the build environment) - - eval $(ssh-agent -s) - - # For Docker builds disable host key checking. Be aware that by adding that - # you are suspectible to man-in-the-middle attacks. - # WARNING: Use this only with the Docker executor, if you use it with shell - # you will overwrite your user's SSH config. - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - -# This folder is cached between builds -# http://docs.gitlab.com/ce/ci/yaml/README.html#cache -#cache: -# paths: -# - node_modules/ - stages: - lint - build - test - - deploy lint: stage: lint @@ -50,14 +28,3 @@ build: artifacts: paths: - dist/ - -deploy: - stage: deploy - environment: dev - only: - - develop - script: - - yarn - - npm run build - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - scp -r dist/* pleroma@tenshi.heldscal.la:~/pleroma diff --git a/README.md b/README.md index 5a3e2a4b..b6e5a586 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,9 @@ npm run unit # Configuration Edit config.json for configuration. scopeOptionsEnabled gives you input fields for CWs and the scope settings. + +## Options + +### Login methods + +```loginMethod``` can be set to either ```password``` (the default) or ```token```, which will use the full oauth redirection flow, which is useful for SSO situations. diff --git a/src/App.js b/src/App.js index b06e8b5d..89aed01d 100644 --- a/src/App.js +++ b/src/App.js @@ -78,6 +78,7 @@ export default { window.scrollTo(0, 0) }, logout () { + this.$router.replace('/main/public') this.$store.dispatch('logout') } } diff --git a/src/boot/after_store.js b/src/boot/after_store.js new file mode 100644 index 00000000..ea5d4ecd --- /dev/null +++ b/src/boot/after_store.js @@ -0,0 +1,184 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' + +import App from '../App.vue' +import PublicTimeline from '../components/public_timeline/public_timeline.vue' +import PublicAndExternalTimeline from '../components/public_and_external_timeline/public_and_external_timeline.vue' +import FriendsTimeline from '../components/friends_timeline/friends_timeline.vue' +import TagTimeline from '../components/tag_timeline/tag_timeline.vue' +import ConversationPage from '../components/conversation-page/conversation-page.vue' +import Mentions from '../components/mentions/mentions.vue' +import DMs from '../components/dm_timeline/dm_timeline.vue' +import UserProfile from '../components/user_profile/user_profile.vue' +import Settings from '../components/settings/settings.vue' +import Registration from '../components/registration/registration.vue' +import UserSettings from '../components/user_settings/user_settings.vue' +import FollowRequests from '../components/follow_requests/follow_requests.vue' +import OAuthCallback from '../components/oauth_callback/oauth_callback.vue' +import UserSearch from '../components/user_search/user_search.vue' + +const afterStoreSetup = ({store, i18n}) => { + window.fetch('/api/statusnet/config.json') + .then((res) => res.json()) + .then((data) => { + const {name, closed: registrationClosed, textlimit, server} = data.site + + store.dispatch('setInstanceOption', { name: 'name', value: name }) + store.dispatch('setInstanceOption', { name: 'registrationOpen', value: (registrationClosed === '0') }) + store.dispatch('setInstanceOption', { name: 'textlimit', value: parseInt(textlimit) }) + store.dispatch('setInstanceOption', { name: 'server', value: server }) + + var apiConfig = data.site.pleromafe + + window.fetch('/static/config.json') + .then((res) => res.json()) + .catch((err) => { + console.warn('Failed to load static/config.json, continuing without it.') + console.warn(err) + return {} + }) + .then((staticConfig) => { + // This takes static config and overrides properties that are present in apiConfig + var config = Object.assign({}, staticConfig, apiConfig) + + var theme = (config.theme) + var background = (config.background) + var hidePostStats = (config.hidePostStats) + var hideUserStats = (config.hideUserStats) + var logo = (config.logo) + var logoMask = (typeof config.logoMask === 'undefined' ? true : config.logoMask) + var logoMargin = (typeof config.logoMargin === 'undefined' ? 0 : config.logoMargin) + var redirectRootNoLogin = (config.redirectRootNoLogin) + var redirectRootLogin = (config.redirectRootLogin) + var chatDisabled = (config.chatDisabled) + var showInstanceSpecificPanel = (config.showInstanceSpecificPanel) + var scopeOptionsEnabled = (config.scopeOptionsEnabled) + var formattingOptionsEnabled = (config.formattingOptionsEnabled) + var collapseMessageWithSubject = (config.collapseMessageWithSubject) + var loginMethod = (config.loginMethod) + var scopeCopy = (config.scopeCopy) + var subjectLineBehavior = (config.subjectLineBehavior) + + store.dispatch('setInstanceOption', { name: 'theme', value: theme }) + store.dispatch('setInstanceOption', { name: 'background', value: background }) + store.dispatch('setInstanceOption', { name: 'hidePostStats', value: hidePostStats }) + store.dispatch('setInstanceOption', { name: 'hideUserStats', value: hideUserStats }) + store.dispatch('setInstanceOption', { name: 'logo', value: logo }) + store.dispatch('setInstanceOption', { name: 'logoMask', value: logoMask }) + store.dispatch('setInstanceOption', { name: 'logoMargin', value: logoMargin }) + store.dispatch('setInstanceOption', { name: 'redirectRootNoLogin', value: redirectRootNoLogin }) + store.dispatch('setInstanceOption', { name: 'redirectRootLogin', value: redirectRootLogin }) + store.dispatch('setInstanceOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) + store.dispatch('setInstanceOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) + store.dispatch('setInstanceOption', { name: 'formattingOptionsEnabled', value: formattingOptionsEnabled }) + store.dispatch('setInstanceOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject }) + store.dispatch('setInstanceOption', { name: 'loginMethod', value: loginMethod }) + store.dispatch('setInstanceOption', { name: 'scopeCopy', value: scopeCopy }) + store.dispatch('setInstanceOption', { name: 'subjectLineBehavior', value: subjectLineBehavior }) + if (chatDisabled) { + store.dispatch('disableChat') + } + + const routes = [ + { name: 'root', + path: '/', + redirect: to => { + return (store.state.users.currentUser + ? store.state.instance.redirectRootLogin + : store.state.instance.redirectRootNoLogin) || '/main/all' + }}, + { path: '/main/all', component: PublicAndExternalTimeline }, + { path: '/main/public', component: PublicTimeline }, + { path: '/main/friends', component: FriendsTimeline }, + { path: '/tag/:tag', component: TagTimeline }, + { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } }, + { name: 'user-profile', path: '/users/:id', component: UserProfile }, + { name: 'mentions', path: '/:username/mentions', component: Mentions }, + { name: 'dms', path: '/:username/dms', component: DMs }, + { name: 'settings', path: '/settings', component: Settings }, + { name: 'registration', path: '/registration', component: Registration }, + { name: 'registration', path: '/registration/:token', component: Registration }, + { name: 'friend-requests', path: '/friend-requests', component: FollowRequests }, + { name: 'user-settings', path: '/user-settings', component: UserSettings }, + { name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) }, + { name: 'user-search', path: '/user-search', component: UserSearch, props: (route) => ({ query: route.query.query }) } + ] + + const router = new VueRouter({ + mode: 'history', + routes, + scrollBehavior: (to, from, savedPosition) => { + if (to.matched.some(m => m.meta.dontScroll)) { + return false + } + return savedPosition || { x: 0, y: 0 } + } + }) + + /* eslint-disable no-new */ + new Vue({ + router, + store, + i18n, + el: '#app', + render: h => h(App) + }) + }) + }) + + window.fetch('/static/terms-of-service.html') + .then((res) => res.text()) + .then((html) => { + store.dispatch('setInstanceOption', { name: 'tos', value: html }) + }) + + window.fetch('/api/pleroma/emoji.json') + .then( + (res) => res.json() + .then( + (values) => { + const emoji = Object.keys(values).map((key) => { + return { shortcode: key, image_url: values[key] } + }) + store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji }) + store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true }) + }, + (failure) => { + store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: false }) + } + ), + (error) => console.log(error) + ) + + window.fetch('/static/emoji.json') + .then((res) => res.json()) + .then((values) => { + const emoji = Object.keys(values).map((key) => { + return { shortcode: key, image_url: false, 'utf': values[key] } + }) + store.dispatch('setInstanceOption', { name: 'emoji', value: emoji }) + }) + + window.fetch('/instance/panel.html') + .then((res) => res.text()) + .then((html) => { + store.dispatch('setInstanceOption', { name: 'instanceSpecificPanelContent', value: html }) + }) + + window.fetch('/nodeinfo/2.0.json') + .then((res) => res.json()) + .then((data) => { + const metadata = data.metadata + + const features = metadata.features + store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') }) + store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') }) + store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) + + const suggestions = metadata.suggestions + store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) + store.dispatch('setInstanceOption', { name: 'suggestionsWeb', value: suggestions.web }) + }) +} + +export default afterStoreSetup diff --git a/src/components/dm_timeline/dm_timeline.js b/src/components/dm_timeline/dm_timeline.js new file mode 100644 index 00000000..8b5393a9 --- /dev/null +++ b/src/components/dm_timeline/dm_timeline.js @@ -0,0 +1,14 @@ +import Timeline from '../timeline/timeline.vue' + +const DMs = { + computed: { + timeline () { + return this.$store.state.statuses.timelines.dms + } + }, + components: { + Timeline + } +} + +export default DMs diff --git a/src/components/dm_timeline/dm_timeline.vue b/src/components/dm_timeline/dm_timeline.vue new file mode 100644 index 00000000..f03da4d3 --- /dev/null +++ b/src/components/dm_timeline/dm_timeline.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index 1266be90..a2b4cb65 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -2,6 +2,9 @@ const FavoriteButton = { props: ['status', 'loggedIn'], data () { return { + hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined' + ? this.$store.state.instance.hidePostStats + : this.$store.state.config.hidePostStats, animated: false } }, diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index 1e1a6970..71cb875e 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -1,11 +1,11 @@ diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index 4405fb92..49868aed 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -1,22 +1,40 @@ +import oauthApi from '../../services/new_api/oauth.js' const LoginForm = { data: () => ({ user: {}, authError: false }), computed: { + loginMethod () { return this.$store.state.instance.loginMethod }, loggingIn () { return this.$store.state.users.loggingIn }, registrationOpen () { return this.$store.state.instance.registrationOpen } }, methods: { + oAuthLogin () { + oauthApi.login({ + oauth: this.$store.state.oauth, + instance: this.$store.state.instance.server, + commit: this.$store.commit + }) + }, submit () { - this.$store.dispatch('loginUser', this.user).then( - () => {}, - (error) => { - this.authError = error - this.user.username = '' - this.user.password = '' - } - ) + const data = { + oauth: this.$store.state.oauth, + instance: this.$store.state.instance.server + } + oauthApi.getOrCreateApp(data).then((app) => { + oauthApi.getTokenWithCredentials( + { + app, + instance: data.instance, + username: this.user.username, + password: this.user.password}) + .then((result) => { + this.$store.commit('setToken', result.access_token) + this.$store.dispatch('loginUser', result.access_token) + this.$router.push('/main/friends') + }) + }) } } } diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue index b7fed48a..12971882 100644 --- a/src/components/login_form/login_form.vue +++ b/src/components/login_form/login_form.vue @@ -5,7 +5,7 @@ {{$t('login.login')}}
-
+
@@ -20,8 +20,17 @@
-
-
{{authError}}
+ + +
+
+

{{$t('login.description')}}

+
+
+
diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 0b188f9a..93deaf97 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -12,6 +12,11 @@ {{ $t("nav.mentions") }} +
  • + + {{ $t("nav.dms") }} + +
  • {{ $t("nav.friend_requests") }} diff --git a/src/components/oauth_callback/oauth_callback.js b/src/components/oauth_callback/oauth_callback.js new file mode 100644 index 00000000..7a5132ad --- /dev/null +++ b/src/components/oauth_callback/oauth_callback.js @@ -0,0 +1,20 @@ +import oauth from '../../services/new_api/oauth.js' + +const oac = { + props: ['code'], + mounted () { + if (this.code) { + oauth.getToken({ + app: this.$store.state.oauth, + instance: this.$store.state.instance.server, + code: this.code + }).then((result) => { + this.$store.commit('setToken', result.access_token) + this.$store.dispatch('loginUser', result.access_token) + this.$router.push('/main/friends') + }) + } + } +} + +export default oac diff --git a/src/components/oauth_callback/oauth_callback.vue b/src/components/oauth_callback/oauth_callback.vue new file mode 100644 index 00000000..9c806916 --- /dev/null +++ b/src/components/oauth_callback/oauth_callback.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index a84e764c..fa86ee59 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -24,7 +24,7 @@ const PostStatusForm = { 'replyTo', 'repliedUser', 'attentions', - 'messageScope', + 'copyMessageScope', 'subject' ], components: { @@ -46,6 +46,10 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } + const scope = (this.copyMessageScope && this.$store.state.config.copyScope || this.copyMessageScope === 'direct') + ? this.copyMessageScope + : this.$store.state.users.currentUser.default_scope + return { dropFiles: [], submitDisabled: false, @@ -53,12 +57,12 @@ const PostStatusForm = { posting: false, highlighted: 0, newStatus: { - spoilerText: this.subject, + spoilerText: this.subject || '', status: statusText, contentType: 'text/plain', nsfw: false, files: [], - visibility: this.messageScope || this.$store.state.users.currentUser.default_scope + visibility: scope }, caret: 0 } @@ -128,6 +132,9 @@ const PostStatusForm = { statusLength () { return this.newStatus.status.length }, + spoilerTextLength () { + return this.newStatus.spoilerText.length + }, statusLengthLimit () { return this.$store.state.instance.textlimit }, @@ -135,10 +142,10 @@ const PostStatusForm = { return this.statusLengthLimit > 0 }, charactersLeft () { - return this.statusLengthLimit - this.statusLength + return this.statusLengthLimit - (this.statusLength + this.spoilerTextLength) }, isOverLengthLimit () { - return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit) + return this.hasStatusLengthLimit && (this.charactersLeft < 0) }, scopeOptionsEnabled () { return this.$store.state.instance.scopeOptionsEnabled @@ -223,6 +230,7 @@ const PostStatusForm = { if (!data.error) { this.newStatus = { status: '', + spoilerText: '', files: [], visibility: newStatus.visibility, contentType: newStatus.contentType diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index 8f59878d..f7f8a720 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -1,3 +1,5 @@ +import oauthApi from '../../services/new_api/oauth.js' + const registration = { data: () => ({ user: {}, @@ -25,9 +27,23 @@ const registration = { this.$store.state.api.backendInteractor.register(this.user).then( (response) => { if (response.ok) { - this.$store.dispatch('loginUser', this.user) - this.$router.push('/main/all') - this.registering = false + const data = { + oauth: this.$store.state.oauth, + instance: this.$store.state.instance.server + } + oauthApi.getOrCreateApp(data).then((app) => { + oauthApi.getTokenWithCredentials( + { + app, + instance: data.instance, + username: this.user.username, + password: this.user.password}) + .then((result) => { + this.$store.commit('setToken', result.access_token) + this.$store.dispatch('loginUser', result.access_token) + this.$router.push('/main/friends') + }) + }) } else { this.registering = false response.json().then((data) => { diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index cafa9cbc..eb4e4b41 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -2,6 +2,9 @@ const RetweetButton = { props: ['status', 'loggedIn', 'visibility'], data () { return { + hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined' + ? this.$store.state.instance.hidePostStats + : this.$store.state.config.hidePostStats, animated: false } }, diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index ee5722bd..5b1e64b8 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -2,7 +2,7 @@
    diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index a24bc265..910eea63 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -13,6 +13,14 @@ const settings = { hideAttachmentsLocal: user.hideAttachments, hideAttachmentsInConvLocal: user.hideAttachmentsInConv, hideNsfwLocal: user.hideNsfw, + hidePostStatsLocal: typeof user.hidePostStats === 'undefined' + ? instance.hidePostStats + : user.hidePostStats, + hidePostStatsDefault: this.$t('settings.values.' + instance.hidePostStats), + hideUserStatsLocal: typeof user.hideUserStats === 'undefined' + ? instance.hideUserStats + : user.hideUserStats, + hideUserStatsDefault: this.$t('settings.values.' + instance.hideUserStats), notificationVisibilityLocal: user.notificationVisibility, replyVisibilityLocal: user.replyVisibility, loopVideoLocal: user.loopVideo, @@ -26,6 +34,12 @@ const settings = { ? instance.collapseMessageWithSubject : user.collapseMessageWithSubject, collapseMessageWithSubjectDefault: this.$t('settings.values.' + instance.collapseMessageWithSubject), + subjectLineBehaviorLocal: typeof user.subjectLineBehavior === 'undefined' + ? instance.subjectLineBehavior + : user.subjectLineBehavior, + subjectLineBehaviorDefault: instance.subjectLineBehavior, + scopeCopyLocal: user.scopeCopy, + scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy), stopGifs: user.stopGifs, loopSilentAvailable: // Firefox @@ -56,6 +70,12 @@ const settings = { hideAttachmentsInConvLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value }) }, + hidePostStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hidePostStats', value }) + }, + hideUserStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hideUserStats', value }) + }, hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, @@ -99,6 +119,12 @@ const settings = { collapseMessageWithSubjectLocal (value) { this.$store.dispatch('setOption', { name: 'collapseMessageWithSubject', value }) }, + scopeCopyLocal (value) { + this.$store.dispatch('setOption', { name: 'scopeCopy', value }) + }, + subjectLineBehaviorLocal (value) { + this.$store.dispatch('setOption', { name: 'subjectLineBehavior', value }) + }, stopGifs (value) { this.$store.dispatch('setOption', { name: 'stopGifs', value }) } diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 2097fd22..7a955203 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -54,6 +54,41 @@
  • + +
    +

    {{$t('settings.composing')}}

    + +
    +

    {{$t('settings.attachments')}}

    +
    + + +
    +
    + + +

    {{$t('settings.filtering_explanation')}}

    diff --git a/src/components/status/status.js b/src/components/status/status.js index 45f5ccac..10716583 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -31,10 +31,17 @@ const Status = { preview: null, showPreview: false, showingTall: false, - expandingSubject: !this.$store.state.config.collapseMessageWithSubject + expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' + ? !this.$store.state.instance.collapseMessageWithSubject + : !this.$store.state.config.collapseMessageWithSubject } }, computed: { + localCollapseSubjectDefault () { + return typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' + ? this.$store.state.instance.collapseMessageWithSubject + : this.$store.state.config.collapseMessageWithSubject + }, muteWords () { return this.$store.state.config.muteWords }, @@ -147,13 +154,13 @@ const Status = { return this.status.attentions.length > 0 }, hideSubjectStatus () { - if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) { + if (this.tallStatus && !this.localCollapseSubjectDefault) { return false } return !this.expandingSubject && this.status.summary }, hideTallStatus () { - if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + if (this.status.summary && this.localCollapseSubjectDefault) { return false } if (this.showingTall) { @@ -168,16 +175,22 @@ const Status = { if (!this.status.nsfw) { return false } - if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + if (this.status.summary && this.localCollapseSubjectDefault) { return false } return true }, replySubject () { - if (this.status.summary && !this.status.summary.match(/^re[: ]/i)) { + if (!this.status.summary) return '' + const behavior = this.$store.state.config.subjectLineBehavior + const startsWithRe = this.status.summary.match(/^re[: ]/i) + if (behavior !== 'noop' && startsWithRe || behavior === 'masto') { + return this.status.summary + } else if (behavior === 'email') { return 're: '.concat(this.status.summary) + } else if (behavior === 'noop') { + return '' } - return this.status.summary }, attachmentSize () { if ((this.$store.state.config.hideAttachments && !this.inConversation) || diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 0edc7b71..4541c560 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -106,7 +106,7 @@
    - +
    diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 6f9ed9fe..064c984d 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -3,6 +3,13 @@ import { hex2rgb } from '../../services/color_convert/color_convert.js' export default { props: [ 'user', 'switcher', 'selected', 'hideBio' ], + data () { + return { + hideUserStatsLocal: typeof this.$store.state.config.hideUserStats === 'undefined' + ? this.$store.state.instance.hideUserStats + : this.$store.state.config.hideUserStats + } + }, computed: { headingStyle () { const color = this.$store.state.config.customTheme.colors.bg diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 9830f283..bb1e314f 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -17,7 +17,7 @@
    {{user.name}}
    @{{user.screen_name}} - {{dailyAvg}} {{ $t('user_card.per_day') }} + {{dailyAvg}} {{ $t('user_card.per_day') }} @@ -91,23 +91,24 @@
    -
    +
    {{ $t('user_card.statuses') }}
    - {{user.statuses_count}}
    + {{user.statuses_count}}
    {{ $t('user_card.followees') }}
    - {{user.friends_count}} + {{user.friends_count}}
    {{ $t('user_card.followers') }}
    - {{user.followers_count}} + {{user.followers_count}}
    -

    -

    {{ user.description }}

    +

    +

    {{ user.description }}

    +
    diff --git a/src/components/user_finder/user_finder.js b/src/components/user_finder/user_finder.js index a743b5f6..74f79d1b 100644 --- a/src/components/user_finder/user_finder.js +++ b/src/components/user_finder/user_finder.js @@ -7,25 +7,10 @@ const UserFinder = { }), methods: { findUser (username) { - username = username[0] === '@' ? username.slice(1) : username - this.loading = true - this.$store.state.api.backendInteractor.externalProfile(username) - .then((user) => { - this.loading = false - this.hidden = true - if (!user.error) { - this.$store.commit('addNewUsers', [user]) - this.$router.push({name: 'user-profile', params: {id: user.id}}) - } else { - this.error = true - } - }) + this.$router.push({ name: 'user-search', query: { query: username } }) }, toggleHidden () { this.hidden = !this.hidden - }, - dismissError () { - this.error = false } } } diff --git a/src/components/user_finder/user_finder.vue b/src/components/user_finder/user_finder.vue index 69bd1d21..f2556569 100644 --- a/src/components/user_finder/user_finder.vue +++ b/src/components/user_finder/user_finder.vue @@ -1,9 +1,5 @@