Skip to content

Commit

Permalink
Private staging specific changes
Browse files Browse the repository at this point in the history
- add footer indicating experimental things
- always show the new total score
- add check for nextCursor is_legacy
  • Loading branch information
nanaya committed Aug 16, 2023
1 parent 87319d3 commit 5367579
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
6 changes: 4 additions & 2 deletions app/Libraries/Score/FetchDedupedScores.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public function all(): array

while ($hasNext) {
if ($nextCursor !== null) {
// FIXME: cursor value returned is 0/1 but elasticsearch expects false/true...
$nextCursor['is_legacy'] = get_bool($nextCursor['is_legacy']);
if (isset($nextCursor['is_legacy'])) {
// FIXME: cursor value returned is 0/1 string but elasticsearch expects false/true...
$nextCursor['is_legacy'] = get_bool($nextCursor['is_legacy']);
}
$search->searchAfter(array_values($nextCursor));
}
$response = $search->response();
Expand Down
2 changes: 1 addition & 1 deletion resources/css/bem/development-deploy-footer.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
16 changes: 16 additions & 0 deletions resources/js/core/link-main-host.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

const className = 'js-link-main-host';
const searchQuery = `.${className}`;

export default class LinkMainHost {
constructor() {
$(document).on('click', searchQuery, this.handleClick);
}

private readonly handleClick = (e: JQuery.Event) => {
e.preventDefault();
window.location.host = 'osu.ppy.sh';
};
}
3 changes: 3 additions & 0 deletions resources/js/osu-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -49,6 +50,7 @@ export default class OsuCore {
readonly forumPostEdit;
readonly forumPostInput;
readonly forumPostReport;
readonly linkMainHost;
readonly localtime;
readonly mobileToggle;
readonly notificationsWorker;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion resources/js/utils/score-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
5 changes: 2 additions & 3 deletions resources/views/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ class="js-permanent-fixed-footer
>
@yield('permanent-fixed-footer')

@if (config('osu.is_development_deploy'))
<div class="development-deploy-footer">
This is a development instance of the <a href="https://osu.ppy.sh" class="development-deploy-footer__link">osu! website</a>. Please do not login with your osu! credentials.
You are viewing an experimental osu!web deploy with osu!(lazer) scores incorporated in the mix.
<br>You can choose to return to the <a href="https://osu.ppy.sh" class="js-link-main-host development-deploy-footer__link">normal version</a>.
</div>
@endif
</div>
</div>

Expand Down

0 comments on commit 5367579

Please sign in to comment.