Skip to content
Snippets Groups Projects
Verified Commit 95e087b3 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Removed raven on front-end

parent 5321cb4c
No related branches found
No related tags found
No related merge requests found
......@@ -58,15 +58,6 @@ class RavenDSN(types.StringPreference):
field_kwargs = {"required": False}
@global_preferences_registry.register
class RavenEnabled(types.BooleanPreference):
show_in_api = True
section = raven
name = "front_enabled"
default = False
verbose_name = "Report front-end errors with Raven"
@global_preferences_registry.register
class InstanceNodeinfoEnabled(types.BooleanPreference):
show_in_api = False
......
......@@ -20,7 +20,6 @@
"lodash": "^4.17.10",
"masonry-layout": "^4.2.2",
"moment": "^2.22.2",
"raven-js": "^3.26.4",
"semantic-ui-css": "^2.4.1",
"showdown": "^1.8.6",
"vue": "^2.5.17",
......
......@@ -43,10 +43,6 @@
:version="version"
@show:shortcuts-modal="showShortcutsModal = !showShortcutsModal"
></app-footer>
<raven
v-if="$store.state.instance.settings.raven.front_enabled.value"
:dsn="$store.state.instance.settings.raven.front_dsn.value"
></raven>
<playlist-modal v-if="$store.state.auth.authenticated"></playlist-modal>
<shortcuts-modal @update:show="showShortcutsModal = $event" :show="showShortcutsModal"></shortcuts-modal>
<GlobalEvents @keydown.h.exact="showShortcutsModal = !showShortcutsModal"/>
......@@ -63,7 +59,6 @@ import GlobalEvents from '@/components/utils/global-events'
import Sidebar from '@/components/Sidebar'
import AppFooter from '@/components/Footer'
import Raven from '@/components/Raven'
import ServiceMessages from '@/components/ServiceMessages'
import locales from './locales'
......@@ -75,7 +70,6 @@ export default {
components: {
Sidebar,
AppFooter,
Raven,
PlaylistModal,
ShortcutsModal,
GlobalEvents,
......
<template>
<div class="raven"></div>
</template>
<script>
import Raven from 'raven-js'
import RavenVue from 'raven-js/plugins/vue'
import Vue from 'vue'
import logger from '@/logging'
export default {
props: ['dsn'],
created () {
Raven.uninstall()
this.setUp()
},
destroyed () {
Raven.uninstall()
},
methods: {
setUp () {
Raven.uninstall()
logger.default.info('Installing raven...')
Raven.config(this.dsn).addPlugin(RavenVue, Vue).install()
}
},
watch: {
dsn: function () {
this.setUp()
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped >
.raven {
display: none;
}
</style>
......@@ -40,14 +40,6 @@ export default {
enabled: {
value: true
}
},
raven: {
front_enabled: {
value: false
},
front_dsn: {
value: null
}
}
}
},
......
......@@ -142,11 +142,6 @@ export default {
"instance__nodeinfo_stats_enabled",
"instance__nodeinfo_private"
]
},
{
label: errorLabel,
id: "reporting",
settings: ["raven__front_enabled", "raven__front_dsn"]
}
]
}
......
......@@ -18,11 +18,11 @@ describe('store/instance', () => {
describe('mutations', () => {
it('settings', () => {
const state = {settings: {raven: {front_dsn: {value: 'test'}}}}
let settings = {raven: {front_enabled: {value: true}}}
const state = {settings: {users: {upload_quota: {value: 1}}}}
let settings = {users: {registration_enabled: {value: true}}}
store.mutations.settings(state, settings)
expect(state.settings).to.deep.equal({
raven: {front_dsn: {value: 'test'}, front_enabled: {value: true}}
users: {upload_quota: {value: 1}, registration_enabled: {value: true}}
})
})
})
......@@ -32,13 +32,13 @@ describe('store/instance', () => {
status: 200,
response: [
{
section: 'raven',
name: 'front_dsn',
value: 'test'
section: 'users',
name: 'upload_quota',
value: 1
},
{
section: 'raven',
name: 'front_enabled',
section: 'users',
name: 'registration_enabled',
value: false
}
]
......@@ -50,15 +50,15 @@ describe('store/instance', () => {
{
type: 'settings',
payload: {
raven: {
front_dsn: {
section: 'raven',
name: 'front_dsn',
value: 'test'
users: {
upload_quota: {
section: 'users',
name: 'upload_quota',
value: 1
},
front_enabled: {
section: 'raven',
name: 'front_enabled',
registration_enabled: {
section: 'users',
name: 'registration_enabled',
value: false
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment