Wizard Step 2 being skipped in Modal Dialog
Has anyone else experienced a situation where step 2 (and only step 2!) is always skipped in a Wizard, in a modal dialog?
There is literally nothing special about the wizard. It also appears to ignore the cannot-skip flags and cannot click away flag.
I can create a sample if required to reproduce, but again, there isn't much special about it. You can witness the behaviour via https://internal-development.asmorphic.com/
58 Replies
(you can get into the modal dialog by clicking the 'edit' button, that isn't normally possible, I did some crafty business to make that work)
Should I just raise a bug ticket on GitHub perhaps?
At that URL I'm getting this error just trying to click the "Next" button to start the Wizard.
And I see no Edit button.
the pencil
I've created an isolated test now as well
https://internal-development.asmorphic.com/test/
Just preparing a vanilla installation so I can create a standalone laravel/filament instance that shows it
DrByte - how are you starting the wizard? It isn't the main steps, it's the wizard inside the modal
Yeah, I see it happening, but without a repro I can't debug it. If you want to create a little repro (base it on the Demo app if that helps) and submit an issue, I'll fix it for ya.
Yep I'm doing that now
Cool. Just @ me in here when it's done, I'll have a hack at it.
Just loaded the page and got the green button, and tried clicking it.
If you can let me know how you go about debugging it - I'd love to learn - I'm still getting my debugging approach in check, I come from the old land of xdebug =]
I'm 100% xdebug.
Yeah, unfortunately the forms required to build the main version of this thing hit the 256 stack limit haha
It's sooooooo much easier and quicker than dd() or ray(). I only use ray() when "well shit, it works locally but not in production".
and I'm presently using artisan serve (and the plugin for artisan serve:xdebug was abandoned)
At which point ray's remote feature is a godsend.
I have xdebug running on the webserver pushing the requests to me, but then I have to deploy code from phpstorm auto -> webserver
Ah, I'm using valet.
haven't heard of that - will make a note
Well, valet / sail, depending on the project. But xdebug works a treat in both.
well, good to know that's still the best way to go - I've taught so many of my developers in the past that were still "echo'ing" their way through things
especially when writing billing / telephony rating code for examples or billing processes, being able to see 'state' is essential, I find it's new territory for those who are only PHP devs, if you come from a compiled language (java/c# for example) it's just the way its done
Valet can be a mild pain to get set up, but in combination with PHP Monitor, once set up it makes life very easy. One of these days I may try Herd, once they support xdebug, but I'm in no hurry. Very happy with Valet.
I'll give it a red hot go!
anyway, gimme a few minutes, just injecting the code now - how did you want me to share it? I thought github requires something special for a public repo?
As long as it's not a private repo, it'll be fine.
sweet
<-- name is Martin btw
Pleased to meet you.
You too!
Feeding the dogs, back in a few.
Coolio
Aside: DM me with your pain-points regarding Valet. I'm often chatting with Matt Stauffer about tweaks we can incorporate to make Valet better/easier, etc.
Really hard to articulate. It just breaks sometimes. And really hard to figure out if it was PHP Monitor, brew or Valet. And once broken, it's hours of brew hell trying to piece things back together, that usually ends up with just blowing it all away and starting again. That said, this hasn't happened for about 6 months now, after happening a few times in the 6 months before that, so the gremlins may have been flushed out.
while I'm here, I'm just copying the base layout into my app layout (which is how I get the styles all to render outside of the panel) - and the base has $livewire - any idea how I push the livewire instance along?
{{ filled($title = strip_tags($livewire->getTitle())) ? "{$title} - " : null }}
because in my base I'm also using filament() - but I can't touch it to fix the brands
separate issue, of course
ie, $this->setBrandLogo() sets a value, but it's not populating the filament manager
well that's interesting, in the fresh install using exactly the same code, it doesn't appear to skip
That's the main reason for creating a repro.
Yeah lot of content in what I have in the main one - so that should be interesting to pick apart - there isnt' much to it - I wonder if the copied base layout is actually part of the problem somehow
one tick
Or rather, us insisting that people do. Because quite often, the problem goes away on a cut down, fresh repro, and gives you hints about where the issue may be in your app.
Solution
Yeah, looks like it's the way I copied the base.blade.php
I do the same all the time in other packages I maintain: 80% of the time the solution is found just in creating a stripped down demo ... "oh, I missed xyz"
so I just need to work with that - so the next step is how I get the livewire instance passed along to it
Which layout are you copying? If you are running standalone Forms outside a panel, you should be following the instructions ...
https://filamentphp.com/docs/3.x/forms/installation
I copied from views.components.layout.base
will check it out
I'm pretty sure last time I tried that I ended up without styles or anything, but maybe I missed something
I think this is part of what made me use an alternative:
<title>{{ config('app.name') }}</title>
because I'm after all the other layout bits such as headings/subheadings/logos etc.
for example, this works,
<title>
{{ filament()->getBrandName() }}
</title>
In all fairness it sounds like you’d be better off using the packages as stand alone implementations. There has to be a tipping point where the level of customization outweighs the use of a panel.
Yeah I'm not in a panel at all and that works. I'm not touching anything in vendor/*
Not saying it’s necessarily the case here. But filament isn’t a ui framework.
Yeah, I realise I'm pushing the boundaries 😉
I was surprised I managed to get the modal working in an action invoked from within a repeater
If you mean you copied the base layout from ./panels/resources/views in Filament to use standalone ... no, that's not the right approach. Just use the example from the docs ^^, then provide your own accessors in your component (or parent class) to get headings, etc.
I do a lot of Filament work outside panels.
OK, I"ll try that, and you get access to filament() or did you create your own Filament manager class more geared towards pages?
because that's the direction I started taking
Something is getting lost here. Are you using panels or not? Seems like your trying to cross use expected functionality.
I am not using panels
Depends what you mean by "Filament manager class". I replicate some of Filament's features, like relation managers, by borrowing bits of code, and have my own Resource / Relation parent class(es).
route -> livewire (as a page)
what I mean is:
one tick
this guy: function filament(?string $plugin = null): FilamentManager | Plugin
in global_helpers.php
but that's obviously (and purposely) very panel specific
but it manages BrandName(), BrandLogo() etc.
which will become relevant
because once I am done with this setup and I have the signup process working correctly, I intend to have it detect domain which will then look up a brand table, populating the company_id (multi-tenant) and pulling down the rest of the customisation
because the goal here is that the signup can change its look and feel based on the charity its' dealing with and that I am using the rendering hooks to allow the charity to customise the look and feel/design outside the scope of the form/wizard itself
the other things I'm still working through also are;
* Making the repeater render a HTML block styled how I want based on the return data from the modal (the underlying values are held as hidden values and I build HTML in the callback) - Placeholder new HtmlString() doesn't appear to cut it. Would be better to inject a blade dynamically somehow, but don't even know if that's possible
* Building a confirmation page as the last step of the Wizard which is essentially completely custom formatted which will display the contents as I need it to, showing what you are purchasing before I hit the final submit button which will finalise my Order (and child OrderServices) which will then fire off API calls to Verizon/Helix and separately to the BSS/OSS platform to configure it.
So yeah, I understand it's not a UI framework as such, but I think i've been able to address all roadblocks so far so it's able to exist as one, at least for my purposes
But things like brandName() and brandLogo() are part of the panel package. They just don't exist on a "front end" running standalone Forms or Tables.
Yeah, I know, I'm just stealing them - it sounds like you're suggesting it better just to create my own version of them
I just need to figure out how to create a similar 'helper' which is available in the blade and has current state
rather than rely simply on @props (which I don't completely understand yet)
PS: All the help you guys are giving is fantastic - rest assured the background behind this is a very good cause - all the mobile services that are sold under this solution (and associated interconnected applications) results in $$ going to the causes that partner with us in the US
(as much as I'm in AU)
www.agilitymobile.com
You need to mentally separate the Forms, Tables, Infolists, Notifications and Actions packages from Panels. Panels is a UI which stiches all those together into ... well, admin panels. But as soon as you move out of panels and start using the individual packages in your own "front end" ... forget about anything in Panels, it's no longer relevant, and trying use that code will just bring pain. You can borrow parts of it, like I borrow parts of the Relation Manager stuff for my front end. But I'm not calling Filament panels code directly. Just copying bits of it to achieve similar functionality, but in my own Livewire components / parent classes / views.
Yeah cool - essentially thus far, besides the use of the Filament Manager helper, I've done exactly that
no panels were harmed in the making of this solution
OK, I think that gives me enough to go on - I think first up I'll revisit the link you posted and try that approach to styling
Any comment re; the customisation of HTML content within the Repeater block and the full custom rendered last-step of the wizard? how I might best achieve that?
for example, this is what I get at the moment in the Repeater block
and that's by populating a hidden field called 'processed_message' then using the StateChanged to populate the Placeholder value with the contents
but because it's a placeholder I'm not sure it's working the same way as a 'value' as I'm not accessing the content() method persae
-a
Best open another thread on that, and clearly explain what you are trying to achieve, and show the code you are using.
OK, can do
Yeah, sorry, it's been good to throw out everything I'm doing but I should separate them 😉
I'll do that in a few moments - thankyou so much for your (all) help!!