Mark Chaney
Lazy loaded tables and refresh()
I would really like the ability to lazy load table components I have in tabs on standalone livewire pages. But if I have a dispatch to refresh that component after an action happens and if it’s not currently loaded, I get the error ‘$table must not be accessed before initialization’. How can I more elegantly handle this in a simple way? Do I override refresh() in my tabs trait that does some checks first? Seems like livewire should handle this a bit more gracefully. Obviously it doesn’t need to rerender something that hasn’t rendered yet.
2 replies
Global Notification Colors
As far as I can see, there is no way to automatically have the color() of the notificaiton simply to be the same as the status(), right? So if its a success message, the color will be success (green). I simply want background colors automatically on all notifications. Am i missing something? Tried
Notification::configureUsing($notification)
, but nothing is available in the $notification.7 replies
ActionGroups and Testing
When asserting that a table action exists, is it handled any differently when an action group is involved? Having an issue asserting that an ImportAction exists in an ActionGroup on a table header. Says it cant find it.
2 replies
Working form field on ViewRecord?
I have an Input form at the top of the long form that i use for search for input fields. Works great on edit, but on viewrecord, its disabled. Is there a way not to disable this single input field on ViewRecord? Its set to dyhydrated(false) anyway, so its never used for actual saving anything.
4 replies
canAccess() and Clusters
Shouldnt i be able to use public static function canAccess(): bool
{
return false;
}
} to stop a user from accessing a cluster and its contents? Obviously testing in its simplest form. Right now it doesnt appear to do anything.
5 replies
Lazy load and livewire refresh with tables
ok, so i have some alpine tabs and within those tabs are lazy loaded lw3 components with filament tables in it. Now on the parent component, sometimes i perform an action that would require one of those lazy loaded components to be refreshed (which really only matters if that tab is active). The problem is that if i sent the refresh event to a component that isnt currently rendered, it throws an error about
$table must not be accessed before initialization
. Is there not a native way to not attempt a refresh for a component that isnt even rendered? Doesnt really make sense to refresh one that isn rendered, right? I use these components in different areas of the app, so I am hoping to avoid having to add a property like $isRendered that has to be set/checked, etc, on each one.3 replies
Setting/Asserting TableActionData
does ->setTableActionData($data) wipe out default() values for the form even if its not a set in $data and can ->assertTableActionDataSet() check defaults? Was thinking something like
->assertTableActionDataSet([...$data, 'primary_case_manager' => $user->case_manager_id]). Full code being . Cant seem to assert that default value of the primary_case_manager field.
5 replies
Testing and requiresConfirmation
I have a RM with a table row action, that row action launches a modal with an approval action. I can get all the way up that point and it works fine in my test and will perform the approveAction, but if i add a confirmation to the approveAction, I cant seem to figure how to click the "Confirm" on the requiresConfirmation modal as it doesnt appear to have a mountAction for me to be able to call. This is wher i am so far:
21 replies