From 08f4ef4a8e98ea1acd7b88a7f65267965343d1a3 Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Tue, 24 Jan 2023 12:19:33 +0100 Subject: [PATCH] Remove analytics dashboard This was originally used to show plausible external dashboard, this has been removed. --- .env.example | 1 - app/abilities/repository.js | 8 -------- app/models/repository.js | 15 --------------- app/router.js | 1 - app/templates/components/analytics.hbs | 14 -------------- app/templates/providers/show/repositories/new.hbs | 4 ---- app/templates/repositories/show.hbs | 11 ----------- app/templates/repositories/show/analytics.hbs | 1 - app/templates/repositories/show/edit.hbs | 4 ---- config/environment.js | 2 -- 10 files changed, 61 deletions(-) delete mode 100644 app/templates/components/analytics.hbs delete mode 100644 app/templates/repositories/show/analytics.hbs diff --git a/.env.example b/.env.example index f4322416c..cd8f05d49 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,6 @@ FABRICA_URL=https://doi.stage.datacite.org EVENTDATA_URL=https://api.stage.datacite.org SEARCH_URL=https://search.stage.datacite.org CDN_URL=https://assets.stage.datacite.org -ANALYTICS_URL=https://analytics.stage.datacite.org JWT_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA22lpr1ntJQYKa+aCRjre\nPKTze/00S0SCdsWKhvk3honfjdebuxc54YdvfqKQk/1jLOPJj++vqIGwytKRI9uC\n1BmMRLrOluACiOgTc5DpzMm68lZss5D5g7tzjxB7NlFiKiYav1BtVDfvVxwuNqkY\njyNupf1Gjqp2/8wbsZ6SGIkzgovgjcHI5S8HZ7DE7rcrStISNJqTvpuMUXp++eie\nPkTgcrdZScKjO6VYu9epuhoyD2mbZdjAUbxYyjQ3vgftseLo4hXFEXpfIQzwxOLS\njmg1S/qxOzZHOMrp31pS1ricMtd4frvXztHPfh5XuyiOEozR0An9OIIwzKQsn+0q\np5QKfN+lHJflYGZ1TD8QruinWf8a5uWYd3q9c1V8RYgwgmfoxgHX5TmMbcQsBTuB\nyIy3io3rBiRnJEAgSu4PxNuQqVqqsaJ4cCmQrATLViZmXhZcbHJyWl3GJnZMpv8P\nor6m239QGZdoy5ijoOdVLQowtnsr+SWWrcYKF4J66223xjGBse7o3Q+gJUkyQKtB\nLifDld9XMTpgvEsZtZKEQ9S5gAWkiAzcjSMV0J4XMOzvHAalyNTucLc6ljG8HnjO\n34SrkvkkTlUwNsJOygRNJQujfQaStvb3MTagSqPteGhy9qSitSJPrDmN/W79stIe\nSvqHoJznDJsFfKUcypEG4l0CAwEAAQ==\n-----END PUBLIC KEY-----\n SENTRY_DSN=https://63201db022924202b697e03bc5e0d0ba@sentry.io/1420435 TRACKING_ID=UA-22806196-13 diff --git a/app/abilities/repository.js b/app/abilities/repository.js index b365f967d..4a23a6090 100644 --- a/app/abilities/repository.js +++ b/app/abilities/repository.js @@ -143,13 +143,5 @@ export default Ability.extend({ default: return false; } - }), - canSetAnalyticsUrl: computed('currentUser.role_id', function () { - switch (this.get('currentUser.role_id')) { - case 'staff_admin': - return true; - default: - return false; - } }) }); diff --git a/app/models/repository.js b/app/models/repository.js index 353f99ecc..317bcde30 100644 --- a/app/models/repository.js +++ b/app/models/repository.js @@ -134,7 +134,6 @@ export default Model.extend(Validations, { keepPassword: attr('boolean', { defaultValue: true }), created: attr('date'), updated: attr('date'), - analyticsDashboardUrl: attr('string'), targetId: attr(), mode: attr('string'), @@ -154,19 +153,5 @@ export default Model.extend(Validations, { } else { return null; } - }), - analyticsDashboardUrlCmp: computed('analyticsDashboardUrl', function () { - const theme = '&embed=true&theme=light'; - var ret = ''; - - if (!isEmpty(this.analyticsDashboardUrl)) { - ret = this.analyticsDashboardUrl + theme; - } else if (!isEmpty(ENV.ANALYTICS_DASHBOARD_URL)) { - ret = ENV.ANALYTICS_DASHBOARD_URL + theme; - } else { - ret = ''; - } - - return ret; }) }); diff --git a/app/router.js b/app/router.js index 0bb5cf94e..cda7aa4d1 100644 --- a/app/router.js +++ b/app/router.js @@ -44,7 +44,6 @@ Router.map(function () { this.route('new'); this.route('upload'); }); - this.route('analytics'); this.route('transfer'); this.route('prefixes', function () { this.route('show', { path: '/:prefix_id' }, function () { diff --git a/app/templates/components/analytics.hbs b/app/templates/components/analytics.hbs deleted file mode 100644 index aab707184..000000000 --- a/app/templates/components/analytics.hbs +++ /dev/null @@ -1,14 +0,0 @@ -{{#if @model.analyticsDashboardUrlCmp}} -
- -
Stats powered by Plausible Analytics
- -
-{{else}} -
- - No analytics found for this repository. - -
-{{/if}} diff --git a/app/templates/providers/show/repositories/new.hbs b/app/templates/providers/show/repositories/new.hbs index 1584a5ab1..cc44f9daa 100644 --- a/app/templates/providers/show/repositories/new.hbs +++ b/app/templates/providers/show/repositories/new.hbs @@ -111,10 +111,6 @@ {{/if}} - {{#if (can "setAnalyticsUrl repository" model)}} - - {{/if}} -
diff --git a/app/templates/repositories/show.hbs b/app/templates/repositories/show.hbs index ddebd4fcc..2ee73e302 100644 --- a/app/templates/repositories/show.hbs +++ b/app/templates/repositories/show.hbs @@ -85,17 +85,6 @@ Info - {{#if model.analyticsDashboardUrlCmp}} - - - Usage Dashboard - - - {{/if}} diff --git a/app/templates/repositories/show/edit.hbs b/app/templates/repositories/show/edit.hbs index 77150e079..092d059c8 100644 --- a/app/templates/repositories/show/edit.hbs +++ b/app/templates/repositories/show/edit.hbs @@ -111,10 +111,6 @@
{{/if}} - {{#if (can "setAnalyticsUrl repository" model)}} - - {{/if}} - {{#if (can "create repository" model)}} {{/if}} diff --git a/config/environment.js b/config/environment.js index c5d0243d8..15d0349dd 100644 --- a/config/environment.js +++ b/config/environment.js @@ -82,8 +82,6 @@ module.exports = function (environment) { EVENTDATA_URL: process.env.EVENTDATA_URL || 'https://api.stage.datacite.org', CDN_URL: process.env.CDN_URL || 'https://www.stage.datacite.org', - ANALYTICS_URL: process.env.ANALYTICS_URL || 'https://analytics.stage.datacite.org', - ANALYTICS_DASHBOARD_URL: process.env.ANALYTICS_DASHBOARD_URL || '', JWT_PUBLIC_KEY: process.env.JWT_PUBLIC_KEY ||