Skip to content

Commit

Permalink
solve spelling mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
jayushi-canyon committed Jan 2, 2025
1 parent 9c928e9 commit 3cd32fc
Showing 1 changed file with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,61 +52,61 @@
*/
class ManageAiIntegratedAssistantSettings extends SettingsPage
{
protected static string $settings = AiIntegratedAssistantSettings::class;
protected static string $settings = AiIntegratedAssistantSettings::class;

protected static ?string $title = 'Integrated Assistant';
protected static ?string $title = 'Integrated Assistant';

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

protected static ?string $navigationIcon = 'heroicon-o-cube-transparent';
protected static ?string $navigationIcon = 'heroicon-o-cube-transparent';

protected static ?int $navigationSort = 20;
protected static ?int $navigationSort = 20;

public static function canAccess(): bool
{
/** @var User $user */
$user = auth()->user();
public static function canAccess(): bool
{
/** @var User $user */
$user = auth()->user();

if (! $user->hasLicense(LicenseType::ConversationalAi)) {
return false;
}

return $user->isSuperAdmin();
if (! $user->hasLicense(LicenseType::ConversationalAi)) {
return false;
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('default_model')
->options(collect(AiModel::getDefaultModels())
->mapWithKeys(fn (AiModel $model): array => [$model->value => $model->getLabel()])
->all())
->searchable()
->helperText('Used for general purposes like generating content when an assistant is not being used.')
->required(),
])
->disabled(! auth()->user()->isSuperAdmin());
return $user->isSuperAdmin();
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('default_model')
->options(collect(AiModel::getDefaultModels())
->mapWithKeys(fn(AiModel $model): array => [$model->value => $model->getLabel()])
->all())
->searchable()
->helperText('Used for general purposes like generating content when an assistant is not being used.')
->required(),
])
->disabled(! auth()->user()->isSuperAdmin());
}

public function save(): void
{
if (! auth()->user()->isSuperAdmin()) {
return;
}

public function save(): void
{
if (! auth()->user()->cisSuperAdminan()) {
return;
}
parent::save();
}

parent::save();
/**
* @return array<Action | ActionGroup>
*/
public function getFormActions(): array
{
if (! auth()->user()->isSuperAdmin()) {
return [];
}

/**
* @return array<Action | ActionGroup>
*/
public function getFormActions(): array
{
if (! auth()->user()->isSuperAdmin()) {
return [];
}

return parent::getFormActions();
}
return parent::getFormActions();
}
}

0 comments on commit 3cd32fc

Please sign in to comment.