Renan Pereira
Modal not working on Firefox
We "fixed" by applying the code below
{{-- Corrigir o problema no Firefox --}}
{{-- Too many calls to location or history APIs in a short period of time. --}}
<script>
const original = window.history.replaceState;
let timer = Date.now();
let timeout = null;
let lastArgs = null;
window.history.replaceState = function (...args) {
const time = Date.now();
if (time - timer < 300) {
lastArgs = args;
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(() => {
original.apply(this, lastArgs);
timeout = null;
lastArgs = null;
}, 100);
return;
}
timer = time;
original.apply(this, args);
};
</script>
16 replies
EditAction enabling hidden CreateAction in headerActions
CreateAction::make()
->icon('heroicon-c-plus')
->label('Adicionar')
->color('success')
->hidden(function () {
if (!Auth::user()->can('edit_empresas')) {
return true;
}
if (request()->routeIs('funcionarios.index')) {
return true;
}
})
20 replies
Export Column State Not Working
I tried on both, ExportAction and ExportBulkAction, none where working
->headerActions([
Action::make('create')
->label('Adicionar')
->icon('heroicon-c-plus')
->color('success')
->hidden(!\Auth::user()->can('add_new_docto_empresa'))
->extraAttributes([
'class' => 'p-2 bg-success text-white text-lg',
])
->url(fn (): string => route('empresas.doctos.create', $this->empresa->id)),
ExportAction::make()
->exporter(EmpresaDoctoExporter::class)
->label('Exportar')
->color('info')
->icon('heroicon-s-arrow-down-tray')
])
->bulkActions([
ExportBulkAction::make()
->exporter(EmpresaDoctoExporter::class)
->label('Exportar')
->color('info')
->icon('heroicon-s-arrow-down-tray')
19 replies