feat(Password process for new admin, cleaning translations)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m21s
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m21s
This commit is contained in:
@@ -3,22 +3,22 @@
|
||||
namespace App\Filament\Resources\Members\Schemas;
|
||||
|
||||
use App\Enums\IspconfigType;
|
||||
use App\Filament\Actions\ServiceToggleAction;
|
||||
use App\Models\Member;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Infolists\Components\ViewEntry;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Infolists\Components\RepeatableEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Infolists\Components\ViewEntry;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use App\Filament\Actions\ServiceToggleAction;
|
||||
|
||||
class MemberForm
|
||||
{
|
||||
@@ -42,10 +42,10 @@ class MemberForm
|
||||
| TAB : Informations générales
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
Tabs\Tab::make('Informations générales')
|
||||
Tabs\Tab::make(__('members.tabs.general_info'))
|
||||
->icon(Heroicon::OutlinedInformationCircle)
|
||||
->schema([
|
||||
Section::make('Informations personnelles')
|
||||
Section::make(__('members.sections.personal_info'))
|
||||
->collapsible()
|
||||
->schema([
|
||||
TextInput::make('lastname')
|
||||
@@ -64,7 +64,7 @@ class MemberForm
|
||||
])
|
||||
->columns(2),
|
||||
|
||||
Section::make('Informations administratives')
|
||||
Section::make(__('members.sections.administrative_info'))
|
||||
->collapsible()
|
||||
->schema([
|
||||
TextInput::make('keycloak_id')
|
||||
@@ -86,7 +86,7 @@ class MemberForm
|
||||
])
|
||||
->columns(2),
|
||||
|
||||
Section::make('Coordonnées')
|
||||
Section::make(__('members.sections.contact_info'))
|
||||
->collapsible()
|
||||
->schema([
|
||||
TextInput::make('email')
|
||||
@@ -122,143 +122,135 @@ class MemberForm
|
||||
| TAB : Services/Modules
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
Tabs\Tab::make('Modules')
|
||||
Tabs\Tab::make(__('members.tabs.modules'))
|
||||
->icon(Heroicon::OutlinedPuzzlePiece)
|
||||
->schema([
|
||||
/*
|
||||
| Messageries ISPConfig (lecture seule)
|
||||
*/
|
||||
Section::make('Messagerie ISPConfig')
|
||||
Section::make(__('members.sections.ispconfig_mail'))
|
||||
->afterHeader([
|
||||
ServiceToggleAction::forService('mail'),
|
||||
])
|
||||
->collapsible()
|
||||
->schema([
|
||||
RepeatableEntry::make('ispconfig_mails')
|
||||
->label('Données ISPConfig Mail')
|
||||
->state(fn(?Member $record) => $record?->ispconfigs()
|
||||
->label(__('members.ispconfig.mail_data'))
|
||||
->state(fn (?Member $record) => $record?->ispconfigs()
|
||||
->where('type', IspconfigType::MAIL)
|
||||
->get()
|
||||
)
|
||||
->schema([
|
||||
TextEntry::make('email')
|
||||
->label('Adresse email'),
|
||||
->label(__('members.ispconfig.email')),
|
||||
|
||||
TextEntry::make('ispconfig_service_user_id')
|
||||
->label('ID ISPConfig'),
|
||||
->label(__('members.ispconfig.id')),
|
||||
|
||||
TextEntry::make('data.mailuser.quota')
|
||||
->label('Quota'),
|
||||
//->formatStateUsing(fn($state) => $state ? "{$state} Mo" : 'Non défini'
|
||||
//),
|
||||
->label(__('members.ispconfig.quota')),
|
||||
|
||||
TextEntry::make('data.mailuser.domain')
|
||||
->label('Domaine')
|
||||
->label(__('members.ispconfig.domain'))
|
||||
->default('retzien.fr'),
|
||||
ViewEntry::make('data')
|
||||
->label('JSON')
|
||||
->view('filament.components.json-viewer')
|
||||
->viewData(fn($state) => [
|
||||
->viewData(fn ($state) => [
|
||||
'data' => $state,
|
||||
])
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(2),
|
||||
])
|
||||
->visible(fn(?Member $record) => $record?->ispconfigs()
|
||||
->visible(fn (?Member $record) => $record?->ispconfigs()
|
||||
->where('type', IspconfigType::MAIL)
|
||||
->exists()
|
||||
),
|
||||
|
||||
/*
|
||||
| Hébergements web ISPConfig
|
||||
*/
|
||||
Section::make('Hébergements Web')
|
||||
Section::make(__('members.sections.ispconfig_web'))
|
||||
->afterHeader([
|
||||
ServiceToggleAction::forService('webhosting'),
|
||||
])
|
||||
->collapsible()
|
||||
->schema([
|
||||
RepeatableEntry::make('ispconfigs_web')
|
||||
->label('Données ISPConfig Web')
|
||||
->state(fn(?Member $record) => $record?->ispconfigs()
|
||||
->label(__('members.ispconfig.web_data'))
|
||||
->state(fn (?Member $record) => $record?->ispconfigs()
|
||||
->where('type', IspconfigType::WEB)
|
||||
->get()
|
||||
->map(fn($ispconfig) => $ispconfig->toArray())
|
||||
->map(fn ($ispconfig) => $ispconfig->toArray())
|
||||
->all()
|
||||
)
|
||||
->schema([
|
||||
TextEntry::make('data.domain_id')
|
||||
->label('ID ISPConfig'),
|
||||
->label(__('members.ispconfig.id')),
|
||||
|
||||
TextEntry::make('data.domain')
|
||||
->label('Domaine'),
|
||||
->label(__('members.ispconfig.domain')),
|
||||
|
||||
TextEntry::make('data.active')
|
||||
->label('État')
|
||||
->formatStateUsing(fn($state) => $state === 'y' ? 'Activé' : 'Désactivé'
|
||||
->label(__('members.ispconfig.state'))
|
||||
->formatStateUsing(fn ($state) => $state === 'y'
|
||||
? __('members.ispconfig.enabled')
|
||||
: __('members.ispconfig.disabled')
|
||||
),
|
||||
ViewEntry::make('data')
|
||||
->label('JSON')
|
||||
->view('filament.components.json-viewer')
|
||||
->viewData(fn($state) => [
|
||||
->viewData(fn ($state) => [
|
||||
'data' => $state,
|
||||
])
|
||||
->columnSpanFull(),
|
||||
// @todo: background color : #F5F8FA
|
||||
])
|
||||
->columns(3),
|
||||
|
||||
])
|
||||
->visible(fn(?Member $record) => $record?->ispconfigs()
|
||||
->visible(fn (?Member $record) => $record?->ispconfigs()
|
||||
->where('type', IspconfigType::WEB)
|
||||
->exists()
|
||||
),
|
||||
|
||||
/*
|
||||
| Compte(s) NextCloud (lecture seule)
|
||||
*/
|
||||
Section::make('NextCloud')
|
||||
Section::make(__('members.sections.nextcloud'))
|
||||
->afterHeader([
|
||||
ServiceToggleAction::forService('nextcloud'),
|
||||
])
|
||||
->collapsible()
|
||||
->schema([
|
||||
RepeatableEntry::make('nextcloud_accounts')
|
||||
->label('Données NextCloud')
|
||||
->state(fn(?Member $record) => $record?->nextcloudAccounts()
|
||||
->label(__('members.ispconfig.nextcloud_data'))
|
||||
->state(fn (?Member $record) => $record?->nextcloudAccounts()
|
||||
->get()
|
||||
->map(fn($nextcloudAccount) => $nextcloudAccount->toArray())
|
||||
->map(fn ($nextcloudAccount) => $nextcloudAccount->toArray())
|
||||
->all()
|
||||
)
|
||||
->schema([
|
||||
TextEntry::make('nextcloud_user_id')
|
||||
->label('Id Nextcloud'),
|
||||
->label(__('members.ispconfig.nextcloud_id')),
|
||||
|
||||
TextEntry::make('data.displayname')
|
||||
->label('Nom de l\'utilisateur'),
|
||||
->label(__('members.ispconfig.display_name')),
|
||||
|
||||
TextEntry::make('data.enabled')
|
||||
->label('État')
|
||||
->formatStateUsing(fn($state) => $state == 'true' ? 'Activé' : 'Désactivé'
|
||||
->label(__('members.ispconfig.state'))
|
||||
->formatStateUsing(fn ($state) => $state == 'true'
|
||||
? __('members.ispconfig.enabled')
|
||||
: __('members.ispconfig.disabled')
|
||||
),
|
||||
|
||||
ViewEntry::make('data')
|
||||
->label('JSON')
|
||||
->view('filament.components.json-viewer')
|
||||
->viewData(fn($state) => [
|
||||
->viewData(fn ($state) => [
|
||||
'data' => $state,
|
||||
])
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(3),
|
||||
])
|
||||
->visible(fn(?Member $record) => $record?->nextcloudAccounts()
|
||||
->visible(fn (?Member $record) => $record?->nextcloudAccounts()
|
||||
->exists()
|
||||
),
|
||||
]),
|
||||
])
|
||||
->contained(false)
|
||||
->contained(false),
|
||||
])
|
||||
->columnSpan(3),
|
||||
|
||||
@@ -269,7 +261,7 @@ class MemberForm
|
||||
*/
|
||||
Grid::make(1)
|
||||
->schema([
|
||||
Section::make('Statut')
|
||||
Section::make(__('members.sections.status'))
|
||||
->collapsible()
|
||||
->schema([
|
||||
Select::make('status')
|
||||
@@ -290,18 +282,18 @@ class MemberForm
|
||||
])
|
||||
->extraAttributes(['class' => 'sticky top-4 h-fit']),
|
||||
|
||||
Section::make('Actions')
|
||||
Section::make(__('members.sections.actions'))
|
||||
->collapsible()
|
||||
->schema([
|
||||
Action::make('send-payment-mail')
|
||||
->label('Envoyer le mail de paiement')
|
||||
->label(__('members.actions.send_payment_mail'))
|
||||
->icon('heroicon-o-envelope')
|
||||
->action(function () {
|
||||
// Mail de paiement pour nouvelle inscription (Job)
|
||||
}),
|
||||
|
||||
Action::make('send-renewal-mail')
|
||||
->label('Envoyer un mail de relance')
|
||||
->label(__('members.actions.send_renewal_mail'))
|
||||
->icon('heroicon-o-envelope')
|
||||
->action(function () {
|
||||
// Mail de relance à créer (Job)
|
||||
|
||||
Reference in New Issue
Block a user