From a8c4aec721f8438f1aefc8595bb1ac7889dcad83 Mon Sep 17 00:00:00 2001 From: floatingghost Date: Wed, 20 Jul 2022 15:36:45 +0000 Subject: [PATCH] purge shout/chat (#49) Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/49 --- src/App.js | 13 - src/App.vue | 8 +- src/_variables.scss | 1 - src/boot/after_store.js | 3 - src/boot/routes.js | 11 - .../account_actions/account_actions.js | 12 - .../account_actions/account_actions.vue | 7 - src/components/chat/chat.js | 346 ------------------ src/components/chat/chat.scss | 108 ------ src/components/chat/chat.vue | 100 ----- src/components/chat/chat_layout_utils.js | 24 -- src/components/chat_list/chat_list.js | 37 -- src/components/chat_list/chat_list.vue | 64 ---- .../chat_list_item/chat_list_item.js | 69 ---- .../chat_list_item/chat_list_item.scss | 91 ----- .../chat_list_item/chat_list_item.vue | 53 --- src/components/chat_message/chat_message.js | 108 ------ src/components/chat_message/chat_message.scss | 179 --------- src/components/chat_message/chat_message.vue | 103 ------ src/components/chat_new/chat_new.js | 83 ----- src/components/chat_new/chat_new.scss | 31 -- src/components/chat_new/chat_new.vue | 51 --- src/components/chat_title/chat_title.js | 27 -- src/components/chat_title/chat_title.vue | 65 ---- .../features_panel/features_panel.js | 3 - .../features_panel/features_panel.vue | 9 - src/components/mobile_nav/mobile_nav.js | 7 +- src/components/mobile_nav/mobile_nav.vue | 2 +- .../mobile_post_status_button.js | 7 - src/components/nav_panel/nav_panel.js | 5 +- src/components/nav_panel/nav_panel.vue | 18 - src/components/notifications/notifications.js | 4 +- .../settings_modal/tabs/general_tab.js | 1 - .../settings_modal/tabs/general_tab.vue | 8 - .../tabs/theme_tab/theme_tab.js | 6 +- .../tabs/theme_tab/theme_tab.vue | 67 ---- src/components/shout_panel/shout_panel.js | 53 --- src/components/shout_panel/shout_panel.vue | 156 -------- src/components/side_drawer/side_drawer.js | 8 +- src/components/side_drawer/side_drawer.vue | 33 -- src/main.js | 4 - src/modules/api.js | 32 -- src/modules/chats.js | 240 ------------ src/modules/config.js | 2 - src/modules/instance.js | 8 - src/modules/serverSideConfig.js | 4 - src/modules/shout.js | 46 --- src/modules/users.js | 8 - src/services/api/api.service.js | 92 +---- src/services/chat_service/chat_service.js | 226 ------------ src/services/chat_utils/chat_utils.js | 41 --- .../entity_normalizer.service.js | 35 +- src/services/style_setter/style_setter.js | 3 +- src/services/theme_data/pleromafe.js | 57 +-- .../chat_service/chat_service.spec.js | 108 ------ 55 files changed, 15 insertions(+), 2872 deletions(-) delete mode 100644 src/components/chat/chat.js delete mode 100644 src/components/chat/chat.scss delete mode 100644 src/components/chat/chat.vue delete mode 100644 src/components/chat/chat_layout_utils.js delete mode 100644 src/components/chat_list/chat_list.js delete mode 100644 src/components/chat_list/chat_list.vue delete mode 100644 src/components/chat_list_item/chat_list_item.js delete mode 100644 src/components/chat_list_item/chat_list_item.scss delete mode 100644 src/components/chat_list_item/chat_list_item.vue delete mode 100644 src/components/chat_message/chat_message.js delete mode 100644 src/components/chat_message/chat_message.scss delete mode 100644 src/components/chat_message/chat_message.vue delete mode 100644 src/components/chat_new/chat_new.js delete mode 100644 src/components/chat_new/chat_new.scss delete mode 100644 src/components/chat_new/chat_new.vue delete mode 100644 src/components/chat_title/chat_title.js delete mode 100644 src/components/chat_title/chat_title.vue delete mode 100644 src/components/shout_panel/shout_panel.js delete mode 100644 src/components/shout_panel/shout_panel.vue delete mode 100644 src/modules/chats.js delete mode 100644 src/modules/shout.js delete mode 100644 src/services/chat_service/chat_service.js delete mode 100644 src/services/chat_utils/chat_utils.js delete mode 100644 test/unit/specs/services/chat_service/chat_service.spec.js diff --git a/src/App.js b/src/App.js index f01f8788..4304787f 100644 --- a/src/App.js +++ b/src/App.js @@ -3,7 +3,6 @@ import NavPanel from './components/nav_panel/nav_panel.vue' import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue' import FeaturesPanel from './components/features_panel/features_panel.vue' import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue' -import ShoutPanel from './components/shout_panel/shout_panel.vue' import SettingsModal from './components/settings_modal/settings_modal.vue' import MediaModal from './components/media_modal/media_modal.vue' import SideDrawer from './components/side_drawer/side_drawer.vue' @@ -26,7 +25,6 @@ export default { InstanceSpecificPanel, FeaturesPanel, WhoToFollowPanel, - ShoutPanel, MediaModal, SideDrawer, MobilePostStatusButton, @@ -75,27 +73,16 @@ export default { } } }, - shout () { return this.$store.state.shout.joined }, suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled }, showInstanceSpecificPanel () { return this.$store.state.instance.showInstanceSpecificPanel && !this.$store.getters.mergedConfig.hideISP && this.$store.state.instance.instanceSpecificPanelContent }, - isChats () { - return this.$route.name === 'chat' || this.$route.name === 'chats' - }, newPostButtonShown () { - if (this.isChats) return false return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile' }, showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, - shoutboxPosition () { - return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false - }, - hideShoutbox () { - return this.$store.getters.mergedConfig.hideShoutbox - }, layoutType () { return this.$store.state.interface.layoutType }, privateMode () { return this.$store.state.instance.private }, reverseLayout () { diff --git a/src/App.vue b/src/App.vue index d1d4217b..c3cf33f8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -33,7 +33,7 @@
- diff --git a/src/_variables.scss b/src/_variables.scss index 099d3606..65ce4027 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -27,7 +27,6 @@ $fallback--tooltipRadius: 5px; $fallback--avatarRadius: 4px; $fallback--avatarAltRadius: 10px; $fallback--attachmentRadius: 10px; -$fallback--chatMessageRadius: 10px; $fallback--buttonShadow: 0px 0px 2px 0px rgba(0, 0, 0, 1), 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset, 0px -1px 0px 0px rgba(0, 0, 0, 0.2) inset; diff --git a/src/boot/after_store.js b/src/boot/after_store.js index b8bbbe38..b2c8d59d 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -247,9 +247,6 @@ const getNodeInfo = async ({ store }) => { 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: 'shoutAvailable', value: features.includes('chat') }) - store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') }) - store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') }) store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) diff --git a/src/boot/routes.js b/src/boot/routes.js index 00f553c2..00ffda66 100644 --- a/src/boot/routes.js +++ b/src/boot/routes.js @@ -6,8 +6,6 @@ import BookmarkTimeline from 'components/bookmark_timeline/bookmark_timeline.vue import ConversationPage from 'components/conversation-page/conversation-page.vue' import Interactions from 'components/interactions/interactions.vue' import DMs from 'components/dm_timeline/dm_timeline.vue' -import ChatList from 'components/chat_list/chat_list.vue' -import Chat from 'components/chat/chat.vue' import UserProfile from 'components/user_profile/user_profile.vue' import Search from 'components/search/search.vue' import Registration from 'components/registration/registration.vue' @@ -16,7 +14,6 @@ import FollowRequests from 'components/follow_requests/follow_requests.vue' import OAuthCallback from 'components/oauth_callback/oauth_callback.vue' import Notifications from 'components/notifications/notifications.vue' import AuthForm from 'components/auth_form/auth_form.js' -import ShoutPanel from 'components/shout_panel/shout_panel.vue' import WhoToFollow from 'components/who_to_follow/who_to_follow.vue' import About from 'components/about/about.vue' import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue' @@ -68,7 +65,6 @@ export default (store) => { { 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: 'shout-panel', path: '/shout-panel', component: ShoutPanel, props: () => ({ floating: false }) }, { 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 }, @@ -80,12 +76,5 @@ export default (store) => { { name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile } ] - if (store.state.instance.pleromaChatMessagesAvailable) { - routes = routes.concat([ - { name: 'chat', path: '/users/:username/chats/:recipient_id', component: Chat, meta: { dontScroll: false }, beforeEnter: validateAuthenticatedRoute }, - { name: 'chats', path: '/users/:username/chats', component: ChatList, meta: { dontScroll: false }, beforeEnter: validateAuthenticatedRoute } - ]) - } - return routes } diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 99762562..8fe0fe5e 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -1,4 +1,3 @@ -import { mapState } from 'vuex' import ProgressButton from '../progress_button/progress_button.vue' import Popover from '../popover/popover.vue' import { library } from '@fortawesome/fontawesome-svg-core' @@ -36,18 +35,7 @@ const AccountActions = { }, reportUser () { this.$store.dispatch('openUserReportingModal', { userId: this.user.id }) - }, - openChat () { - this.$router.push({ - name: 'chat', - params: { username: this.$store.state.users.currentUser.screen_name, recipient_id: this.user.id } - }) } - }, - computed: { - ...mapState({ - pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable - }) } } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index c35d01af..afd8bb1b 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -48,13 +48,6 @@ > {{ $t('user_card.report') }} -