From 91d2266a20435435f1fe1b42d92d6dfe0707c5f7 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 26 Mar 2026 15:48:29 +0700 Subject: [PATCH] feat: Introduce NotifStyle enum for notification customization and update Filament actions to utilize it, enhancing user engagement and clarity across the application. --- app/Enums/{UxStyle.php => NotifStyle.php} | 2 +- .../Actions/Cheerful/DeleteAction.php | 6 ++-- .../Actions/Cheerful/ForceDeleteAction.php | 6 ++-- .../Exports/IssueManagementExcelExport.php | 4 +-- app/Filament/Pages/Auth/Profile.php | 12 ++++---- app/Filament/Pages/Company.php | 8 ++--- app/Filament/Pages/Media.php | 6 ++-- .../Manage/Contacts/ContactResource.php | 8 ++--- .../Cooperations/CooperationResource.php | 4 +-- .../Cooperations/Schemas/CooperationForm.php | 6 ++-- .../Manage/Partners/PartnerResource.php | 26 ++++++++-------- .../Pages/ManageSubClassifications.php | 6 ++-- .../SubClassificationResource.php | 6 ++-- .../SubLocations/Pages/ManageSubLocations.php | 6 ++-- .../SubLocations/SubLocationResource.php | 6 ++-- .../Schemas/ContentRecapForm.php | 6 ++-- .../Schemas/IssueManagementForm.php | 10 +++---- .../Tables/IssueManagementTable.php | 8 ++--- .../Schemas/MediaMonitoringForm.php | 6 ++-- .../Publication/News/Schemas/NewsForm.php | 6 ++-- app/Filament/Support/CheerfulNotification.php | 30 +++++++++---------- app/Models/UserSetting.php | 4 +-- app/Observers/UserObserver.php | 4 +-- ..._26_140819_add_ux_style_to_users_table.php | 2 +- ...3_26_144130_create_user_settings_table.php | 12 ++++---- .../SubClassificationResourceTest.php | 26 ++++++++-------- .../SubLocations/SubLocationResourceTest.php | 26 ++++++++-------- 27 files changed, 126 insertions(+), 126 deletions(-) rename app/Enums/{UxStyle.php => NotifStyle.php} (88%) diff --git a/app/Enums/UxStyle.php b/app/Enums/NotifStyle.php similarity index 88% rename from app/Enums/UxStyle.php rename to app/Enums/NotifStyle.php index 2b10469..fd0f646 100644 --- a/app/Enums/UxStyle.php +++ b/app/Enums/NotifStyle.php @@ -4,7 +4,7 @@ use Filament\Support\Contracts\HasLabel; -enum UxStyle: string implements HasLabel +enum NotifStyle: string implements HasLabel { case CHEERFUL = 'cheerful'; case FORMAL = 'formal'; diff --git a/app/Filament/Actions/Cheerful/DeleteAction.php b/app/Filament/Actions/Cheerful/DeleteAction.php index 1c462ca..d0bb1b5 100644 --- a/app/Filament/Actions/Cheerful/DeleteAction.php +++ b/app/Filament/Actions/Cheerful/DeleteAction.php @@ -2,7 +2,7 @@ namespace App\Filament\Actions\Cheerful; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use Filament\Actions\DeleteAction as ActionsDeleteAction; @@ -12,12 +12,12 @@ protected function setUp(): void { parent::setUp(); - $this->modalHeading(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL + $this->modalHeading(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'Betulan Mau Hapus? ๐Ÿ—‘๏ธ๐Ÿค”' : 'Hapus Data' ); - $this->modalDescription(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL + $this->modalDescription(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'Data ini akan kita lepas ya. Hati-hati, data berelasi juga mungkin bakal ikut berpamitan! ๐Ÿƒ๐Ÿ’จ' : 'Apakah Anda yakin ingin menghapus data ini secara permanen?' ); diff --git a/app/Filament/Actions/Cheerful/ForceDeleteAction.php b/app/Filament/Actions/Cheerful/ForceDeleteAction.php index b72c1df..3ee8259 100644 --- a/app/Filament/Actions/Cheerful/ForceDeleteAction.php +++ b/app/Filament/Actions/Cheerful/ForceDeleteAction.php @@ -2,7 +2,7 @@ namespace App\Filament\Actions\Cheerful; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use Filament\Actions\ForceDeleteAction as ActionsForceDeleteAction; @@ -12,12 +12,12 @@ protected function setUp(): void { parent::setUp(); - $this->modalHeading(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL + $this->modalHeading(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'Yakin Hapus Selamanya? ๐Ÿ—‘๏ธ๐Ÿ”ฅ' : 'Hapus Permanen' ); - $this->modalDescription(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL + $this->modalDescription(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'Data ini bakal hilang dari muka bumi sistem dan nggak bisa balik lagi. Hati-hati ya! ๐Ÿ˜จ๐Ÿ™' : 'Tindakan ini tidak dapat dibatalkan. Apakah Anda yakin ingin menghapus data ini secara permanen?' ); diff --git a/app/Filament/Exports/IssueManagementExcelExport.php b/app/Filament/Exports/IssueManagementExcelExport.php index 7f95d74..7d87ecf 100644 --- a/app/Filament/Exports/IssueManagementExcelExport.php +++ b/app/Filament/Exports/IssueManagementExcelExport.php @@ -32,13 +32,13 @@ public function setUp() ->heading('Lokus'), Column::make('subLocation.name') - ->heading('Sub Lokus'), + ->heading('Sublokus'), Column::make('classification.name') ->heading('Klasifikasi'), Column::make('subClassification.name') - ->heading('Sub Klasifikasi'), + ->heading('Subklasifikasi'), Column::make('description') ->heading('Keterangan'), diff --git a/app/Filament/Pages/Auth/Profile.php b/app/Filament/Pages/Auth/Profile.php index 1530872..c108168 100644 --- a/app/Filament/Pages/Auth/Profile.php +++ b/app/Filament/Pages/Auth/Profile.php @@ -2,7 +2,7 @@ namespace App\Filament\Pages\Auth; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use Filament\Auth\Pages\EditProfile; use Filament\Facades\Filament; @@ -92,7 +92,7 @@ public function form(Schema $schema): Schema ->components([ Section::make(CheerfulNotification::getMessage('Detail Profil ๐Ÿ‘คโœจ', 'Profil Pengguna')) ->description(CheerfulNotification::getMessage('Yuk, kelola informasi detail profil Anda agar selalu terkini! ๐Ÿ‘ค๐Ÿš€', 'Kelola informasi profil dasar Anda di bawah ini.')) - ->icon(CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-user' : null) + ->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null) ->schema([ Grid::make(2) ->schema([ @@ -129,13 +129,13 @@ public function form(Schema $schema): Schema Section::make(CheerfulNotification::getMessage('Pengaturan Tampilan & UX ๐ŸŽจโœจ', 'Preferensi Tampilan')) ->description(CheerfulNotification::getMessage('Personalisasi pengalaman aplikasi Anda agar lebih nyaman dan sesuai selera! ๐ŸŒˆ๐Ÿš€', 'Sesuaikan gaya bahasa, warna tema, dan jenis huruf aplikasi Anda.')) - ->icon(CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-swatch' : null) + ->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-swatch' : null) ->schema([ Grid::make(2) ->schema([ - Select::make('settings.ux_style') + Select::make('settings.notif_style') ->label('Gaya Bahasa') - ->options(UxStyle::class) + ->options(NotifStyle::class) ->native(false) ->required(), @@ -199,7 +199,7 @@ public function form(Schema $schema): Schema Section::make(CheerfulNotification::getMessage('Keamanan Akun ๐Ÿ”โœจ', 'Ubah Kata Sandi')) ->description(CheerfulNotification::getMessage('Ingin ganti kata sandi? Pastikan pilih yang kuat ya biar makin aman! ๐Ÿ”๐Ÿ’ช', 'Silakan masukkan kata sandi baru untuk memperbarui keamanan akun Anda.')) - ->icon(CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-lock-closed' : null) + ->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-lock-closed' : null) ->schema([ Grid::make(2) ->schema([ diff --git a/app/Filament/Pages/Company.php b/app/Filament/Pages/Company.php index bb6a7d1..80af25b 100644 --- a/app/Filament/Pages/Company.php +++ b/app/Filament/Pages/Company.php @@ -3,7 +3,7 @@ namespace App\Filament\Pages; use App\Enums\DataChangeStatus; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Enums\VerificationStatus; use App\Filament\Resources\Manage\DataChanges\DataChangesResource; use App\Filament\Support\CheerfulNotification; @@ -194,7 +194,7 @@ public static function form(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Informasi Perusahaan ๐Ÿ—๏ธโœจ', 'Profil Perusahaan')) ->description(fn () => CheerfulNotification::getMessage('Kelola informasi perusahaan Anda biar tetap resmi dan kredibel! ๐Ÿš€โœจ', 'Kelola informasi detail perusahaan Anda di sini.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-building-office-2' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-building-office-2' : null) ->schema([ TextInput::make('name') ->label('Nama') @@ -240,7 +240,7 @@ public static function form(Schema $schema): Schema array_merge( [ Section::make(fn () => CheerfulNotification::getMessage('NIK Direktur ๐Ÿ‘คโœจ', 'NIK Direktur')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-user' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null) ->schema([ TextInput::make('director_nik') ->hiddenLabel() @@ -265,7 +265,7 @@ public static function form(Schema $schema): Schema collect($documents) ->map(function (array $doc): Section { return Section::make(fn () => CheerfulNotification::getMessage($doc['title'].' ๐Ÿ“„โœจ', $doc['title'])) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextInput::make($doc['text_name']) ->hiddenLabel() diff --git a/app/Filament/Pages/Media.php b/app/Filament/Pages/Media.php index b9b4f0c..2f22d5c 100644 --- a/app/Filament/Pages/Media.php +++ b/app/Filament/Pages/Media.php @@ -5,8 +5,8 @@ use App\Enums\DataChangeStatus; use App\Enums\MediaClassification; use App\Enums\MediaType; +use App\Enums\NotifStyle; use App\Enums\RoleEnum; -use App\Enums\UxStyle; use App\Enums\VerificationStatus; use App\Filament\Resources\Manage\DataChanges\DataChangesResource; use App\Filament\Support\CheerfulNotification; @@ -167,7 +167,7 @@ public static function form(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Detail Informasi ๐Ÿ“ฐโœจ', 'Informasi Media')) ->description(fn () => CheerfulNotification::getMessage('Kelola informasi media Anda biar tetap eksis dan terpercaya! ๐Ÿš€โœจ', 'Kelola informasi detail media Anda di sini.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-newspaper' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-newspaper' : null) ->schema([ TextInput::make('name') ->label('Nama') @@ -214,7 +214,7 @@ public static function form(Schema $schema): Schema collect($documents) ->map(function (array $doc): Section { return Section::make(fn () => CheerfulNotification::getMessage($doc['title'].' ๐Ÿ“„โœจ', $doc['title'])) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextInput::make($doc['text_name']) ->hiddenLabel() diff --git a/app/Filament/Resources/Manage/Contacts/ContactResource.php b/app/Filament/Resources/Manage/Contacts/ContactResource.php index 1caf9e6..87e5dca 100644 --- a/app/Filament/Resources/Manage/Contacts/ContactResource.php +++ b/app/Filament/Resources/Manage/Contacts/ContactResource.php @@ -2,7 +2,7 @@ namespace App\Filament\Resources\Manage\Contacts; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Actions\Cheerful\DeleteAction; use App\Filament\Actions\DefaultBulkActions; use App\Filament\Columns\RowIndexColumn; @@ -54,7 +54,7 @@ public static function infolist(Schema $schema): Schema ->schema([ Section::make(fn () => CheerfulNotification::getMessage('Informasi Pengirim ๐Ÿ“ง', 'Informasi Pengirim')) ->description(fn () => CheerfulNotification::getMessage('Cek detail identitas pengirim pesan biar makin kenal! ๐Ÿ“งโœจ', 'Detail mengenai identitas pengirim pesan.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-user' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null) ->schema([ Grid::make(4) ->schema([ @@ -80,7 +80,7 @@ public static function infolist(Schema $schema): Schema Section::make(fn () => CheerfulNotification::getMessage('Isi Pesan ๐Ÿ’ฌ', 'Isi Pesan')) ->description(fn () => CheerfulNotification::getMessage('Yuk, baca pesan lengkap yang dikirimkan oleh pengguna! ๐Ÿ’ฌโœจ', 'Pesan lengkap yang dikirimkan oleh pengguna.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-chat-bubble-left-right' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-chat-bubble-left-right' : null) ->schema([ TextEntry::make('message') ->label('Konten Pesan') @@ -90,7 +90,7 @@ public static function infolist(Schema $schema): Schema Section::make(fn () => CheerfulNotification::getMessage('Riwayat Balasan ๐Ÿ“ค', 'Riwayat Balasan')) ->description(fn () => CheerfulNotification::getMessage('Lihat detail tanggapan yang sudah Admin berikan sebelumnya! ๐Ÿ“คโœจ', 'Detail mengenai tanggapan yang telah diberikan.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-paper-airplane' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-paper-airplane' : null) ->schema([ TextEntry::make('repliedBy.name') ->label('Dibalas Oleh') diff --git a/app/Filament/Resources/Manage/Cooperations/CooperationResource.php b/app/Filament/Resources/Manage/Cooperations/CooperationResource.php index 7d113c3..5946a3b 100644 --- a/app/Filament/Resources/Manage/Cooperations/CooperationResource.php +++ b/app/Filament/Resources/Manage/Cooperations/CooperationResource.php @@ -2,8 +2,8 @@ namespace App\Filament\Resources\Manage\Cooperations; +use App\Enums\NotifStyle; use App\Enums\RoleEnum; -use App\Enums\UxStyle; use App\Filament\Resources\Manage\Cooperations\Pages\CreateCooperation; use App\Filament\Resources\Manage\Cooperations\Pages\EditCooperation; use App\Filament\Resources\Manage\Cooperations\Pages\ListCooperations; @@ -76,7 +76,7 @@ public static function infolist(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Informasi Kerja Sama ๐Ÿค', 'Informasi Kerja Sama')) ->description(fn () => CheerfulNotification::getMessage('Detail lengkap mengenai data kerja sama yang sedang berjalan. ๐Ÿคโœจ', 'Informasi detail mengenai pelaksanaan kerja sama.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-hand-raised' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-hand-raised' : null) ->headerActions([ Action::make('status') ->label(fn (Cooperation $record): ?string => $record->status->getLabel()) diff --git a/app/Filament/Resources/Manage/Cooperations/Schemas/CooperationForm.php b/app/Filament/Resources/Manage/Cooperations/Schemas/CooperationForm.php index 7aed9c4..bfdac10 100644 --- a/app/Filament/Resources/Manage/Cooperations/Schemas/CooperationForm.php +++ b/app/Filament/Resources/Manage/Cooperations/Schemas/CooperationForm.php @@ -2,7 +2,7 @@ namespace App\Filament\Resources\Manage\Cooperations\Schemas; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use App\Models\PartnerMedia; use Asmit\FilamentUpload\Forms\Components\AdvancedFileUpload; @@ -27,7 +27,7 @@ public static function configure(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Detail Kerja Sama ๐Ÿค', 'Detail Kerja Sama')) ->description(fn () => CheerfulNotification::getMessage('Ayo lengkapi informasi mengenai judul, durasi, dan media yang diajak kerja sama! ๐Ÿคโœจ', 'Lengkapi informasi mengenai judul, durasi, dan media yang terlibat.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-hand-raised' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-hand-raised' : null) ->schema([ TextInput::make('title') ->label('Judul Kerja Sama') @@ -90,7 +90,7 @@ public static function configure(Schema $schema): Schema Section::make(fn () => CheerfulNotification::getMessage('Lampiran & Media ๐Ÿ–ผ๏ธ', 'Lampiran & Media')) ->description(fn () => CheerfulNotification::getMessage('Jangan lupa unggah banner promosi dan template pengajuannya ya! ๐Ÿ–ผ๏ธโœจ', 'Unggah banner promosi dan template untuk pengajuan.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-paper-clip' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-paper-clip' : null) ->schema([ SpatieMediaLibraryFileUpload::make('banner') ->label('Banner Promosi') diff --git a/app/Filament/Resources/Manage/Partners/PartnerResource.php b/app/Filament/Resources/Manage/Partners/PartnerResource.php index 1dcca42..01d5efc 100644 --- a/app/Filament/Resources/Manage/Partners/PartnerResource.php +++ b/app/Filament/Resources/Manage/Partners/PartnerResource.php @@ -5,8 +5,8 @@ use App\Enums\DecisionAdmin; use App\Enums\MediaClassification; use App\Enums\MediaType; +use App\Enums\NotifStyle; use App\Enums\RoleEnum; -use App\Enums\UxStyle; use App\Enums\VerificationStatus; use App\Filament\Actions\DefaultBulkActions; use App\Filament\Columns\RowIndexColumn; @@ -123,7 +123,7 @@ public static function infolist(Schema $schema): Schema Grid::make(3) ->schema([ Section::make(fn () => CheerfulNotification::getMessage('NIK Direktur ๐Ÿ‘คโœจ', 'NIK Direktur')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-user' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null) ->schema([ TextEntry::make('company.director_nik') ->hiddenLabel(), @@ -158,7 +158,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('Akta Pendirian ๐Ÿ“„โœจ', 'Akta Pendirian')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.deed_incorporation') ->hiddenLabel(), @@ -167,7 +167,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('SIUP / NIB ๐Ÿ“„โœจ', 'SIUP / NIB')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.trade_license') ->hiddenLabel(), @@ -176,7 +176,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('NPWP ๐Ÿ“„โœจ', 'NPWP')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.tax_id_number') ->hiddenLabel(), @@ -185,7 +185,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('PKP ๐Ÿ“„โœจ', 'PKP')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.taxable_enterprise') ->hiddenLabel(), @@ -194,7 +194,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('SPT Tahunan ๐Ÿ“„โœจ', 'SPT Tahunan')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.annual_tax_return') ->hiddenLabel(), @@ -203,7 +203,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('SK Domisili ๐Ÿ“„โœจ', 'SK Domisili')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.domicile_certificate') ->hiddenLabel(), @@ -212,7 +212,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('Profil Perusahaan ๐Ÿ“„โœจ', 'Profil Perusahaan')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.profile') ->hiddenLabel(), @@ -250,7 +250,7 @@ public static function infolist(Schema $schema): Schema Grid::make(2) ->schema([ Section::make(fn () => CheerfulNotification::getMessage('Sertifikat Organisasi Kewartawanan ๐Ÿ“„โœจ', 'Sertifikat Organisasi Kewartawanan')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.partnerMedia.journalism_organization') ->hiddenLabel(), @@ -259,7 +259,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('Sertifikat Dewan Pers ๐Ÿ“„โœจ', 'Sertifikat Dewan Pers')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('company.partnerMedia.press_council_certificate') ->hiddenLabel(), @@ -289,7 +289,7 @@ public static function infolist(Schema $schema): Schema Grid::make(2) ->schema([ Section::make(fn () => CheerfulNotification::getMessage('Kartu Pers ๐Ÿ†”โœจ', 'Kartu Pers')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-identification' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-identification' : null) ->schema([ TextEntry::make('press_card') ->hiddenLabel(), @@ -298,7 +298,7 @@ public static function infolist(Schema $schema): Schema ]), Section::make(fn () => CheerfulNotification::getMessage('Sertifikat UKW ๐Ÿ“„โœจ', 'Sertifikat UKW')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextEntry::make('ukw_certificate') ->hiddenLabel(), diff --git a/app/Filament/Resources/Master/SubClassifications/Pages/ManageSubClassifications.php b/app/Filament/Resources/Master/SubClassifications/Pages/ManageSubClassifications.php index 38929f8..12ca45f 100644 --- a/app/Filament/Resources/Master/SubClassifications/Pages/ManageSubClassifications.php +++ b/app/Filament/Resources/Master/SubClassifications/Pages/ManageSubClassifications.php @@ -12,15 +12,15 @@ class ManageSubClassifications extends ManageRecords { protected static string $resource = SubClassificationResource::class; - protected static ?string $title = 'Sub Klasifikasi'; + protected static ?string $title = 'Subklasifikasi'; protected function getHeaderActions(): array { return [ CreateAction::make() ->label('Tambah') - ->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Sub Klasifikasi Baru ๐Ÿ“‘โœจ', 'Tambah Sub Klasifikasi')) - ->modalDescription(fn () => CheerfulNotification::getMessage('Perdalam klasifikasi data biar makin detail dan tertata! ๐Ÿ—‚๏ธ๐Ÿ˜Š', 'Silakan masukkan detail sub klasifikasi data di bawah ini.')) + ->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Subklasifikasi Baru ๐Ÿ“‘โœจ', 'Tambah Subklasifikasi')) + ->modalDescription(fn () => CheerfulNotification::getMessage('Perdalam klasifikasi data biar makin detail dan tertata! ๐Ÿ—‚๏ธ๐Ÿ˜Š', 'Silakan masukkan detail subklasifikasi data di bawah ini.')) ->modalSubmitActionLabel('Simpan') ->modalCancelActionLabel('Batal') ->extraModalFooterActions(fn (CreateAction $action): array => [ diff --git a/app/Filament/Resources/Master/SubClassifications/SubClassificationResource.php b/app/Filament/Resources/Master/SubClassifications/SubClassificationResource.php index a8ef349..344ac47 100644 --- a/app/Filament/Resources/Master/SubClassifications/SubClassificationResource.php +++ b/app/Filament/Resources/Master/SubClassifications/SubClassificationResource.php @@ -41,7 +41,7 @@ class SubClassificationResource extends Resource protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedQueueList; - protected static ?string $navigationLabel = 'Sub Klasifikasi'; + protected static ?string $navigationLabel = 'Subklasifikasi'; protected static ?int $navigationSort = 2; @@ -63,7 +63,7 @@ public static function form(Schema $schema): Schema ->autofocus(), TextInput::make('name') - ->label('Nama Sub-Klasifikasi') + ->label('Nama Subklasifikasi') ->placeholder('Korupsi') ->autocomplete(false) ->required() @@ -128,7 +128,7 @@ public static function table(Table $table): Table ]) ->toolbarActions([ BulkActionGroup::make([ - ...DefaultBulkActions::make('Sub Klasifikasi'), + ...DefaultBulkActions::make('Subklasifikasi'), ]), ]) ->emptyStateIcon(Heroicon::OutlinedQueueList) diff --git a/app/Filament/Resources/Master/SubLocations/Pages/ManageSubLocations.php b/app/Filament/Resources/Master/SubLocations/Pages/ManageSubLocations.php index a94b4f3..0880dad 100644 --- a/app/Filament/Resources/Master/SubLocations/Pages/ManageSubLocations.php +++ b/app/Filament/Resources/Master/SubLocations/Pages/ManageSubLocations.php @@ -12,15 +12,15 @@ class ManageSubLocations extends ManageRecords { protected static string $resource = SubLocationResource::class; - protected static ?string $title = 'Sub Lokus'; + protected static ?string $title = 'Sublokus'; protected function getHeaderActions(): array { return [ CreateAction::make() ->label('Tambah') - ->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Sub Lokus Baru ๐Ÿ“Œโœจ', 'Tambah Sub Lokus')) - ->modalDescription(fn () => CheerfulNotification::getMessage('Detailkan lebih dalam lagi titik lokasinya, ya! ๐Ÿ“๐Ÿ˜Š', 'Silakan masukkan detail sub lokasi/lokus data di bawah ini.')) + ->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Sublokus Baru ๐Ÿ“Œโœจ', 'Tambah Sublokus')) + ->modalDescription(fn () => CheerfulNotification::getMessage('Detailkan lebih dalam lagi titik lokasinya, ya! ๐Ÿ“๐Ÿ˜Š', 'Silakan masukkan detail sublokus data di bawah ini.')) ->modalSubmitActionLabel('Simpan') ->modalCancelActionLabel('Batal') ->extraModalFooterActions(fn (CreateAction $action): array => [ diff --git a/app/Filament/Resources/Master/SubLocations/SubLocationResource.php b/app/Filament/Resources/Master/SubLocations/SubLocationResource.php index 3d0c75b..23140b5 100644 --- a/app/Filament/Resources/Master/SubLocations/SubLocationResource.php +++ b/app/Filament/Resources/Master/SubLocations/SubLocationResource.php @@ -41,7 +41,7 @@ class SubLocationResource extends Resource protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedNumberedList; - protected static ?string $navigationLabel = 'Sub Lokus'; + protected static ?string $navigationLabel = 'Sublokus'; protected static ?int $navigationSort = 4; @@ -63,7 +63,7 @@ public static function form(Schema $schema): Schema ->autofocus(), TextInput::make('name') - ->label('Nama Sub-Lokus') + ->label('Nama Sublokus') ->placeholder('Kecamatan Purwakarta') ->autocomplete(false) ->required() @@ -125,7 +125,7 @@ public static function table(Table $table): Table ]) ->toolbarActions([ BulkActionGroup::make([ - ...DefaultBulkActions::make('Sub Lokus'), + ...DefaultBulkActions::make('Sublokus'), ]), ]) ->emptyStateIcon(Heroicon::OutlinedNumberedList) diff --git a/app/Filament/Resources/Monitoring/ContentRecaps/Schemas/ContentRecapForm.php b/app/Filament/Resources/Monitoring/ContentRecaps/Schemas/ContentRecapForm.php index 498c47f..6fc1c9d 100644 --- a/app/Filament/Resources/Monitoring/ContentRecaps/Schemas/ContentRecapForm.php +++ b/app/Filament/Resources/Monitoring/ContentRecaps/Schemas/ContentRecapForm.php @@ -4,8 +4,8 @@ use App\Enums\Channel; use App\Enums\ContentType; +use App\Enums\NotifStyle; use App\Enums\SocialMedia; -use App\Enums\UxStyle; use App\Filament\Support\CheerfulNotification; use Filament\Forms\Components\DatePicker; use Filament\Forms\Components\Select; @@ -24,7 +24,7 @@ public static function configure(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Informasi Konten ๐Ÿ“', 'Informasi Konten')) ->description(fn () => CheerfulNotification::getMessage('Lengkapi detail judul, tautan, dan jenis konten Anda biar makin keren! ๐Ÿš€๐Ÿ˜Š', 'Lengkapi detail judul, tautan, dan jenis konten Anda.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-document-text' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextInput::make('title') ->label('Judul Konten') @@ -76,7 +76,7 @@ public static function configure(Schema $schema): Schema Section::make(fn () => CheerfulNotification::getMessage('Klasifikasi & Lampiran ๐Ÿ“', 'Klasifikasi & Lampiran')) ->description(fn () => CheerfulNotification::getMessage('Pilih klasifikasi yang pas dan unggah gambar pendukung ya! ๐Ÿ“โœจ', 'Pilih klasifikasi yang sesuai dan unggah gambar pendukung.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-folder-open' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-folder-open' : null) ->schema([ Select::make('classification_id') ->label('Klasifikasi') diff --git a/app/Filament/Resources/Monitoring/IssueManagements/Schemas/IssueManagementForm.php b/app/Filament/Resources/Monitoring/IssueManagements/Schemas/IssueManagementForm.php index bc56b02..9b6ba5a 100644 --- a/app/Filament/Resources/Monitoring/IssueManagements/Schemas/IssueManagementForm.php +++ b/app/Filament/Resources/Monitoring/IssueManagements/Schemas/IssueManagementForm.php @@ -3,7 +3,7 @@ namespace App\Filament\Resources\Monitoring\IssueManagements\Schemas; use App\Enums\IssueSentiment; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\Select; @@ -22,7 +22,7 @@ public static function configure(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Identifikasi Isu ๐Ÿ”', 'Identifikasi Isu')) ->description(fn () => CheerfulNotification::getMessage('Yuk, hubungkan dengan berita monitoring dan tentukan lokasi isunya! ๐Ÿ”โœจ', 'Hubungkan dengan berita monitoring dan tentukan lokasi isu.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-magnifying-glass' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-magnifying-glass' : null) ->schema([ Select::make('media_monitoring_id') ->label('Monitoring Media') @@ -59,7 +59,7 @@ public static function configure(Schema $schema): Schema ->required(), Select::make('sub_location_id') - ->label('Sub Lokus') + ->label('Sublokus') ->relationship('subLocation', 'name', fn (Builder $query, Get $get): Builder => $query->active()->where('location_id', $get('location_id'))) ->searchable() ->preload() @@ -75,7 +75,7 @@ public static function configure(Schema $schema): Schema Section::make(fn () => CheerfulNotification::getMessage('Sentimen & Klasifikasi ๐Ÿ“Š', 'Sentimen & Klasifikasi')) ->description(fn () => CheerfulNotification::getMessage('Tentukan sentimen isu, respon, dan kategorinya biar makin jelas! ๐Ÿ“Šโœจ', 'Tentukan sentimen isu, respon, dan kategori klasifikasinya.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-chart-bar' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-chart-bar' : null) ->schema([ Select::make('issue') ->label('Sentimen Isu') @@ -103,7 +103,7 @@ public static function configure(Schema $schema): Schema ->required(), Select::make('sub_classification_id') - ->label('Sub Klasifikasi') + ->label('Subklasifikasi') ->relationship('subClassification', 'name', fn (Builder $query, Get $get): Builder => $query->where('classification_id', $get('location_id'))->active()) ->searchable() ->preload() diff --git a/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php b/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php index 7c1397c..3e35f85 100644 --- a/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php +++ b/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php @@ -62,7 +62,7 @@ public static function configure(Table $table): Table ->sortable(), TextColumn::make('subLocation.name') - ->label('Sub Lokus') + ->label('Sublokus') ->searchable() ->sortable(), @@ -72,7 +72,7 @@ public static function configure(Table $table): Table ->sortable(), TextColumn::make('subClassification.name') - ->label('Sub Klasifikasi') + ->label('Subklasifikasi') ->searchable() ->sortable(), @@ -101,7 +101,7 @@ public static function configure(Table $table): Table ->native(false), SelectFilter::make('subLocation') - ->label('Sub Lokus') + ->label('Sublokus') ->relationship('subLocation', 'name') ->searchable() ->preload() @@ -123,7 +123,7 @@ public static function configure(Table $table): Table ->native(false), SelectFilter::make('subClassification') - ->label('Sub Klasifikasi') + ->label('Subklasifikasi') ->relationship('subClassification', 'name') ->searchable() ->preload() diff --git a/app/Filament/Resources/Monitoring/MediaMonitorings/Schemas/MediaMonitoringForm.php b/app/Filament/Resources/Monitoring/MediaMonitorings/Schemas/MediaMonitoringForm.php index 916d860..a66c15f 100644 --- a/app/Filament/Resources/Monitoring/MediaMonitorings/Schemas/MediaMonitoringForm.php +++ b/app/Filament/Resources/Monitoring/MediaMonitorings/Schemas/MediaMonitoringForm.php @@ -3,7 +3,7 @@ namespace App\Filament\Resources\Monitoring\MediaMonitorings\Schemas; use App\Enums\Channel; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use Filament\Forms\Components\DatePicker; use Filament\Forms\Components\RichEditor; @@ -23,7 +23,7 @@ public static function configure(Schema $schema): Schema ->components([ Section::make(fn () => CheerfulNotification::getMessage('Detail Berita ๐Ÿ“ฐ', 'Detail Berita')) ->description(fn () => CheerfulNotification::getMessage('Masukkan informasi lengkap mengenai pemberitaan media biar makin lengkap! ๐Ÿ“ฐโœจ', 'Masukkan informasi lengkap mengenai pemberitaan media.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-newspaper' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-newspaper' : null) ->schema([ TextInput::make('media_name') ->label('Nama Media') @@ -77,7 +77,7 @@ public static function configure(Schema $schema): Schema Section::make(fn () => CheerfulNotification::getMessage('Kategori & Metadata ๐Ÿท๏ธ', 'Kategori & Metadata')) ->description(fn () => CheerfulNotification::getMessage('Tentukan kategori berita dan informasi tambahan lainnya biar makin rapi! ๐Ÿท๏ธโœจ', 'Tentukan kategori berita dan informasi tambahan lainnya.')) - ->icon(fn () => CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-tag' : null) + ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-tag' : null) ->schema([ Select::make('channel') ->label('Kanal') diff --git a/app/Filament/Resources/Publication/News/Schemas/NewsForm.php b/app/Filament/Resources/Publication/News/Schemas/NewsForm.php index e252818..6406a51 100644 --- a/app/Filament/Resources/Publication/News/Schemas/NewsForm.php +++ b/app/Filament/Resources/Publication/News/Schemas/NewsForm.php @@ -3,7 +3,7 @@ namespace App\Filament\Resources\Publication\News\Schemas; use App\Enums\NewsStatus; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Filament\Support\CheerfulNotification; use App\Models\News; use Filament\Forms\Components\Hidden; @@ -29,7 +29,7 @@ public static function configure(Schema $schema): Schema Section::make(CheerfulNotification::getMessage('Konten Berita โœ๏ธ', 'Konten Berita')) ->description(CheerfulNotification::getMessage('Yuk, tuliskan judul, ringkasan, dan isi lengkap berita Anda biar makin menarik! ๐Ÿš€๐Ÿ˜Š', 'Silakan tuliskan judul, ringkasan, dan isi lengkap berita Anda.')) - ->icon(CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-pencil-square' : null) + ->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-pencil-square' : null) ->schema([ TextInput::make('title') ->label('Judul Berita') @@ -54,7 +54,7 @@ public static function configure(Schema $schema): Schema Section::make(CheerfulNotification::getMessage('Kategori & Publikasi ๐Ÿท๏ธ', 'Kategori & Publikasi')) ->description(CheerfulNotification::getMessage('Tentukan kategori, tautan media, dan status publikasi biar berita kita gampang dicari! ๐Ÿท๏ธโœจ', 'Tentukan kategori, tautan media, dan status publikasi.')) - ->icon(CheerfulNotification::getUxStyle() === UxStyle::CHEERFUL ? 'heroicon-o-tag' : null) + ->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-tag' : null) ->schema([ TextInput::make('link') ->label('Tautan Media (Opsional)') diff --git a/app/Filament/Support/CheerfulNotification.php b/app/Filament/Support/CheerfulNotification.php index 958e7a6..8881bd1 100644 --- a/app/Filament/Support/CheerfulNotification.php +++ b/app/Filament/Support/CheerfulNotification.php @@ -2,7 +2,7 @@ namespace App\Filament\Support; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use Filament\Notifications\Notification; class CheerfulNotification @@ -16,20 +16,20 @@ public static function make(): Notification } /** - * Get the current user's UX style preference. + * Get the current user's Notification style preference. */ - public static function getUxStyle(): UxStyle + public static function getNotifStyle(): NotifStyle { try { - return auth()->user()?->settings?->ux_style ?? UxStyle::CHEERFUL; + return auth()->user()?->settings?->notif_style ?? NotifStyle::CHEERFUL; } catch (\Throwable $e) { - return UxStyle::CHEERFUL; + return NotifStyle::CHEERFUL; } } public static function create(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Hore! Data Tersimpan ๐ŸŽ‰โœจ' : 'Data Berhasil Disimpan') @@ -39,7 +39,7 @@ public static function create(): Notification public static function update(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Mantap! Data Diperbarui โœ…๐Ÿ”ฅ' : 'Perubahan Tersimpan') @@ -49,7 +49,7 @@ public static function update(): Notification public static function delete(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Oke, Data Dihapus ๐Ÿ—‘๏ธ๐Ÿ‘‹' : 'Data Dihapus') @@ -59,7 +59,7 @@ public static function delete(): Notification public static function forceDelete(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Selamat Tinggal Selamanya ๐Ÿ‘‹๐Ÿ˜ข' : 'Data Dihapus Permanen') @@ -69,7 +69,7 @@ public static function forceDelete(): Notification public static function restore(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Welcome Back! Data Pulih โ™ป๏ธโœจ' : 'Data Berhasil Dipulihkan') @@ -79,7 +79,7 @@ public static function restore(): Notification public static function statusUpdated(?string $title = null, ?string $body = null): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($title ?? ($cheerful ? 'Status Berubah! ๐Ÿ”„โœจ' : 'Status Diperbarui')) @@ -89,7 +89,7 @@ public static function statusUpdated(?string $title = null, ?string $body = null public static function bulkDelete(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Oke, Banyak Data Dihapus ๐Ÿ—‘๏ธ๐Ÿ‘‹' : 'Data Berhasil Dihapus') @@ -99,7 +99,7 @@ public static function bulkDelete(): Notification public static function bulkForceDelete(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Bye Bye Semua! ๐Ÿ‘‹๐Ÿ”ฅ' : 'Data Dihapus Permanen') @@ -109,7 +109,7 @@ public static function bulkForceDelete(): Notification public static function bulkRestore(): Notification { - $cheerful = self::getUxStyle() === UxStyle::CHEERFUL; + $cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL; return self::make() ->title($cheerful ? 'Hore! Banyak Data Pulih โ™ป๏ธ๐ŸŽ‰' : 'Data Berhasil Dipulihkan') @@ -166,6 +166,6 @@ public static function danger(string $title, string $body): Notification */ public static function getMessage(string $cheerful, string $formal): string { - return self::getUxStyle() === UxStyle::CHEERFUL ? $cheerful : $formal; + return self::getNotifStyle() === NotifStyle::CHEERFUL ? $cheerful : $formal; } } diff --git a/app/Models/UserSetting.php b/app/Models/UserSetting.php index 03a9621..0ff3a5a 100644 --- a/app/Models/UserSetting.php +++ b/app/Models/UserSetting.php @@ -2,7 +2,7 @@ namespace App\Models; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -13,7 +13,7 @@ class UserSetting extends Model protected function casts(): array { return [ - 'ux_style' => UxStyle::class, + 'notif_style' => NotifStyle::class, ]; } diff --git a/app/Observers/UserObserver.php b/app/Observers/UserObserver.php index aa0367e..fe85bda 100644 --- a/app/Observers/UserObserver.php +++ b/app/Observers/UserObserver.php @@ -2,7 +2,7 @@ namespace App\Observers; -use App\Enums\UxStyle; +use App\Enums\NotifStyle; use App\Models\User; class UserObserver @@ -13,7 +13,7 @@ class UserObserver public function created(User $user): void { $user->settings()->create([ - 'ux_style' => UxStyle::CHEERFUL, + 'notif_style' => NotifStyle::CHEERFUL, 'primary_color' => 'blue', ]); } diff --git a/database/migrations/2026_03_26_140819_add_ux_style_to_users_table.php b/database/migrations/2026_03_26_140819_add_ux_style_to_users_table.php index e98e2c2..3591858 100644 --- a/database/migrations/2026_03_26_140819_add_ux_style_to_users_table.php +++ b/database/migrations/2026_03_26_140819_add_ux_style_to_users_table.php @@ -12,7 +12,7 @@ public function up(): void { Schema::table('users', function (Blueprint $table) { - $table->string('ux_style')->default('cheerful')->after('email_verified_at'); + $table->string('notif_style')->default('cheerful')->after('email_verified_at'); }); } diff --git a/database/migrations/2026_03_26_144130_create_user_settings_table.php b/database/migrations/2026_03_26_144130_create_user_settings_table.php index 51835a9..d50ad40 100644 --- a/database/migrations/2026_03_26_144130_create_user_settings_table.php +++ b/database/migrations/2026_03_26_144130_create_user_settings_table.php @@ -15,18 +15,18 @@ public function up(): void Schema::create('user_settings', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->unique()->constrained()->onDelete('cascade'); - $table->string('ux_style')->default('cheerful'); + $table->string('notif_style')->default('cheerful'); $table->string('primary_color')->nullable(); // For future extension $table->timestamps(); }); - // Migrate existing data from users table (already has ux_style from earlier migration) + // Migrate existing data from users table (already has notif_style from earlier migration) $users = DB::table('users')->get(); foreach ($users as $user) { DB::table('user_settings')->updateOrInsert( ['user_id' => $user->id], [ - 'ux_style' => $user->ux_style ?? 'cheerful', + 'notif_style' => $user->notif_style ?? 'cheerful', 'created_at' => now(), 'updated_at' => now(), ] @@ -35,7 +35,7 @@ public function up(): void // Drop the old column from users Schema::table('users', function (Blueprint $table) { - $table->dropColumn('ux_style'); + $table->dropColumn('notif_style'); }); } @@ -45,7 +45,7 @@ public function up(): void public function down(): void { Schema::table('users', function (Blueprint $table) { - $table->string('ux_style')->default('cheerful')->after('email_verified_at'); + $table->string('notif_style')->default('cheerful')->after('email_verified_at'); }); // Revert data @@ -53,7 +53,7 @@ public function down(): void foreach ($settings as $setting) { DB::table('users') ->where('id', $setting->user_id) - ->update(['ux_style' => $setting->ux_style]); + ->update(['notif_style' => $setting->notif_style]); } Schema::dropIfExists('user_settings'); diff --git a/tests/Feature/Filament/Resources/Master/SubClassifications/SubClassificationResourceTest.php b/tests/Feature/Filament/Resources/Master/SubClassifications/SubClassificationResourceTest.php index 9e1c7ad..630e245 100644 --- a/tests/Feature/Filament/Resources/Master/SubClassifications/SubClassificationResourceTest.php +++ b/tests/Feature/Filament/Resources/Master/SubClassifications/SubClassificationResourceTest.php @@ -34,14 +34,14 @@ ]); }); -test('can render sub-classification list page', function () { +test('can render subklasifikasi list page', function () { $this->actingAs($this->user); Livewire::test(ManageSubClassifications::class) ->assertSuccessful(); }); -test('can list sub-classifications', function () { +test('can list subklasifikasi', function () { $subClassifications = SubClassification::factory()->count(5)->create(); $this->actingAs($this->user); @@ -51,7 +51,7 @@ ->assertCanSeeTableRecords($subClassifications); }); -test('can create sub-classification', function () { +test('can create subklasifikasi', function () { $classification = Classification::factory()->create(['is_active' => IsActive::ACTIVE]); $this->actingAs($this->user); @@ -60,18 +60,18 @@ ->mountAction('create') ->setActionData([ 'classification_id' => $classification->id, - 'name' => 'Sub Klasifikasi Baru', + 'name' => 'Subklasifikasi Baru', ]) ->callMountedAction() ->assertHasNoActionErrors(); $this->assertDatabaseHas('sub_classifications', [ 'classification_id' => $classification->id, - 'name' => 'Sub Klasifikasi Baru', + 'name' => 'Subklasifikasi Baru', ]); }); -test('cannot create sub-classification with invalid data', function () { +test('cannot create subklasifikasi with invalid data', function () { $this->actingAs($this->user); // Empty name @@ -89,7 +89,7 @@ ->assertHasActionErrors(['classification_id']); }); -test('can edit sub-classification', function () { +test('can edit subklasifikasi', function () { $subClassification = SubClassification::factory()->create(); $newClassification = Classification::factory()->create(['is_active' => IsActive::ACTIVE]); @@ -99,12 +99,12 @@ ->mountTableAction('edit', $subClassification) ->setActionData([ 'classification_id' => $newClassification->id, - 'name' => 'Sub Klasifikasi Updated', + 'name' => 'Subklasifikasi Updated', ]) ->callMountedTableAction() ->assertHasNoActionErrors(); - expect($subClassification->refresh()->name)->toBe('Sub Klasifikasi Updated'); + expect($subClassification->refresh()->name)->toBe('Subklasifikasi Updated'); expect($subClassification->classification_id)->toBe($newClassification->id); }); @@ -119,7 +119,7 @@ expect($subClassification->refresh()->is_active)->toBe(IsActive::ACTIVE); }); -test('unauthorized user cannot render sub-classification page', function () { +test('unauthorized user cannot render subklasifikasi page', function () { $unauthorizedUser = User::factory()->create(['is_active' => IsActive::ACTIVE]); $this->actingAs($unauthorizedUser); @@ -139,7 +139,7 @@ ->assertTableActionHidden('edit', $subClassification); }); -test('can delete sub-classification', function () { +test('can delete subklasifikasi', function () { $subClassification = SubClassification::factory()->create(); $this->actingAs($this->user); @@ -150,7 +150,7 @@ $this->assertSoftDeleted($subClassification); }); -test('can restore deleted sub-classification', function () { +test('can restore deleted subklasifikasi', function () { $roleDev = Role::firstOrCreate(['name' => RoleEnum::DEVELOPER->value, 'guard_name' => 'web']); $this->user->assignRole($roleDev); @@ -168,7 +168,7 @@ ]); }); -test('can force delete sub-classification', function () { +test('can force delete subklasifikasi', function () { $roleDev = Role::firstOrCreate(['name' => RoleEnum::DEVELOPER->value, 'guard_name' => 'web']); $this->user->assignRole($roleDev); diff --git a/tests/Feature/Filament/Resources/Master/SubLocations/SubLocationResourceTest.php b/tests/Feature/Filament/Resources/Master/SubLocations/SubLocationResourceTest.php index 648a75f..c369e4a 100644 --- a/tests/Feature/Filament/Resources/Master/SubLocations/SubLocationResourceTest.php +++ b/tests/Feature/Filament/Resources/Master/SubLocations/SubLocationResourceTest.php @@ -40,14 +40,14 @@ |-------------------------------------------------------------------------- */ -test('can render sub-location list page', function () { +test('can render sublokus list page', function () { $this->actingAs($this->user); Livewire::test(ManageSubLocations::class) ->assertSuccessful(); }); -test('can list sub-locations', function () { +test('can list sublokus', function () { $subLocations = SubLocation::factory()->count(5)->create(); $this->actingAs($this->user); @@ -57,7 +57,7 @@ ->assertCanSeeTableRecords($subLocations); }); -test('can create sub-location', function () { +test('can create sublokus', function () { $location = Location::factory()->create(['is_active' => IsActive::ACTIVE]); $this->actingAs($this->user); @@ -66,18 +66,18 @@ ->mountAction('create') ->setActionData([ 'location_id' => $location->id, - 'name' => 'Sub Lokus Baru', + 'name' => 'Sublokus Baru', ]) ->callMountedAction() ->assertHasNoActionErrors(); $this->assertDatabaseHas('sub_locations', [ 'location_id' => $location->id, - 'name' => 'Sub Lokus Baru', + 'name' => 'Sublokus Baru', ]); }); -test('can edit sub-location', function () { +test('can edit sublokus', function () { $subLocation = SubLocation::factory()->create(); $newLocation = Location::factory()->create(['is_active' => IsActive::ACTIVE]); @@ -87,12 +87,12 @@ ->mountTableAction('edit', $subLocation) ->setActionData([ 'location_id' => $newLocation->id, - 'name' => 'Sub Lokus Updated', + 'name' => 'Sublokus Updated', ]) ->callMountedTableAction() ->assertHasNoActionErrors(); - expect($subLocation->refresh()->name)->toBe('Sub Lokus Updated'); + expect($subLocation->refresh()->name)->toBe('Sublokus Updated'); expect($subLocation->location_id)->toBe($newLocation->id); }); @@ -113,7 +113,7 @@ |-------------------------------------------------------------------------- */ -test('cannot create sub-location with invalid data', function () { +test('cannot create sublokus with invalid data', function () { $this->actingAs($this->user); // Empty name @@ -131,7 +131,7 @@ ->assertHasActionErrors(['location_id']); }); -test('unauthorized user cannot render sub-location page', function () { +test('unauthorized user cannot render sublokus page', function () { $unauthorizedUser = User::factory()->create(['is_active' => IsActive::ACTIVE]); $this->actingAs($unauthorizedUser); @@ -157,7 +157,7 @@ |-------------------------------------------------------------------------- */ -test('can delete sub-location', function () { +test('can delete sublokus', function () { $subLocation = SubLocation::factory()->create(); $this->actingAs($this->user); @@ -168,7 +168,7 @@ $this->assertSoftDeleted($subLocation); }); -test('can restore deleted sub-location', function () { +test('can restore deleted sublokus', function () { $roleDev = Role::firstOrCreate(['name' => RoleEnum::DEVELOPER->value, 'guard_name' => 'web']); $this->user->assignRole($roleDev); @@ -186,7 +186,7 @@ ]); }); -test('can force delete sub-location', function () { +test('can force delete sublokus', function () { $roleDev = Role::firstOrCreate(['name' => RoleEnum::DEVELOPER->value, 'guard_name' => 'web']); $this->user->assignRole($roleDev);