From cbddcd671c9ebd11ce5d10fb7d6fe9e405616c83 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 22 May 2024 12:09:09 +0200 Subject: [PATCH] Remove obsolete "Appearance" settings page (#8697) The "new" design hasn't been worked on in ages, so we might as well remove the support code for now... --- app/components/footer.module.css | 4 ---- app/components/settings-page.hbs | 3 --- app/components/settings-page.js | 6 ----- app/controllers/application.js | 1 - app/controllers/settings/appearance.js | 15 ------------ app/router.js | 1 - app/services/design.js | 21 ---------------- app/styles/application.module.css | 5 ---- app/templates/application.hbs | 1 - app/templates/settings/appearance.hbs | 33 -------------------------- 10 files changed, 90 deletions(-) delete mode 100644 app/components/settings-page.js delete mode 100644 app/controllers/settings/appearance.js delete mode 100644 app/services/design.js delete mode 100644 app/templates/settings/appearance.hbs diff --git a/app/components/footer.module.css b/app/components/footer.module.css index f5e436b4134..db1baab99c7 100644 --- a/app/components/footer.module.css +++ b/app/components/footer.module.css @@ -7,10 +7,6 @@ --footer-link-hover-shadow-color: var(--green900); } -[data-theme="new-design"] { - --footer-bg-color: var(--grey900); -} - .footer { display: grid; justify-items: center; diff --git a/app/components/settings-page.hbs b/app/components/settings-page.hbs index f679456bba7..6019d44dbcf 100644 --- a/app/components/settings-page.hbs +++ b/app/components/settings-page.hbs @@ -1,9 +1,6 @@
Profile - {{#if this.design.showToggleButton}} - Appearance - {{/if}} Email Notifications API Tokens diff --git a/app/components/settings-page.js b/app/components/settings-page.js deleted file mode 100644 index 2b134e1e6c5..00000000000 --- a/app/components/settings-page.js +++ /dev/null @@ -1,6 +0,0 @@ -import { inject as service } from '@ember/service'; -import Component from '@glimmer/component'; - -export default class SettingsPage extends Component { - @service design; -} diff --git a/app/controllers/application.js b/app/controllers/application.js index 5fe55b29330..140cfcc0847 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -3,7 +3,6 @@ import { inject as service } from '@ember/service'; export default class ApplicationController extends Controller { @service colorScheme; - @service design; @service progress; @service router; diff --git a/app/controllers/settings/appearance.js b/app/controllers/settings/appearance.js deleted file mode 100644 index aa201c2d2a8..00000000000 --- a/app/controllers/settings/appearance.js +++ /dev/null @@ -1,15 +0,0 @@ -import Controller from '@ember/controller'; -import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; - -import { alias } from 'macro-decorators'; - -export default class AppearanceSettingsController extends Controller { - @service design; - - @alias('design.theme') theme; - - @action setTheme(theme) { - this.theme = theme; - } -} diff --git a/app/router.js b/app/router.js index f5d5fa814ca..1041ef1d0c3 100644 --- a/app/router.js +++ b/app/router.js @@ -31,7 +31,6 @@ Router.map(function () { this.route('pending-invites'); }); this.route('settings', function () { - this.route('appearance'); this.route('email-notifications'); this.route('profile'); this.route('tokens', function () { diff --git a/app/services/design.js b/app/services/design.js deleted file mode 100644 index 633cffd06cb..00000000000 --- a/app/services/design.js +++ /dev/null @@ -1,21 +0,0 @@ -import Service from '@ember/service'; -import { tracked } from '@glimmer/tracking'; - -import config from '../config/environment'; -import * as localStorage from '../utils/local-storage'; - -const KNOWN_THEMES = new Set(['classic', 'new-design']); - -export default class DesignService extends Service { - @tracked _theme = localStorage.getItem('theme'); - @tracked showToggleButton = config.environment === 'development' || config.environment === 'test'; - - get theme() { - return KNOWN_THEMES.has(this._theme) ? this._theme : 'classic'; - } - - set theme(theme) { - this._theme = theme; - localStorage.setItem('theme', theme); - } -} diff --git a/app/styles/application.module.css b/app/styles/application.module.css index 156ebb949b9..faba10c821e 100644 --- a/app/styles/application.module.css +++ b/app/styles/application.module.css @@ -85,11 +85,6 @@ color-scheme: dark; } -[data-theme="new-design"] { - --header-bg-color: var(--violet800); - --main-bg: white; -} - * { box-sizing: border-box; } diff --git a/app/templates/application.hbs b/app/templates/application.hbs index edd06ee43c7..0e8649c8cd9 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1,7 +1,6 @@ {{page-title "crates.io: Rust Package Registry" separator=' - ' prepend=true}} -{{set-theme this.design.theme}} {{set-color-scheme this.colorScheme.scheme}} diff --git a/app/templates/settings/appearance.hbs b/app/templates/settings/appearance.hbs deleted file mode 100644 index 1f6e6ac31ae..00000000000 --- a/app/templates/settings/appearance.hbs +++ /dev/null @@ -1,33 +0,0 @@ -{{page-title 'Settings'}} - - - - -

Appearance

- -
- - - -
-
\ No newline at end of file