diff --git a/app/Filament/Admin/Resources/InstitutionResource/Pages/ViewInstitution.php b/app/Filament/Admin/Resources/InstitutionResource/Pages/ViewInstitution.php index a01184e6..60b90b4f 100644 --- a/app/Filament/Admin/Resources/InstitutionResource/Pages/ViewInstitution.php +++ b/app/Filament/Admin/Resources/InstitutionResource/Pages/ViewInstitution.php @@ -8,9 +8,9 @@ use App\Filament\Admin\Resources\InstitutionResource; use App\Filament\Admin\Resources\InstitutionResource\Actions\ActivateInstitution; use App\Filament\Admin\Resources\InstitutionResource\Actions\InactivateInstitution; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DocumentPreview; use App\Infolists\Components\Location; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; use Filament\Infolists\Infolist; @@ -51,10 +51,7 @@ public function infolist(Infolist $infolist): Infolist return $infolist->schema([ Section::make(__('institution.headings.institution_details')) ->headerActions([ - Action::make('edit') - ->label(__('general.action.edit')) - ->icon('heroicon-o-pencil') - ->link() + EditAction::make() ->url(self::$resource::getUrl('edit_institution_details', ['record' => $this->getRecord()])), ]) ->maxWidth('3xl') diff --git a/app/Filament/Admin/Resources/InstitutionResource/RelationManagers/OrganizationsRelationManager.php b/app/Filament/Admin/Resources/InstitutionResource/RelationManagers/OrganizationsRelationManager.php index 235a58f8..003e5ef3 100644 --- a/app/Filament/Admin/Resources/InstitutionResource/RelationManagers/OrganizationsRelationManager.php +++ b/app/Filament/Admin/Resources/InstitutionResource/RelationManagers/OrganizationsRelationManager.php @@ -5,11 +5,11 @@ namespace App\Filament\Admin\Resources\InstitutionResource\RelationManagers; use App\Filament\Admin\Resources\InstitutionResource; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DocumentPreview; use App\Infolists\Components\SectionHeader; use App\Models\Institution; use Filament\Facades\Filament; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\RepeatableEntry; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; @@ -37,10 +37,7 @@ public function infolist(Infolist $infolist): Infolist SectionHeader::make('center_details') ->state(__('institution.headings.center_details')) ->action( - Action::make('edit_centers') - ->label(__('general.action.edit')) - ->icon('heroicon-o-pencil') - ->link() + EditAction::make('edit_centers') ->url(InstitutionResource::getUrl('edit_institution_centers', ['record' => $this->getOwnerRecord()])) ), diff --git a/app/Filament/Admin/Resources/OrganizationResource/RelationManagers/UsersRelationManager.php b/app/Filament/Admin/Resources/OrganizationResource/RelationManagers/UsersRelationManager.php index 56b3823b..355854e4 100644 --- a/app/Filament/Admin/Resources/OrganizationResource/RelationManagers/UsersRelationManager.php +++ b/app/Filament/Admin/Resources/OrganizationResource/RelationManagers/UsersRelationManager.php @@ -4,6 +4,7 @@ namespace App\Filament\Admin\Resources\OrganizationResource\RelationManagers; +use App\Tables\Actions\EditAction; use Filament\Forms; use Filament\Forms\Form; use Filament\Resources\RelationManagers\RelationManager; @@ -52,7 +53,7 @@ public function table(Table $table): Table Tables\Actions\CreateAction::make(), ]) ->actions([ - Tables\Actions\EditAction::make(), + EditAction::make(), Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ diff --git a/app/Filament/Admin/Resources/ResultResource.php b/app/Filament/Admin/Resources/ResultResource.php index d7961773..a501dce3 100644 --- a/app/Filament/Admin/Resources/ResultResource.php +++ b/app/Filament/Admin/Resources/ResultResource.php @@ -7,12 +7,12 @@ use App\Enums\GeneralStatus; use App\Filament\Admin\Resources\ResultResource\Pages; use App\Models\Result; +use App\Tables\Actions\EditAction; use App\Tables\Filters\SelectFilter; use Filament\Forms\Components\Section; use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Resources\Resource; -use Filament\Tables; use Filament\Tables\Actions\CreateAction; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; @@ -66,8 +66,7 @@ public static function table(Table $table): Table ->options(GeneralStatus::options()), ]) ->actions([ - Tables\Actions\EditAction::make() - ->label(__('general.action.change')), + EditAction::make(), ]) ->emptyStateHeading(__('nomenclature.headings.empty_state_results_table')) ->emptyStateDescription(null) diff --git a/app/Filament/Admin/Resources/RoleResource.php b/app/Filament/Admin/Resources/RoleResource.php index 9609cef5..859dcd05 100644 --- a/app/Filament/Admin/Resources/RoleResource.php +++ b/app/Filament/Admin/Resources/RoleResource.php @@ -10,6 +10,7 @@ use App\Filament\Admin\Resources\RoleResource\Pages; use App\Forms\Components\Spacer; use App\Models\Role; +use App\Tables\Actions\EditAction; use Filament\Forms\Components\CheckboxList; use Filament\Forms\Components\Placeholder; use Filament\Forms\Components\Section; @@ -17,7 +18,6 @@ use Filament\Forms\Components\Toggle; use Filament\Forms\Form; use Filament\Resources\Resource; -use Filament\Tables; use Filament\Tables\Actions\CreateAction; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Filters\SelectFilter; @@ -106,8 +106,7 @@ public static function table(Table $table): Table ->options(GeneralStatus::options()), ]) ->actions([ - Tables\Actions\EditAction::make() - ->label(__('nomenclature.actions.edit')), + EditAction::make(), ]) ->emptyStateHeading(__('nomenclature.labels.empty_state_role_table')) ->emptyStateDescription(null) diff --git a/app/Filament/Admin/Resources/UserInstitutionResource/Pages/ViewUserInstitution.php b/app/Filament/Admin/Resources/UserInstitutionResource/Pages/ViewUserInstitution.php index 12c8337d..053d2ccc 100644 --- a/app/Filament/Admin/Resources/UserInstitutionResource/Pages/ViewUserInstitution.php +++ b/app/Filament/Admin/Resources/UserInstitutionResource/Pages/ViewUserInstitution.php @@ -11,9 +11,9 @@ use App\Filament\Admin\Resources\UserInstitutionResource\Actions\ActivateUserAction; use App\Filament\Admin\Resources\UserInstitutionResource\Actions\DeactivateUserAction; use App\Filament\Admin\Resources\UserInstitutionResource\Actions\ResendInvitationAction; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DateTimeEntry; use App\Infolists\Components\SectionHeader; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; use Filament\Infolists\Infolist; @@ -85,9 +85,7 @@ public function infolist(Infolist $infolist): Infolist SectionHeader::make('edit_user') ->state(__('user.heading.specialist_details')) ->action( - Action::make('edit') - ->label(__('general.action.edit')) - ->link() + EditAction::make() ->url(self::getParentResource()::getUrl('user.edit', [ 'parent' => $this->parent, 'record' => $this->getRecord(), diff --git a/app/Filament/Admin/Resources/UserResource.php b/app/Filament/Admin/Resources/UserResource.php index b4d6a90a..021f314d 100644 --- a/app/Filament/Admin/Resources/UserResource.php +++ b/app/Filament/Admin/Resources/UserResource.php @@ -7,6 +7,7 @@ use App\Filament\Admin\Resources\UserResource\Pages; use App\Forms\Components\Select; use App\Models\User; +use App\Tables\Actions\EditAction; use Filament\Forms\Components\Radio; use Filament\Forms\Components\Section; use Filament\Forms\Components\TextInput; @@ -126,7 +127,7 @@ public static function table(Table $table): Table ->multiple(), ]) ->actions([ - Tables\Actions\EditAction::make(), + EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ diff --git a/app/Filament/Organizations/Resources/BeneficiaryInterventionResource.php b/app/Filament/Organizations/Resources/BeneficiaryInterventionResource.php index b865abee..c48d1e6f 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryInterventionResource.php +++ b/app/Filament/Organizations/Resources/BeneficiaryInterventionResource.php @@ -11,6 +11,7 @@ use App\Models\BeneficiaryIntervention; use App\Models\InterventionService; use App\Models\OrganizationServiceIntervention; +use App\Tables\Actions\EditAction; use Filament\Forms\Components\Grid; use Filament\Forms\Components\Group; use Filament\Forms\Components\Section; @@ -127,7 +128,7 @@ public static function table(Table $table): Table // ]) ->actions([ - Tables\Actions\EditAction::make(), + EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ diff --git a/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewBeneficiaryIntervention.php b/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewBeneficiaryIntervention.php index 20fdcec6..72c6b295 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewBeneficiaryIntervention.php +++ b/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewBeneficiaryIntervention.php @@ -10,8 +10,8 @@ use App\Filament\Organizations\Resources\BeneficiaryInterventionResource; use App\Filament\Organizations\Resources\InterventionPlanResource; use App\Filament\Organizations\Resources\InterventionServiceResource; +use App\Infolists\Components\Actions\EditAction; use App\Services\Breadcrumb\InterventionPlanBreadcrumb; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\Grid; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; @@ -58,10 +58,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('intervention_plan.headings.intervention_indicators')) ->headerActions([ - Action::make('edit_intervention') - ->label(__('general.action.edit')) - ->icon('heroicon-o-pencil') - ->link() + EditAction::make('edit_intervention') ->url(fn () => InterventionServiceResource::getUrl('edit_intervention', [ 'parent' => $this->record->interventionService, 'record' => $this->record, diff --git a/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewMeetings.php b/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewMeetings.php index 4f7f7d82..c75ef701 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewMeetings.php +++ b/app/Filament/Organizations/Resources/BeneficiaryInterventionResource/Pages/ViewMeetings.php @@ -14,7 +14,7 @@ use App\Forms\Components\DatePicker; use App\Forms\Components\Select; use App\Infolists\Components\Actions\CreateAction; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\SectionHeader; use App\Models\InterventionMeeting; use App\Services\Breadcrumb\InterventionPlanBreadcrumb; @@ -140,8 +140,7 @@ public function infolist(Infolist $infolist): Infolist }) ->badge(fn (InterventionMeeting $record) => $record->status) ->action( - Edit::make('edit') - ->icon('heroicon-o-pencil') + EditAction::make() ->modalHeading(__('general.action.edit')) ->form($this->getFormSchema()) ->fillForm(fn (InterventionMeeting $record) => $record->toArray()) diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CloseFile/ViewCloseFile.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CloseFile/ViewCloseFile.php index 6296a447..c21af740 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CloseFile/ViewCloseFile.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CloseFile/ViewCloseFile.php @@ -7,7 +7,7 @@ use App\Actions\BackAction; use App\Enums\CloseMethod; use App\Filament\Organizations\Resources\BeneficiaryResource; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DateEntry; use App\Infolists\Components\Notice; use App\Models\Beneficiary; @@ -73,7 +73,7 @@ public function infolist(Infolist $infolist): Infolist ->columns() ->relationship('closeFile') ->headerActions([ - Edit::make('edit_details') + EditAction::make('edit_details') ->url(self::getResource()::getUrl('edit_close_file_details', ['record' => $this->getRecord()])), ]) ->schema([ @@ -131,7 +131,7 @@ public function infolist(Infolist $infolist): Infolist ->columns() ->relationship('closeFile') ->headerActions([ - Edit::make('edit_details') + EditAction::make('edit_details') ->url(self::getResource()::getUrl('edit_close_file_general_details', ['record' => $this->getRecord()])), ]) ->schema([ diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/DetailedEvaluation/ViewDetailedEvaluation.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/DetailedEvaluation/ViewDetailedEvaluation.php index d14176c9..f91e9457 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/DetailedEvaluation/ViewDetailedEvaluation.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/DetailedEvaluation/ViewDetailedEvaluation.php @@ -10,7 +10,7 @@ use App\Enums\Ternary; use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Filament\Organizations\Resources\BeneficiaryResource\Pages\ViewBeneficiaryIdentity; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DateEntry; use App\Infolists\Components\Location; use App\Services\Breadcrumb\BeneficiaryBreadcrumb; @@ -59,7 +59,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.detailed_evaluation.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_detailed_evaluation', ['record' => $record] @@ -85,7 +85,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.section.detailed_evaluation.heading.partner')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_beneficiary_partner', ['record' => $record] @@ -100,7 +100,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.multidisciplinary_evaluation.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_multidisciplinary_evaluation', ['record' => $record] @@ -117,7 +117,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.results.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_detailed_evaluation_result', ['record' => $record] diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/InitialEvaluation/ViewInitialEvaluation.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/InitialEvaluation/ViewInitialEvaluation.php index 7cc8c78f..8d5f560f 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/InitialEvaluation/ViewInitialEvaluation.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/InitialEvaluation/ViewInitialEvaluation.php @@ -9,11 +9,10 @@ use App\Enums\Ternary; use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Filament\Organizations\Resources\BeneficiaryResource\Pages\ViewBeneficiaryIdentity; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\Notice; use App\Infolists\Components\SectionHeader; use App\Services\Breadcrumb\BeneficiaryBreadcrumb; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\Tabs; use Filament\Infolists\Components\TextEntry; @@ -56,7 +55,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.details.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_initial_evaluation_details', ['record' => $record] @@ -77,7 +76,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.violence.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_initial_evaluation_violence', ['record' => $record] @@ -94,13 +93,11 @@ public function infolist(Infolist $infolist): Infolist SectionHeader::make('riskFactors') ->state(__('beneficiary.wizard.risk_factors.label')) ->action( - Action::make('view') - ->label(__('general.action.edit')) + EditAction::make() ->url(BeneficiaryResource::getUrl( 'edit_initial_evaluation_risk_factors', ['record' => $this->getRecord()] - )) - ->link(), + )), ), ...EditRiskFactors::getInfoListSchema(), @@ -111,7 +108,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.requested_services.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_initial_evaluation_requested_services', ['record' => $record] @@ -123,7 +120,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('beneficiary.wizard.beneficiary_situation.label')) ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl( 'edit_initial_evaluation_beneficiary_situation', ['record' => $record] diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryIdentity.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryIdentity.php index 72200414..9e1eeee7 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryIdentity.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryIdentity.php @@ -7,7 +7,7 @@ use App\Actions\BackAction; use App\Enums\AddressType; use App\Filament\Organizations\Resources\BeneficiaryResource; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DateEntry; use App\Infolists\Components\EnumEntry; use App\Infolists\Components\Location; @@ -72,7 +72,7 @@ public static function getBeneficiaryIdentityFormSchema(): array return [ Section::make(__('beneficiary.section.identity.tab.beneficiary')) ->headerActions([ - Edit::make('edit') + EditAction::make('edit') ->url(fn ($record) => BeneficiaryResource::getUrl('edit_identity', ['record' => $record])), ]) ->schema(self::identitySchema()), @@ -210,7 +210,7 @@ public static function getChildrenIdentityFormSchema(): array return [ Section::make(__('beneficiary.section.identity.tab.children')) ->headerActions([ - Edit::make('edit') + EditAction::make('edit') ->url(fn ($record) => BeneficiaryResource::getUrl('edit_children', ['record' => $record])), ]) ->schema(self::childrenSchema()), diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryPersonalInformation.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryPersonalInformation.php index b3d1ff99..00bb1c46 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryPersonalInformation.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiaryPersonalInformation.php @@ -9,7 +9,7 @@ use App\Enums\Diseases; use App\Enums\Ternary; use App\Filament\Organizations\Resources\BeneficiaryResource; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\EnumEntry; use App\Infolists\Components\SectionHeader; use App\Models\Aggressor; @@ -91,7 +91,7 @@ protected static function beneficiarySection(): array ->columns() ->relationship('details') ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl('edit_personal_information', ['record' => $record])), ]) ->extraAttributes([ @@ -240,7 +240,7 @@ protected static function aggressorSection(): array Section::make(__('beneficiary.section.personal_information.section.aggressor')) ->columns() ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl('edit_aggressor', ['record' => $record])), ]) ->extraAttributes([ @@ -360,7 +360,7 @@ protected static function antecedentsSection(): array ->columns() ->relationship('antecedents') ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl('edit_antecedents', ['record' => $record])), ]) ->extraAttributes([ @@ -404,7 +404,7 @@ protected static function flowSection(): array ->columns() ->relationship('flowPresentation') ->headerActions([ - Edit::make('edit') + EditAction::make() ->url(fn ($record) => BeneficiaryResource::getUrl('edit_flow_presentation', ['record' => $record])), ]) ->extraAttributes([ diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Widgets/ListSpecialistsWidget.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Widgets/ListSpecialistsWidget.php index 81398315..8396a3b1 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Widgets/ListSpecialistsWidget.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Widgets/ListSpecialistsWidget.php @@ -69,7 +69,6 @@ public function table(Table $table): Table return $record->toArray(); }) - ->label(__('beneficiary.section.specialists.change_action')) ->modalHeading(__('beneficiary.section.specialists.heading.edit_modal')) ->extraModalFooterActions([ DeleteAction::make() diff --git a/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/BenefitsWidget.php b/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/BenefitsWidget.php index 07825311..0d29e85b 100644 --- a/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/BenefitsWidget.php +++ b/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/BenefitsWidget.php @@ -59,7 +59,6 @@ public function table(Table $table): Table ]) ->actions([ EditAction::make() - ->label(__('intervention_plan.actions.edit')) ->form($this->getBenefitSchema()) ->extraModalFooterActions([ DeleteAction::make() diff --git a/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/ResultsWidget.php b/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/ResultsWidget.php index dfdf2d7e..66c9ce3f 100644 --- a/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/ResultsWidget.php +++ b/app/Filament/Organizations/Resources/InterventionPlanResource/Widgets/ResultsWidget.php @@ -75,7 +75,6 @@ public function table(Table $table): Table ]) ->actions([ EditAction::make() - ->label(__('general.action.change')) ->form($this->getFormSchema()) ->modalHeading(__('intervention_plan.headings.edit_result')) ->extraModalFooterActions([ diff --git a/app/Filament/Organizations/Resources/InterventionServiceResource.php b/app/Filament/Organizations/Resources/InterventionServiceResource.php index 45e4f329..c3a28ce6 100644 --- a/app/Filament/Organizations/Resources/InterventionServiceResource.php +++ b/app/Filament/Organizations/Resources/InterventionServiceResource.php @@ -10,10 +10,7 @@ use App\Filament\Organizations\Resources\BeneficiaryInterventionResource\Pages\ViewUnfoldedMeetings; use App\Filament\Organizations\Resources\InterventionServiceResource\Pages; use App\Models\InterventionService; -use Filament\Forms\Form; use Filament\Resources\Resource; -use Filament\Tables; -use Filament\Tables\Table; class InterventionServiceResource extends Resource { @@ -23,40 +20,6 @@ class InterventionServiceResource extends Resource public static string $parentResource = InterventionPlanResource::class; - public static function form(Form $form): Form - { - return $form - ->schema([ - - ]); - } - - public static function table(Table $table): Table - { - return $table - ->columns([ - // - ]) - ->filters([ - // - ]) - ->actions([ - Tables\Actions\EditAction::make(), - ]) - ->bulkActions([ - Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), - ]), - ]); - } - - public static function getRelations(): array - { - return [ - // - ]; - } - public static function getPages(): array { return [ diff --git a/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/CounselingSheetWidget.php b/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/CounselingSheetWidget.php index a1156b97..e4465170 100644 --- a/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/CounselingSheetWidget.php +++ b/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/CounselingSheetWidget.php @@ -18,6 +18,7 @@ use App\Enums\Ternary; use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Filament\Organizations\Resources\InterventionPlanResource; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\EnumEntry; use App\Infolists\Components\SectionHeader; use App\Models\InterventionService; @@ -77,17 +78,14 @@ protected function getInfoListSchema(): array SectionHeader::make('counseling_sheet') ->state(__('intervention_plan.headings.counseling_sheet')) ->action( - Action::make('view') - ->label(__('general.action.edit')) - ->icon('heroicon-o-pencil') + EditAction::make() ->url(InterventionPlanResource::getUrl( 'edit_counseling_sheet', [ 'parent' => $this->record->interventionPlan, 'record' => $this->record, ] - )) - ->link(), + )), ), ...$schema]), ]; diff --git a/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/ServiceDescriptionWidget.php b/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/ServiceDescriptionWidget.php index 2f89bbb5..f3f2e254 100644 --- a/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/ServiceDescriptionWidget.php +++ b/app/Filament/Organizations/Resources/InterventionServiceResource/Widgets/ServiceDescriptionWidget.php @@ -5,10 +5,9 @@ namespace App\Filament\Organizations\Resources\InterventionServiceResource\Widgets; use App\Filament\Organizations\Resources\InterventionPlanResource; +use App\Infolists\Components\Actions\EditAction; use App\Models\InterventionService; use App\Widgets\InfolistWidget; -use Filament\Infolists\Components\Actions\Action; -//use Filament\Actions\Action; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; @@ -28,10 +27,7 @@ protected function getInfolistSchema(): array ->maxWidth('3xl') ->columns() ->headerActions([ - Action::make('edit') - ->label(__('intervention_plan.actions.edit')) - ->icon('heroicon-o-pencil') - ->link() + EditAction::make() ->url(InterventionPlanResource::getUrl('edit_intervention_service', [ 'parent' => $this->record->interventionPlan, 'record' => $this->record, diff --git a/app/Filament/Organizations/Resources/MonitoringResource.php b/app/Filament/Organizations/Resources/MonitoringResource.php index 62ef05e8..5d33cadd 100644 --- a/app/Filament/Organizations/Resources/MonitoringResource.php +++ b/app/Filament/Organizations/Resources/MonitoringResource.php @@ -5,10 +5,7 @@ namespace App\Filament\Organizations\Resources; use App\Models\Monitoring; -use Filament\Forms\Form; use Filament\Resources\Resource; -use Filament\Tables; -use Filament\Tables\Table; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Database\Eloquent\Model; @@ -24,31 +21,4 @@ public static function getRecordTitle(Model|null $record): string|null|Htmlable { return $record->number; } - - public static function form(Form $form): Form - { - return $form - ->schema([ - // - ]); - } - - public static function table(Table $table): Table - { - return $table - ->columns([ - // - ]) - ->filters([ - // - ]) - ->actions([ - Tables\Actions\EditAction::make(), - ]) - ->bulkActions([ - Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), - ]), - ]); - } } diff --git a/app/Filament/Organizations/Resources/MonitoringResource/Pages/ViewMonitoring.php b/app/Filament/Organizations/Resources/MonitoringResource/Pages/ViewMonitoring.php index 2c8be481..3627878e 100644 --- a/app/Filament/Organizations/Resources/MonitoringResource/Pages/ViewMonitoring.php +++ b/app/Filament/Organizations/Resources/MonitoringResource/Pages/ViewMonitoring.php @@ -9,7 +9,7 @@ use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Filament\Organizations\Resources\BeneficiaryResource\Pages\ViewBeneficiaryIdentity; use App\Filament\Organizations\Resources\MonitoringResource; -use App\Infolists\Components\Actions\Edit; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DateEntry; use App\Infolists\Components\SectionHeader; use App\Services\Breadcrumb\BeneficiaryBreadcrumb; @@ -71,7 +71,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('monitoring.headings.details')) ->headerActions([ - Edit::make('edit_details') + EditAction::make() ->url(self::getParentResource()::getUrl('monitoring.edit_details', [ 'parent' => $this->parent, 'record' => $this->getRecord(), @@ -110,7 +110,7 @@ public function infolist(Infolist $infolist): Infolist Section::make(__('monitoring.headings.child_info')) ->visible(fn () => $this->getRecord()->children->isNotEmpty()) ->headerActions([ - Edit::make('edit_details') + EditAction::make() ->url(self::getParentResource()::getUrl('monitoring.edit_children', [ 'parent' => $this->parent, 'record' => $this->getRecord(), @@ -165,7 +165,7 @@ public function infolist(Infolist $infolist): Infolist ->schema([ Section::make(__('monitoring.headings.general')) ->headerActions([ - Edit::make('edit_details') + EditAction::make() ->url(self::getParentResource()::getUrl('monitoring.edit_general', [ 'parent' => $this->parent, 'record' => $this->getRecord(), diff --git a/app/Filament/Organizations/Resources/MonthlyPlanResource/Pages/ViewMonthlyPlan.php b/app/Filament/Organizations/Resources/MonthlyPlanResource/Pages/ViewMonthlyPlan.php index b3eeb9bd..34936468 100644 --- a/app/Filament/Organizations/Resources/MonthlyPlanResource/Pages/ViewMonthlyPlan.php +++ b/app/Filament/Organizations/Resources/MonthlyPlanResource/Pages/ViewMonthlyPlan.php @@ -9,13 +9,13 @@ use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Filament\Organizations\Resources\InterventionPlanResource; use App\Filament\Organizations\Resources\MonthlyPlanResource; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\SectionHeader; use App\Infolists\Components\TableEntry; use App\Models\Specialist; use App\Services\Breadcrumb\InterventionPlanBreadcrumb; use Carbon\Carbon; use Filament\Actions\DeleteAction; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\RepeatableEntry; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\Tabs; @@ -87,9 +87,7 @@ public function infolist(Infolist $infolist): Infolist SectionHeader::make('monthly_plan_details') ->state(__('intervention_plan.headings.monthly_plan_details')) ->action( - Action::make('edit_details') - ->label(__('general.action.edit')) - ->link() + EditAction::make() ->url( InterventionPlanResource::getUrl('edit_monthly_plan_details', [ 'parent' => $this->parent, @@ -137,9 +135,7 @@ public function infolist(Infolist $infolist): Infolist SectionHeader::make('monthly_plan_details') ->state(__('intervention_plan.headings.services_and_interventions')) ->action( - Action::make('edit_details') - ->label(__('general.action.edit')) - ->link() + EditAction::make() ->url( InterventionPlanResource::getUrl('edit_monthly_plan_services_and_interventions', [ 'parent' => $this->parent, diff --git a/app/Filament/Organizations/Resources/UserResource/Pages/ViewUser.php b/app/Filament/Organizations/Resources/UserResource/Pages/ViewUser.php index 71cdd779..1782e81b 100644 --- a/app/Filament/Organizations/Resources/UserResource/Pages/ViewUser.php +++ b/app/Filament/Organizations/Resources/UserResource/Pages/ViewUser.php @@ -13,10 +13,10 @@ use App\Filament\Organizations\Resources\UserResource\Actions\ReactivateUserAction; use App\Filament\Organizations\Resources\UserResource\Actions\ResendInvitationAction; use App\Filament\Organizations\Resources\UserResource\Actions\ResetPasswordAction; +use App\Infolists\Components\Actions\EditAction; use App\Infolists\Components\DateTimeEntry; use App\Infolists\Components\SectionHeader; use App\Models\User; -use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\Group; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; @@ -44,10 +44,8 @@ public function infolist(Infolist $infolist): Infolist ->columns() ->maxWidth('3xl') ->headerActions([ - Action::make('edit') - ->label(__('general.action.edit')) - ->url(self::$resource::getUrl('edit', ['record' => $this->getRecord()])) - ->link(), + EditAction::make() + ->url(self::$resource::getUrl('edit', ['record' => $this->getRecord()])), ]) ->schema([ diff --git a/app/Infolists/Components/Actions/Edit.php b/app/Infolists/Components/Actions/EditAction.php similarity index 85% rename from app/Infolists/Components/Actions/Edit.php rename to app/Infolists/Components/Actions/EditAction.php index dad0cc62..0f7355c3 100644 --- a/app/Infolists/Components/Actions/Edit.php +++ b/app/Infolists/Components/Actions/EditAction.php @@ -7,7 +7,7 @@ use App\Concerns\HasModalExtraFooterActionsAlignment; use Filament\Infolists\Components\Actions\Action; -class Edit extends Action +class EditAction extends Action { use HasModalExtraFooterActionsAlignment; @@ -21,6 +21,7 @@ protected function setUp(): void parent::setUp(); $this->label(__('general.action.edit')); + $this->icon('heroicon-o-pencil-square'); $this->link(); } diff --git a/app/Tables/Actions/EditAction.php b/app/Tables/Actions/EditAction.php index c8fbf262..05ec3d4a 100644 --- a/app/Tables/Actions/EditAction.php +++ b/app/Tables/Actions/EditAction.php @@ -10,4 +10,12 @@ class EditAction extends BaseEditAction { use HasModalExtraFooterActionsAlignment; + + protected function setUp(): void + { + parent::setUp(); + + $this->label(__('general.action.change')); + $this->icon(null); + } } diff --git a/lang/ro/beneficiary.php b/lang/ro/beneficiary.php index 67d468eb..2b3e298d 100644 --- a/lang/ro/beneficiary.php +++ b/lang/ro/beneficiary.php @@ -311,7 +311,6 @@ 'specialists' => [ 'title' => 'Echipa de caz', 'add_action' => 'Adaugă membru echipă', - 'change_action' => 'Modifică', 'heading' => [ 'add_modal' => 'Adaugă membru în echipă', 'edit_modal' => 'Modifică membru în echipă', diff --git a/lang/ro/intervention_plan.php b/lang/ro/intervention_plan.php index 8ce307b9..56d2ba90 100644 --- a/lang/ro/intervention_plan.php +++ b/lang/ro/intervention_plan.php @@ -253,7 +253,6 @@ 'actions' => [ 'create' => 'Creează plan', - 'edit' => 'Editează', 'edit_intervention_plan' => 'Actualizează detalii', 'add_service' => 'Adaugă serviciu', 'add_service_repeater' => 'Adaugă încă un serviciu', diff --git a/lang/ro/nomenclature.php b/lang/ro/nomenclature.php index d752a62a..2b74e9c6 100644 --- a/lang/ro/nomenclature.php +++ b/lang/ro/nomenclature.php @@ -83,7 +83,6 @@ 'add_role' => 'Adaugă rol specialist', 'edit_role' => 'Modifică rol specialist', 'delete_role' => 'Șterge rol', - 'edit' => 'Modifică', 'add_benefit' => 'Adaugă beneficiu social', 'add_benefit_type' => 'Adaugă încă un tip', 'edit_benefit' => 'Modifică beneficiu',