-
-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathManageJiraSettings.php
More file actions
77 lines (64 loc) · 2.43 KB
/
ManageJiraSettings.php
File metadata and controls
77 lines (64 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
namespace App\Filament\Pages;
use BackedEnum;
use App\Settings\JiraSettings;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Schema;
use Filament\Forms\Components\TextInput;
use Filament\Actions\Action;
use Filament\Pages\SettingsPage;
use Filament\Support\Enums\Width;
use Illuminate\Contracts\Support\Htmlable;
class ManageJiraSettings extends SettingsPage
{
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-cloud-arrow-up';
protected static string $settings = JiraSettings::class;
protected Width | string | null $maxContentWidth = Width::Full;
public static function shouldRegisterNavigation(): bool
{
return auth()->user()->can('Import from Jira');
}
public function getHeading(): string|Htmlable
{
return __('Manage Jira settings');
}
public static function getNavigationLabel(): string
{
return __('Jira');
}
public static function getNavigationGroup(): ?string
{
return __('Settings');
}
public function form(Schema $schema): Schema
{
return $schema->columns(1)->components([
Section::make(__('Jira credentials'))
->description(__('Configure your Jira connection credentials. The API token is stored encrypted.'))
->columnSpanFull()
->schema([
Grid::make(2)
->schema([
TextInput::make('host')
->label(__('Host'))
->helperText(__('The URL used to access your Jira account (e.g. https://yourcompany.atlassian.net)'))
->required(),
TextInput::make('username')
->label(__('Username'))
->helperText(__('Your Jira account username (email)'))
->required(),
TextInput::make('token')
->label(__('API Token'))
->helperText(__('Your Jira account API token'))
->password()
->required(),
]),
]),
]);
}
public function getSaveFormAction(): Action
{
return parent::getSaveFormAction()->label(__('Save'));
}
}