Skip to content

Commit 867622f

Browse files
committed
Project upgrade to Filament 3/4 and laravel 12
1 parent 5498216 commit 867622f

143 files changed

Lines changed: 5996 additions & 4673 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/Console/Kernel.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/Exceptions/Handler.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

app/Filament/Pages/Board.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Filament\Pages;
44

55
use App\Models\Project;
6-
use Filament\Forms\Components\Card;
6+
use Filament\Forms\Components\Section;
77
use Filament\Forms\Components\Grid;
88
use Filament\Forms\Components\Select;
99
use Filament\Forms\Concerns\InteractsWithForms;
@@ -15,15 +15,15 @@ class Board extends Page implements HasForms
1515
{
1616
use InteractsWithForms;
1717

18-
protected static ?string $navigationIcon = 'heroicon-o-view-boards';
18+
protected static ?string $navigationIcon = 'heroicon-o-view-columns';
1919

2020
protected static string $view = 'filament.pages.board';
2121

2222
protected static ?string $slug = 'board';
2323

2424
protected static ?int $navigationSort = 4;
2525

26-
protected function getSubheading(): string|Htmlable|null
26+
public function getSubheading(): string|Htmlable|null
2727
{
2828
return __("In this section you can choose one of your projects to show it's Scrum or Kanban board");
2929
}
@@ -33,20 +33,20 @@ public function mount(): void
3333
$this->form->fill();
3434
}
3535

36-
protected static function getNavigationLabel(): string
36+
public static function getNavigationLabel(): string
3737
{
3838
return __('Board');
3939
}
4040

41-
protected static function getNavigationGroup(): ?string
41+
public static function getNavigationGroup(): ?string
4242
{
4343
return __('Management');
4444
}
4545

46-
protected function getFormSchema(): array
46+
public function getFormSchema(): array
4747
{
4848
return [
49-
Card::make()
49+
Section::make()
5050
->schema([
5151
Grid::make()
5252
->columns(1)
@@ -55,7 +55,7 @@ protected function getFormSchema(): array
5555
->label(__('Project'))
5656
->required()
5757
->searchable()
58-
->reactive()
58+
->live()
5959
->afterStateUpdated(fn () => $this->search())
6060
->helperText(__("Choose a project to show it's board"))
6161
->options(fn() => Project::where('owner_id', auth()->user()->id)
@@ -72,9 +72,9 @@ public function search(): void
7272
$data = $this->form->getState();
7373
$project = Project::find($data['project']);
7474
if ($project->type === "scrum") {
75-
$this->redirect(route('filament.pages.scrum/{project}', ['project' => $project]));
75+
$this->redirect(route('filament.admin.pages.scrum/{project}', ['project' => $project]));
7676
} else {
77-
$this->redirect(route('filament.pages.kanban/{project}', ['project' => $project]));
77+
$this->redirect(route('filament.admin.pages.kanban/{project}', ['project' => $project]));
7878
}
7979
}
8080
}

app/Filament/Pages/Dashboard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class Dashboard extends BasePage
1717
{
1818
protected static bool $shouldRegisterNavigation = false;
1919

20-
protected function getColumns(): int | array
20+
public function getColumns(): int | string | array
2121
{
2222
return 6;
2323
}
2424

25-
protected function getWidgets(): array
25+
public function getWidgets(): array
2626
{
2727
return [
2828
FavoriteProjects::class,

app/Filament/Pages/JiraImport.php

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use App\Helpers\JiraHelper;
66
use App\Jobs\ImportJiraTicketsJob;
7-
use Filament\Forms\Components\Card;
7+
use Filament\Forms\Components\Section;
88
use Filament\Forms\Components\Checkbox;
99
use Filament\Forms\Components\CheckboxList;
1010
use Filament\Forms\Components\Grid;
@@ -13,6 +13,7 @@
1313
use Filament\Forms\Components\Wizard;
1414
use Filament\Forms\Concerns\InteractsWithForms;
1515
use Filament\Forms\Contracts\HasForms;
16+
use Filament\Notifications\Notification;
1617
use Filament\Pages\Page;
1718
use Illuminate\Contracts\Support\Htmlable;
1819
use Illuminate\Support\HtmlString;
@@ -22,7 +23,7 @@ class JiraImport extends Page implements HasForms
2223
{
2324
use InteractsWithForms, JiraHelper;
2425

25-
protected static ?string $navigationIcon = 'heroicon-o-cloud-download';
26+
protected static ?string $navigationIcon = 'heroicon-o-cloud-arrow-down';
2627

2728
protected static string $view = 'filament.pages.jira-import';
2829

@@ -52,30 +53,30 @@ public function mount(): void
5253
$this->form->fill();
5354
}
5455

55-
protected static function shouldRegisterNavigation(): bool
56+
public static function shouldRegisterNavigation(): bool
5657
{
5758
return auth()->user()->can('Import from Jira');
5859
}
5960

60-
protected function getSubheading(): string|Htmlable|null
61+
public function getSubheading(): string|Htmlable|null
6162
{
6263
return __('Use this section to login into your jira account and import tickets to this application');
6364
}
6465

65-
protected static function getNavigationLabel(): string
66+
public static function getNavigationLabel(): string
6667
{
6768
return __('Jira import');
6869
}
6970

70-
protected static function getNavigationGroup(): ?string
71+
public static function getNavigationGroup(): ?string
7172
{
7273
return __('Settings');
7374
}
7475

75-
protected function getFormSchema(): array
76+
public function getFormSchema(): array
7677
{
7778
return [
78-
Card::make()
79+
Section::make()
7980
->schema([
8081
Wizard::make([
8182
Wizard\Step::make(__('Jira login'))
@@ -84,7 +85,7 @@ protected function getFormSchema(): array
8485
->extraAttributes([
8586
'class' => 'bg-primary-500 rounded-lg border border-primary-600 text-white font-medium text-sm py-3 px-4'
8687
])
87-
->disableLabel()
88+
->hiddenLabel()
8889
->content(__('Important: Your jira credentials are only used to communicate with jira REST API, and will not be stored in this application')),
8990

9091
Grid::make()
@@ -117,23 +118,23 @@ protected function getFormSchema(): array
117118
->extraAttributes([
118119
'class' => 'bg-primary-500 rounded-lg border border-primary-600 text-white font-medium text-sm py-3 px-4'
119120
])
120-
->disableLabel()
121+
->hiddenLabel()
121122
->visible(fn() => !$this->loadingProjects && $this->projects)
122123
->content(__('Choose your jira projects to import')),
123124

124125
Placeholder::make('loading')
125126
->extraAttributes([
126127
'class' => 'bg-warning-500 rounded-lg border border-warning-600 text-white font-medium text-sm py-3 px-4'
127128
])
128-
->disableLabel()
129+
->hiddenLabel()
129130
->visible(fn() => $this->loadingProjects)
130131
->content(__('Loading projects, please wait...')),
131132

132133
Placeholder::make('info')
133134
->extraAttributes([
134135
'class' => 'bg-danger-500 rounded-lg border border-danger-600 text-white font-medium text-sm py-3 px-4'
135136
])
136-
->disableLabel()
137+
->hiddenLabel()
137138
->visible(fn() => !$this->loadingProjects && !$this->projects)
138139
->content(__('Your jira credentials are incorrect, please go to previous step and re-enter your jira credentials')),
139140

@@ -173,15 +174,15 @@ protected function getFormSchema(): array
173174
->extraAttributes([
174175
'class' => 'bg-primary-500 rounded-lg border border-primary-600 text-white font-medium text-sm py-3 px-4'
175176
])
176-
->disableLabel()
177+
->hiddenLabel()
177178
->visible(fn() => !$this->loadingTickets && $this->tickets)
178179
->content(__('Choose your jira projects to import'));
179180

180181
$fields[] = Placeholder::make('loading')
181182
->extraAttributes([
182183
'class' => 'bg-warning-500 rounded-lg border border-warning-600 text-white font-medium text-sm py-3 px-4'
183184
])
184-
->disableLabel()
185+
->hiddenLabel()
185186
->visible(fn() => $this->loadingTickets)
186187
->content(__('Loading tickets, please wait...'));
187188

@@ -219,7 +220,7 @@ protected function getFormSchema(): array
219220
->extraAttributes([
220221
'class' => 'bg-warning-500 rounded-lg border border-warning-600 text-white font-medium text-sm py-3 px-4'
221222
])
222-
->disableLabel()
223+
->hiddenLabel()
223224
->visible(fn() => !$this->projects)
224225
->content(__('No tickets found!'));
225226
}
@@ -241,10 +242,16 @@ public function import(): void
241242
$tickets[] = $this->getJiraTicketDetails($this->host, $this->username, $this->token, $url);
242243
}
243244
dispatch(new ImportJiraTicketsJob($tickets, auth()->user()));
244-
$this->notify('success', __('The importation job is started, when finished you will be notified'), true);
245-
$this->redirect(route('filament.pages.jira-import'));
245+
Notification::make()
246+
->success()
247+
->title(__('The importation job is started, when finished you will be notified'))
248+
->send();
249+
$this->redirect(route('filament.admin.pages.jira-import'));
246250
} else {
247-
$this->notify('warning', __('Please choose at least a jira ticket to import'));
251+
Notification::make()
252+
->warning()
253+
->title(__('Please choose at least a jira ticket to import'))
254+
->send();
248255
}
249256
}
250257

app/Filament/Pages/Kanban.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
use App\Helpers\KanbanScrumHelper;
66
use App\Models\Project;
7-
use Filament\Facades\Filament;
87
use Filament\Forms\Concerns\InteractsWithForms;
98
use Filament\Forms\Contracts\HasForms;
10-
use Filament\Pages\Actions\Action;
9+
use Filament\Notifications\Notification;
10+
use Filament\Actions\Action;
1111
use Filament\Pages\Page;
1212
use Illuminate\Contracts\Support\Htmlable;
1313

1414
class Kanban extends Page implements HasForms
1515
{
1616
use InteractsWithForms, KanbanScrumHelper;
1717

18-
protected static ?string $navigationIcon = 'heroicon-o-view-boards';
18+
protected static ?string $navigationIcon = 'heroicon-o-view-columns';
1919

2020
protected static ?string $slug = 'kanban/{project}';
2121

@@ -32,7 +32,7 @@ public function mount(Project $project)
3232
{
3333
$this->project = $project;
3434
if ($this->project->type === 'scrum') {
35-
$this->redirect(route('filament.pages.scrum/{project}', ['project' => $project]));
35+
$this->redirect(route('filament.admin.pages.scrum/{project}', ['project' => $project]));
3636
} elseif (
3737
$this->project->owner_id != auth()->user()->id
3838
&&
@@ -43,26 +43,29 @@ public function mount(Project $project)
4343
$this->form->fill();
4444
}
4545

46-
protected function getActions(): array
46+
public function getHeaderActions(): array
4747
{
4848
return [
4949
Action::make('refresh')
5050
->button()
5151
->label(__('Refresh'))
52-
->color('secondary')
52+
->color('gray')
5353
->action(function () {
5454
$this->getRecords();
55-
Filament::notify('success', __('Kanban board updated'));
55+
Notification::make()
56+
->success()
57+
->title(__('Kanban board updated'))
58+
->send();
5659
})
5760
];
5861
}
5962

60-
protected function getHeading(): string|Htmlable
63+
public function getHeading(): string|Htmlable
6164
{
6265
return $this->kanbanHeading();
6366
}
6467

65-
protected function getFormSchema(): array
68+
public function getFormSchema(): array
6669
{
6770
return $this->formSchema();
6871
}

0 commit comments

Comments
 (0)