refactor: Replace CheerfulNotification with SystemNotification across action classes and login page
This commit is contained in:
parent
282e205ec1
commit
3c0fcd4dff
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Actions\Cheerful;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use Filament\Actions\CreateAction as ActionsCreateAction;
|
||||
|
||||
class CreateAction extends ActionsCreateAction
|
||||
@ -12,7 +12,7 @@ protected function setUp(): void
|
||||
parent::setUp();
|
||||
|
||||
$this->successNotification(
|
||||
CheerfulNotification::create()
|
||||
SystemNotification::create()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Actions\Cheerful;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use Filament\Actions\DeleteAction as ActionsDeleteAction;
|
||||
|
||||
class DeleteAction extends ActionsDeleteAction
|
||||
@ -12,7 +12,7 @@ protected function setUp(): void
|
||||
parent::setUp();
|
||||
|
||||
$this->successNotification(
|
||||
CheerfulNotification::delete()
|
||||
SystemNotification::delete()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Actions\Cheerful;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use Filament\Actions\EditAction as ActionsEditAction;
|
||||
|
||||
class EditAction extends ActionsEditAction
|
||||
@ -12,7 +12,7 @@ protected function setUp(): void
|
||||
parent::setUp();
|
||||
|
||||
$this->successNotification(
|
||||
CheerfulNotification::update()
|
||||
SystemNotification::update()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Actions\Cheerful;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use Filament\Actions\ForceDeleteAction as ActionsForceDeleteAction;
|
||||
|
||||
class ForceDeleteAction extends ActionsForceDeleteAction
|
||||
@ -12,7 +12,7 @@ protected function setUp(): void
|
||||
parent::setUp();
|
||||
|
||||
$this->successNotification(
|
||||
CheerfulNotification::forceDelete()
|
||||
SystemNotification::forceDelete()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Actions\Cheerful;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use Filament\Actions\RestoreAction as ActionsRestoreAction;
|
||||
|
||||
class RestoreAction extends ActionsRestoreAction
|
||||
@ -12,7 +12,7 @@ protected function setUp(): void
|
||||
parent::setUp();
|
||||
|
||||
$this->successNotification(
|
||||
CheerfulNotification::restore()
|
||||
SystemNotification::restore()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Actions;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\ForceDeleteBulkAction;
|
||||
use Filament\Actions\RestoreBulkAction;
|
||||
@ -15,19 +15,19 @@ public static function make(string $entity): array
|
||||
DeleteBulkAction::make()
|
||||
->modalHeading("Hapus {$entity} yang dipilih")
|
||||
->successNotification(
|
||||
CheerfulNotification::bulkDelete()
|
||||
SystemNotification::bulkDelete()
|
||||
),
|
||||
|
||||
ForceDeleteBulkAction::make()
|
||||
->modalHeading("Hapus {$entity} yang dipilih")
|
||||
->successNotification(
|
||||
CheerfulNotification::bulkForceDelete()
|
||||
SystemNotification::bulkForceDelete()
|
||||
),
|
||||
|
||||
RestoreBulkAction::make()
|
||||
->modalHeading("Pulihkan {$entity} yang dipilih")
|
||||
->successNotification(
|
||||
CheerfulNotification::bulkRestore()
|
||||
SystemNotification::bulkRestore()
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Pages\Auth;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
|
||||
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
|
||||
use Filament\Auth\Http\Responses\Contracts\LoginResponse;
|
||||
@ -134,9 +134,9 @@ public function authenticate(): ?LoginResponse
|
||||
|
||||
session()->regenerate();
|
||||
|
||||
CheerfulNotification::success(
|
||||
'Hore! Berhasil Masuk 🎉',
|
||||
'Selamat datang kembali, '.$user->name.'! Siap untuk beraksi hari ini? 🚀✨'
|
||||
SystemNotification::success(
|
||||
'Berhasil Masuk',
|
||||
'Selamat datang kembali, '.$user->name.'. Anda telah berhasil masuk ke dalam sistem.'
|
||||
)->send();
|
||||
|
||||
return app(LoginResponse::class);
|
||||
@ -144,9 +144,9 @@ public function authenticate(): ?LoginResponse
|
||||
|
||||
protected function throwFailureValidationException(): never
|
||||
{
|
||||
CheerfulNotification::danger(
|
||||
'Ups! Gagal Masuk 😅',
|
||||
'Sepertinya ada yang salah nih. Coba cek email atau kata sandi mu lagi ya! 🤔🔐'
|
||||
SystemNotification::danger(
|
||||
'Gagal Masuk',
|
||||
'Terjadi kesalahan saat proses masuk. Silakan periksa kembali alamat surel atau kata sandi Anda.'
|
||||
)->send();
|
||||
|
||||
throw ValidationException::withMessages([]);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Master\Users\Actions;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Support\SystemNotification;
|
||||
use App\Models\User;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
@ -33,7 +33,7 @@ protected function setUp(): void
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
|
||||
CheerfulNotification::success(
|
||||
SystemNotification::success(
|
||||
'Kata sandi berhasil diubah! 🔑',
|
||||
"Kata sandi untuk pengguna {$record->name} telah diperbarui."
|
||||
)->send();
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
use Filament\Notifications\Notification;
|
||||
|
||||
class CheerfulNotification
|
||||
class SystemNotification
|
||||
{
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
@ -20,8 +20,8 @@ public static function make(): Notification
|
||||
public static function create(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Hore! Data Tersimpan 🎉✨')
|
||||
->body('Data baru berhasil ditambahkan! Sistem sudah menyimpannya dengan aman. 🚀💪')
|
||||
->title('Data Berhasil Disimpan')
|
||||
->body('Data baru telah berhasil ditambahkan dan disimpan oleh sistem.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -31,8 +31,8 @@ public static function create(): Notification
|
||||
public static function update(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Mantap! Data Diperbarui ✅🔥')
|
||||
->body('Perubahan berhasil disimpan! Data sekarang sudah up-to-date dan segar lagi. ✨👌')
|
||||
->title('Perubahan Berhasil Disimpan')
|
||||
->body('Perubahan pada data telah berhasil disimpan dan diperbarui di sistem.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -42,8 +42,8 @@ public static function update(): Notification
|
||||
public static function delete(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Oke, Data Dihapus 🗑️👋')
|
||||
->body('Data tersebut sudah berhasil dihapus dari sistem. Semuanya bersih dan rapi sekarang! 😊🚮')
|
||||
->title('Data Berhasil Dihapus')
|
||||
->body('Data yang dipilih telah berhasil dihapus dari sistem.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ public static function delete(): Notification
|
||||
public static function forceDelete(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Selamat Tinggal Selamanya 👋😢')
|
||||
->body('Data telah dihapus permanen dan tidak bisa kembali. Semoga ini keputusan yang tepat! 🚮💨')
|
||||
->title('Data Dihapus Secara Permanen')
|
||||
->body('Data yang dipilih telah dihapus secara permanen dan tidak dapat dipulihkan kembali.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -64,8 +64,8 @@ public static function forceDelete(): Notification
|
||||
public static function restore(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Welcome Back! Data Pulih ♻️✨')
|
||||
->body('Data berhasil dikembalikan! Hati-hati ya, jangan sampai terhapus lagi. 😉👍')
|
||||
->title('Data Berhasil Dipulihkan')
|
||||
->body('Data yang sebelumnya dihapus telah berhasil dipulihkan dan diaktifkan kembali.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -75,8 +75,8 @@ public static function restore(): Notification
|
||||
public static function statusUpdated(?string $title = null, ?string $body = null): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title($title ?? 'Status Berubah! 🔄✨')
|
||||
->body($body ?? 'Status data berhasil diperbarui. Perubahan langsung aktif ya! 👍')
|
||||
->title($title ?? 'Status Berhasil Diperbarui')
|
||||
->body($body ?? 'Status data telah berhasil diperbarui dan saat ini sudah aktif.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -86,8 +86,8 @@ public static function statusUpdated(?string $title = null, ?string $body = null
|
||||
public static function bulkDelete(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Oke, Banyak Data Dihapus 🗑️👋')
|
||||
->body('Semua data yang dipilih berhasil dihapus. Sistem makin lega deh! 😊')
|
||||
->title('Data Berhasil Dihapus')
|
||||
->body('Seluruh data yang dipilih telah berhasil dihapus dari sistem.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -97,8 +97,8 @@ public static function bulkDelete(): Notification
|
||||
public static function bulkForceDelete(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Bye Bye Semua! 👋🔥')
|
||||
->body('Data yang dipilih sudah dihapus permanen. Bersih total! 🧹💨')
|
||||
->title('Data Dihapus Secara Permanen')
|
||||
->body('Seluruh data yang dipilih telah dihapus secara permanen dari sistem.')
|
||||
->success();
|
||||
}
|
||||
|
||||
@ -108,8 +108,8 @@ public static function bulkForceDelete(): Notification
|
||||
public static function bulkRestore(): Notification
|
||||
{
|
||||
return self::make()
|
||||
->title('Hore! Banyak Data Pulih ♻️🎉')
|
||||
->body('Data-data tersebut sudah kembali aktif. Selamat bekerja kembali! 💪✨')
|
||||
->title('Data Berhasil Dipulihkan')
|
||||
->body('Seluruh data yang dipilih telah berhasil dipulihkan dan diaktifkan kembali.')
|
||||
->success();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user