Browse Source

Merge branch 'master' into feature/new-user-card

pull/4295/head
Edho Arief 1 month ago
parent
commit
41a05de73f
No account linked to committer's email address

+ 0
- 1
.env.example View File

@@ -190,7 +190,6 @@ SITE_SWITCHER_JS_HASH=
190 190
 # USER_MAX_MULTIPLAYER_ROOMS_SUPPORTER=5
191 191
 
192 192
 # NOTIFICATION_QUEUE=notification
193
-# NOTIFICATION_QUEUE_CONNECTION=redis-notification
194 193
 # NOTIFICATION_REDIS_HOST=127.0.0.1
195 194
 # NOTIFICATION_REDIS_PORT=6379
196 195
 # NOTIFICATION_SERVER_LISTEN_HOST=127.0.0.1

+ 0
- 1
.travis.yml View File

@@ -28,7 +28,6 @@ env:
28 28
     - APP_ENV=testing
29 29
     - APP_KEY=base64:q7U5qyAkedR1F6UhN0SQlUxBpAMDyfHy3NNFkqmiMqA=
30 30
     - APP_URL=http://127.0.0.1:8000
31
-    - BROADCAST_DRIVER=log
32 31
     - CACHE_DRIVER=redis
33 32
     - DB_USERNAME=root
34 33
     - ES_VERSION=6.6.0 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.zip

+ 0
- 1
app/Events/NewNotificationEvent.php View File

@@ -28,7 +28,6 @@ class NewNotificationEvent extends NotificationEventBase
28 28
     use SerializesModels;
29 29
 
30 30
     public $notification;
31
-    public $connection = 'redis-notification';
32 31
 
33 32
     /**
34 33
      * Create a new event instance.

+ 2
- 2
app/Events/NotificationEventBase.php View File

@@ -24,10 +24,10 @@ use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
24 24
 
25 25
 abstract class NotificationEventBase implements ShouldBroadcast
26 26
 {
27
-    public $connection;
27
+    public $broadcastQueue;
28 28
 
29 29
     public function __construct()
30 30
     {
31
-        $this->connection = config('osu.notification.queue_connection');
31
+        $this->broadcastQueue = config('osu.notification.queue_name');
32 32
     }
33 33
 }

+ 1
- 2
app/Events/NotificationReadEvent.php View File

@@ -21,10 +21,9 @@
21 21
 namespace App\Events;
22 22
 
23 23
 use Illuminate\Broadcasting\Channel;
24
-use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
25 24
 use Illuminate\Queue\SerializesModels;
26 25
 
27
-class NotificationReadEvent extends NotificationEventBase implements ShouldBroadcastNow
26
+class NotificationReadEvent extends NotificationEventBase
28 27
 {
29 28
     use SerializesModels;
30 29
 

+ 1
- 0
app/Jobs/BroadcastNotification.php View File

@@ -173,6 +173,7 @@ class BroadcastNotification implements ShouldQueue
173 173
         $this->receiverIds = $this->object
174 174
             ->topic
175 175
             ->watches()
176
+            ->where('mail', true)
176 177
             ->where('user_id', '<>', $this->source->getKey())
177 178
             ->pluck('user_id')
178 179
             ->all();

+ 1
- 1
app/Traits/NotificationQueue.php View File

@@ -24,6 +24,6 @@ trait NotificationQueue
24 24
 {
25 25
     public function dispatch()
26 26
     {
27
-        dispatch($this->onConnection(config('osu.notification.queue_connection')));
27
+        dispatch($this->onQueue(config('osu.notification.queue_name')));
28 28
     }
29 29
 }

+ 1
- 1
app/Transformers/BeatmapsetTransformer.php View File

@@ -218,7 +218,7 @@ class BeatmapsetTransformer extends Fractal\TransformerAbstract
218 218
     {
219 219
         $rel = $params->get('with_trashed') ? 'allBeatmaps' : 'beatmaps';
220 220
 
221
-        return $this->collection($beatmapset->$rel, new BeatmapTransformer);
221
+        return $this->collection($beatmapset->$rel()->with('beatmapset')->get(), new BeatmapTransformer);
222 222
     }
223 223
 
224 224
     public function includeConverts(Beatmapset $beatmapset)

+ 1
- 1
config/osu.php View File

@@ -103,7 +103,7 @@ return [
103 103
     ],
104 104
     'notification' => [
105 105
         'endpoint' => presence(env('NOTIFICATION_ENDPOINT'), '/home/notifications/feed'),
106
-        'queue_connection' => presence(env('NOTIFICATION_QUEUE_CONNECTION'), 'redis-notification'),
106
+        'queue_name' => presence(env('NOTIFICATION_QUEUE'), 'notification'),
107 107
     ],
108 108
     'search' => [
109 109
         'minimum_length' => get_int(env('SEARCH_MINIMUM_LENGTH', 2)),

+ 0
- 8
config/queue.php View File

@@ -47,14 +47,6 @@ return [
47 47
             'queue' => 'default',
48 48
             'retry_after' => 305, // our longest job timeout is 5m, plus 5s to allow time for workers to be killed
49 49
         ],
50
-
51
-        'redis-notification' => [
52
-            'driver' => 'redis',
53
-            'connection' => 'notification',
54
-            'queue' => presence(env('NOTIFICATION_QUEUE'), 'notification'),
55
-            'retry_after' => 305, // our longest job timeout is 5m, plus 5s to allow time for workers to be killed
56
-        ],
57
-
58 50
     ],
59 51
 
60 52
     /*

+ 1
- 1
phpunit.xml View File

@@ -19,6 +19,6 @@
19 19
         <env name="APP_ENV" value="testing"/>
20 20
         <env name="CACHE_DRIVER" value="array"/>
21 21
         <env name="SESSION_DRIVER" value="array"/>
22
-        <env name="NOTIFICATION_QUEUE_CONNECTION" value="sync"/>
22
+        <env name="BROADCAST_DRIVER" value="log"/>
23 23
     </php>
24 24
 </phpunit>

+ 8
- 0
resources/assets/coffee/_classes/current-user-observer.coffee View File

@@ -29,6 +29,7 @@ class @CurrentUserObserver
29 29
   reinit: =>
30 30
     @setAvatars()
31 31
     @setCovers()
32
+    @setSentryUser()
32 33
 
33 34
 
34 35
   setAvatars: (elements) =>
@@ -51,3 +52,10 @@ class @CurrentUserObserver
51 52
     window.currentUser = data
52 53
 
53 54
     @reinit()
55
+
56
+
57
+  setSentryUser: ->
58
+    return unless Sentry?
59
+
60
+    Sentry.configureScope (scope) ->
61
+      scope.setUser id: currentUser.id, username: currentUser.username

+ 1
- 0
resources/assets/coffee/_classes/line-chart.coffee View File

@@ -224,6 +224,7 @@ class @LineChart
224 224
     i = @lookupIndexFromX x
225 225
 
226 226
     return unless i
227
+    return unless @data[i - 1] && @data[i]
227 228
 
228 229
     @hoverStart()
229 230
     Timeout.clear @_autoEndHover

+ 1
- 0
resources/assets/coffee/react/mp-history/content.coffee View File

@@ -17,6 +17,7 @@
17 17
 ###
18 18
 
19 19
 import { Event } from './event'
20
+import { Game } from './game'
20 21
 import * as React from 'react'
21 22
 import { button, div } from 'react-dom-factories'
22 23
 import { Spinner } from 'spinner'

+ 1
- 1
resources/assets/coffee/react/mp-history/score.coffee View File

@@ -49,7 +49,7 @@ export class Score extends React.Component
49 49
           a
50 50
             href: laroute.route 'rankings',
51 51
               mode: @props.mode
52
-              country: user.country.code
52
+              country: user.country?.code
53 53
               type: 'performance'
54 54
             el FlagCountry, country: user.country
55 55
 

+ 1
- 1
resources/assets/coffee/react/profile-page/account-standing.coffee View File

@@ -18,7 +18,7 @@
18 18
 
19 19
 import { ExtraHeader } from './extra-header'
20 20
 import * as React from 'react'
21
-import { div, span, h3, table, thead, tbody, tr, th, td, time } from 'react-dom-factories'
21
+import { a, div, span, h3, table, thead, tbody, tr, th, td, time } from 'react-dom-factories'
22 22
 el = React.createElement
23 23
 
24 24
 bn = 'profile-extra-recent-infringements'

+ 15
- 0
resources/assets/less/bem/notification-popup-item.less View File

@@ -17,6 +17,8 @@
17 17
  */
18 18
 
19 19
 .notification-popup-item {
20
+  @_top: notification-popup-item;
21
+
20 22
   display: flex;
21 23
   width: 100%;
22 24
 
@@ -56,6 +58,13 @@
56 58
     padding: 5px 0 5px 10px;
57 59
     display: flex;
58 60
     min-width: 0;
61
+
62
+    .@{_top}:hover &::before {
63
+      .full-size();
64
+      content: '';
65
+      background-color: fade(#fff, 10%);
66
+      border-radius: 0 @border-radius-large @border-radius-large 0;
67
+    }
59 68
   }
60 69
 
61 70
   &__message {
@@ -74,6 +83,12 @@
74 83
 
75 84
   &__read-button {
76 85
     .reset-input();
86
+    color: @greysky-light;
87
+    padding: 2px;
88
+
89
+    &:hover {
90
+      color: #fff;
91
+    }
77 92
   }
78 93
 
79 94
   &__side-buttons {

+ 8
- 7
resources/views/layout/metadata.blade.php View File

@@ -64,10 +64,11 @@
64 64
 
65 65
 <script src="{{ mix("js/vendor.js") }}" data-turbolinks-track="reload"></script>
66 66
 @if(config('services.sentry.public_dsn') !== '')
67
-    <script src="//cdn.ravenjs.com/3.17.0/raven.min.js" crossorigin="anonymous"></script>
67
+    <script src="https://browser.sentry-cdn.com/5.1.0/bundle.min.js" crossorigin="anonymous"></script>
68 68
     <script>
69
-        var ravenOptions = {
70
-            release: '{{ config('osu.git-sha') }}',
69
+        Sentry.init({
70
+            debug: {!! json_encode(config('app.debug')) !!},
71
+            dsn: {!! json_encode(config('services.sentry.public_dsn')) !!},
71 72
             ignoreErrors: [
72 73
                 // Random plugins/extensions
73 74
                 'top.GLOBALS'
@@ -79,10 +80,10 @@
79 80
                 /^resource:\/\//i,
80 81
                 // Errors caused by spyware/adware junk
81 82
                 /^\/loaders\//i
82
-            ]
83
-        }
84
-        Raven.config('{{ config('services.sentry.public_dsn') }}', ravenOptions).install();
85
-        Raven.setUserContext({lang: currentLocale});
83
+            ],
84
+            release: {!! json_encode(config('osu.git-sha')) !!},
85
+            whitelistUrls: [/^{!! preg_quote(config('app.url'), '/') !!}\/.*\.js(?:\?.*)?$/],
86
+        });
86 87
     </script>
87 88
 @endif
88 89
 <script src="{{ mix("js/app-deps.js") }}" data-turbolinks-track="reload"></script>

+ 1
- 1
webpack.mix.js View File

@@ -104,7 +104,7 @@ let webpackConfig = {
104 104
     splitChunks: {
105 105
       cacheGroups: {
106 106
         commons: {
107
-          name: "js/commons",
107
+          name: "/js/commons",
108 108
           chunks: "initial",
109 109
           minChunks: 2,
110 110
         }

Loading…
Cancel
Save