Skip to content

Commit

Permalink
Merge pull request #378 from liberu-genealogy/analysis-16JBoA
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
curtisdelicata authored Mar 13, 2024
2 parents 7106916 + e98b777 commit c1f74fe
Show file tree
Hide file tree
Showing 63 changed files with 345 additions and 386 deletions.
1 change: 0 additions & 1 deletion app/Filament/Pages/DAbovilleReportPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Filament\Pages;

use App\Filament\Pages\CustomFilamentBasePage;
use Livewire\Livewire;

class DAbovilleReportPage extends CustomFilamentBasePage
Expand Down
3 changes: 0 additions & 3 deletions app/Filament/Pages/ManageSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

namespace App\Filament\Pages;

use App\Filament\Pages\CustomFilamentBasePage;
use App\Services\StripeSubscriptionService;
use Livewire\Component;
use Filament\Forms;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Select;

class ManageSubscription extends CustomFilamentBasePage
Expand Down
1 change: 0 additions & 1 deletion app/Filament/Pages/PedigreeChartPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Filament\Pages;

use Filament\Resources\ResourcePage;
use Filament\Pages\Page;

class PedigreeChartPage extends Page
Expand Down
1 change: 0 additions & 1 deletion app/Filament/Pages/PeopleDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Filament\Pages;

use Filament\Pages\Page;
use Livewire\Livewire;

class PeopleDashboard extends Page
{
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Pages/Tenancy/RegisterTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function form(Form $form): Form
resolve(TeamInvitationController::class)->sendInvitation(new Request(['email' => $email, 'team_id' => $teamId]));
}
})
->type('button')
->type('button'),
]);
}

Expand Down
6 changes: 2 additions & 4 deletions app/Filament/Resources/DnaResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ class DnaResource extends Resource

/**
* Define the form fields and behavior for the DnaResource.
*
* @param Form $form
*
* @return Form
*
* @param Form $form
* @param Form $form
*
* @return Form
* @return Form
*/
public static function form(Form $form): Form
{
Expand Down
5 changes: 1 addition & 4 deletions app/Filament/Resources/FamilyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use App\Models\Type;
use App\Models\Husband;
use App\Models\Wife;

class FamilyResource extends Resource
{
Expand All @@ -33,7 +30,7 @@ public static function form(Form $form): Form
Forms\Components\TextInput::make('husband_id')
->numeric(),
Forms\Components\TextInput::make('wife_id')
->numeric(),
->numeric(),
Forms\Components\TextInput::make('chan')
->maxLength(255),
Forms\Components\TextInput::make('nchi')
Expand Down
30 changes: 14 additions & 16 deletions app/Filament/Resources/GedcomResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
namespace App\Filament\Resources;

use App\Filament\Resources\GedcomResource\Pages;
use App\Jobs\ImportGedcom;
use App\Models\Gedcom;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use App\Jobs\ImportGedcom;
use Illuminate\Support\Facades\Storage;

class GedcomResource extends Resource {
class GedcomResource extends Resource
{
/**
* Class GedcomResource
* Class GedcomResource.
*
* This class represents a resource for handling Gedcom data.
*
Expand All @@ -25,7 +26,7 @@ class GedcomResource extends Resource {
protected static ?string $model = Gedcom::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function getPages(): array
{
return [
Expand All @@ -36,18 +37,14 @@ public static function getPages(): array
];
}



/**
/**
* Define the form fields and behavior for the DnaResource.
*
* @param Form $form
*
* @return Form
*
* @param Form $form
* @param Form $form
*
* @return Form
* @return Form
*/
public static function form(Form $form): Form
{
Expand All @@ -68,10 +65,11 @@ public static function form(Form $form): Form
]);
}

/**
/**
* Define the table columns, filters, actions, and bulk actions.
*
* @param Table $table The table object to be defined.
* @param Table $table The table object to be defined.
*
* @return Table The updated table.
*/
public static function table(Table $table): Table
Expand All @@ -97,7 +95,7 @@ public static function table(Table $table): Table
]);
}

/**
/**
* Perform the import functionality.
*
* @return array
Expand All @@ -114,7 +112,7 @@ private static function import(): array
public static function exportGedcom(): void
{
$user = auth()->user(); // Assuming the user is authenticated
$fileName = now()->format('Y-m-d_His') . '_family_tree.ged'; // Generating a unique file name
$fileName = now()->format('Y-m-d_His').'_family_tree.ged'; // Generating a unique file name
ExportGedCom::dispatch($fileName, $user);
}
}
}
84 changes: 46 additions & 38 deletions app/Filament/Resources/PersonResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,61 @@ class PersonResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

/**
* Get the form for creating/editing a person.
* @param Form $form The form object.
* @return Form The form object.
*/
public static function form(Form $form): Form
* Get the form for creating/editing a person.
*
* @param Form $form The form object.
*
* @return Form The form object.
*/
public static function form(Form $form): Form
{
return $form
->schema([
/**
* Name field.
* @var TextInput
*/
TextInput::make('name')
->required()
->label('Name'),
* Name field.
*
* @var TextInput
*/
TextInput::make('name')
->required()
->label('Name'),
/**
* Birth Date field.
* @var DatePicker
*/
DatePicker::make('birth_date')
->label('Birth Date'),
* Birth Date field.
*
* @var DatePicker
*/
DatePicker::make('birth_date')
->label('Birth Date'),
/**
* Death Date field.
* @var DatePicker
*/
DatePicker::make('death_date')
->label('Death Date'),
* Death Date field.
*
* @var DatePicker
*/
DatePicker::make('death_date')
->label('Death Date'),
/**
* Father field.
* @var SelectInput
*/
SelectInput::make('father_id')
->relationship('father', 'name')
->label('Father'),
* Father field.
*
* @var SelectInput
*/
SelectInput::make('father_id')
->relationship('father', 'name')
->label('Father'),
/**
* Mother field.
* @var SelectInput
*/
SelectInput::make('mother_id')
->relationship('mother', 'name')
->label('Mother'),
* Mother field.
*
* @var SelectInput
*/
SelectInput::make('mother_id')
->relationship('mother', 'name')
->label('Mother'),
/**
* Notes field.
* @var Textarea
*/
Textarea::make('notes')
->label('Notes'),
* Notes field.
*
* @var Textarea
*/
Textarea::make('notes')
->label('Notes'),
]);
}

Expand Down
19 changes: 9 additions & 10 deletions app/Filament/Widgets/DabovilleReportWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Filament\Widgets;

use Filament\Widgets\Widget;
use App\Models\Person;
use Filament\Widgets\Widget;

class DabovilleReportWidget extends Widget
{
Expand Down Expand Up @@ -31,21 +31,20 @@ private function traverseFamilyTree($person, $currentNumber)
{
$this->reportData[$person->id] = [
'number' => $currentNumber,
'name' => $person->fullname(),
'birth' => optional($person->birth())->date,
'death' => optional($person->death())->date,
'name' => $person->fullname(),
'birth' => optional($person->birth())->date,
'death' => optional($person->death())->date,
];

$childNumber = 1;
foreach ($person->child_in_family as $child) {
$this->traverseFamilyTree($child, $currentNumber . '.' . $childNumber);
$this->traverseFamilyTree($child, $currentNumber.'.'.$childNumber);
$childNumber++;
}
}

public function render(): \Illuminate\Contracts\View\View
{
return view(static::$view, ['reportData' => $this->reportData, 'selectedPersonId' => $this->selectedPersonId]);
}

public function render(): \Illuminate\Contracts\View\View
{
return view(static::$view, ['reportData' => $this->reportData, 'selectedPersonId' => $this->selectedPersonId]);
}
}
4 changes: 2 additions & 2 deletions app/Filament/Widgets/DescendantChartWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Filament\Widgets;

use Filament\Widgets\Widget;
use App\Models\Person;
use Filament\Widgets\Widget;

class DescendantChartWidget extends Widget
{
Expand All @@ -21,7 +21,7 @@ private function processDescendantData($data)
{
return array_map(function ($item) {
return [
'id' => $item['id'],
'id' => $item['id'],
'name' => $item['name'],
];
}, $data);
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Widgets/FanChartWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Filament\Widgets;

use Filament\Widgets\Widget;
use App\Models\Person;
use Filament\Widgets\Widget;

class FanChartWidget extends Widget
{
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Widgets/PedigreeChartWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Filament\Widgets;

use Filament\Widgets\Widget;
use App\Models\Person;
use Filament\Widgets\Widget;

class PedigreeChartWidget extends Widget
{
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

namespace App\Http\Controllers;

use App\Mail\ContactMail;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use App\Mail\ContactMail;

class ContactController extends Controller
{
public function sendEmail(Request $request)
{
$validatedData = $request->validate([
'name' => 'required|string|max:255',
'email' => 'required|email',
'message' => 'required|string'
'name' => 'required|string|max:255',
'email' => 'required|email',
'message' => 'required|string',
]);

Mail::to(env('CONTACT_EMAIL'))->send(new ContactMail($validatedData));
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/FanChartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class FanChartController extends Controller
{
public function show()
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/PedigreeChartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class PedigreeChartController extends Controller
{
public function __construct()
Expand Down
Loading

0 comments on commit c1f74fe

Please sign in to comment.