From 276ddbf60a6c55184731d2796716ce434642e764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Tue, 23 Jan 2024 10:23:02 +0100 Subject: [PATCH] fix: allow editing inactive organisations (#145) --- .../RelationManagers/DocumentsRelationManager.php | 3 +-- .../RelationManagers/ResourcesRelationManager.php | 3 +-- .../RelationManagers/UsersRelationManager.php | 3 +-- .../RelationManagers/VolunteersRelationManager.php | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/Filament/Resources/OrganisationResource/RelationManagers/DocumentsRelationManager.php b/app/Filament/Resources/OrganisationResource/RelationManagers/DocumentsRelationManager.php index 2a88d27..b5f7b5e 100644 --- a/app/Filament/Resources/OrganisationResource/RelationManagers/DocumentsRelationManager.php +++ b/app/Filament/Resources/OrganisationResource/RelationManagers/DocumentsRelationManager.php @@ -116,8 +116,7 @@ public static function table(Table $table): Table ->headerActions([ ExportAction::make(), - Tables\Actions\CreateAction::make() - ->disabled(fn (self $livewire) => $livewire->getOwnerRecord()->isInactive()), + Tables\Actions\CreateAction::make(), ]) ->actions([ Tables\Actions\ViewAction::make(), diff --git a/app/Filament/Resources/OrganisationResource/RelationManagers/ResourcesRelationManager.php b/app/Filament/Resources/OrganisationResource/RelationManagers/ResourcesRelationManager.php index 26b9af0..1e76db5 100644 --- a/app/Filament/Resources/OrganisationResource/RelationManagers/ResourcesRelationManager.php +++ b/app/Filament/Resources/OrganisationResource/RelationManagers/ResourcesRelationManager.php @@ -170,8 +170,7 @@ public static function table(Table $table): Table ->modalHeading(__('resource.modal.heading')) ->modalSubheading(__('resource.modal.subheading')) ->modalWidth('4xl') - ->slideOver() - ->disabled(fn (self $livewire) => $livewire->getOwnerRecord()->isInactive()), + ->slideOver(), ]) ->actions([ Tables\Actions\ViewAction::make(), diff --git a/app/Filament/Resources/OrganisationResource/RelationManagers/UsersRelationManager.php b/app/Filament/Resources/OrganisationResource/RelationManagers/UsersRelationManager.php index 01ab9e4..49677c7 100644 --- a/app/Filament/Resources/OrganisationResource/RelationManagers/UsersRelationManager.php +++ b/app/Filament/Resources/OrganisationResource/RelationManagers/UsersRelationManager.php @@ -104,8 +104,7 @@ public static function table(Table $table): Table $data['role'] = UserRole::ORG_ADMIN; return $data; - }) - ->disabled(fn (self $livewire) => $livewire->getOwnerRecord()->isInactive()), + }), ]) ->actions([ Tables\Actions\ViewAction::make(), diff --git a/app/Filament/Resources/OrganisationResource/RelationManagers/VolunteersRelationManager.php b/app/Filament/Resources/OrganisationResource/RelationManagers/VolunteersRelationManager.php index d4b8524..0dda4fd 100644 --- a/app/Filament/Resources/OrganisationResource/RelationManagers/VolunteersRelationManager.php +++ b/app/Filament/Resources/OrganisationResource/RelationManagers/VolunteersRelationManager.php @@ -136,8 +136,7 @@ public static function table(Table $table): Table ->modalHeading(__('volunteer.modal.heading')) ->modalSubheading(__('volunteer.modal.subheading')) ->modalWidth('4xl') - ->slideOver() - ->disabled(fn (self $livewire) => $livewire->getOwnerRecord()->isInactive()), + ->slideOver(), ]) ->actions([ Tables\Actions\ViewAction::make(),