Skip to content

Upgrade 1.0#55

Draft
blocknotes wants to merge 10 commits intomainfrom
upgrade-1.0
Draft

Upgrade 1.0#55
blocknotes wants to merge 10 commits intomainfrom
upgrade-1.0

Conversation

@blocknotes
Copy link
Owner

No description provided.

Fix params_to_s pushing [string] instead of string and add URL encoding
via CGI.escape. Fix Flash component using "notices" CSS class for all
message types instead of "warnings"/"errors". Add nil guard on
Head#style_links and Store#prepare_sections navbar. Add rescue in
Support.to_date for values that do not respond to to_date.
…Page

DRY up duplicated update_attributes into a Views::Attributes module
shared by BasicLayout and BasicComponent. Extract inline actions_buttons
methods from Index and Show into a reusable ActionsButtons component.
Consolidate three identical error page view_templates into an ErrorPage
base class. Also adds nil guard on field access in Index and Show
table/record iteration.
…arden settings

Consolidate to_class into BasicApp.authentication_plugin via Utils
include. Use Utils.humanize in Field.create_field instead of inline
logic. Extract repeated authorization checks in Router into a single
authorize! helper method. Guard Settings#load_settings against nil
authentication plugin and make it idempotent with @loaded flag so
repeated calls (e.g. per-request) are a no-op.
The session secret was regenerated with SecureRandom.hex(64) on every
boot, which invalidates all existing sessions on restart. Now reads
from ENV["TINY_ADMIN_SECRET"] with fallback to the random value, so
production deployments can maintain stable sessions across restarts.
Update gemspec constraint from ~> 1, >= 1.10.0 to ~> 2. Replace
deprecated unsafe_raw(content) with raw(safe(content)) in Content page.
Replace removed yield_content(&block) with plain yield in
DefaultLayout. All existing tests pass with Phlex 2.4.1.
… view components

Add 31 new specs bringing line coverage to 100% and branch coverage
from 80.97% to 83.4%. Covers TinyAdmin.configure block form,
Utils#prepare_page, Settings#load_settings idempotency, and unit
specs for FieldValue, Widgets, FiltersForm (all filter types),
and ActionsButtons components.
…ored methods

The RBS runtime type checker was failing because signatures were stale
after the Phlex 2 upgrade and code refactoring. Key changes:
- Fix view_template block arity: (untyped) -> () for Phlex 2 yield pattern
- Add signatures for Attributes module, ActionsButtons, and ErrorPage
- Update BasicLayout/BasicComponent to include Attributes module
- Add authorize! to Router, @loaded to Settings
- Remove stale actions_buttons from Index/Show (now a component)
Copy link

@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

[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

page = utils_instance.prepare_page(TinyAdmin::Views::Pages::Root, attributes: {title: "My Title"})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

page = utils_instance.prepare_page(TinyAdmin::Views::Pages::Root, attributes: {title: "My Title"})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

page = utils_instance.prepare_page(TinyAdmin::Views::Pages::Root, params: {"page" => "2"})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

page = utils_instance.prepare_page(TinyAdmin::Views::Pages::Root, params: {"page" => "2"})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

expect(page.params).to eq({"page" => "2"})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

expect(page.params).to eq({"page" => "2"})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

page = utils_instance.prepare_page(TinyAdmin::Views::Pages::Root, attributes: {widgets: ["TestWidget"]})


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

page = utils_instance.prepare_page(TinyAdmin::Views::Pages::Root, attributes: {widgets: ["TestWidget"]})


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [2/1].


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [3/1].

it "renders action buttons with links" do


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

component.update_attributes(actions: {"export" => action_class}, slug: "posts")


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

component.update_attributes(actions: {"export" => action_class}, slug: "posts")


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

component.update_attributes(actions: {"export" => action_class}, slug: "posts", reference: "42")


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

component.update_attributes(actions: {"export" => action_class}, slug: "posts", reference: "42")


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

component.update_attributes(actions: {"download" => action_class}, slug: "posts")


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

component.update_attributes(actions: {"download" => action_class}, slug: "posts")


[rubocop] reported by reviewdog 🐶
RSpec/VerifiedDoubles: Prefer using verifying doubles over normal doubles.

let(:record) { double("record", id: 1) }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [2/1].

it "renders the translated value in a span" do


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:field) { TinyAdmin::Field.new(name: "author_id", type: :integer, title: "Author", options: {link_to: "authors"}) }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:field) { TinyAdmin::Field.new(name: "author_id", type: :integer, title: "Author", options: {link_to: "authors"}) }


[rubocop] reported by reviewdog 🐶
RSpec/VerifiedDoubles: Prefer using verifying doubles over normal doubles.

let(:record) { double("record", id: 1) }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [3/1].


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:field) { TinyAdmin::Field.new(name: "status", type: :string, title: "Status", options: {options: ["value_class"]}) }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:field) { TinyAdmin::Field.new(name: "status", type: :string, title: "Status", options: {options: ["value_class"]}) }


[rubocop] reported by reviewdog 🐶
RSpec/VerifiedDoubles: Prefer using verifying doubles over normal doubles.

let(:record) { double("record", id: 1) }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :boolean}, value: "1"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :boolean}, value: "1"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :boolean}, value: "1"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :boolean}, value: "1"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :boolean}, value: "1"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :boolean}, value: "1"}} }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [3/1].

it "renders a select with true/false options" do


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :date}, value: "2024-01-01"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :date}, value: "2024-01-01"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :date}, value: "2024-01-01"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :date}, value: "2024-01-01"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :date}, value: "2024-01-01"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :date}, value: "2024-01-01"}} }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [2/1].


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :datetime}, value: "2024-01-01T12:00"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :datetime}, value: "2024-01-01T12:00"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :datetime}, value: "2024-01-01T12:00"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :datetime}, value: "2024-01-01T12:00"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :datetime}, value: "2024-01-01T12:00"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :datetime}, value: "2024-01-01T12:00"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :integer}, value: "25"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :integer}, value: "25"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :integer}, value: "25"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :integer}, value: "25"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :integer}, value: "25"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :integer}, value: "25"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :select, values: %w[available unavailable]}, value: "available"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :select, values: %w[available unavailable]}, value: "available"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {type: :select, values: %w[available unavailable]}, value: "available"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :select, values: %w[available unavailable]}, value: "available"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :select, values: %w[available unavailable]}, value: "available"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {type: :select, values: %w[available unavailable]}, value: "available"}} }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [3/1].

it "renders a select with the provided values" do


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {}, value: "hello"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {}, value: "hello"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {}, value: "hello"}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {}, value: "hello"}} }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [2/1].


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {}, value: ""}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

let(:filters) { {field => {filter: {}, value: ""}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {}, value: ""}} }


[rubocop] reported by reviewdog 🐶
[Correctable] Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let(:filters) { {field => {filter: {}, value: ""}} }


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [2/1].

it "renders Clear and Filter buttons" do


[rubocop] reported by reviewdog 🐶
RSpec/MultipleExpectations: Example has too many expectations [2/1].

it "renders each widget in a card" do

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.

1 participant