Skip to content

Commit

Permalink
🔥 remove beta disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Jan 11, 2025
1 parent d8fb63f commit 0422533
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
13 changes: 1 addition & 12 deletions app/Http/Controllers/API/v1/TripController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,9 @@ class TripController extends Controller
{

/**
* Undocumented beta endpoint - only specific users have access
*
* @param Request $request
*
* @return TripResource|Response
*
* @todo add docs
* @todo currently the stations need to be in the database. We need to add a fallback to HAFAS.
* -> later solve the problem for non-existing stations
* @todo add docs when endpoint is stable
*/
public function createTrip(Request $request): TripResource|JsonResponse {
if (!auth()->user()?->can('create-manual-trip')) {
return response()->json(['message' => 'This endpoint is currently only available for open-beta users (you can enable open beta in your settings).'], 403);
}
if (auth()->user()?->can('disallow-manual-trips')) {
return response()->json(['message' => 'You are not allowed to create manual trips'], 403);
}
Expand Down
6 changes: 3 additions & 3 deletions resources/views/vuestationboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<div class="col-md-8 col-lg-7" id="station-board-new">
<Stationboard></Stationboard>

@if(auth()->user()->hasRole('open-beta') && !auth()->user()->can('disallow-manual-trips'))
@cannot('disallow-manual-trips')
<div class="text-center mt-4">
<hr/>
<p>
<span class="badge text-bg-info">Beta</span>
<i class="fa-solid fa-plus"></i>
{{__('missing-journey')}}
</p>
<a href="{{ route('trip.create') }}" class="btn btn-sm btn-outline-secondary">
<i class="fa-solid fa-plus"></i>
{{__('create-journey')}}
</a>
</div>
@endif
@endcannot

@if(isset($station) && auth()->user()?->hasRole('open-beta'))
@include('includes.station-infos')
Expand Down
1 change: 0 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
Route::middleware(['auth', 'privacy'])->group(function() {

Route::view('/trip/create', 'beta.trip-creation')
->middleware(['can:create-manual-trip'])
->name('trip.create');

Route::view('/report', 'report')
Expand Down

0 comments on commit 0422533

Please sign in to comment.