From 0433d949cde67dfcd78bbb7653885d039dc1e8c9 Mon Sep 17 00:00:00 2001 From: Jayushi Jain Date: Mon, 9 Dec 2024 09:54:38 +0000 Subject: [PATCH 1/2] change sorting order --- .../Filament/Resources/ProductResource.php | 58 ++++++++-------- .../src/Filament/Pages/ServiceRequests.php | 66 +++++++++---------- .../Resources/ChangeRequestResource.php | 30 ++++----- .../src/Filament/Resources/TaskResource.php | 28 ++++---- 4 files changed, 91 insertions(+), 91 deletions(-) diff --git a/app-modules/license-management/src/Filament/Resources/ProductResource.php b/app-modules/license-management/src/Filament/Resources/ProductResource.php index de06da16c..4854ba69d 100644 --- a/app-modules/license-management/src/Filament/Resources/ProductResource.php +++ b/app-modules/license-management/src/Filament/Resources/ProductResource.php @@ -47,33 +47,33 @@ class ProductResource extends Resource { - protected static ?string $model = Product::class; - - protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; - - protected static ?string $navigationGroup = 'Service Management'; - - protected static ?string $navigationLabel = 'License Management'; - - protected static ?int $navigationSort = 31; - - public static function getRecordSubNavigation(Page $page): array - { - return $page->generateNavigationItems([ - ViewProduct::class, - EditProduct::class, - ManageProductLicenses::class, - ]); - } - - public static function getPages(): array - { - return [ - 'index' => ListProducts::route('/'), - 'create' => CreateProduct::route('/create'), - 'view' => ViewProduct::route('/{record}'), - 'edit' => EditProduct::route('/{record}/edit'), - 'product-licences' => ManageProductLicenses::route('/{record}/product-licences'), - ]; - } + protected static ?string $model = Product::class; + + protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + + protected static ?string $navigationGroup = 'Service Management'; + + protected static ?string $navigationLabel = 'License Management'; + + protected static ?int $navigationSort = 50; + + public static function getRecordSubNavigation(Page $page): array + { + return $page->generateNavigationItems([ + ViewProduct::class, + EditProduct::class, + ManageProductLicenses::class, + ]); + } + + public static function getPages(): array + { + return [ + 'index' => ListProducts::route('/'), + 'create' => CreateProduct::route('/create'), + 'view' => ViewProduct::route('/{record}'), + 'edit' => EditProduct::route('/{record}/edit'), + 'product-licences' => ManageProductLicenses::route('/{record}/product-licences'), + ]; + } } diff --git a/app-modules/report/src/Filament/Pages/ServiceRequests.php b/app-modules/report/src/Filament/Pages/ServiceRequests.php index c32b727a7..f67bb88b6 100644 --- a/app-modules/report/src/Filament/Pages/ServiceRequests.php +++ b/app-modules/report/src/Filament/Pages/ServiceRequests.php @@ -47,48 +47,48 @@ class ServiceRequests extends Dashboard { - protected static ?string $navigationIcon = 'heroicon-o-document-text'; + protected static ?string $navigationIcon = 'heroicon-o-document-text'; - protected static ?string $cluster = ReportLibrary::class; + protected static ?string $cluster = ReportLibrary::class; - protected static ?string $navigationGroup = 'Service Management'; + protected static ?string $navigationGroup = 'Service Management'; - protected static ?string $navigationLabel = 'Service Requests'; + protected static ?string $navigationLabel = 'Service Requests'; - protected static ?string $title = 'Service Requests'; + protected static ?string $title = 'Service Requests'; - protected static string $routePath = 'service-requests'; + protected static string $routePath = 'service-requests'; - protected static ?int $navigationSort = 30; + protected static ?int $navigationSort = 10; - protected $cacheTag = 'report-service-requests'; + protected $cacheTag = 'report-service-requests'; - public static function canAccess(): bool - { - /** @var User $user */ - $user = auth()->user(); + public static function canAccess(): bool + { + /** @var User $user */ + $user = auth()->user(); - return $user->can('report-library.view-any'); - } + return $user->can('report-library.view-any'); + } - public function getWidgets(): array - { - return [ - RefreshWidget::make(['cacheTag' => $this->cacheTag]), - ServiceRequestsStats::make(['cacheTag' => $this->cacheTag]), - ServiceRequestStatusDistributionDonutChart::make(['cacheTag' => $this->cacheTag]), - ServiceRequestsOverTimeLineChart::make(['cacheTag' => $this->cacheTag]), - RecentServiceRequestsTable::make(['cacheTag' => $this->cacheTag]), - TopServiceRequestTypesTable::make(['cacheTag' => $this->cacheTag]), - ]; - } + public function getWidgets(): array + { + return [ + RefreshWidget::make(['cacheTag' => $this->cacheTag]), + ServiceRequestsStats::make(['cacheTag' => $this->cacheTag]), + ServiceRequestStatusDistributionDonutChart::make(['cacheTag' => $this->cacheTag]), + ServiceRequestsOverTimeLineChart::make(['cacheTag' => $this->cacheTag]), + RecentServiceRequestsTable::make(['cacheTag' => $this->cacheTag]), + TopServiceRequestTypesTable::make(['cacheTag' => $this->cacheTag]), + ]; + } - public function getColumns(): int | string | array - { - return [ - 'sm' => 2, - 'md' => 4, - 'lg' => 4, - ]; - } + public function getColumns(): int | string | array + { + return [ + 'sm' => 2, + 'md' => 4, + 'lg' => 4, + ]; + } } diff --git a/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php b/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php index 65ccb8fd8..9bb201627 100644 --- a/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php +++ b/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php @@ -45,25 +45,25 @@ class ChangeRequestResource extends Resource { - protected static ?string $model = ChangeRequest::class; + protected static ?string $model = ChangeRequest::class; - protected static ?string $navigationLabel = 'Change Management'; + protected static ?string $navigationLabel = 'Change Management'; - protected static ?string $navigationIcon = 'heroicon-m-arrow-path-rounded-square'; + protected static ?string $navigationIcon = 'heroicon-m-arrow-path-rounded-square'; - protected static ?string $navigationGroup = 'Service Management'; + protected static ?string $navigationGroup = 'Service Management'; - protected static ?int $navigationSort = 40; + protected static ?int $navigationSort = 60; - protected static ?string $breadcrumb = 'Change Management'; + protected static ?string $breadcrumb = 'Change Management'; - public static function getPages(): array - { - return [ - 'index' => ListChangeRequests::route('/'), - 'create' => CreateChangeRequest::route('/create'), - 'view' => ViewChangeRequest::route('/{record}'), - 'edit' => EditChangeRequest::route('/{record}/edit'), - ]; - } + public static function getPages(): array + { + return [ + 'index' => ListChangeRequests::route('/'), + 'create' => CreateChangeRequest::route('/create'), + 'view' => ViewChangeRequest::route('/{record}'), + 'edit' => EditChangeRequest::route('/{record}/edit'), + ]; + } } diff --git a/app-modules/task/src/Filament/Resources/TaskResource.php b/app-modules/task/src/Filament/Resources/TaskResource.php index e581cc58b..280979730 100644 --- a/app-modules/task/src/Filament/Resources/TaskResource.php +++ b/app-modules/task/src/Filament/Resources/TaskResource.php @@ -44,24 +44,24 @@ class TaskResource extends Resource { - protected static ?string $model = Task::class; + protected static ?string $model = Task::class; - protected static ?string $navigationGroup = 'Service Management'; + protected static ?string $navigationGroup = 'Service Management'; - protected static ?int $navigationSort = 60; + protected static ?int $navigationSort = 70; - protected static ?string $breadcrumb = 'Task Management'; + protected static ?string $breadcrumb = 'Task Management'; - protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check'; + protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check'; - protected static ?string $navigationLabel = 'Task Management'; + protected static ?string $navigationLabel = 'Task Management'; - public static function getPages(): array - { - return [ - 'index' => ListTasks::route('/'), - 'create' => CreateTask::route('/create'), - 'edit' => EditTask::route('/{record}/edit'), - ]; - } + public static function getPages(): array + { + return [ + 'index' => ListTasks::route('/'), + 'create' => CreateTask::route('/create'), + 'edit' => EditTask::route('/{record}/edit'), + ]; + } } From 1be7473fb961545333ba5d912a622276ddd4d384 Mon Sep 17 00:00:00 2001 From: jayushi-canyon Date: Mon, 9 Dec 2024 09:59:53 +0000 Subject: [PATCH 2/2] chore: fix code style --- .../Filament/Resources/ProductResource.php | 58 ++++++++-------- .../src/Filament/Pages/ServiceRequests.php | 66 +++++++++---------- .../Resources/ChangeRequestResource.php | 30 ++++----- .../src/Filament/Resources/TaskResource.php | 28 ++++---- 4 files changed, 91 insertions(+), 91 deletions(-) diff --git a/app-modules/license-management/src/Filament/Resources/ProductResource.php b/app-modules/license-management/src/Filament/Resources/ProductResource.php index 4854ba69d..8028bb717 100644 --- a/app-modules/license-management/src/Filament/Resources/ProductResource.php +++ b/app-modules/license-management/src/Filament/Resources/ProductResource.php @@ -47,33 +47,33 @@ class ProductResource extends Resource { - protected static ?string $model = Product::class; - - protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; - - protected static ?string $navigationGroup = 'Service Management'; - - protected static ?string $navigationLabel = 'License Management'; - - protected static ?int $navigationSort = 50; - - public static function getRecordSubNavigation(Page $page): array - { - return $page->generateNavigationItems([ - ViewProduct::class, - EditProduct::class, - ManageProductLicenses::class, - ]); - } - - public static function getPages(): array - { - return [ - 'index' => ListProducts::route('/'), - 'create' => CreateProduct::route('/create'), - 'view' => ViewProduct::route('/{record}'), - 'edit' => EditProduct::route('/{record}/edit'), - 'product-licences' => ManageProductLicenses::route('/{record}/product-licences'), - ]; - } + protected static ?string $model = Product::class; + + protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + + protected static ?string $navigationGroup = 'Service Management'; + + protected static ?string $navigationLabel = 'License Management'; + + protected static ?int $navigationSort = 50; + + public static function getRecordSubNavigation(Page $page): array + { + return $page->generateNavigationItems([ + ViewProduct::class, + EditProduct::class, + ManageProductLicenses::class, + ]); + } + + public static function getPages(): array + { + return [ + 'index' => ListProducts::route('/'), + 'create' => CreateProduct::route('/create'), + 'view' => ViewProduct::route('/{record}'), + 'edit' => EditProduct::route('/{record}/edit'), + 'product-licences' => ManageProductLicenses::route('/{record}/product-licences'), + ]; + } } diff --git a/app-modules/report/src/Filament/Pages/ServiceRequests.php b/app-modules/report/src/Filament/Pages/ServiceRequests.php index f67bb88b6..3d6107ff0 100644 --- a/app-modules/report/src/Filament/Pages/ServiceRequests.php +++ b/app-modules/report/src/Filament/Pages/ServiceRequests.php @@ -47,48 +47,48 @@ class ServiceRequests extends Dashboard { - protected static ?string $navigationIcon = 'heroicon-o-document-text'; + protected static ?string $navigationIcon = 'heroicon-o-document-text'; - protected static ?string $cluster = ReportLibrary::class; + protected static ?string $cluster = ReportLibrary::class; - protected static ?string $navigationGroup = 'Service Management'; + protected static ?string $navigationGroup = 'Service Management'; - protected static ?string $navigationLabel = 'Service Requests'; + protected static ?string $navigationLabel = 'Service Requests'; - protected static ?string $title = 'Service Requests'; + protected static ?string $title = 'Service Requests'; - protected static string $routePath = 'service-requests'; + protected static string $routePath = 'service-requests'; - protected static ?int $navigationSort = 10; + protected static ?int $navigationSort = 10; - protected $cacheTag = 'report-service-requests'; + protected $cacheTag = 'report-service-requests'; - public static function canAccess(): bool - { - /** @var User $user */ - $user = auth()->user(); + public static function canAccess(): bool + { + /** @var User $user */ + $user = auth()->user(); - return $user->can('report-library.view-any'); - } + return $user->can('report-library.view-any'); + } - public function getWidgets(): array - { - return [ - RefreshWidget::make(['cacheTag' => $this->cacheTag]), - ServiceRequestsStats::make(['cacheTag' => $this->cacheTag]), - ServiceRequestStatusDistributionDonutChart::make(['cacheTag' => $this->cacheTag]), - ServiceRequestsOverTimeLineChart::make(['cacheTag' => $this->cacheTag]), - RecentServiceRequestsTable::make(['cacheTag' => $this->cacheTag]), - TopServiceRequestTypesTable::make(['cacheTag' => $this->cacheTag]), - ]; - } + public function getWidgets(): array + { + return [ + RefreshWidget::make(['cacheTag' => $this->cacheTag]), + ServiceRequestsStats::make(['cacheTag' => $this->cacheTag]), + ServiceRequestStatusDistributionDonutChart::make(['cacheTag' => $this->cacheTag]), + ServiceRequestsOverTimeLineChart::make(['cacheTag' => $this->cacheTag]), + RecentServiceRequestsTable::make(['cacheTag' => $this->cacheTag]), + TopServiceRequestTypesTable::make(['cacheTag' => $this->cacheTag]), + ]; + } - public function getColumns(): int | string | array - { - return [ - 'sm' => 2, - 'md' => 4, - 'lg' => 4, - ]; - } + public function getColumns(): int | string | array + { + return [ + 'sm' => 2, + 'md' => 4, + 'lg' => 4, + ]; + } } diff --git a/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php b/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php index 9bb201627..d027250df 100644 --- a/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php +++ b/app-modules/service-management/src/Filament/Resources/ChangeRequestResource.php @@ -45,25 +45,25 @@ class ChangeRequestResource extends Resource { - protected static ?string $model = ChangeRequest::class; + protected static ?string $model = ChangeRequest::class; - protected static ?string $navigationLabel = 'Change Management'; + protected static ?string $navigationLabel = 'Change Management'; - protected static ?string $navigationIcon = 'heroicon-m-arrow-path-rounded-square'; + protected static ?string $navigationIcon = 'heroicon-m-arrow-path-rounded-square'; - protected static ?string $navigationGroup = 'Service Management'; + protected static ?string $navigationGroup = 'Service Management'; - protected static ?int $navigationSort = 60; + protected static ?int $navigationSort = 60; - protected static ?string $breadcrumb = 'Change Management'; + protected static ?string $breadcrumb = 'Change Management'; - public static function getPages(): array - { - return [ - 'index' => ListChangeRequests::route('/'), - 'create' => CreateChangeRequest::route('/create'), - 'view' => ViewChangeRequest::route('/{record}'), - 'edit' => EditChangeRequest::route('/{record}/edit'), - ]; - } + public static function getPages(): array + { + return [ + 'index' => ListChangeRequests::route('/'), + 'create' => CreateChangeRequest::route('/create'), + 'view' => ViewChangeRequest::route('/{record}'), + 'edit' => EditChangeRequest::route('/{record}/edit'), + ]; + } } diff --git a/app-modules/task/src/Filament/Resources/TaskResource.php b/app-modules/task/src/Filament/Resources/TaskResource.php index 280979730..acf29af41 100644 --- a/app-modules/task/src/Filament/Resources/TaskResource.php +++ b/app-modules/task/src/Filament/Resources/TaskResource.php @@ -44,24 +44,24 @@ class TaskResource extends Resource { - protected static ?string $model = Task::class; + protected static ?string $model = Task::class; - protected static ?string $navigationGroup = 'Service Management'; + protected static ?string $navigationGroup = 'Service Management'; - protected static ?int $navigationSort = 70; + protected static ?int $navigationSort = 70; - protected static ?string $breadcrumb = 'Task Management'; + protected static ?string $breadcrumb = 'Task Management'; - protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check'; + protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check'; - protected static ?string $navigationLabel = 'Task Management'; + protected static ?string $navigationLabel = 'Task Management'; - public static function getPages(): array - { - return [ - 'index' => ListTasks::route('/'), - 'create' => CreateTask::route('/create'), - 'edit' => EditTask::route('/{record}/edit'), - ]; - } + public static function getPages(): array + { + return [ + 'index' => ListTasks::route('/'), + 'create' => CreateTask::route('/create'), + 'edit' => EditTask::route('/{record}/edit'), + ]; + } }