Skip to content

Commit 1cad431

Browse files
authored
🔥 remove global dashboard (#3129)
1 parent 7c15718 commit 1cad431

File tree

14 files changed

+239
-389
lines changed

14 files changed

+239
-389
lines changed

app/Http/Controllers/API/v1/StatusController.php

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -72,39 +72,7 @@ public static function getDashboard(): AnonymousResourceCollection {
7272
}
7373

7474
/**
75-
* @OA\Get(
76-
* path="/dashboard/global",
77-
* operationId="getGlobalDashboard",
78-
* tags={"Dashboard"},
79-
* summary="Get paginated statuses of global dashboard",
80-
* description="Returns paginated statuses of global dashboard",
81-
* @OA\Parameter (
82-
* name="page",
83-
* description="Page of pagination",
84-
* required=false,
85-
* in="query",
86-
* @OA\Schema(type="integer")
87-
* ),
88-
* @OA\Response(
89-
* response=200,
90-
* description="successful operation",
91-
* @OA\JsonContent(
92-
* @OA\Property(property="data", type="array",
93-
* @OA\Items(
94-
* ref="#/components/schemas/StatusResource"
95-
* )
96-
* ),
97-
* @OA\Property(property="links", ref="#/components/schemas/Links"),
98-
* @OA\Property(property="meta", ref="#/components/schemas/PaginationMeta"),
99-
* )
100-
* ),
101-
* @OA\Response(response=400, description="Bad request"),
102-
* @OA\Response(response=401, description="Not logged in"),
103-
* security={
104-
* {"passport": {"read-statuses"}}, {"token": {}}
105-
* }
106-
* )
107-
*
75+
* @deprecated
10876
*/
10977
public static function getGlobalDashboard(): AnonymousResourceCollection {
11078
return StatusResource::collection(DashboardController::getGlobalDashboard(Auth::user()));

app/Http/Controllers/FrontendStatusController.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ public function getDashboard(): Renderable|RedirectResponse {
3030
]);
3131
}
3232

33-
public function getGlobalDashboard(): Renderable {
34-
return view('dashboard', [
35-
'statuses' => DashboardController::getGlobalDashboard(Auth::user()),
36-
'latest' => StationController::getLatestArrivals(Auth::user()),
37-
'future' => StatusBackend::getFutureCheckins(),
38-
'showGlobalButton' => false
39-
]);
40-
}
41-
4233
public function getActiveStatuses(): View {
4334
return view('activejourneys', [
4435
'currentUser' => Auth::user(),

lang/de.json

Lines changed: 228 additions & 228 deletions
Large diffs are not rendered by default.

lang/en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,7 @@
476476
"dashboard.empty": "Your dashboard seems a bit empty.",
477477
"dashboard.empty.teaser": "If you want to, you can follow some people to see their check-ins here.",
478478
"dashboard.empty.discover1": "You can discover new people in the section",
479-
"dashboard.empty.discover2": "or",
480-
"dashboard.empty.discover3": "(careful, slow load times)",
479+
"dashboard.empty.discover3": "",
481480
"user.block-tooltip": "Block user",
482481
"user.blocked": "You have blocked the user :username.",
483482
"user.already-blocked": "The user :username is already blocked.",

lang/es.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@
572572
"messages.exception.general-values": "Ha ocurrido un error desconocido. Vuelve a probar con otros valores.",
573573
"messages.exception.reference": "Referencia del error: :reference",
574574
"generic.error": "Error",
575-
"dashboard.empty.discover2": "o",
576-
"dashboard.empty.discover3": "(cuidado, tiempos largos de carga)",
575+
"dashboard.empty.discover3": "",
577576
"user.unmute-tooltip": "Quitar silencio al usuario",
578577
"dashboard.empty": "Tu escritorio parece vacío.",
579578
"dashboard.empty.teaser": "Si quieres, puedes seguir a otras personas para ver sus check-ins aqui.",

lang/fr.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@
752752
"user.login.mastodon": "S'identifier avec Mastodon",
753753
"user.login.or": "ou",
754754
"user.no-account": "Vous n'avez pas encore de compte ?",
755-
"dashboard.empty.discover3": "(attention, temps de chargement lents)",
755+
"dashboard.empty.discover3": "",
756756
"checkin.success.body": "Vous avez réussi avec succés votre enregistrement !",
757757
"checkin.success.body2": "Vous allez faire :distance km dans la ligne :lineName de :origin à :destination.",
758758
"settings.friend_checkin.friends": "Amis",
@@ -792,7 +792,6 @@
792792
"welcome.stats.million": "Million",
793793
"welcome.stats.distance": "kilomètres parcourus",
794794
"welcome.hero.stats.description": "Vous pouvez recueillir des statistiques sur les opérateurs de transport les plus utilisés, les modes de transport et bien plus encore !",
795-
"dashboard.empty.discover2": "ou",
796795
"notifications.eventSuggestionProcessed.missing-information": "Nous ne pouvons pas approuver cet événement en raison d'informations manquantes. Veuillez nous fournir une source ou un site web spécifique sur cet événement.",
797796
"notifications.youHaveBeenCheckedIn.lead": "Vous avez été enregistré par <b>@:username</b>",
798797
"welcome.header.open-source": "Open source & gratuit, aujourd'hui et pour toujours.",

lang/nl.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,7 @@
766766
"dashboard.empty": "Je overzicht lijkt erg leeg.",
767767
"dashboard.empty.teaser": "Als je wilt, kun je mensen volgen en hier zien waar ze zijn ingecheckt.",
768768
"dashboard.empty.discover1": "Zoek personen om te volgen in de sectie",
769-
"dashboard.empty.discover2": "of",
770-
"dashboard.empty.discover3": "(let op: lange laadtijden)",
769+
"dashboard.empty.discover3": "",
771770
"trip_creation.limitations.6.rules": "Regels",
772771
"trip_creation.limitations.6.link": "https://help.traewelling.de/en/features/manual-trips/#info",
773772
"user.points-enabled": "Punten en klassement tonen",

resources/views/dashboard.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ class="accordion-collapse collapse"
161161
</h4>
162162
<p>{{ __('dashboard.empty.teaser') }}</p>
163163
<p>{{ __('dashboard.empty.discover1') }}
164-
<a href="{{route('statuses.active')}}">{{ __('menu.active') }}</a>
165-
{{ __('dashboard.empty.discover2') }}
166-
<a href="{{route('globaldashboard') }}">{{ __('menu.globaldashboard') }}</a>
167-
{{ __('dashboard.empty.discover3') }}
164+
<a href="{{route('statuses.active')}}">
165+
{{ __('menu.active') }}
166+
</a>
167+
{{ __('dashboard.empty.discover3') }}.
168168
</p>
169169
</div>
170170
@endif

resources/views/layouts/app.blade.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ class="border border-white rounded-left form-control my-0 py-1"
195195
<div class="row">
196196
<div class="col-6 col-md-2 mb-3">
197197
<ul class="nav flex-column">
198-
<li class="nav-item mb-2">
199-
<a href="{{ route('globaldashboard') }}" class="nav-link p-0 text-body-secondary">
200-
{{ __('menu.globaldashboard') }}
201-
</a>
202-
</li>
203198
<li class="nav-item mb-2">
204199
<a href="{{ route('events') }}" class="nav-link p-0 text-body-secondary">
205200
{{ __('events') }}

routes/web.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@
195195
Route::get('/dashboard', [FrontendStatusController::class, 'getDashboard'])
196196
->name('dashboard');
197197

198-
Route::get('/dashboard/global', [FrontendStatusController::class, 'getGlobalDashboard'])
199-
->name('globaldashboard');
200-
201198
Route::post('/status/update', [StatusController::class, 'updateStatus'])
202199
->name('status.update'); //TODO: Replace with API Endpoint
203200

storage/api-docs/api-docs.json

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,69 +2218,6 @@
22182218
]
22192219
}
22202220
},
2221-
"/dashboard/global": {
2222-
"get": {
2223-
"tags": [
2224-
"Dashboard"
2225-
],
2226-
"summary": "Get paginated statuses of global dashboard",
2227-
"description": "Returns paginated statuses of global dashboard",
2228-
"operationId": "getGlobalDashboard",
2229-
"parameters": [
2230-
{
2231-
"name": "page",
2232-
"in": "query",
2233-
"description": "Page of pagination",
2234-
"required": false,
2235-
"schema": {
2236-
"type": "integer"
2237-
}
2238-
}
2239-
],
2240-
"responses": {
2241-
"200": {
2242-
"description": "successful operation",
2243-
"content": {
2244-
"application/json": {
2245-
"schema": {
2246-
"properties": {
2247-
"data": {
2248-
"type": "array",
2249-
"items": {
2250-
"$ref": "#/components/schemas/StatusResource"
2251-
}
2252-
},
2253-
"links": {
2254-
"$ref": "#/components/schemas/Links"
2255-
},
2256-
"meta": {
2257-
"$ref": "#/components/schemas/PaginationMeta"
2258-
}
2259-
},
2260-
"type": "object"
2261-
}
2262-
}
2263-
}
2264-
},
2265-
"400": {
2266-
"description": "Bad request"
2267-
},
2268-
"401": {
2269-
"description": "Not logged in"
2270-
}
2271-
},
2272-
"security": [
2273-
{
2274-
"passport": [
2275-
"read-statuses"
2276-
]
2277-
},
2278-
{
2279-
"token": []
2280-
}
2281-
]
2282-
}
2283-
},
22842221
"/dashboard/future": {
22852222
"get": {
22862223
"tags": [

tests/Feature/Frontend/LanguageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testRequestHasValidLanguageCodeWithLoggedInUser(): void {
5959
$user = User::factory()->create();
6060
$this->assertDatabaseMissing('users', ['username' => $user->username, 'language' => 'de']);
6161
$response = $this->actingAs($user)
62-
->get(route('globaldashboard', ['language' => 'de']));
62+
->get(route('dashboard', ['language' => 'de']));
6363
$response->assertOk();
6464
$response->assertViewIs('dashboard');
6565
$this->assertDatabaseHas('users', ['username' => $user->username, 'language' => 'de']);

tests/Feature/UserBlockTest.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,6 @@ public function testStatusesAreBlocked(): void {
4646
->assertForbidden();
4747
}
4848

49-
public function testAlicesStatusIsHiddenFromBobsGlobalDashboard(): void {
50-
$this->actingAs($this->bob)
51-
->get(route('globaldashboard'))
52-
->assertSee($this->alice->username);
53-
54-
$this->aliceBlocksBob();
55-
56-
$this->actingAs($this->bob)
57-
->get(route('globaldashboard'))
58-
->assertOk()
59-
->assertDontSee($this->alice->username);
60-
}
61-
62-
public function testBobsStatusIsHiddenFromAlicesGlobalDashboard(): void {
63-
Checkin::factory(['user_id' => $this->bob->id])->create();
64-
65-
$this->actingAs($this->alice)
66-
->get(route('globaldashboard'))
67-
->assertOk()
68-
->assertSee(ProfilePictureController::getUrl($this->bob))
69-
->assertSee(ProfilePictureController::getUrl($this->alice));
70-
71-
$this->aliceBlocksBob();
72-
73-
$this->actingAs($this->alice)
74-
->get(route('globaldashboard'))
75-
->assertOk()
76-
// Bob's name is present in the session bag due the "you successfully blocked bob' message. Instead, we
77-
// check that Bob's profile picture is not there, while Alice's picture is still there (from the checkin
78-
// in self::setUp).
79-
->assertDontSee(ProfilePictureController::getUrl($this->bob))
80-
->assertSee(ProfilePictureController::getUrl($this->alice));
81-
}
82-
8349
public function testAlicesStatusIsHiddenFromBobsActiveJourneys(): void {
8450
$this->actingAs($this->bob)
8551
->get(route('statuses.active'))

tests/Feature/UserRedirectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function gdpr_interception() {
7979

8080
// If the user opens the app again, they get intercepted again.
8181
$response = $this->actingAs($user)
82-
->get('/dashboard/global');
82+
->get('/dashboard');
8383
$response->assertStatus(302);
8484
$response->assertRedirect('/gdpr-intercept');
8585
$this->followRedirects($response)

0 commit comments

Comments
 (0)