Releases: TrestleAdmin/trestle
v0.10.1
Features & Fixes
- Improve Brazilian Portuguese translations by @ASVdeM and @kwy95 in #460
- Support Rails 8.0 routes by @zealot128 in #470
- Document and clean up helper modules by @spohlenz in #474
- Add
config.default_form_controllers
option for default form Stimulus controllers by @spohlenz in #475 - Navigation item path improvements by @spohlenz in #480
- Defer registration of admin models until lookup time by @spohlenz in #483
- Avoid passing default action from navigation item (let admin decide) by @spohlenz in #484
- Fix
Admin#path
when nil passed as action parameter by @spohlenz in #485 - Improve fetch wrapper error handling by @spohlenz in #488
- Rewrite URL helpers and support
:method
option onadmin_link_to
by @spohlenz in #490 - Add
serialize_persistent_params
helper method by @spohlenz in #493 - Turbo frame wrapper improvements by @spohlenz in #494 / #495 / #497 / #502
- Sidebar scroll fixes by @spohlenz in #498
- Remove block passing / layout support from
'trestle/flash/alert'
partial by @spohlenz in #500 - Ensure scopes continue linking to scope even when currently active by @spohlenz in #501
- Update turbo to 8.0.10 by @spohlenz in #504
Maintenance & Cleanup
- Clean up usage of ruby2_keywords by @spohlenz in #469
- Add CI Gemfiles for Rails 8.0.0.alpha by @spohlenz in #471 / #472
- Update scope methods to use kwargs by @spohlenz in #476
- Use kwargs within Navigation classes by @spohlenz in #478
- Globally replace use of
content_tag
withtag.<el>
by @spohlenz in #477 - Rename
Trestle::Builder#params
to#permitted_params
(aliasing old method) by @spohlenz in #481 - Use real ES6 private methods/fields instead of underscore prefixes by @spohlenz in #487
- Remove
:remote
from pagination link options by @spohlenz in #492 - Fix deprecation warnings in Sass build by @spohlenz in #505
v0.10.0
- Add
turbo_frame_tag
to whitelisted (auto-concatenated) form helpers (2d6706b) - Set default target turbo_frame target within
admin_link_to
helper depending onmodal_request?
(d18c9e9) - Update turbo-rails dependency to
>= 2.0.6
(b67fbc0) - Update to Turbo 8.0.5 (e501393)
- Update to FontAwesome 6.6.0 (ebf5933)
- Fix i18n of confirm delete button label (cf9638c)
- Consider requests with
Turbo-Frame: modal
header to be modal requests (544db39)
v0.10.0.pre2
- Added hooks for resource toolbars (2688245)
hook "index.toolbar.secondary" do |toolbar|
...
end
This removes one of the primary reasons for needing to customize the resource index.html.erb
template (and one of the biggest sources of pain when upgrading Trestle versions).
New hooks include index.toolbar.primary
, index.toolbar.secondary
, new.toolbar.primary
, new.toolbar.secondary
, show.toolbar.primary
, show.toolbar.secondary
, edit.toolbar.primary
, edit.toolbar.secondary
. In each case, the toolbar builder is yielded to the hook block.
- Added stimulus controller
batch-action
for batch action triggers (014dc16) - Allow resource toolbar builder to accept custom label and attributes (78899b4)
t.save label: "Save & Publish", icon: "fas fa-share-from-square"
- Fixed compatibility with
sassc-rails
gem (introduce custom compressor to exclude bundled Trestle assets) (f10c78d) - Variety of CSS improvements, notably:
- Remove display: flex from body (can cause layout issues) (c8aba45)
- Avoid setting base font size on root HTML element (39d92dd)
- Use
dvh
units for sticky footer (c8aba45) - Animate sidebar expand/collapse (4f6644d)
- Disable layout animations when
prefers-reduced-motion
(37a8555) - Show sidebar badges as indicator dots in collapsed state (e3b7c46)
- More usage of CSS variables (5367d31, 20bc74b)
- Lay out content header using CSS grid (58b4e7f)
- Switch to
rem
units for dimensions (94456fc) - Introduce CSS classes for basic grid framework (362068b, bf2921b, 60c9d72)
- Use primary theme color as default tag color (3f887fc)
- Update dropdown menu markup for Bootstrap 5 (932152f)
- Ensure dismiss toolbar button specifies type="button" and not type="submit" (c46973a)
- Added
turbo-rails
as a dependency (8b07a7d) - Removed
turbo_stream_modal
helper (useturbo_stream.modal
instead) (315cd4e) - Drop support for Rails 5.2 (4efcc87)
v0.10.0.pre (The Hotwire release)
Introducing one of the largest Trestle updates yet -- the Trestle Hotwire update. This has been a branch two years in the making, and brings the Trestle front-end much more up-to-date and in-line with modern Rails development practices.
Among the things I'm most excited about with this release are the full Stimulus integration, making it easier to override and extend default behavior; Turbo frames, and an easier pathway to real-time updates with Turbo streams; Sass no longer being a required dependency for theming, making it possible to live alongside applications using Tailwind CSS; as well as run-time theming options.
Key Points
- Trestle is now powered by Turbo (8.0.4) & Stimulus (3.2.2)
- Theming is now done via CSS variables -- a Sass compiler is no longer a required dependency
- Bootstrap has been updated from 4.6.x to 5.3.3
- Font Awesome updated from 5.15.x to 6.5.2
- i18n within JS has been streamlined and is handled by fnando/i18n
- Propshaft is now supported as an alternative to Sprockets
- Magnific Popup has been replaced with PhotoSwipe
Breaking Changes
Where possible, I've tried to avoid breaking changes but there are a few potential pitfalls:
- Theming: Trestle no longer reads theme variables from
app/assets/stylesheets/trestle/_theme.scss
. Instead define theme colors inconfig/initializers/trestle.rb
:
# Define primary and secondary theme colors. Color values may be specified
# as either 3- or 6-digit hex codes, or rgb/hsl() triplets.
config.theme = { primary: "#338ab7", secondary: "#719dc3" }
-
Custom views: If you've customized your views by copying over the templates from the Trestle source, you'll want to merge in the updates from this branch to ensure that the required Turbo frames are present. Hopefully overriding views in this way won't be necessary for much longer as the custom actions API will be one of the next major pieces I'll be working on.
-
Bootstrap 5 changes: In particular, Bootstrap 5.x changed a number of class names from
-l
/-left
/-r
/-right
to-s
/-start
/-e
/-end
. e.g.ml-2
becomesms-2
,dropdown-menu-right
becomesdropdown-menu-end
. If you are using any of these in your code, they will need to be updated. See https://getbootstrap.com/docs/5.0/migration/ and https://getbootstrap.com/docs/5.2/migration/ for further information on changes within Bootstrap. -
UJS: The
rails-ujs
library has been removed, so some data attributes may need to be updated to the Turbo equivalent. In particular, usingmethod: :post
on a link should be replaced withdata: { turbo_method: :post }
. See more info on Turbo replacements at https://guides.rubyonrails.org/working_with_javascript_in_rails.html#replacements-for-rails-ujs-functionality. -
sassc-rails: If you are using the
sassc-rails
gem, you may experience compilation failures in production or test environments ("Not enough space" error from Sass). A shim will be added in the next release, but this can alternatively be solved by either removing 'sassc-rails' (if no longer required), adding thesassc-embedded
gem alongside, or replacing withdartsass-sprockets
.
Deprecations
-
Defining a dialog form with
form dialog: true
has been deprecated. Instead useform modal: true
. It is also now possible to specify modal options e.g.form modal: { class: "modal-lg", controller: "stimulus-controller" }
-
The
dialog_request?
helper has been deprecated. Usemodal_request?
instead. -
Setting
Trestle.config.turbolinks
is deprecated. Turbo will always be used within Trestle views, and is provided by the Trestle JS bundle. -
Hooking into Trestle JS callbacks using
Trestle.ready(function() {
andTrestle.init(function(root)
is deprecated. They'll continue to work for now but will be removed by the time 1.0 rolls around. Stimulus controllers are a much better option for integrating custom code.
v0.9.9
- Allow scope counts to be disabled
scope :name, count: false
- Wrap automatic form checkboxes in (unlabeled) form group
- Use CSS to set toolbar (flex-)direction and always append when customizing a toolbar
- Promote
#remove_action
from Resource to Admin-level builder method - Fix errors when Admin/Resource index action is removed
- Fix hook errors when application has a mounted engine named
Admin
- Fix error when
config.action_controller.raise_on_missing_callback_actions
is true - Fix typo in Vietnamese locale
- Update to jQuery 3.7.1
- Add Rails 7.1 specs to GitHub Actions build (and fix errors and deprecation warnings)
- Switch CSS bundle build from node-sass to Dart sass
- Drop support for Rails versions < 5.2
v0.9.8
v0.9.7
- Allow helpers and custom fields to be lazily declared using procs (or String constant names)
Trestle.configure do |config|
config.helper -> { CustomHelper }
config.form_field :custom, -> { CustomFormField }
end
v0.9.6
- Render
enum
columns as radio buttons within automatic forms (#379) - Add support for hash and array parameters in
config.persistent_params
- Implement admin Registry class with support for resource lookups by model
- Allow passing
Trestle.resource(..., register_model: false)
to disable model lookup registration - Allow
class
option to be passed toavatar
helper - Add
avatar-sm
andavatar-lg
CSS classes for small and large avatars - Allow HTML options to be passed to
sidebar
helper - Update to Bootstrap 4.6.1, jQuery 3.6.0, FontAwesome 5.15.4, Flatpickr 4.6.13, rails-ujs 6.1.3
- Revamped sandbox for improved development process
- Standardize colors for additional alert styles, and add support for variable-width alert icons
- Fix Ruby 3 kwargs forwarding within form renderer
- Fix backgrounding and scrolling of stacked modals
- Fix logo stretching in sidebar header
- Add Rails 7 to Travis CI tests and update Ruby versions
- Add
CONTRIBUTING.md
guide
Housekeeping:
- The
master
branch has been renamed tomain
across all TrestleAdmin repositories
v0.9.5
- Add support for scope groups (#322)
scopes do
scope :first, group: "Group Name"
scope :second, group: "Group Name"
scope :third, group: "Another Group"
end
# Default layout is :row. Scope groups will automatically stack for mobile devices.
scopes layout: :columns do ...
# Disable grouping regardless of scope definitions
scopes group: false do ...
# Specify custom classes on the scopes container div
scopes class: "scope-tags" do ...
- Allow default navigation group state to be set to collapsed (#332)
menu do
group :configuration, collapse: true do
item ...
end
end
- Update to Bootstrap 4.6.0, FontAwesome 5.15.2, Flatpickr 4.6.9, rails-ujs 6.1.2
- Update form field error state to show all error messages (#331)
- Fix incorrect admin controller parent class autoloading issues (#329)
- Fix potential XSS cookie injection vulnerability (#341)
- Fix keyword argument forwarding for Ruby 3 (#342)
- Added Rails 6.1 and Ruby 3 to Travis CI tests
v0.9.4
- Add Vietnamese translations [Derek Nguyen]
- Implement preliminary support for AJAX pagination
- Allow access to controller methods (e.g.
current_user
) from within scope blocks - Allow per-admin translations for scope labels
- Change form parameter name to unscoped singular admin name
- Update to jQuery 3.5.1, Bootstrap 4.5.3, FontAwesome 5.15.1, Flatpickr 4.6.6, rails-ujs 6.0.3
- Fix select field options when passing additional data attributes
- Ensure select fields are disabled when
options[:disabled]
is set - Fix use of hooks within form blocks
- Fix form field attributes when
options[:wrapper]
is false - Fix deprecation warnings in Ruby 2.7
- Fix file permissions in gem release