Skip to content

Commit

Permalink
Merge pull request #427 from canyongbs/advapp-205
Browse files Browse the repository at this point in the history
[ADVAPP-205]: Transition Third Level Navigation to Subnavigation Pages and more
  • Loading branch information
Orrison authored Jan 10, 2024
2 parents 4690be2 + 46a9753 commit fd90397
Show file tree
Hide file tree
Showing 119 changed files with 1,549 additions and 1,459 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
namespace AdvisingApp\Analytics\Filament\Resources;

use Filament\Resources\Resource;
use App\Filament\Clusters\AnalyticsResources;
use AdvisingApp\Analytics\Models\AnalyticsResourceCategory;
use AdvisingApp\Analytics\Filament\Resources\AnalyticsResourceCategoryResource\Pages\EditAnalyticsResourceCategory;
use AdvisingApp\Analytics\Filament\Resources\AnalyticsResourceCategoryResource\Pages\ViewAnalyticsResourceCategory;
Expand All @@ -47,11 +48,9 @@ class AnalyticsResourceCategoryResource extends Resource
{
protected static ?string $model = AnalyticsResourceCategory::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?int $navigationSort = 30;

protected static ?string $navigationGroup = 'Product Settings';

protected static ?int $navigationSort = 20;
protected static ?string $cluster = AnalyticsResources::class;

public static function getPages(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
namespace AdvisingApp\Analytics\Filament\Resources;

use Filament\Resources\Resource;
use App\Filament\Clusters\AnalyticsResources;
use AdvisingApp\Analytics\Models\AnalyticsResource;
use AdvisingApp\Analytics\Filament\Resources\AnalyticsResourceResource\Pages\EditAnalyticsResource;
use AdvisingApp\Analytics\Filament\Resources\AnalyticsResourceResource\Pages\ListAnalyticsResources;
Expand All @@ -46,13 +47,9 @@ class AnalyticsResourceResource extends Resource
{
protected static ?string $model = AnalyticsResource::class;

protected static ?string $navigationIcon = 'heroicon-o-arrow-trending-up';
protected static ?int $navigationSort = 10;

protected static ?string $navigationGroup = 'Data and Analytics';

protected static ?int $navigationSort = 1;

protected static ?string $navigationLabel = 'Analytics Portal';
protected static ?string $cluster = AnalyticsResources::class;

public static function getPages(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
namespace AdvisingApp\Analytics\Filament\Resources;

use Filament\Resources\Resource;
use App\Filament\Clusters\AnalyticsResources;
use AdvisingApp\Analytics\Models\AnalyticsResourceSource;
use AdvisingApp\Analytics\Filament\Resources\AnalyticsResourceSourceResource\Pages\EditAnalyticsResourceSource;
use AdvisingApp\Analytics\Filament\Resources\AnalyticsResourceSourceResource\Pages\ViewAnalyticsResourceSource;
Expand All @@ -47,11 +48,9 @@ class AnalyticsResourceSourceResource extends Resource
{
protected static ?string $model = AnalyticsResourceSource::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?int $navigationSort = 20;

protected static ?string $navigationGroup = 'Product Settings';

protected static ?int $navigationSort = 19;
protected static ?string $cluster = AnalyticsResources::class;

public static function getPages(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
namespace AdvisingApp\Application\Filament\Resources;

use Filament\Resources\Resource;
use App\Filament\Clusters\OnlineAdmissions;
use AdvisingApp\Application\Models\ApplicationSubmissionState;
use AdvisingApp\Application\Filament\Resources\ApplicationSubmissionStateResource\Pages\EditApplicationSubmissionState;
use AdvisingApp\Application\Filament\Resources\ApplicationSubmissionStateResource\Pages\ViewApplicationSubmissionState;
Expand All @@ -49,14 +50,12 @@ class ApplicationSubmissionStateResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationParentItem = 'Online Admissions';

protected static ?string $navigationGroup = 'Product Administration';

protected static ?string $navigationLabel = 'Application States';

protected static ?int $navigationSort = 1;

protected static ?string $cluster = OnlineAdmissions::class;

public static function getPages(): array
{
return [
Expand Down
118 changes: 0 additions & 118 deletions app-modules/assistant/src/Filament/Pages/AssistantConfiguration.php

This file was deleted.

33 changes: 3 additions & 30 deletions app-modules/assistant/src/Filament/Pages/ManageAiSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use AdvisingApp\Authorization\Enums\LicenseType;
use App\Filament\Clusters\ArtificialIntelligence;
use AdvisingApp\IntegrationAI\Settings\AISettings;

class ManageAiSettings extends SettingsPage
Expand All @@ -50,12 +51,9 @@ class ManageAiSettings extends SettingsPage

protected static ?string $title = 'Manage AI Settings';

protected static ?string $navigationGroup = 'Product Administration';
protected static ?string $cluster = ArtificialIntelligence::class;

// We don't want to register the navigation as we will be using the navigation item in a different page.
public static function registerNavigationItems(): void {}

public static function shouldRegisterNavigation(): bool
public static function canAccess(): bool
{
/** @var User $user */
$user = auth()->user();
Expand All @@ -67,26 +65,6 @@ public static function shouldRegisterNavigation(): bool
return $user->can(['assistant.access_ai_settings']);
}

public function mount(): void
{
/** @var User $user */
$user = auth()->user();

abort_unless($user->hasLicense(LicenseType::ConversationalAi), 403);

abort_unless($user->can(['assistant.access_ai_settings']), 403);

parent::mount();
}

public function getBreadcrumbs(): array
{
return [
AssistantConfiguration::getUrl() => 'Artificial Intelligence',
$this::getUrl() => 'Manage AI Settings',
];
}

public function form(Form $form): Form
{
return $form
Expand All @@ -113,9 +91,4 @@ public function form(Form $form): Form
->columnSpan('1/2'),
]);
}

public function getSubNavigation(): array
{
return (new AssistantConfiguration())->getSubNavigation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class PersonalAssistant extends Page

public bool $loading = true;

public static function shouldRegisterNavigation(): bool
public static function canAccess(): bool
{
/** @var User $user */
$user = auth()->user();
Expand All @@ -118,10 +118,6 @@ public static function shouldRegisterNavigation(): bool

public function mount(): void
{
abort_unless(auth()->user()->hasLicense(LicenseType::ConversationalAi), 403);

$this->authorize('assistant.access');

$this->consentAgreement = ConsentAgreement::where('type', ConsentAgreementType::AzureOpenAI)->first();

/** @var AssistantChat $chat */
Expand Down
7 changes: 1 addition & 6 deletions app-modules/assistant/src/Filament/Pages/PromptLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PromptLibrary extends Page

protected static ?int $navigationSort = 10;

public static function shouldRegisterNavigation(): bool
public static function canAccess(): bool
{
/** @var User $user */
$user = auth()->user();
Expand All @@ -61,9 +61,4 @@ public static function shouldRegisterNavigation(): bool

return $user->can('assistant.access');
}

public function mount(): void
{
abort_unless(auth()->user()->hasLicense(LicenseType::ConversationalAi), 403);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use App\Infolists\Components\CodeEntry;
use Filament\Tables\Actions\ViewAction;
use Filament\Tables\Columns\TextColumn;
use App\Filament\Clusters\UsageAuditing;
use Filament\Tables\Actions\DeleteAction;
use Filament\Tables\Filters\SelectFilter;
use Filament\Infolists\Components\TextEntry;
Expand All @@ -58,16 +59,14 @@ class AssistantChatMessageLogResource extends Resource

protected static ?string $navigationLabel = 'Personal Assistant';

protected static ?string $navigationParentItem = 'Usage Auditing';

protected static ?string $navigationGroup = 'Reporting';

protected static ?int $navigationSort = 30;

protected static ?string $modelLabel = 'Personal Assistant';

protected static ?string $pluralLabel = 'Personal Assistant';

protected static ?string $cluster = UsageAuditing::class;

public static function infolist(Infolist $infolist): Infolist
{
return $infolist
Expand Down
Loading

0 comments on commit fd90397

Please sign in to comment.