refactor: update enum labels to use localized strings for improved clarity and user experience

This commit is contained in:
Yoga Pangestu 2026-04-08 14:49:05 +07:00
parent 2c90380d3b
commit 94ed87b3bd
8 changed files with 23 additions and 138 deletions

View File

@ -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',
};
}

View File

@ -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',
};
}

View File

@ -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',
};
}

View File

@ -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',
};
}

View File

@ -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',
};
}

View File

@ -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',
};
}

View File

@ -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',
};
}

View File

@ -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! 🚀✨',