F
Filament2mo ago
Xavi

Polling step wizard

I'm making a wizard to connect to Google Analytics, and the first step contains the connect button. The authorization screen to obtain the analytics accounts opens, and what I want is that when I close this screen, I want to automatically go to step 2, which is a select to select which analytics account will be used, and for this I have thought about the first step having a poll. Is this possible? I attach steps image, and this is the code
Tables\Actions\Action::make('connect_analytics')
->icon('heroicon-o-chart-bar')
->label(__('Conectar Google Analytics'))
->steps([
Step::make('step1')
->label(__('Paso 1'))
->description(__('Conecta tu cuenta de Google Analytics'))
->schema([
Actions::make([
Action::make('actionName')
->label(__('Conectar'))
->size('xl')
->extraAttributes([
'class' => 'm-0 auto',
])
->action(function (Media $record, $livewire) {
$url = route('google.auth.redirect', $record);
$livewire->js("window.open('$url', '_blank', 'popup=yes', 'width=350', 'height=250').focus();");
})
//->openUrlInNewTab()
//->url(fn(Media $record) => route('google.auth.redirect', $record))
]),
]),
Step::make('step2')
->label(__('Paso 2'))
->description(__('Selecciona la cuenta de Google Analytics'))
->visible(fn(Media $record) => $record->analyticsAccount)
->schema([
Select::make('analyticsAccount.account_selected')
->options(function (Media $record) {
return Arr::pluck($record->analyticsAccount->accounts, 'name', 'account_id');
})
]),
])
Tables\Actions\Action::make('connect_analytics')
->icon('heroicon-o-chart-bar')
->label(__('Conectar Google Analytics'))
->steps([
Step::make('step1')
->label(__('Paso 1'))
->description(__('Conecta tu cuenta de Google Analytics'))
->schema([
Actions::make([
Action::make('actionName')
->label(__('Conectar'))
->size('xl')
->extraAttributes([
'class' => 'm-0 auto',
])
->action(function (Media $record, $livewire) {
$url = route('google.auth.redirect', $record);
$livewire->js("window.open('$url', '_blank', 'popup=yes', 'width=350', 'height=250').focus();");
})
//->openUrlInNewTab()
//->url(fn(Media $record) => route('google.auth.redirect', $record))
]),
]),
Step::make('step2')
->label(__('Paso 2'))
->description(__('Selecciona la cuenta de Google Analytics'))
->visible(fn(Media $record) => $record->analyticsAccount)
->schema([
Select::make('analyticsAccount.account_selected')
->options(function (Media $record) {
return Arr::pluck($record->analyticsAccount->accounts, 'name', 'account_id');
})
]),
])
Thanks!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server