Skip to content

Commit

Permalink
add PreventSubmitFormOnEnter trait in edit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexPopaCode4 committed Dec 30, 2024
1 parent f2b2e7d commit d06711d
Show file tree
Hide file tree
Showing 38 changed files with 88 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Admin\Resources\BenefitResource\Pages;

use App\Actions\BackAction;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Actions\ChangeNomenclatureStatusAction;
use App\Filament\Admin\Resources\BenefitResource;
use Filament\Actions;
Expand All @@ -13,6 +14,8 @@

class EditBenefit extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = BenefitResource::class;

public function getBreadcrumbs(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Admin\Resources\InstitutionResource\Pages;

use App\Actions\BackAction;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Resources\InstitutionResource;
use App\Forms\Components\Repeater;
use App\Models\Organization;
Expand All @@ -16,6 +17,8 @@

class EditInstitutionCenters extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = InstitutionResource::class;

protected function getRedirectUrl(): ?string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Admin\Resources\InstitutionResource\Pages;

use App\Actions\BackAction;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Enums\AreaType;
use App\Enums\OrganizationType;
use App\Filament\Admin\Resources\InstitutionResource;
Expand All @@ -20,6 +21,8 @@

class EditInstitutionDetails extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = InstitutionResource::class;

protected function getRedirectUrl(): ?string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Admin\Resources\InstitutionResource\RelationManagers;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Resources\InstitutionResource;
use App\Filament\Admin\Resources\UserInstitutionResource\Pages\EditUserInstitution;
use App\Tables\Columns\DateTimeColumn;
Expand All @@ -19,6 +20,8 @@

class AdminsRelationManager extends RelationManager
{
use PreventSubmitFormOnEnter;

protected static string $relationship = 'admins';

public function isReadOnly(): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Admin\Resources\InstitutionResource\RelationManagers;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Resources\InstitutionResource;
use App\Infolists\Components\DocumentPreview;
use App\Infolists\Components\SectionHeader;
Expand All @@ -19,6 +20,8 @@

class OrganizationsRelationManager extends RelationManager
{
use PreventSubmitFormOnEnter;

protected static string $relationship = 'organizations';

protected static string $view = 'infolists.infolist-relation-manager';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Admin\Resources\ResultResource\Pages;

use App\Actions\BackAction;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Actions\ChangeNomenclatureStatusAction;
use App\Filament\Admin\Resources\ResultResource;
use Filament\Actions;
Expand All @@ -13,6 +14,8 @@

class EditResult extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = ResultResource::class;

public function getBreadcrumbs(): array
Expand Down
3 changes: 3 additions & 0 deletions app/Filament/Admin/Resources/RoleResource/Pages/EditRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Admin\Resources\RoleResource\Pages;

use App\Actions\BackAction;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Actions\ChangeNomenclatureStatusAction;
use App\Filament\Admin\Resources\RoleResource;
use Filament\Actions\DeleteAction;
Expand All @@ -13,6 +14,8 @@

class EditRole extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = RoleResource::class;

public function getTitle(): string|Htmlable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Admin\Resources\ServiceResource\Pages;

use App\Actions\BackAction;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Actions\ChangeNomenclatureStatusAction;
use App\Filament\Admin\Resources\ServiceResource;
use Filament\Actions\DeleteAction;
Expand All @@ -13,6 +14,8 @@

class EditService extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = ServiceResource::class;

public function getBreadcrumbs(): array
Expand Down
3 changes: 3 additions & 0 deletions app/Filament/Admin/Resources/UserResource/Pages/EditUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

namespace App\Filament\Admin\Resources\UserResource\Pages;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Admin\Resources\UserResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditUser extends EditRecord
{
use PreventSubmitFormOnEnter;

protected static string $resource = UserResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use App\Actions\BackAction;
use App\Concerns\HasParentResource;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Filament\Organizations\Resources\BeneficiaryInterventionResource;
use App\Filament\Organizations\Resources\InterventionPlanResource;
use App\Filament\Organizations\Resources\InterventionServiceResource;
Expand All @@ -17,6 +18,7 @@
class EditBeneficiaryIntervention extends EditRecord
{
use HasParentResource;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryInterventionResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\CloseFile;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToCloseFile;
use App\Filament\Organizations\Resources\BeneficiaryResource;
use App\Forms\Components\DatePicker;
Expand All @@ -21,6 +22,7 @@
class EditCloseFileDetails extends EditRecord
{
use RedirectToCloseFile;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\CloseFile;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToCloseFile;
use App\Enums\AdmittanceReason;
use App\Enums\CloseMethod;
Expand All @@ -23,6 +24,7 @@
class EditCloseFileGeneralDetails extends EditRecord
{
use RedirectToCloseFile;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\DetailedEvaluation;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToDetailedEvaluation;
use App\Enums\AddressType;
use App\Enums\Occupation;
Expand All @@ -25,6 +26,7 @@
class EditBeneficiaryPartner extends EditRecord
{
use RedirectToDetailedEvaluation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\DetailedEvaluation;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToDetailedEvaluation;
use App\Filament\Organizations\Resources\BeneficiaryResource;
use App\Forms\Components\DatePicker;
Expand All @@ -21,6 +22,7 @@
class EditDetailedEvaluation extends EditRecord
{
use RedirectToDetailedEvaluation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\DetailedEvaluation;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToDetailedEvaluation;
use App\Enums\RecommendationService;
use App\Filament\Organizations\Resources\BeneficiaryResource;
Expand All @@ -21,6 +22,7 @@
class EditDetailedEvaluationResult extends EditRecord
{
use RedirectToDetailedEvaluation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\DetailedEvaluation;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToDetailedEvaluation;
use App\Enums\Applicant;
use App\Filament\Organizations\Resources\BeneficiaryResource;
Expand All @@ -25,6 +26,7 @@
class EditMultidisciplinaryEvaluation extends EditRecord
{
use RedirectToDetailedEvaluation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToPersonalInformation;
use App\Enums\AggressorLegalHistory;
use App\Enums\AggressorRelationship;
Expand Down Expand Up @@ -36,6 +37,7 @@
class EditAggressor extends EditRecord
{
use RedirectToPersonalInformation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToPersonalInformation;
use App\Enums\Ternary;
use App\Filament\Organizations\Resources\BeneficiaryResource;
Expand All @@ -22,6 +23,7 @@
class EditAntecedents extends EditRecord
{
use RedirectToPersonalInformation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use alcea\cnp\Cnp;
use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToIdentity;
use App\Enums\AddressType;
use App\Enums\Citizenship;
Expand Down Expand Up @@ -38,6 +39,7 @@
class EditBeneficiaryIdentity extends EditRecord
{
use RedirectToIdentity;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToPersonalInformation;
use App\Enums\DisabilityDegree;
use App\Enums\DisabilityType;
Expand All @@ -30,6 +31,7 @@
class EditBeneficiaryPersonalInformation extends EditRecord
{
use RedirectToPersonalInformation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToIdentity;
use App\Enums\GenderShortValues;
use App\Filament\Organizations\Resources\BeneficiaryResource;
Expand All @@ -27,6 +28,7 @@
class EditChildrenIdentity extends EditRecord
{
use RedirectToIdentity;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToPersonalInformation;
use App\Enums\ActLocation;
use App\Enums\NotificationMode;
Expand All @@ -26,6 +27,7 @@
class EditFlowPresentation extends EditRecord
{
use RedirectToPersonalInformation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\InitialEvaluation;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToInitialEvaluation;
use App\Filament\Organizations\Resources\BeneficiaryResource;
use App\Services\Breadcrumb\BeneficiaryBreadcrumb;
Expand All @@ -20,6 +21,7 @@
class EditBeneficiarySituation extends EditRecord
{
use RedirectToInitialEvaluation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages\InitialEvaluation;

use App\Concerns\PreventSubmitFormOnEnter;
use App\Concerns\RedirectToInitialEvaluation;
use App\Filament\Organizations\Resources\BeneficiaryResource;
use App\Forms\Components\DatePicker;
Expand All @@ -24,6 +25,7 @@
class EditEvaluationDetails extends EditRecord
{
use RedirectToInitialEvaluation;
use PreventSubmitFormOnEnter;

protected static string $resource = BeneficiaryResource::class;

Expand Down
Loading

0 comments on commit d06711d

Please sign in to comment.