Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: array adapter #3469

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

feature: array adapter #3469

wants to merge 44 commits into from

Conversation

adrianthedev
Copy link
Collaborator

@adrianthedev adrianthedev commented Nov 28, 2024

Description

Fixes # (issue)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Copy link

codeclimate bot commented Nov 28, 2024

Code Climate has analyzed commit 846e3dd and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

rubocop

spec/dummy/app/avo/resources/movie.rb|115 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|120 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|125 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|130 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|135 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|140 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|145 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|150 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|155 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|160 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|165 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|170 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|175 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|180 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|185 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|190 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|195 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|200 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|205 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|210 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|215 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|220 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|225 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|230 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|235 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|240 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|245 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|250 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|255 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|260 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|265 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|270 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|275 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|280 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|285 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|290 col 35| [Corrected] Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
spec/dummy/app/avo/resources/movie.rb|291 col 8| [Corrected] Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array.

app/controllers/avo/array_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/array_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/array_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/array_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/array_controller.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

rubocop

spec/dummy/app/avo/resources/movie.rb|94 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|95 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|99 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|100 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|104 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|105 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|109 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|110 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|114 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|115 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|119 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|120 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|124 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|125 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|129 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|130 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|134 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|135 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|139 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|140 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|144 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|145 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|149 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|150 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|154 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|155 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|159 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|160 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|164 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|165 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|169 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|170 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|174 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|175 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|179 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|180 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|184 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|185 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|189 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|190 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|194 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|195 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|199 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|200 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|204 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|205 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|209 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|210 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|214 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|215 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|219 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|220 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|224 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|225 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|229 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|230 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|234 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|235 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|239 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|240 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|244 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|245 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|249 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|250 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|254 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|255 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|259 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|260 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|264 col 15| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
spec/dummy/app/avo/resources/movie.rb|265 col 23| [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/movie.rb Outdated Show resolved Hide resolved
Copy link
Contributor

This PR has been marked as stale because there was no activity for the past 15 days.

@adrianthedev
Copy link
Collaborator Author

Some exploration code:

Details

<div class="flex flex-col">
  <%
    fields = [:id, :name, :age]
    fields = {
      id: {
        type: :id,
        required: true
      },
      name: {},
      age: {
        type: :number,
      }
    }
    items = [
      {
        id: 123,
        name: "User",
        age: 14,
        email: "test@test.com",
      },
      {
        id: 124,
        name: "User 2",
        age: 15,
        email: "test2@test.com",
      },
      {
        id: 125,
        name: "User 3",
        age: 16,
        email: "test3@test.com",
        _options: {
          id_param: :id,
          show_path: "/users/123"
        }
      }
      # .name
      # [:name]
    ]

    options = {
      id_param: :id,
      path: "/users/123"
    }

    model_key = "users"
    cache_hash = [model_key, Digest::MD5.hexdigest(model_key)] # ai
    options = {}


    #Avo::Resources::Base.for_dumb(name: "Users", fields:, options:)
  %>

  <%#= render Avo::RecordTableComponent.new(name: "Users", items:, fields:, options:, data: {}) %>

  <%#= render Avo::RecordTableComponent.new(items:, fields:, options:, data: {}) %>
</div>

@Paul-Bob
Copy link
Contributor

Paul-Bob commented Jan 10, 2025

TODO:

  • Association array (field :movies, as: :array)

    • Fetch values from:
      1. Block do ... end
      2. Model def movies
      3. Resource def records
  • Make it work with array of active records

    • Enable the edit / delete links for it (not implementing for now)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

rubocop

spec/dummy/app/avo/resources/event.rb|54 col 89| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|55 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|55 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|55 col 90| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|56 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|56 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|56 col 97| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|57 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|57 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|57 col 84| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|58 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|58 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|58 col 98| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|59 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|59 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|59 col 93| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|60 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|60 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|60 col 98| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|61 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|61 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|61 col 96| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|62 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|62 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|62 col 86| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|63 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|63 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|63 col 95| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.
spec/dummy/app/avo/resources/event.rb|64 col 10| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside { detected.
spec/dummy/app/avo/resources/event.rb|64 col 13| [Corrected] Layout/SpaceAfterColon: Space missing after colon.
spec/dummy/app/avo/resources/event.rb|64 col 108| [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside } detected.

spec/dummy/app/avo/resources/attendee.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/dummy/app/avo/resources/event.rb Outdated Show resolved Hide resolved
spec/features/avo/array_resource_spec.rb Outdated Show resolved Hide resolved
spec/features/avo/array_resource_spec.rb Outdated Show resolved Hide resolved
lib/avo/resources/array_resource.rb Outdated Show resolved Hide resolved
lib/avo/resources/array_resource.rb Outdated Show resolved Hide resolved
lib/avo/resources/array_resource.rb Show resolved Hide resolved
@Paul-Bob Paul-Bob marked this pull request as ready for review January 13, 2025 17:36
Copy link
Collaborator Author

@adrianthedev adrianthedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome update. can't wait to have it up.
We had a refinement call and we decide to improve the API a bit.

Some explorations

# HasBaseField

      def initialize(id, **args, &block)
        super(id, **args, &block)
        @scope = args[:scope].present? ? args[:scope] : nil
        @attach_scope = args[:attach_scope].present? ? args[:attach_scope] : nil
        @display = args[:display].present? ? args[:display] : :show
        @searchable = args[:searchable] == true
        @hide_search_input = args[:hide_search_input] || false
        @description = args[:description]
        @use_resource = args[:use_resource] || nil

        # many frame base
        @discreet_pagination = args[:discreet_pagination] || false
        @link_to_child_resource = args[:link_to_child_resource]
        # Defaults to nil so that if not set falls back to `link_to_child_resource` defined in the resource

        has_many < has_base_field < base
        has_one < has_base_field < array_field < base # nu mai are sens
        has_many < has_base_field < array_field < base

        # aici ----
        array    < many_frame_base < frame_base_field < base
        has_one                    < frame_base_field < base
        has_many < many_frame_base < frame_base_field < base
        habtm    < many_frame_base < frame_base_field < base

        # nu se potri-  mutat in has_base
        @attach_fields = args[:attach_fields]

        # frame_base
        @reloadable = args[:reloadable].present? ? args[:reloadable] : false
        @linkable = args[:linkable].present? ? args[:linkable] : false
      end

app/components/avo/resource_component.rb Outdated Show resolved Hide resolved
app/controllers/avo/associations_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/associations_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/base_application_controller.rb Outdated Show resolved Hide resolved
app/controllers/avo/base_controller.rb Outdated Show resolved Hide resolved
lib/avo/concerns/has_items.rb Outdated Show resolved Hide resolved
@@ -1,8 +1,11 @@
module Avo
module Fields
class HasManyField < HasBaseField
attr_reader :array
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we refactor it to ArrayField? I left our explorations in the review.

lib/avo/resources/resource_manager.rb Outdated Show resolved Hide resolved
spec/dummy/app/models/course.rb Show resolved Hide resolved
spec/system/avo/array_resource_spec.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants