@@ -27,11 +27,11 @@ class Kanban extends Page implements HasForms
2727
2828 protected static ?string $ navigationIcon = 'heroicon-o-view-boards ' ;
2929
30- protected static ?string $ slug = 'kanban ' ;
30+ protected static ?string $ slug = 'kanban/{project} ' ;
3131
3232 protected static string $ view = 'filament.pages.kanban ' ;
3333
34- protected static ? int $ navigationSort = 4 ;
34+ protected static bool $ shouldRegisterNavigation = false ;
3535
3636 public bool $ sortable = true ;
3737
@@ -49,26 +49,21 @@ class Kanban extends Page implements HasForms
4949 'closeTicketDialog '
5050 ];
5151
52- public function mount ()
52+ public function mount (Project $ project )
5353 {
54- if ( request ()-> has ( ' project ' )) {
55- $ this ->project = Project:: find ( request ()-> get ( ' project ' ));
56- if (
57- $ this -> project -> owner_id != auth ()-> user ()-> id
58- &&
59- ! $ this -> project -> users -> where ( ' id ' , auth ()-> user ()-> id )-> count ()
60- ) {
61- abort ( 403 );
62- }
54+ $ this -> project = $ project ;
55+ if ( $ this ->project -> type === ' scrum ' ) {
56+ $ this -> redirect ( route ( ' filament.pages.scrum/{project} ' , [ ' project ' => $ project ]));
57+ } elseif (
58+ $ this -> project -> owner_id != auth ()-> user ()-> id
59+ &&
60+ ! $ this -> project -> users -> where ( ' id ' , auth ()-> user ()-> id )-> count ()
61+ ) {
62+ abort ( 403 );
6363 }
6464 $ this ->form ->fill ();
6565 }
6666
67- protected static function getNavigationLabel (): string
68- {
69- return __ ('Kanban ' );
70- }
71-
7267 protected function getFormSchema (): array
7368 {
7469 return [
@@ -130,14 +125,14 @@ protected function getActions(): array
130125 ];
131126 }
132127
133- protected static function getNavigationGroup (): ?string
134- {
135- return __ ('Management ' );
136- }
137-
138128 protected function getHeading (): string |Htmlable
139129 {
140- $ heading = '<div class="flex flex-col gap-1"> ' ;
130+ $ heading = '<div class="w-full flex flex-col gap-1"> ' ;
131+ $ heading .= '<a href=" ' . route ('filament.pages.board ' ) . '"
132+ class="text-primary-500 text-xs font-medium hover:underline"> ' ;
133+ $ heading .= __ ('Back to board ' );
134+ $ heading .= '</a> ' ;
135+ $ heading .= '<div class="flex flex-col gap-1"> ' ;
141136 $ heading .= '<span> ' . __ ('Kanban ' );
142137 if ($ this ->project ) {
143138 $ heading .= ' - ' . $ this ->project ->name . '</span> ' ;
@@ -147,6 +142,7 @@ protected function getHeading(): string|Htmlable
147142 . '</span> ' ;
148143 }
149144 $ heading .= '</div> ' ;
145+ $ heading .= '</div> ' ;
150146 return new HtmlString ($ heading );
151147 }
152148
0 commit comments