Browse Source

refactor

3.x
Andrew Wallo 8 months ago
parent
commit
5bdf83a849

+ 1
- 1
app/Filament/Company/Resources/Sales/RecurringInvoiceResource.php View File

328
                     Tables\Actions\ActionGroup::make([
328
                     Tables\Actions\ActionGroup::make([
329
                         Tables\Actions\EditAction::make(),
329
                         Tables\Actions\EditAction::make(),
330
                         Tables\Actions\ViewAction::make(),
330
                         Tables\Actions\ViewAction::make(),
331
-                        RecurringInvoice::getUpdateScheduleAction(Tables\Actions\Action::class),
331
+                        RecurringInvoice::getManageScheduleAction(Tables\Actions\Action::class),
332
                     ])->dropdown(false),
332
                     ])->dropdown(false),
333
                     Tables\Actions\DeleteAction::make(),
333
                     Tables\Actions\DeleteAction::make(),
334
                 ]),
334
                 ]),

+ 2
- 2
app/Filament/Company/Resources/Sales/RecurringInvoiceResource/Pages/ViewRecurringInvoice.php View File

39
                 ->outlined(),
39
                 ->outlined(),
40
             Actions\ActionGroup::make([
40
             Actions\ActionGroup::make([
41
                 Actions\ActionGroup::make([
41
                 Actions\ActionGroup::make([
42
-                    RecurringInvoice::getUpdateScheduleAction(),
42
+                    RecurringInvoice::getManageScheduleAction(),
43
                     RecurringInvoice::getApproveDraftAction(),
43
                     RecurringInvoice::getApproveDraftAction(),
44
                 ])->dropdown(false),
44
                 ])->dropdown(false),
45
                 Actions\DeleteAction::make(),
45
                 Actions\DeleteAction::make(),
65
                     ->visible(fn (RecurringInvoice $record) => ! $record->hasValidStartDate())
65
                     ->visible(fn (RecurringInvoice $record) => ! $record->hasValidStartDate())
66
                     ->columnSpanFull()
66
                     ->columnSpanFull()
67
                     ->actions([
67
                     ->actions([
68
-                        RecurringInvoice::getUpdateScheduleAction(Action::class)
68
+                        RecurringInvoice::getManageScheduleAction(Action::class)
69
                             ->outlined(),
69
                             ->outlined(),
70
                     ]),
70
                     ]),
71
                 BannerEntry::make('readyToApprove')
71
                 BannerEntry::make('readyToApprove')

+ 4
- 4
app/Models/Accounting/RecurringInvoice.php View File

379
         };
379
         };
380
     }
380
     }
381
 
381
 
382
-    public static function getUpdateScheduleAction(string $action = Action::class): MountableAction
382
+    public static function getManageScheduleAction(string $action = Action::class): MountableAction
383
     {
383
     {
384
-        return $action::make('updateSchedule')
385
-            ->label(fn (self $record) => $record->hasSchedule() ? 'Update schedule' : 'Set schedule')
384
+        return $action::make('manageSchedule')
385
+            ->label(fn (self $record) => $record->hasSchedule() ? 'Edit schedule' : 'Set schedule')
386
             ->icon('heroicon-m-calendar-date-range')
386
             ->icon('heroicon-m-calendar-date-range')
387
             ->slideOver()
387
             ->slideOver()
388
-            ->successNotificationTitle('Schedule updated')
388
+            ->successNotificationTitle('Schedule saved')
389
             ->mountUsing(function (self $record, Form $form) {
389
             ->mountUsing(function (self $record, Form $form) {
390
                 $data = $record->attributesToArray();
390
                 $data = $record->attributesToArray();
391
 
391
 

Loading…
Cancel
Save