Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip checks for deletion on local #978

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/Http/Controllers/Search/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public function index(Request $request, Campaign $campaign, EntityType $entityTy
{
return response()->json(
$this->service
->campaign($campaign)
->request($request)
->entityType($entityType)
->search()
->campaign($campaign)
->request($request)
->entityType($entityType)
->search()
);
}
}
4 changes: 4 additions & 0 deletions app/Http/Middleware/PasswordConfirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public function handle($request, Closure $next, $redirectToRoute = null)
*/
protected function shouldConfirmPassword($request)
{
if (app()->isLocal()) {
return false;
}

$confirmedAt = time() - $request->session()->get('auth.password_confirmed_at', 0);

return $confirmedAt > $this->passwordTimeout;
Expand Down
5 changes: 2 additions & 3 deletions app/Rules/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Rules;

use App\Facades\Module;
use App\Models\EntityType;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
Expand All @@ -12,7 +11,7 @@ class Location implements ValidationRule
/**
* Run the validation rule.
*
* @param \Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail
* @param Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
Expand All @@ -26,7 +25,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
$fail(__('crud.dynamic.unknown', ['module' => $module->name()]));
}

if (empty(trim($value))) {
if (empty(mb_trim($value))) {
return;
}

Expand Down
1 change: 0 additions & 1 deletion app/Services/Search/LiveSearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Traits\EntityTypeAware;
use App\Traits\RequestAware;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Illuminate\Support\Str;

class LiveSearchService
Expand Down
1 change: 0 additions & 1 deletion app/View/Components/Forms/Foreign.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Facades\Module;
use App\Models\Campaign;
use App\Models\Entity;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Model;
Expand Down
2 changes: 1 addition & 1 deletion resources/views/campaigns/delete.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</p>

<div class="required field flex gap-2 flex-wrap">
<input type="text" name="delete" value="" autofocus maxlength="10" required id="campaign-delete-form" class="w-full" />
<input type="text" name="delete" @if (app()->isLocal()) value="delete" @endif autofocus maxlength="10" required id="campaign-delete-form" class="w-full" />

<x-buttons.confirm type="danger" full="true">
<x-icon class="trash" />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/settings/account.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{!! __('profiles.sections.delete.goodbye', ['code' => '<code>goodbye</code>']) !!}
</p>
<x-forms.field field="goodbye" :required="true">
<input type="text" name="goodbye" required />
<input type="text" name="goodbye" @if (app()->isLocal()) value="goodbye" @endif required />
</x-forms.field>
<x-buttons.confirm type="danger" outline="true" full="true">
<x-icon class="fa-solid fa-exclamation-triangle" />
Expand Down
4 changes: 2 additions & 2 deletions routes/campaigns/campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,5 @@
Route::get('/w/{campaign}/deletion', [App\Http\Controllers\Campaign\DeleteController::class, 'show'])->name('campaign.delete');
Route::delete('/w/{campaign}/destroy', [App\Http\Controllers\Campaign\DeleteController::class, 'destroy'])->name('campaigns.destroy');

Route::get('/w/{campaign}/sidebar/image', [\App\Http\Controllers\Campaign\ImageController::class, 'index'])->name('campaign.sidebar.image');
Route::post('/w/{campaign}/sidebar/image', [\App\Http\Controllers\Campaign\ImageController::class, 'save'])->name('campaign.sidebar.image-save');
Route::get('/w/{campaign}/sidebar/image', [App\Http\Controllers\Campaign\ImageController::class, 'index'])->name('campaign.sidebar.image');
Route::post('/w/{campaign}/sidebar/image', [App\Http\Controllers\Campaign\ImageController::class, 'save'])->name('campaign.sidebar.image-save');
4 changes: 2 additions & 2 deletions routes/campaigns/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Old Search
Route::get('/w/{campaign}/search', [App\Http\Controllers\SearchController::class, 'search'])->name('search');

Route::get('/w/{campaign}/search/markers', [\App\Http\Controllers\Search\MarkerController::class, 'index'])->name('markers.find');
Route::get('/w/{campaign}/search/markers', [App\Http\Controllers\Search\MarkerController::class, 'index'])->name('markers.find');
Route::get('/w/{campaign}/search/images', 'Search\ImageSearchController@index')->name('images.find');

Route::get('/w/{campaign}/search/members', 'Search\CampaignSearchController@members')->name('find.campaign.members');
Expand All @@ -24,7 +24,7 @@
Route::get('/w/{campaign}/search/months', 'Search\CalendarController@months')->name('search.calendar-months');


Route::get('/w/{campaign}/search/type/{entity_type}', [\App\Http\Controllers\Search\ListController::class, 'index'])->name('search-list');
Route::get('/w/{campaign}/search/type/{entity_type}', [App\Http\Controllers\Search\ListController::class, 'index'])->name('search-list');

Route::get('/w/{campaign}/search/live', [App\Http\Controllers\Search\LiveController::class, 'index'])->name('search.live');
Route::get('/w/{campaign}/search/recent', [App\Http\Controllers\Search\RecentController::class, 'index'])->name('search.recent');
Expand Down