diff --git a/changes/changelog.d/600.enhancement b/changes/changelog.d/600.enhancement new file mode 100644 index 0000000000000000000000000000000000000000..b91f11713891bb08b7b22d56c6d5a087b2c631f2 --- /dev/null +++ b/changes/changelog.d/600.enhancement @@ -0,0 +1 @@ +Removed "Activity" page, since all the data is available on the "Browse" page (#600) diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index 8702f80511592922e24896190b15f6964e799528..449238c2edaa00a9fde58b9487127d62fde7f1e5 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -71,9 +71,6 @@ class="item"> <i class="list icon"></i><translate>Playlists</translate> </a> - <router-link - v-if="$store.state.auth.authenticated" - class="item" :to="{path: '/activity'}"><i class="bell icon"></i><translate>Activity</translate></router-link> <router-link v-if="$store.state.auth.authenticated" class="item" :to="{name: 'content.index'}"><i class="upload icon"></i><translate>Add content</translate></router-link> diff --git a/front/src/components/activity/Like.vue b/front/src/components/activity/Like.vue deleted file mode 100644 index a0799e8fab47e5e68ec953c990f77e961a31bca8..0000000000000000000000000000000000000000 --- a/front/src/components/activity/Like.vue +++ /dev/null @@ -1,32 +0,0 @@ -<template> - <div class="event"> - <div class="label"> - <i class="pink heart icon"></i> - </div> - <div class="content"> - <div class="summary"> - <translate :translate-params="{user: event.actor.local_id}">%{ user } favorited a track</translate> - <human-date class="date" :date="event.published" /> - </div> - <div class="extra text"> - <router-link :to="{name: 'library.tracks.detail', params: {id: event.object.local_id }}"> - {{ event.object.name }} - </router-link> - <translate :translate-params="{album: event.object.album, artist: event.object.artist}">from %{ album } by %{ artist }</translate> - </div> - </div> - </div> - -</template> - -<script> - -export default { - props: ['event'] -} -</script> - -<!-- Add "scoped" attribute to limit CSS to this component only --> -<style scoped lang="scss"> - -</style> diff --git a/front/src/components/activity/Listen.vue b/front/src/components/activity/Listen.vue deleted file mode 100644 index 7790df58dfd2880d5025f9bd14a7d2efcf8bb979..0000000000000000000000000000000000000000 --- a/front/src/components/activity/Listen.vue +++ /dev/null @@ -1,32 +0,0 @@ -<template> - <div class="event"> - <div class="label"> - <i class="orange sound icon"></i> - </div> - <div class="content"> - <div class="summary"> - <translate :translate-params="{user: event.actor.local_id}">%{ user } listened to a track</translate> - <human-date class="date" :date="event.published" /> - </div> - <div class="extra text"> - <router-link :to="{name: 'library.tracks.detail', params: {id: event.object.local_id }}"> - {{ event.object.name }} - </router-link> - <translate :translate-params="{album: event.object.album, artist: event.object.artist}">from %{ album } by %{ artist }</translate> - </div> - </div> - </div> - -</template> - -<script> - -export default { - props: ['event'] -} -</script> - -<!-- Add "scoped" attribute to limit CSS to this component only --> -<style scoped lang="scss"> - -</style> diff --git a/front/src/router/index.js b/front/src/router/index.js index 148e45b8a2297c5404ce712f45b5804af4a86d77..f6b4d309f2f1ef1c8b60518587feb3149d9d6841 100644 --- a/front/src/router/index.js +++ b/front/src/router/index.js @@ -3,7 +3,6 @@ import Router from 'vue-router' import PageNotFound from '@/components/PageNotFound' import About from '@/components/About' import Home from '@/components/Home' -import InstanceTimeline from '@/views/instance/Timeline' import Login from '@/components/auth/Login' import Signup from '@/components/auth/Signup' import Profile from '@/components/auth/Profile' @@ -56,11 +55,6 @@ export default new Router({ name: 'about', component: About }, - { - path: '/activity', - name: 'activity', - component: InstanceTimeline - }, { path: '/login', name: 'login', diff --git a/front/src/views/instance/Timeline.vue b/front/src/views/instance/Timeline.vue deleted file mode 100644 index a70bd404966cc96972efadaa3f8146ee7b9bb599..0000000000000000000000000000000000000000 --- a/front/src/views/instance/Timeline.vue +++ /dev/null @@ -1,107 +0,0 @@ -<template> - <div class="main pusher" v-title="labels.title"> - <div class="ui vertical center aligned stripe segment"> - <div v-if="isLoading" :class="['ui', {'active': isLoading}, 'inverted', 'dimmer']"> - <div class="ui text loader"><translate>Loading timeline...</translate></div> - </div> - <div v-else class="ui text container"> - <h1 class="ui header"><translate>Recent activity on this instance</translate></h1> - <div class="ui feed"> - <component - class="event" - v-for="(event, index) in events" - :key="event.id + index" - v-if="components[event.type]" - :is="components[event.type]" - :event="event"> - </component> - </div> - </div> - </div> - </div> -</template> - -<script> -import {mapState} from 'vuex' -import { WebSocketBridge } from 'django-channels' -import axios from 'axios' -import logger from '@/logging' - -import Like from '@/components/activity/Like' -import Listen from '@/components/activity/Listen' - -export default { - data () { - return { - isLoading: false, - bridge: null, - components: { - 'Like': Like, - 'Listen': Listen - } - } - }, - created () { - this.openWebsocket() - this.fetchEvents() - }, - destroyed () { - this.disconnect() - }, - computed: { - ...mapState({ - events: state => state.instance.events - }), - labels () { - return { - title: this.$gettext('Instance Timeline') - } - } - }, - methods: { - fetchEvents () { - this.isLoading = true - let self = this - axios.get('/activity/').then((response) => { - self.isLoading = false - self.$store.commit('instance/events', response.data.results) - }) - }, - disconnect () { - if (!this.bridge) { - return - } - this.bridge.socket.close(1000, 'goodbye', {keepClosed: true}) - }, - openWebsocket () { - if (!this.$store.state.auth.authenticated) { - return - } - this.disconnect() - let self = this - let token = this.$store.state.auth.token - // let token = 'test' - const bridge = new WebSocketBridge() - this.bridge = bridge - let url = this.$store.getters['instance/absoluteUrl'](`api/v1/instance/activity?token=${token}`) - url = url.replace('http://', 'ws://') - url = url.replace('https://', 'wss://') - bridge.connect( - url, - null, - {reconnectInterval: 5000}) - bridge.listen(function (event) { - logger.default.info('Received timeline update', event) - self.$store.commit('instance/event', event) - }) - bridge.socket.addEventListener('open', function () { - console.log('Connected to WebSocket') - }) - } - } -} -</script> - -<!-- Add "scoped" attribute to limit CSS to this component only --> -<style scoped> -</style>