From 38192fbcf4c86df199337e66f1e445b74caaf17d Mon Sep 17 00:00:00 2001 From: nanaya Date: Thu, 7 Sep 2023 14:52:58 +0900 Subject: [PATCH] Private staging specific changes - add footer indicating experimental things - always show the new total score - use older table names --- app/Models/ScoreToken.php | 2 ++ app/Models/Solo/Score.php | 2 ++ app/Models/Solo/ScorePerformance.php | 2 +- resources/css/bem/development-deploy-footer.less | 2 +- resources/js/core/link-main-host.ts | 13 +++++++++++++ resources/js/osu-core.ts | 3 +++ resources/js/utils/score-helper.ts | 2 +- resources/views/master.blade.php | 5 ++--- 8 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 resources/js/core/link-main-host.ts diff --git a/app/Models/ScoreToken.php b/app/Models/ScoreToken.php index f75c4bb07c5..d591d95c8a5 100644 --- a/app/Models/ScoreToken.php +++ b/app/Models/ScoreToken.php @@ -25,6 +25,8 @@ */ class ScoreToken extends Model { + protected $table = 'solo_score_tokens'; + public function beatmap() { return $this->belongsTo(Beatmap::class, 'beatmap_id'); diff --git a/app/Models/Solo/Score.php b/app/Models/Solo/Score.php index 63eb74ea3d7..24d865f027d 100644 --- a/app/Models/Solo/Score.php +++ b/app/Models/Solo/Score.php @@ -45,6 +45,8 @@ class Score extends Model implements Traits\ReportableInterface 'preserve' => 'boolean', ]; + protected $table = 'solo_scores'; + public static function createFromJsonOrExplode(array $params) { $score = new static([ diff --git a/app/Models/Solo/ScorePerformance.php b/app/Models/Solo/ScorePerformance.php index b30a1f9a410..972e12fe96c 100644 --- a/app/Models/Solo/ScorePerformance.php +++ b/app/Models/Solo/ScorePerformance.php @@ -17,5 +17,5 @@ class ScorePerformance extends Model public $timestamps = false; protected $primaryKey = 'score_id'; - protected $table = 'score_performance'; + protected $table = 'solo_scores_performance'; } diff --git a/resources/css/bem/development-deploy-footer.less b/resources/css/bem/development-deploy-footer.less index 3f933082abe..22f023239c4 100644 --- a/resources/css/bem/development-deploy-footer.less +++ b/resources/css/bem/development-deploy-footer.less @@ -4,7 +4,7 @@ .development-deploy-footer { width: 100%; padding: 10px; - background: hsl(var(--hsl-red-3)); + background: hsl(var(--hsl-blue-3)); text-align: center; font-weight: bold; diff --git a/resources/js/core/link-main-host.ts b/resources/js/core/link-main-host.ts new file mode 100644 index 00000000000..d29bb57cb86 --- /dev/null +++ b/resources/js/core/link-main-host.ts @@ -0,0 +1,13 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. +// See the LICENCE file in the repository root for full licence text. + +export default class LinkMainHost { + constructor() { + $(document).on('click', '.js-link-main-host', this.handleClick); + } + + private readonly handleClick = (e: JQuery.Event) => { + e.preventDefault(); + window.location.host = 'osu.ppy.sh'; + }; +} diff --git a/resources/js/osu-core.ts b/resources/js/osu-core.ts index cc20073a9fd..f4f6bcc53c1 100644 --- a/resources/js/osu-core.ts +++ b/resources/js/osu-core.ts @@ -11,6 +11,7 @@ import ForumPoll from 'core/forum/forum-poll'; import ForumPostEdit from 'core/forum/forum-post-edit'; import ForumPostInput from 'core/forum/forum-post-input'; import ForumPostReport from 'core/forum/forum-post-report'; +import LinkMainHost from 'core/link-main-host'; import Localtime from 'core/localtime'; import MobileToggle from 'core/mobile-toggle'; import OsuAudio from 'core/osu-audio/main'; @@ -49,6 +50,7 @@ export default class OsuCore { readonly forumPostEdit; readonly forumPostInput; readonly forumPostReport; + readonly linkMainHost; readonly localtime; readonly mobileToggle; readonly notificationsWorker; @@ -94,6 +96,7 @@ export default class OsuCore { this.forumPostEdit = new ForumPostEdit(); this.forumPostInput = new ForumPostInput(); this.forumPostReport = new ForumPostReport(); + this.linkMainHost = new LinkMainHost(); this.localtime = new Localtime(); this.mobileToggle = new MobileToggle(); this.browserTitleWithNotificationCount = new BrowserTitleWithNotificationCount(this); diff --git a/resources/js/utils/score-helper.ts b/resources/js/utils/score-helper.ts index d258d63722d..9320ff2bcfc 100644 --- a/resources/js/utils/score-helper.ts +++ b/resources/js/utils/score-helper.ts @@ -123,5 +123,5 @@ export function scoreUrl(score: SoloScoreJson) { } export function totalScore(score: SoloScoreJson) { - return score.legacy_total_score ?? score.total_score; + return score.total_score; } diff --git a/resources/views/master.blade.php b/resources/views/master.blade.php index a16912d30f9..fe0c91391b7 100644 --- a/resources/views/master.blade.php +++ b/resources/views/master.blade.php @@ -109,11 +109,10 @@ class="js-permanent-fixed-footer > @yield('permanent-fixed-footer') - @if ($GLOBALS['cfg']['osu']['is_development_deploy']) - @endif