Skip to content

Commit ac327ba

Browse files
authored
Merge pull request #144 from mihaisolomon/feature/app-v-2
Ver: 2.0
2 parents 5498216 + ac755a5 commit ac327ba

184 files changed

Lines changed: 10392 additions & 7354 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: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

33
namespace App\Filament\Pages;
4+
use BackedEnum;
45

56
use App\Models\Project;
6-
use Filament\Forms\Components\Card;
7-
use Filament\Forms\Components\Grid;
7+
use Filament\Schemas\Components\Section;
8+
use Filament\Schemas\Components\Grid;
89
use Filament\Forms\Components\Select;
910
use Filament\Forms\Concerns\InteractsWithForms;
1011
use Filament\Forms\Contracts\HasForms;
@@ -15,15 +16,15 @@ class Board extends Page implements HasForms
1516
{
1617
use InteractsWithForms;
1718

18-
protected static ?string $navigationIcon = 'heroicon-o-view-boards';
19+
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-view-columns';
1920

20-
protected static string $view = 'filament.pages.board';
21+
protected string $view = 'filament.pages.board';
2122

2223
protected static ?string $slug = 'board';
2324

2425
protected static ?int $navigationSort = 4;
2526

26-
protected function getSubheading(): string|Htmlable|null
27+
public function getSubheading(): string|Htmlable|null
2728
{
2829
return __("In this section you can choose one of your projects to show it's Scrum or Kanban board");
2930
}
@@ -33,20 +34,20 @@ public function mount(): void
3334
$this->form->fill();
3435
}
3536

36-
protected static function getNavigationLabel(): string
37+
public static function getNavigationLabel(): string
3738
{
3839
return __('Board');
3940
}
4041

41-
protected static function getNavigationGroup(): ?string
42+
public static function getNavigationGroup(): ?string
4243
{
4344
return __('Management');
4445
}
4546

46-
protected function getFormSchema(): array
47+
public function getFormSchema(): array
4748
{
4849
return [
49-
Card::make()
50+
Section::make()
5051
->schema([
5152
Grid::make()
5253
->columns(1)
@@ -55,7 +56,7 @@ protected function getFormSchema(): array
5556
->label(__('Project'))
5657
->required()
5758
->searchable()
58-
->reactive()
59+
->live()
5960
->afterStateUpdated(fn () => $this->search())
6061
->helperText(__("Choose a project to show it's board"))
6162
->options(fn() => Project::where('owner_id', auth()->user()->id)
@@ -72,9 +73,9 @@ public function search(): void
7273
$data = $this->form->getState();
7374
$project = Project::find($data['project']);
7475
if ($project->type === "scrum") {
75-
$this->redirect(route('filament.pages.scrum/{project}', ['project' => $project]));
76+
$this->redirect(route('filament.admin.pages.scrum.{project}', ['project' => $project]));
7677
} else {
77-
$this->redirect(route('filament.pages.kanban/{project}', ['project' => $project]));
78+
$this->redirect(route('filament.admin.pages.kanban.{project}', ['project' => $project]));
7879
}
7980
}
8081
}

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 | 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: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<?php
22

33
namespace App\Filament\Pages;
4+
use BackedEnum;
45

56
use App\Helpers\JiraHelper;
67
use App\Jobs\ImportJiraTicketsJob;
7-
use Filament\Forms\Components\Card;
8+
use Filament\Schemas\Components\Section;
89
use Filament\Forms\Components\Checkbox;
910
use Filament\Forms\Components\CheckboxList;
10-
use Filament\Forms\Components\Grid;
11+
use Filament\Schemas\Components\Grid;
1112
use Filament\Forms\Components\Placeholder;
1213
use Filament\Forms\Components\TextInput;
13-
use Filament\Forms\Components\Wizard;
14+
use Filament\Schemas\Components\Wizard;
1415
use Filament\Forms\Concerns\InteractsWithForms;
1516
use Filament\Forms\Contracts\HasForms;
17+
use Filament\Notifications\Notification;
1618
use Filament\Pages\Page;
1719
use Illuminate\Contracts\Support\Htmlable;
1820
use Illuminate\Support\HtmlString;
@@ -22,9 +24,9 @@ class JiraImport extends Page implements HasForms
2224
{
2325
use InteractsWithForms, JiraHelper;
2426

25-
protected static ?string $navigationIcon = 'heroicon-o-cloud-download';
27+
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-cloud-arrow-down';
2628

27-
protected static string $view = 'filament.pages.jira-import';
29+
protected string $view = 'filament.pages.jira-import';
2830

2931
protected static ?string $slug = 'jira-import';
3032

@@ -52,30 +54,30 @@ public function mount(): void
5254
$this->form->fill();
5355
}
5456

55-
protected static function shouldRegisterNavigation(): bool
57+
public static function shouldRegisterNavigation(): bool
5658
{
5759
return auth()->user()->can('Import from Jira');
5860
}
5961

60-
protected function getSubheading(): string|Htmlable|null
62+
public function getSubheading(): string|Htmlable|null
6163
{
6264
return __('Use this section to login into your jira account and import tickets to this application');
6365
}
6466

65-
protected static function getNavigationLabel(): string
67+
public static function getNavigationLabel(): string
6668
{
6769
return __('Jira import');
6870
}
6971

70-
protected static function getNavigationGroup(): ?string
72+
public static function getNavigationGroup(): ?string
7173
{
7274
return __('Settings');
7375
}
7476

75-
protected function getFormSchema(): array
77+
public function getFormSchema(): array
7678
{
7779
return [
78-
Card::make()
80+
Section::make()
7981
->schema([
8082
Wizard::make([
8183
Wizard\Step::make(__('Jira login'))
@@ -84,7 +86,7 @@ protected function getFormSchema(): array
8486
->extraAttributes([
8587
'class' => 'bg-primary-500 rounded-lg border border-primary-600 text-white font-medium text-sm py-3 px-4'
8688
])
87-
->disableLabel()
89+
->hiddenLabel()
8890
->content(__('Important: Your jira credentials are only used to communicate with jira REST API, and will not be stored in this application')),
8991

9092
Grid::make()
@@ -117,23 +119,23 @@ protected function getFormSchema(): array
117119
->extraAttributes([
118120
'class' => 'bg-primary-500 rounded-lg border border-primary-600 text-white font-medium text-sm py-3 px-4'
119121
])
120-
->disableLabel()
122+
->hiddenLabel()
121123
->visible(fn() => !$this->loadingProjects && $this->projects)
122124
->content(__('Choose your jira projects to import')),
123125

124126
Placeholder::make('loading')
125127
->extraAttributes([
126128
'class' => 'bg-warning-500 rounded-lg border border-warning-600 text-white font-medium text-sm py-3 px-4'
127129
])
128-
->disableLabel()
130+
->hiddenLabel()
129131
->visible(fn() => $this->loadingProjects)
130132
->content(__('Loading projects, please wait...')),
131133

132134
Placeholder::make('info')
133135
->extraAttributes([
134136
'class' => 'bg-danger-500 rounded-lg border border-danger-600 text-white font-medium text-sm py-3 px-4'
135137
])
136-
->disableLabel()
138+
->hiddenLabel()
137139
->visible(fn() => !$this->loadingProjects && !$this->projects)
138140
->content(__('Your jira credentials are incorrect, please go to previous step and re-enter your jira credentials')),
139141

@@ -173,15 +175,15 @@ protected function getFormSchema(): array
173175
->extraAttributes([
174176
'class' => 'bg-primary-500 rounded-lg border border-primary-600 text-white font-medium text-sm py-3 px-4'
175177
])
176-
->disableLabel()
178+
->hiddenLabel()
177179
->visible(fn() => !$this->loadingTickets && $this->tickets)
178180
->content(__('Choose your jira projects to import'));
179181

180182
$fields[] = Placeholder::make('loading')
181183
->extraAttributes([
182184
'class' => 'bg-warning-500 rounded-lg border border-warning-600 text-white font-medium text-sm py-3 px-4'
183185
])
184-
->disableLabel()
186+
->hiddenLabel()
185187
->visible(fn() => $this->loadingTickets)
186188
->content(__('Loading tickets, please wait...'));
187189

@@ -219,7 +221,7 @@ protected function getFormSchema(): array
219221
->extraAttributes([
220222
'class' => 'bg-warning-500 rounded-lg border border-warning-600 text-white font-medium text-sm py-3 px-4'
221223
])
222-
->disableLabel()
224+
->hiddenLabel()
223225
->visible(fn() => !$this->projects)
224226
->content(__('No tickets found!'));
225227
}
@@ -241,10 +243,16 @@ public function import(): void
241243
$tickets[] = $this->getJiraTicketDetails($this->host, $this->username, $this->token, $url);
242244
}
243245
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'));
246+
Notification::make()
247+
->success()
248+
->title(__('The importation job is started, when finished you will be notified'))
249+
->send();
250+
$this->redirect(route('filament.admin.pages.jira-import'));
246251
} else {
247-
$this->notify('warning', __('Please choose at least a jira ticket to import'));
252+
Notification::make()
253+
->warning()
254+
->title(__('Please choose at least a jira ticket to import'))
255+
->send();
248256
}
249257
}
250258

0 commit comments

Comments
 (0)