瀏覽代碼

refactor

3.x
Andrew Wallo 8 月之前
父節點
當前提交
5bdf83a849

+ 1
- 1
app/Filament/Company/Resources/Sales/RecurringInvoiceResource.php 查看文件

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

+ 2
- 2
app/Filament/Company/Resources/Sales/RecurringInvoiceResource/Pages/ViewRecurringInvoice.php 查看文件

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

+ 4
- 4
app/Models/Accounting/RecurringInvoice.php 查看文件

@@ -379,13 +379,13 @@ class RecurringInvoice extends Document
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 386
             ->icon('heroicon-m-calendar-date-range')
387 387
             ->slideOver()
388
-            ->successNotificationTitle('Schedule updated')
388
+            ->successNotificationTitle('Schedule saved')
389 389
             ->mountUsing(function (self $record, Form $form) {
390 390
                 $data = $record->attributesToArray();
391 391
 

Loading…
取消
儲存