Skip to content

Version 2#328

Merged
bogdan merged 177 commits intomainfrom
version-2
Nov 20, 2024
Merged

Version 2#328
bogdan merged 177 commits intomainfrom
version-2

Conversation

@bogdan
Copy link
Copy Markdown
Owner

@bogdan bogdan commented Nov 9, 2024

Major Changes

  1. Support Ruby open end Range for range: true filters
  2. Modern modular CSS class names
  3. Use HTML5 input types: date, datetime-local, number
  4. Enhanced built-in partials for maximum customization of the UI

Backward compatibility

Version-2 is has some breaking changes to ensure best implementation of modern technologies in the gem.

Migration Guide

TODO

[X] Integrate into datagrid-demo
[X] Integrate into 7F app
[ ] Update wiki

Fixes #325.

@bogdan
Copy link
Copy Markdown
Owner Author

bogdan commented Nov 17, 2024

@zhuravel I found out that introducing tag_options instead of column[class] can not be done without backward incompatibility, so we have to do it in the PR.

The problem I wasn't able to solve is the merge of class attribute. In current implementation, using tag_options: {class: "my-class"} would cause the override of datagrid-order-active-asc/desc classes. That is not easily solvable as class maybe specified as String, Hash or Array. I didn't find universal utility to merge two class options of tag.whatever.

https://github.com/bogdan/datagrid/blob/version-2/app/views/datagrid/_head.html.erb#L7

@zhuravel
Copy link
Copy Markdown
Contributor

@bogdan

That is not easily solvable as class maybe specified as String, Hash or Array.

You might try to delegate that to class_names method added in Rails 6.1:
https://www.bigbinary.com/blog/rails-6-1-introduces-class_names-helper
Source: https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/actionview/lib/action_view/helpers/tag_helper.rb#L527-L543

Either way no problem, I’ll migrate to only use tag_options.

@zhuravel

This comment was marked as resolved.

@bogdan bogdan merged commit cca04d9 into main Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTMLs for range filters don't conform to the HTML standards

3 participants