Skip to content

Twill 2.1.0

Compare
Choose a tag to compare
@ifox ifox released this 15 Jul 20:05
· 1299 commits to 2.x since this release

Twill 2.1.0 is a minor release addressing some critical bugs, as well as a bunch of new features and improvements.

HOW TO UPDATE

Run composer update in your project and then, run Twill's own update command: php artisan twill:update. This will force update your published Twill assets. You can delete the old ones from your repository. If you are using custom Vue components, you should rebuild Twill assets using php artisan twill:build.

Added

  • Self-contained blocks (#597) 1e95b0ac 9ae502a4 948985ef 66fa7c5e c00759ee
    • This change allows defining blocks without adding them to the twill.block_editor configuration
    • This is backwards compatible with blocks already defined in configuration
    • Repeaters are now created in a dedicated folder: views/admin/repeaters by default, but your existing repeaters in the views/admin/blocks file will still work
    • Annotations are now supported in blocks and repeaters Blade files:
      • Provide a title with @twillPropTitle or @twillBlockTitle or @twillRepeaterTitle
      • Provide an icon with @twillPropIcon or @twillBlockIcon or @twillRepeaterIcon
      • Provide a group with @twillPropGroup or @twillBlockGroup or @twillRepeaterGroup (defaults to app)
      • Provide a repeater trigger label with @twillPropTrigger or @twillRepeaterTrigger
      • Provide a repeater max items with @twillPropMax or @twillRepeaterMax
      • Define a block or repeater as compiled with @twillPropCompiled or @twillBlockCompiled or @twillRepeaterCompiled
      • Define a block or repeater component with @twillPropComponent or @twillBlockComponent or @twillRepeaterComponent
      • Example:
        @twillBlockTitle('Body text')
        @twillBlockIcon('text')
        
        @formField('wysiwyg', [
            'name' => 'text',
            'label' => 'Text',
        ])
      • This change also provides new Artisan commands:
        • php artisan twill:make:block {name} {baseBlock} {icon}, which generates a new block based on a provided block
        • php artisan twill:list:blocks, which lists blocks with a couple of options:
          • -s|--shorter for a shorter table,
          • -b|--blocks for blocks only,
          • -r|--repeaters for repeaters only,
          • -a|--app for app blocks/repeaters only,
          • -c|--custom for app blocks/repeaters overriding Twill blocks/repeaters only,
          • -t|--twill for Twill blocks/repeaters only
        • php artisan twill:list:icons, which lists all icons available
        • php artisan twill:make:module, equivalent to the now deprecated twill:module which will be removed in Twill 3.0.
  • Resolve npm modules from root app (#617) 360d82c1
    • This change allows requiring node modules from the root project folder. Previously, custom Vue components could only use npm packages installed by Twill itself. With this change, any npm package from the main app can be required. We do this by adding the root npm_modules folder to webpack’s module resolver.
  • Add a new option to skip the add new modal to create records (#642) 1ec1f428
    • This change allows users to create full records by landing directly on the form when adding new records
    • It is enabled through the new skipCreateModal option of a module's controller $indexOptions array.
  • Implement a new behavior to allow saving repeaters into json columns (#654) 85f96306 a2fffa4f
    • This trait is not intended to replace main repeaters but to give a quick and easy alternative for simple elements where creating a new table might be an overkill.
    • Simply define an array with repeater names on your repository: protected $jsonRepeaters = [ 'REPEATER_NAME_1', 'REPEATER_NAME_2', ... ]
  • Add new options to medias and files form fields c564ecc2 571cc1e9
    • filesizeMax, on the files field, to prevent selecting a file which filesize is above provided value in mb
    • widthMin, on the medias field, to prevent selecting an image which width is below provided value in px
    • heightMin, on the medias field, to prevent selecting an image which height is below provided value in px
  • Added new option to display filenames of images in the media library grid (#658) 2034b6e7
  • Add confirmation modal option to checkbox and radio form fields (#687) 41261c18 b152cdd9 fe6ec3d0
  • Allow user to filter by unused images or files in the media library (#688) a52349a9 261941fc
  • Add admin title tag suffix to config (#680) 3aefcdc3
  • Support checkbox form field in settings d62d303f
  • Support date_picker and color form fields in settings (#576) f66aaa68
  • Allow 3 columns layout by setting up a middle columns (#638) 2b2e3e49
  • Allow browsers to sync extra pivot attributes (#629) f33b8825
  • Provide env variable for configuring custom s3 hosts 5894ccce
  • Add ability to provide a custom morphed repeaters name (#679) 3a118bc3
  • Support required option on wysiwyg form field e780bcfd
  • Support disabled option on select form field e780bcfd
  • Allow format change in datepicker field (#628) 936057d8
  • Allow datepicker format in publication dates (#636) 477bc288
  • Allow a model class to be passed instead of the relation name (#640/#619) 8bf8e8f0
  • Add new buttonOnTop option to medias, files and browser form fields (#598) 964c99a0 cf8ead0d
  • Provide optional parameters for changing label and including a note in tags form field 0d535710

Fixed

  • Fix new listing actions behaviors 2d1b2eb5
    • Destroy action was not removed when disabling forceDelete in indexOptions
    • Duplicate action was showing in trash and was not removed when disabled in indexOptions (which is by default)
    • Fix bulk destroy integration
  • Fix validation errors display (#605) fc5b16a9
    • With the simplification of the exception handler in #561 the override of the invalidJson method was dropped by mistake. It is currently necessary as the frontend expects errors only in a validation exception response. In future improvements it would be better to keep the default Laravel response format and update the frontend to read one level deeper.
  • Fix local disk and Glide base url request scheme resolution 15a2dbea
    • This commit introduced an issue by using request() in config. When using php artisan config:cache that request is not coming externally with the appropriate headers.
  • Fix draggable regression on datatable a79e3d2e
  • Fix scheme being added twice when APP_URL has the scheme (#651) 2e5784cc
  • Fix Twill form utils aliases on Laravel 7 c0018e5c
  • Fix connected fields component alias 4b61b78e
  • Fix typo in translation c0c492c5
  • Fix child module redirect when adding new records in Laravel 6 / 7 e60c5066
  • Fix filesize limit uploader error display (#614) 21263a3e
  • Fix missing row duplication event handler for nested tables (#615) c50b16d2
  • Fix translateTitle in a form (#648) 8f5b0e28
  • Fix route name duplicating prefix and module (#591) 267eec02
  • Fix media form fields binding 73104e62
  • Fix blocks spacing 56b5bc21
  • Fix icons missing svg attributes c29b9dd6
  • Fix tests cd50ea9d
  • Fix translated medias in settings (#620) e036313d
  • Fix select with no options (#625) 3adea583
  • Fix select field in settings: wrap string values in quotes (#653) 86d72939
  • Fix preview iframe resizing for blocks (#669) 33f77ee7
  • Fix notifications url (#678) 379df54c
  • Fix multi_select values escaping (#690) d54b94ac

Improved

Chore