How can i define custom route and controller in Laravel Nova - laravel-nova

I have some custom field on Laravel nova with my own server rendered ui. I made this field by using https://github.com/JoshMoreno/nova-html-field
but i need this custom field with a button (will add this button as directly to blade view as HTML). So i need to add a route i will be able run from nova (when admin press this button) and some handler to catch it... Maybe some one would know how can i achieve this?

Related

Laravel Nova - Let user chose which fields/columns are displayed on index

I'm using Laravel 9 and Nova 4 to create an admin panel and recently got the request you can see in the title.
Is there any way to let the user dynamically select which fields of the resource are shown on the index instead of hard-coding the visibility?
I want to show/hide full columns of the resource via the click of a button.
Maybe i searched for the wrong stuff I haven't found any information on this. Neither here on StackOverflow nor anywhere else.

Open Form with Request-Product-Button

we would like to open a modal with a form when the user clicks the request-product-button. We want to send the configuration with the form.
How do we get the values into the form and how to open a modal on click?
Regards
Here is the documentation on how to listen to onRequestProduct: https://docs.roomle.com/web/embedding/#listen-to-onrequestproduct
In the callback you get configurationId, image, partlist, price, labels and configuration. Depending on what you need you can then open your modal and pass them as values.

Make collection_select display as an image (Rails 3 App)

All,
BACKGROUND: I have a collection_select statement that displays a dropdown box.
OBJECTIVE: I'd like the dropdown to be an image that the user clicks to see the collection rather than the default box + down arrow that appears.
You need something like this plugin for jQuery. It allows you to replace a normal select with a custom one based on your wants. You would have to write your own select helper since you need to add the attributes to the select options that this plugin requires. If you get started and need help, post back here with what you're stuck on.

Orbeon: creating my own delete button

2/28: Seems the Go uri is only if you create your own persisten layer. I'm going to try and use a link on my form to do this. If I can figure out how to find the form_id of the current form.
Original Question:
I'm trying to restrict who can delete a form instance. It seems if people can get to the form-runner summary page, they can click the delete button and delete a form (even if they are not allowed to do any "/orbeon/fr/hr/expense-report/edit/*" options.
Anyone found a way around this issue. I wonder if we could use the GO button on the form /edit/ view to build our own delete feature.
If I look at the page source from the hr/expense-report/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4 view, that the from does have the details to the actual form instance.
Example:
form id="xforms-form" class="xforms-form xforms-initially-hidden xforms-layout-nospan" action="/orbeon/fr/Test/Hidden_Search/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4"
I wonder if that information could be passed to the "GO" button, if I have that on my page?
Right now, if users can access the Form Runner summary page, they can also access the "delete" button. Showing the "delete" button on the summary page for some users but not others, requires a change to Form Runner, which shouldn't very complicated.
For instance, if you only want the "delete" button to be shown for users with the role can-delete, on this xforms:bind of fr/summary/view.xhtml add the attribute:
relevant="xxforms:is-user-in-role('can-delete')"

Creating an Ajax.ActionLink using javascript

I have a Todo List (an ASP.MVC UserControl) that for each row has the name of the task (that can be clicked to toggle between done/outstanding) and a delete button for removing the task - Both are created using Ajax.ActionLink to query the server.
When creating a new row I need the task text and delete button to be ActionLinks, how would I do this from the client side? Is there an Ajax.ActionLink equivalent in the Microsoft Ajax JS libraries?
Take a look at the code that is being generated using View Source. All you need to do is add the same markup and add the correct click handler via javascript. You may find it actually easier to do this with jQuery for all elements and add the jQuery code in your UserControl. At least that way you control the code and if Microsoft decides to change the way their ActionLink works, you won't get caught short.

Resources