In laravel-nova how would I go about changing CREATE/UPDATE forms to have "leaving with unsaved progress" warning when changing routes? - laravel-nova

So in general in vue, implementing the unsaved progress popup is easily googlable.
The problem is specifically how to do it in laravel-nova.
Is it possible to customize the vue-router beforeRouteLeave event, to override all standard CREATE/UPDATE forms?
Preferably without changing core files, maybe with custom tools somehow?

Related

how do i prevent minimize application from minimizing all forms?

I have an application with three forms. The main form is created automatically and the others are created manually at runtime.
I need to minimaze the main form if the user clicks on minimize but do not minimize all other forms. Is it something I have to edit in the project source or it is the VCL behavior that I can't avoid?
I have searched before posting this question and I found some references about how to prevent the form from being minimized which is not the case here.

Hook before fluid rendering or extending f:translation?

i want to implement my own localization tool over the typo3 database. Thus i implement a table with all localizations. But I have trouble to implement the functionality to render the label/localizations. Is there a hook, before normal rendering starts, so i can replace the fluid f:translation tag? Or can I extend the fluid f:translation helper?
I prefer the hook, but I am open to test something else.
best regards
Even though this document has seen its days, i find that it's still a very nice reference for hooks:
https://buzz.typo3.org/uploads/media/TYPO3_Frontend_Rendering_Process_v1.5.pdf
I suppose the one you're looking for is the determineId-PostProc hook.
Of course you can extend existing view helpers to your own namespace, not sure if you can overwrite existing core view helpers though.
Here's an article for extendind from an existing one (in German):
http://www.motions-media.de/2014/03/11/extbase-fluid-image-viewhelper-erweitern-fuer-lazyloading/

Can I use User Controls in MVC 4 aspx View Engine?

I have a mature open source User controls used in my project for control panel for navigation. However, I am now on a new project using MVC 4. I noticed there is also aspx view engine provided, can I still use the custom control in the new project?
As one of my concerns, the control functions a url redirect but also do some postback stuff such as setting session values. I am wondering if postback is a main issue that blocks me using it?
icons http://img401.imageshack.us/img401/8209/captureyhf.png
The bigger question is, do you really want to try? If you're moving to MVC, why not embrace the new architecture and take this as an opportunity to get your old code up-to-date. You're always going to reach a breaking point when it becomes better to rewrite old stuff than to try to keep adapting it to new tech, and a move from forms apps to MVC seems like a really good time to make that switch (especially when it comes to using the Session State).
Yes and no. Chances are, most controls won't work. This is because they depend on ViewState to function. Controls that do not depend on ViewState will work. So, if you can disable ViewState and still use the control, chance are it will will, unless it has some other dependency on specific WebForms functionality that isn't present in MVC.
This is not, however, a recommended practice, as this support is sort of accidental and not really supported by the MVC team.. thus it could disappear in a later version. Also, it creates a sort of split-brain design that is just poor practice.

"Autosave with undo/redo" vs "Save/Revert buttons" when using backbone.js

I'm building a data entry intensive RIA using backbone.js. My first plan was to have "Save" and "Cancel" buttons on my UI and to only save my models in big chunks whenever the user hits save. Hitting cancel would simply reload the model from the server. This way, users don't need to worry about making irreversible mistakes.
I'm however now realizing that implementing undo/redo would probably not be so difficult given how easy it is to "watch" for changes on models and have a view correctly update itself when reverting model values. If I had undo/redo, I'd then choose to have my models save to the server instantly.
Is one of the two approaches favoured by backbone? What's a good way to implement the undo/redo using backbone's style of MVC?
You've been waiting a while for this answer, maybe you've answered it already. I do not have code, but a couple of concepts struck me off the top of my head.
From a high level, I would have a base model that was undoable -- or maybe you could use some form of mixin to give a model the ability to be undoable. The implementation of the undo would use the command pattern to form a multi-level undo 'stack'.
If I were implementing this, I think I might equip an undoable model with a backbone.js collection of command models. These command models would encapsulate the changes to the undoable model and would be created in conjunction with a change event from the model. To undo a change to the undoable model, you would pop the top command off and have it apply its undo to the undoable model. A server refresh would wipe away the collection of commands.
The one complication to all of this is how to manage through the changes that occur due to an undo -- these themselves should not generate an undo command to the top of the stack.
Hope this helps.

Rails web application control panel with ajax tabs and validation

I'm looking to build a rails web app with an admin control panel. I'd like the control panel to use a tabbed interface for controlling users, projects, tasks etc, and I'd like to switch between tabs using jquery tab UI controls with ajax. Also using restful authentication for users and my own code for projects, tasks etc.
Here's what I can't wrap my head around. Normally, I'd have a controller for each tab, so validation is simple, if there's an error (say in the user) i just render the proper action with the object and it's errors and we're set. However, if I'm not refreshing (to different controllers between tabs) how does this work? Do I need to have one massive controller with all the user, project, task validation and controls (ie. crud operations)? Seems like not the greatest design.
Or is there some way I can use an 'admin' controller that encompasses separate controllers for proper crud/error checking etc.
Hope this makes sense?
I would make the contents of each tab be called in by a separate ajax request. This would give you the following benefits
Now each tab can easily be a different view/controller
You only need to load the contents for a tab when it is used; you won't be processing code/downloading html for tabs that the user doesn't use.
If you don't want to use this route, (i.e. you feel you need to load all the contents of the tabs on page download in a single request) then you could separate out the code using helper methods and partials. See my answer here: Rails Sub-controllers?
I would personally use inline validation in the forms. Jquery does that pretty well , but there are a lot of library that can help you with that.
I guess it's not exactly what you were looking for, but it would make your job easier. Of course still keep validation in the models so that no one can bypass the validation (using firebug or something like this)

Resources