From 9186c84e64c1f2a9fa443da1819d1bad8170766f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 20 May 2019 14:15:46 +0100 Subject: [PATCH] Removed unused body classes added by using the StyleBody mixin no issue - many routes were attaching classes to the `` tag via the `StyleBody` mixin but those classes were never used and applied inconsistently throughout the app --- ghost/admin/app/routes/about.js | 7 ++----- ghost/admin/app/routes/settings/code-injection.js | 4 +--- ghost/admin/app/routes/settings/design.js | 4 +--- ghost/admin/app/routes/settings/integration.js | 4 +--- ghost/admin/app/routes/settings/integrations.js | 4 +--- ghost/admin/app/routes/settings/integrations/amp.js | 4 +--- ghost/admin/app/routes/settings/integrations/slack.js | 4 +--- ghost/admin/app/routes/settings/integrations/unsplash.js | 4 +--- ghost/admin/app/routes/settings/labs.js | 4 +--- ghost/admin/app/routes/signout.js | 5 +---- ghost/admin/app/routes/site.js | 5 +---- ghost/admin/app/routes/staff/index.js | 4 +--- ghost/admin/app/routes/staff/user.js | 5 +---- 13 files changed, 14 insertions(+), 44 deletions(-) diff --git a/ghost/admin/app/routes/about.js b/ghost/admin/app/routes/about.js index 86e47d0296..c83a30838e 100644 --- a/ghost/admin/app/routes/about.js +++ b/ghost/admin/app/routes/about.js @@ -1,8 +1,5 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; -import styleBody from 'ghost-admin/mixins/style-body'; -export default AuthenticatedRoute.extend(styleBody, { - titleToken: 'About', - - classNames: ['view-about'] +export default AuthenticatedRoute.extend({ + titleToken: 'About' }); diff --git a/ghost/admin/app/routes/settings/code-injection.js b/ghost/admin/app/routes/settings/code-injection.js index c6ce00ee58..8caf926f95 100644 --- a/ghost/admin/app/routes/settings/code-injection.js +++ b/ghost/admin/app/routes/settings/code-injection.js @@ -1,13 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { settings: service(), titleToken: 'Settings - Code injection', - classNames: ['settings-view-code'], beforeModel() { this._super(...arguments); diff --git a/ghost/admin/app/routes/settings/design.js b/ghost/admin/app/routes/settings/design.js index 3074c2abb3..6113008871 100644 --- a/ghost/admin/app/routes/settings/design.js +++ b/ghost/admin/app/routes/settings/design.js @@ -2,14 +2,12 @@ import $ from 'jquery'; import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; import RSVP from 'rsvp'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { settings: service(), titleToken: 'Settings - Design', - classNames: ['settings-view-design'], beforeModel() { this._super(...arguments); diff --git a/ghost/admin/app/routes/settings/integration.js b/ghost/admin/app/routes/settings/integration.js index 9eef3296bd..e794755065 100644 --- a/ghost/admin/app/routes/settings/integration.js +++ b/ghost/admin/app/routes/settings/integration.js @@ -1,13 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { router: service(), titleToken: 'Settings - Integrations', - classNames: ['settings-view-integration'], init() { this._super(...arguments); diff --git a/ghost/admin/app/routes/settings/integrations.js b/ghost/admin/app/routes/settings/integrations.js index d402854d32..4e0075e0b4 100644 --- a/ghost/admin/app/routes/settings/integrations.js +++ b/ghost/admin/app/routes/settings/integrations.js @@ -1,13 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { settings: service(), titleToken: 'Settings - Integrations', - classNames: ['settings-view-integrations'], beforeModel() { this._super(...arguments); diff --git a/ghost/admin/app/routes/settings/integrations/amp.js b/ghost/admin/app/routes/settings/integrations/amp.js index e065b4728d..bf648e00b4 100644 --- a/ghost/admin/app/routes/settings/integrations/amp.js +++ b/ghost/admin/app/routes/settings/integrations/amp.js @@ -1,13 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { settings: service(), titleToken: 'AMP', - classNames: ['settings-view-integrations-amp'], beforeModel() { this._super(...arguments); diff --git a/ghost/admin/app/routes/settings/integrations/slack.js b/ghost/admin/app/routes/settings/integrations/slack.js index 69e754067f..25e99d47d0 100644 --- a/ghost/admin/app/routes/settings/integrations/slack.js +++ b/ghost/admin/app/routes/settings/integrations/slack.js @@ -1,13 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from '../../../mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { settings: service(), titleToken: 'Slack', - classNames: ['settings-view-integrations-slack'], beforeModel() { this._super(...arguments); diff --git a/ghost/admin/app/routes/settings/integrations/unsplash.js b/ghost/admin/app/routes/settings/integrations/unsplash.js index 7b03110d1c..51003b1294 100644 --- a/ghost/admin/app/routes/settings/integrations/unsplash.js +++ b/ghost/admin/app/routes/settings/integrations/unsplash.js @@ -1,15 +1,13 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from '../../../mixins/current-user-settings'; import UnsplashObject from 'ghost-admin/models/unsplash-integration'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { config: service(), settings: service(), titleToken: 'Unsplash', - classNames: ['settings-view-integrations-unsplash'], // reload settings to ensure we have latest values and pre-configure // Unsplash to be active if the server doesn't have any unsplash setting diff --git a/ghost/admin/app/routes/settings/labs.js b/ghost/admin/app/routes/settings/labs.js index 846b6f2dd2..3836894200 100644 --- a/ghost/admin/app/routes/settings/labs.js +++ b/ghost/admin/app/routes/settings/labs.js @@ -1,13 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { settings: service(), titleToken: 'Settings - Labs', - classNames: ['settings'], beforeModel() { this._super(...arguments); diff --git a/ghost/admin/app/routes/signout.js b/ghost/admin/app/routes/signout.js index c58801dd7d..2f6b29d625 100644 --- a/ghost/admin/app/routes/signout.js +++ b/ghost/admin/app/routes/signout.js @@ -1,14 +1,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, { +export default AuthenticatedRoute.extend({ notifications: service(), titleToken: 'Sign Out', - classNames: ['ghost-signout'], - afterModel(/*model, transition*/) { this.notifications.clearAll(); this.session.invalidate(); diff --git a/ghost/admin/app/routes/site.js b/ghost/admin/app/routes/site.js index 77050b4ccc..85613354fd 100644 --- a/ghost/admin/app/routes/site.js +++ b/ghost/admin/app/routes/site.js @@ -1,11 +1,8 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; -import styleBody from 'ghost-admin/mixins/style-body'; -export default AuthenticatedRoute.extend(styleBody, { +export default AuthenticatedRoute.extend({ titleToken: 'Site', - classNames: ['view-site'], - model() { return (new Date()).valueOf(); } diff --git a/ghost/admin/app/routes/staff/index.js b/ghost/admin/app/routes/staff/index.js index 1d958074df..9f3b89bc24 100644 --- a/ghost/admin/app/routes/staff/index.js +++ b/ghost/admin/app/routes/staff/index.js @@ -1,14 +1,12 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; import {inject as service} from '@ember/service'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { infinity: service(), session: service(), titleToken: 'Staff', - classNames: ['view-team'], model() { return this.session.user; diff --git a/ghost/admin/app/routes/staff/user.js b/ghost/admin/app/routes/staff/user.js index 8ca6baa7b3..f23f8797fd 100644 --- a/ghost/admin/app/routes/staff/user.js +++ b/ghost/admin/app/routes/staff/user.js @@ -1,13 +1,10 @@ /* eslint-disable camelcase */ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; -import styleBody from 'ghost-admin/mixins/style-body'; -export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { +export default AuthenticatedRoute.extend(CurrentUserSettings, { titleToken: 'Staff - User', - classNames: ['team-view-user'], - model(params) { return this.store.queryRecord('user', {slug: params.user_slug, include: 'count.posts'}); },