From eaefd1f75d008dcd00c9263880db552ea2cd1182 Mon Sep 17 00:00:00 2001 From: ketan-canyon Date: Wed, 31 Jul 2024 10:16:11 +0000 Subject: [PATCH 1/4] feature:add bagde for status --- .../views/filament/pages/badges.blade.php | 43 +++++++++++++++++++ .../Pages/EditKnowledgeBaseItem.php | 3 ++ 2 files changed, 46 insertions(+) create mode 100644 app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php diff --git a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php new file mode 100644 index 000000000..2422cfbd8 --- /dev/null +++ b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php @@ -0,0 +1,43 @@ +{{-- + + + Copyright © 2016-2024, Canyon GBS LLC. All rights reserved. + + Aiding App™ is licensed under the Elastic License 2.0. For more details, + see + + Notice: + + - You may not provide the software to third parties as a hosted or managed + service, where the service provides users with access to any substantial set of + the features or functionality of the software. + - You may not move, change, disable, or circumvent the license key functionality + in the software, and you may not remove or obscure any functionality in the + software that is protected by the license key. + - You may not alter, remove, or obscure any licensing, copyright, or other notices + of the licensor in the software. Any use of the licensor’s trademarks is subject + to applicable law. + - Canyon GBS LLC respects the intellectual property rights of others and expects the + same in return. Canyon GBS™ and Aiding App™ are registered trademarks of + Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks + vigorously. + - The software solution, including services, infrastructure, and code, is offered as a + Software as a Service (SaaS) by Canyon GBS LLC. + - Use of this software implies agreement to the license terms and conditions as stated + in the Elastic License 2.0. + + For more information or inquiries please visit our website at + or contact us via email at legal@canyongbs.com. + + +--}} + +
+ Status: + + + {{ $getRecord()->status ? $getRecord()->status->name : "" }} + + +
+ diff --git a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php index f0b09958f..52124561d 100644 --- a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php +++ b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php @@ -38,6 +38,7 @@ use Filament\Forms\Form; use Filament\Actions\EditAction; +use Filament\Forms\Components\View; use Filament\Forms\Components\Section; use Illuminate\Database\Eloquent\Model; use Filament\Forms\Components\TextInput; @@ -87,6 +88,8 @@ public function form(Form $form): Form }), ), ]), + View::make('knowledge-base::filament.pages.badges') + ->visible(fn (Model $record): bool => ($record->status)?true:false), TiptapEditor::make('article_details') ->label('Article Details') ->columnSpanFull() From 584e3ef32f61c18eb33265889b249555f121f543 Mon Sep 17 00:00:00 2001 From: ketan-canyon Date: Wed, 31 Jul 2024 10:24:13 +0000 Subject: [PATCH 2/4] chore: fix code style --- .../resources/views/filament/pages/badges.blade.php | 7 +++---- .../Pages/EditKnowledgeBaseItem.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php index 2422cfbd8..ea1cc1249 100644 --- a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php +++ b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php @@ -34,10 +34,9 @@
Status: - + - {{ $getRecord()->status ? $getRecord()->status->name : "" }} + {{ $getRecord()->status ? $getRecord()->status->name : '' }} - -
+ diff --git a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php index 52124561d..d1379fa73 100644 --- a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php +++ b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php @@ -89,7 +89,7 @@ public function form(Form $form): Form ), ]), View::make('knowledge-base::filament.pages.badges') - ->visible(fn (Model $record): bool => ($record->status)?true:false), + ->visible(fn (Model $record): bool => ($record->status) ? true : false), TiptapEditor::make('article_details') ->label('Article Details') ->columnSpanFull() From e874e894c7cf28d0852e2ee1cad74ac8ee22a947 Mon Sep 17 00:00:00 2001 From: ketan-canyon Date: Wed, 31 Jul 2024 17:12:02 +0000 Subject: [PATCH 3/4] improvment: worked on pr review changes --- .../resources/views/filament/pages/badges.blade.php | 9 +++------ .../Pages/EditKnowledgeBaseItem.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php index ea1cc1249..2f4c8d9ea 100644 --- a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php +++ b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php @@ -32,11 +32,8 @@ --}} -
- Status: - - - {{ $getRecord()->status ? $getRecord()->status->name : '' }} +
+ + {{ $getRecord()?->status?->name ?? '' }} -
diff --git a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php index d1379fa73..35b2cbe3f 100644 --- a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php +++ b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/EditKnowledgeBaseItem.php @@ -89,7 +89,7 @@ public function form(Form $form): Form ), ]), View::make('knowledge-base::filament.pages.badges') - ->visible(fn (Model $record): bool => ($record->status) ? true : false), + ->visible(fn (Model $record): bool => ! empty($record->status)), TiptapEditor::make('article_details') ->label('Article Details') ->columnSpanFull() From f3b4f07aaad4bc4801f759fc27d4b714e26e1850 Mon Sep 17 00:00:00 2001 From: ketan-canyon Date: Wed, 31 Jul 2024 17:14:49 +0000 Subject: [PATCH 4/4] chore: fix code style --- .../resources/views/filament/pages/badges.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php index 2f4c8d9ea..2e8946193 100644 --- a/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php +++ b/app-modules/knowledge-base/resources/views/filament/pages/badges.blade.php @@ -34,6 +34,6 @@
- {{ $getRecord()?->status?->name ?? '' }} + {{ $getRecord()?->status?->name ?? '' }}