From 94ed87b3bdce3428734db13ec5edb03b246cc279 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Wed, 8 Apr 2026 14:49:05 +0700 Subject: [PATCH] refactor: update enum labels to use localized strings for improved clarity and user experience --- app/Enums/ApprovalStatus.php | 7 +- app/Enums/CooperationStatus.php | 11 ++-- app/Enums/DataChangeDecision.php | 5 +- app/Enums/DataChangeStatus.php | 7 +- app/Enums/DecisionAdmin.php | 7 +- app/Enums/NewsStatus.php | 7 +- app/Enums/VerificationStatus.php | 9 ++- lang/id/notif.php | 108 ------------------------------- 8 files changed, 23 insertions(+), 138 deletions(-) diff --git a/app/Enums/ApprovalStatus.php b/app/Enums/ApprovalStatus.php index cb050ec..24e2023 100644 --- a/app/Enums/ApprovalStatus.php +++ b/app/Enums/ApprovalStatus.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasColor; @@ -19,9 +18,9 @@ enum ApprovalStatus: int implements HasColor, HasLabel public function getLabel(): ?string { return match ($this) { - self::PENDING => CheerfulNotification::getByKey('enum.approval_status.pending'), - self::ACCEPTED => CheerfulNotification::getByKey('enum.approval_status.accepted'), - self::REJECTED => CheerfulNotification::getByKey('enum.approval_status.rejected'), + self::PENDING => 'Menunggu', + self::ACCEPTED => 'Menerima', + self::REJECTED => 'Menolak', }; } diff --git a/app/Enums/CooperationStatus.php b/app/Enums/CooperationStatus.php index 92f07da..94fe138 100644 --- a/app/Enums/CooperationStatus.php +++ b/app/Enums/CooperationStatus.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasColor; @@ -21,11 +20,11 @@ enum CooperationStatus: int implements HasColor, HasLabel public function getLabel(): ?string { return match ($this) { - self::PENDING => CheerfulNotification::getByKey('enum.cooperation_status.pending'), - self::ASSIGNMENT => CheerfulNotification::getByKey('enum.cooperation_status.assignment'), - self::VERIFICATION => CheerfulNotification::getByKey('enum.cooperation_status.verification'), - self::PAYMENT => CheerfulNotification::getByKey('enum.cooperation_status.payment'), - self::COMPLETED => CheerfulNotification::getByKey('enum.cooperation_status.completed'), + self::PENDING => 'Menunggu', + self::ASSIGNMENT => 'Media Order', + self::VERIFICATION => 'Verifikasi', + self::PAYMENT => 'Pembayaran', + self::COMPLETED => 'Selesai', }; } diff --git a/app/Enums/DataChangeDecision.php b/app/Enums/DataChangeDecision.php index bf176bf..b61cbec 100644 --- a/app/Enums/DataChangeDecision.php +++ b/app/Enums/DataChangeDecision.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasColor; @@ -18,8 +17,8 @@ enum DataChangeDecision: int implements HasColor, HasLabel public function getLabel(): ?string { return match ($this) { - self::APPROVED => CheerfulNotification::getByKey('enum.data_change_decision.approved'), - self::REJECTED => CheerfulNotification::getByKey('enum.data_change_decision.rejected'), + self::APPROVED => 'Disetujui', + self::REJECTED => 'Ditolak', }; } diff --git a/app/Enums/DataChangeStatus.php b/app/Enums/DataChangeStatus.php index 0b347d0..5b9e4d0 100644 --- a/app/Enums/DataChangeStatus.php +++ b/app/Enums/DataChangeStatus.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasColor; @@ -19,9 +18,9 @@ enum DataChangeStatus: int implements HasColor, HasLabel public function getLabel(): ?string { return match ($this) { - self::PENDING => CheerfulNotification::getByKey('enum.data_change_status.pending'), - self::APPROVED => CheerfulNotification::getByKey('enum.data_change_status.approved'), - self::REJECTED => CheerfulNotification::getByKey('enum.data_change_status.rejected'), + self::PENDING => 'Menunggu Verifikasi', + self::APPROVED => 'Disetujui', + self::REJECTED => 'Ditolak', }; } diff --git a/app/Enums/DecisionAdmin.php b/app/Enums/DecisionAdmin.php index e716349..f75c29c 100644 --- a/app/Enums/DecisionAdmin.php +++ b/app/Enums/DecisionAdmin.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasColor; @@ -19,9 +18,9 @@ enum DecisionAdmin: int implements HasColor, HasLabel public function getLabel(): ?string { return match ($this) { - self::APPROVED => CheerfulNotification::getByKey('enum.decision_admin.approved'), - self::NEED_REVISION => CheerfulNotification::getByKey('enum.decision_admin.need_revision'), - self::REJECTED => CheerfulNotification::getByKey('enum.decision_admin.rejected'), + self::APPROVED => 'Disetujui', + self::NEED_REVISION => 'Perlu Revisi', + self::REJECTED => 'Ditolak', }; } diff --git a/app/Enums/NewsStatus.php b/app/Enums/NewsStatus.php index a50f14e..40af2d4 100644 --- a/app/Enums/NewsStatus.php +++ b/app/Enums/NewsStatus.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasLabel; @@ -18,9 +17,9 @@ enum NewsStatus: int implements HasLabel public function getLabel(): ?string { return match ($this) { - self::DRAFT => CheerfulNotification::getByKey('enum.news_status.draft'), - self::PUBLISHED => CheerfulNotification::getByKey('enum.news_status.published'), - self::ARCHIVED => CheerfulNotification::getByKey('enum.news_status.archived'), + self::DRAFT => 'Draft', + self::PUBLISHED => 'Publish', + self::ARCHIVED => 'Arsip', }; } diff --git a/app/Enums/VerificationStatus.php b/app/Enums/VerificationStatus.php index 27b4fef..fd44038 100644 --- a/app/Enums/VerificationStatus.php +++ b/app/Enums/VerificationStatus.php @@ -2,7 +2,6 @@ namespace App\Enums; -use App\Filament\Support\CheerfulNotification; use App\Traits\Enum\WithComment; use App\Traits\Enum\WithValue; use Filament\Support\Contracts\HasColor; @@ -20,10 +19,10 @@ enum VerificationStatus: int implements HasColor, HasLabel public function getLabel(): ?string { return match ($this) { - self::PENDING => CheerfulNotification::getByKey('enum.verification_status.pending'), - self::APPROVED => CheerfulNotification::getByKey('enum.verification_status.approved'), - self::NEED_REVISION => CheerfulNotification::getByKey('enum.verification_status.need_revision'), - self::REJECTED => CheerfulNotification::getByKey('enum.verification_status.rejected'), + self::PENDING => 'Menunggu Verifikasi', + self::APPROVED => 'Disetujui', + self::NEED_REVISION => 'Perlu Revisi', + self::REJECTED => 'Ditolak', }; } diff --git a/lang/id/notif.php b/lang/id/notif.php index ab5dbf6..2d92b94 100644 --- a/lang/id/notif.php +++ b/lang/id/notif.php @@ -653,114 +653,6 @@ 'formal' => 'Tidak Ada Pengajuan Perubahan', ], ], - 'enum' => [ - 'news_status' => [ - 'draft' => [ - 'cheerful' => 'Draft - Sempurnakan Lagi! ✍️🛠️', - 'formal' => 'Draft', - ], - 'published' => [ - 'cheerful' => 'Telah Tayang! 🚀✨', - 'formal' => 'Publish', - ], - 'archived' => [ - 'cheerful' => 'Arsip - Disimpan Dulu Ya! 📦🔒', - 'formal' => 'Arsip', - ], - ], - 'data_change_decision' => [ - 'approved' => [ - 'cheerful' => 'Perubahan Disetujui! ✅🚀', - 'formal' => 'Disetujui', - ], - 'rejected' => [ - 'cheerful' => 'Perubahan Ditolak 🛑😔', - 'formal' => 'Ditolak', - ], - ], - 'decision_admin' => [ - 'approved' => [ - 'cheerful' => 'Sudah Disetujui! ✅🚀', - 'formal' => 'Disetujui', - ], - 'need_revision' => [ - 'cheerful' => 'Perlu Revisi nih! ✍️🛠️', - 'formal' => 'Perlu Revisi', - ], - 'rejected' => [ - 'cheerful' => 'Ditolak, Tetap Semangat! 🛑😔', - 'formal' => 'Ditolak', - ], - ], - 'approval_status' => [ - 'pending' => [ - 'cheerful' => 'Menunggu Persetujuan ⏳✨', - 'formal' => 'Menunggu', - ], - 'accepted' => [ - 'cheerful' => 'Diterima! ✅🚀', - 'formal' => 'Menerima', - ], - 'rejected' => [ - 'cheerful' => 'Ditolak, Tetap Semangat! 🛑😔', - 'formal' => 'Menolak', - ], - ], - 'data_change_status' => [ - 'pending' => [ - 'cheerful' => 'Menunggu Verifikasi ⏳✨', - 'formal' => 'Menunggu Verifikasi', - ], - 'approved' => [ - 'cheerful' => 'Perubahan Disetujui! ✅🚀', - 'formal' => 'Disetujui', - ], - 'rejected' => [ - 'cheerful' => 'Perubahan Ditolak 🛑😔', - 'formal' => 'Ditolak', - ], - ], - 'verification_status' => [ - 'pending' => [ - 'cheerful' => 'Menunggu Verifikasi ⏳✨', - 'formal' => 'Menunggu Verifikasi', - ], - 'approved' => [ - 'cheerful' => 'Sudah Disetujui! ✅🚀', - 'formal' => 'Disetujui', - ], - 'need_revision' => [ - 'cheerful' => 'Perlu Revisi nih! ✍️🛠️', - 'formal' => 'Perlu Revisi', - ], - 'rejected' => [ - 'cheerful' => 'Ditolak, Tetap Semangat! 🛑😔', - 'formal' => 'Ditolak', - ], - ], - 'cooperation_status' => [ - 'pending' => [ - 'cheerful' => 'Menunggu... Tetap Sabar Ya! ⏳✨', - 'formal' => 'Menunggu', - ], - 'assignment' => [ - 'cheerful' => 'Sedang Ditugaskan nih! 📋🛠️', - 'formal' => 'Media Order', - ], - 'verification' => [ - 'cheerful' => 'Lagi Diverifikasi, Tunggu Sebentar! 🔍✅', - 'formal' => 'Verifikasi', - ], - 'payment' => [ - 'cheerful' => 'Waktunya Pembayaran! 💵🚀', - 'formal' => 'Pembayaran', - ], - 'completed' => [ - 'cheerful' => 'Selesai! Mantap Jiwa! 🎉🔥', - 'formal' => 'Selesai', - ], - ], - ], 'visitor' => [ 'empty_state' => [ 'cheerful' => 'Belum ada data Pengunjung nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨',