nova-flexible-content icon indicating copy to clipboard operation
nova-flexible-content copied to clipboard

Feature/removable files

Open mrdj07 opened this issue 2 years ago • 11 comments

I needed to fix the remove image problem. I had in mind a solution of flattening the fields of the layout in order to let the Deletion Controller do it's job, but this pull request had it laid down pretty nicely.

I based my branch from master, cleaned up some stuff I found unnecessary in the initial PR, then found the following issues and fixed them:

  • The Original PR worked to delete the files, tough this was not the correct way of dealing with the model, this way I let Nova know what fields to update and it does the job.
  • The FormField did not update the last version timestamp after the deletion of the file, as the original FormFileField does. So I added the needed events to be caught by the FormPanel.
  • The Add Layout button was gone: The field limit counter was buggy. Returned a "NaN" when no limit was set. Added validation for both the original dropdown and the searchfield.
  • The required Laravel Version was added by previous commits, I added version 8, since this is the version I'm working with, and I've encountered no problems at all.

I also reformatted all of the PHP files in PSR-2.

mrdj07 avatar Aug 31 '21 19:08 mrdj07